diff --git a/aqt/dropbox.py b/aqt/dropbox.py deleted file mode 100644 index 3a6d138c6..000000000 --- a/aqt/dropbox.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python -# stripped down version of http://dl.dropbox.com/u/552/pyDropboxPath/1.0.1/index.html - -import imp, os, sys, sqlite3 -from base64 import b64encode, b64decode -from pickle import dumps, loads - -def GetDbFolder(): - if sys.platform == 'win32': - assert os.environ.has_key('APPDATA'), Exception('APPDATA env variable not found') - dbpath = os.path.join(os.environ['APPDATA'],'Dropbox') - elif sys.platform in ('linux2','darwin'): - assert os.environ.has_key('HOME'), Exception('HOME env variable not found') - dbpath = os.path.join(os.environ['HOME'],'.dropbox') - else: # FIXME other archs? - raise Exception('platform %s not known, please report' % sys.platform) - if os.path.isfile(os.path.join(dbpath,'config.db')): - dbfn, dbfnver = os.path.join(dbpath,'config.db'), 1 - elif os.path.isfile(os.path.join(dbpath, 'dropbox.db')): - dbfn, dbfnver = os.path.join(dbpath,'dropbox.db'), 0 - else: - raise Exception('Dropbox database not found, is dropbox installed?') - return (dbfn, dbfnver) - - -def GetConn(dbfile): - lastdir = os.getcwd() - os.chdir(os.path.dirname(dbfile)) - connection = sqlite3.connect(os.path.basename(dbfile), isolation_level=None) - os.chdir(lastdir) - return connection - - -def ReadDbLocation(dbfile, dbfnver): - connection = GetConn(dbfile) - cursor = connection.cursor() - if dbfnver == 0: # dropbox.db, old-style - dbver = 0 - elif dbfnver == 1: # config.db, can be upgraded, lets check schema - cursor.execute('SELECT value FROM config WHERE key="config_schema_version"') - row = cursor.fetchone() - dbver = row[0] - # dup code now, but maybe someday it will be confusing - if dbver == 0: - cursor.execute('SELECT value FROM config WHERE key="dropbox_path"') - elif dbver == 1: - cursor.execute('SELECT value FROM config WHERE key="dropbox_path"') - else: - raise Exception('Unhandled DB schema version %d' % dbver) - - row = cursor.fetchone() - cursor.close() - connection.close() - if row is None: - if sys.platform == 'win32': - import ctypes - dll = ctypes.windll.shell32 - buf = ctypes.create_string_buffer(300) - dll.SHGetSpecialFolderPathA(None, buf, 0x0005, False) - dbfolder = os.path.join(buf.value,'My Dropbox') - elif sys.platform in ('linux2','darwin'): - dbfolder = os.path.join(os.environ['HOME'],'Dropbox') - else: - raise Exception('platform %s not known, please report' % sys.platform) - #print 'No dropbox path defined in config, using default location %s' % dbfolder - else: - if dbver == 0: # always b64encoded - dbfolder = loads(b64decode(row[0])) - elif dbver == 1: # normal - dbfolder = row[0] - else: - raise Exception('Unhandled DB schema version %d' % dbver) - return (dbfolder, dbver) - -def getPath(): - return ReadDbLocation(*GetDbFolder())[0] diff --git a/designer/activetags.ui b/designer/activetags.ui deleted file mode 100644 index 6666f3c06..000000000 --- a/designer/activetags.ui +++ /dev/null @@ -1,182 +0,0 @@ - - - Dialog - - - - 0 - 0 - 341 - 348 - - - - Selective Study - - - - - - Show only cards with any of these tags: - - - - - - - false - - - - 0 - 2 - - - - QAbstractItemView::MultiSelection - - - - - - - Hide cards with any of these tags: - - - - - - - false - - - - 0 - 2 - - - - QAbstractItemView::MultiSelection - - - - - - - - - - 0 - 0 - - - - Change settings for: - - - - - - New Cards - - - - - - - Reviews - - - - - - - Both - - - - - - - - - - Qt::Vertical - - - QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok - - - - - - - - - - - buttonBox - accepted() - Dialog - accept() - - - 358 - 264 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - activeCheck - toggled(bool) - activeList - setEnabled(bool) - - - 133 - 18 - - - 133 - 85 - - - - - inactiveCheck - toggled(bool) - inactiveList - setEnabled(bool) - - - 146 - 213 - - - 68 - 276 - - - - - diff --git a/designer/colopts.ui b/designer/colopts.ui deleted file mode 100644 index 7dc8a720b..000000000 --- a/designer/colopts.ui +++ /dev/null @@ -1,140 +0,0 @@ - - - Dialog - - - Qt::ApplicationModal - - - - 0 - 0 - 353 - 363 - - - - Deck Options - - - - - - 0 - - - - Basic - - - - - - Synchronize this deck with AnkiWeb - - - - - - - label - - - <b>Synchronization</b> - - - false - - - true - - - - - - - 4 - - - - - Media URL - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close|QDialogButtonBox::Help - - - - - - - qtabwidget - doSync - mediaURL - buttonBox - - - - - buttonBox - accepted() - Dialog - accept() - - - 275 - 442 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 343 - 442 - - - 286 - 274 - - - - - diff --git a/designer/groupconf.ui b/designer/dconf.ui similarity index 100% rename from designer/groupconf.ui rename to designer/dconf.ui diff --git a/designer/gencards.ui b/designer/gencards.ui deleted file mode 100644 index 75c3007c3..000000000 --- a/designer/gencards.ui +++ /dev/null @@ -1,85 +0,0 @@ - - - Dialog - - - - 0 - 0 - 249 - 268 - - - - Generate Cards - - - - - - Select cards to generate: - - - - - - - QAbstractItemView::MultiSelection - - - - - - - Delete unselected cards - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - Dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/designer/getshared.ui b/designer/getshared.ui deleted file mode 100644 index 9ebf333ac..000000000 --- a/designer/getshared.ui +++ /dev/null @@ -1,162 +0,0 @@ - - - Dialog - - - - 0 - 0 - 715 - 598 - - - - - - - - - Search: - - - - - - - - - - - - Qt::Vertical - - - - - 0 - 0 - - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Plain - - - Qt::ScrollBarAsNeeded - - - Qt::ScrollBarAlwaysOff - - - - - 0 - 0 - 494 - 54 - - - - - 0 - 0 - - - - - - - - 0 - 0 - - - - Loading... - - - true - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - Dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/designer/groupconfsel.ui b/designer/groupconfsel.ui deleted file mode 100644 index 51a86129a..000000000 --- a/designer/groupconfsel.ui +++ /dev/null @@ -1,78 +0,0 @@ - - - Dialog - - - - 0 - 0 - 421 - 188 - - - - Anki - - - - - - - - Choose configuration for selected groups: - - - - - - - - - - - - Qt::Vertical - - - QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - Dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/designer/groups.ui b/designer/groups.ui deleted file mode 100644 index a7b7b821b..000000000 --- a/designer/groups.ui +++ /dev/null @@ -1,164 +0,0 @@ - - - Dialog - - - - 0 - 0 - 527 - 394 - - - - Groups - - - - - - - 0 - 10 - - - - true - - - QAbstractItemView::ExtendedSelection - - - false - - - false - - - - Group - - - - - Options - - - - - On - - - - - Cards - - - - - Due - - - - - New - - - - - - - - - - Select &All - - - - - - - &Rename... - - - - - - - Select &None - - - - - - - Delete - - - - - - - Qt::Vertical - - - QDialogButtonBox::Close|QDialogButtonBox::Help - - - - - - - &Options... - - - - - - - - - tree - selAll - selNone - rename - delete_2 - opts - buttonBox - - - - - buttonBox - accepted() - Dialog - accept() - - - 489 - 322 - - - 524 - 338 - - - - - buttonBox - rejected() - Dialog - reject() - - - 483 - 324 - - - 521 - 291 - - - - - diff --git a/designer/share.ui b/designer/share.ui deleted file mode 100644 index 5895a3e00..000000000 --- a/designer/share.ui +++ /dev/null @@ -1,135 +0,0 @@ - - - Dialog - - - - 0 - 0 - 517 - 411 - - - - Get Shared Decks/Plugins - - - - - - - - Search: - - - - - - - - - - Type: - - - - - - - - - - - - Qt::Vertical - - - - - QFrame::StyledPanel - - - QFrame::Plain - - - Qt::ScrollBarAsNeeded - - - Qt::ScrollBarAlwaysOff - - - - - 0 - 0 - 494 - 54 - - - - - 0 - 0 - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - Dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/designer/syncdeck.ui b/designer/syncdeck.ui deleted file mode 100644 index 6c9f48d32..000000000 --- a/designer/syncdeck.ui +++ /dev/null @@ -1,89 +0,0 @@ - - - DeckChooser - - - - 0 - 0 - 484 - 320 - - - - Anki - - - - 6 - - - 9 - - - - - - - - Qt::AlignCenter - - - - - - - - 12 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - DeckChooser - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - DeckChooser - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/designer/templates.ui b/designer/templates.ui deleted file mode 100644 index 439614cc8..000000000 --- a/designer/templates.ui +++ /dev/null @@ -1,143 +0,0 @@ - - - Dialog - - - - 0 - 0 - 400 - 300 - - - - - - - - - - - - - 0 - 1 - - - - - 0 - 60 - - - - - - - - - - &Add - - - false - - - - - - - &Up - - - false - - - - - - - Dow&n - - - false - - - - - - - &Delete - - - false - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - - - - - - buttonBox - accepted() - Dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - -