From 79d4451299e08fc91d1098654751cccef5c3c456 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 14 May 2013 15:23:50 +0900 Subject: [PATCH] move full sync into preferences, and remove maintenance menu --- anki/importing/noteimp.py | 2 +- aqt/errors.py | 2 +- aqt/main.py | 12 ------------ aqt/preferences.py | 5 +++++ aqt/reviewer.py | 2 +- aqt/sync.py | 2 +- designer/main.ui | 31 +++---------------------------- designer/preferences.ui | 11 +++++++++-- 8 files changed, 21 insertions(+), 46 deletions(-) diff --git a/anki/importing/noteimp.py b/anki/importing/noteimp.py index 3317e10ad..e28579e89 100644 --- a/anki/importing/noteimp.py +++ b/anki/importing/noteimp.py @@ -164,7 +164,7 @@ class NoteImporter(Importer): # generate cards if self.col.genCards(self._ids): self.log.insert(0, _( - "Empty cards found. Please run Tools>Maintenance>Empty Cards.")) + "Empty cards found. Please run Tools>Empty Cards.")) # apply scheduling updates self.updateCards() # make sure to update sflds, etc diff --git a/aqt/errors.py b/aqt/errors.py index 0f5d66cc7..77724cd82 100644 --- a/aqt/errors.py +++ b/aqt/errors.py @@ -60,7 +60,7 @@ class ErrorHandler(QObject): An error occurred. It may have been caused by a harmless bug,
or your deck may have a problem.

To confirm it's not a problem with your deck, please run -Tools > Maintenance > Check Database. +Tools > Check Database.

If that doesn't fix the problem, please copy the following
into a bug report:""") pluginText = _("""\ diff --git a/aqt/main.py b/aqt/main.py index 73d334fa9..b3677dc48 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -550,17 +550,6 @@ title="%s">%s''' % ( if not self.col: self.loadCollection() - def onFullSync(self): - if not askUser(_("""\ -If you proceed, you will need to choose between a full download or full \ -upload, overwriting any changes either here or on AnkiWeb. Proceed?""")): - return - self.hideSchemaMsg = True - self.col.modSchema() - self.col.setMod() - self.hideSchemaMsg = False - self.onSync() - # Tools ########################################################################## @@ -772,7 +761,6 @@ and check the statistics for a home deck instead.""")) self.connect(m.actionCheckMediaDatabase, s, self.onCheckMediaDB) self.connect(m.actionDocumentation, s, self.onDocumentation) self.connect(m.actionDonate, s, self.onDonate) - self.connect(m.actionFullSync, s, self.onFullSync) self.connect(m.actionStudyDeck, s, self.onStudyDeck) self.connect(m.actionCreateFiltered, s, self.onCram) self.connect(m.actionEmptyCards, s, self.onEmptyCards) diff --git a/aqt/preferences.py b/aqt/preferences.py index 257779d9b..5d9bb75f2 100644 --- a/aqt/preferences.py +++ b/aqt/preferences.py @@ -99,6 +99,11 @@ Not currently enabled; click the sync button in the main window to enable.""")) def updateNetwork(self): self.prof['autoSync'] = self.form.syncOnProgramOpen.isChecked() self.prof['syncMedia'] = self.form.syncMedia.isChecked() + if self.form.fullSync.isChecked(): + self.mw.hideSchemaMsg = True + self.mw.col.modSchema() + self.mw.col.setMod() + self.mw.hideSchemaMsg = False # Backup ###################################################################### diff --git a/aqt/reviewer.py b/aqt/reviewer.py index 6c8d2e38c..0a497e5db 100644 --- a/aqt/reviewer.py +++ b/aqt/reviewer.py @@ -363,7 +363,7 @@ img { max-width: 95%; max-height: 95%; } if self.typeCorrect is None: if clozeIdx: warn = _("""\ -Please run Tools>Maintenance>Empty Cards""") +Please run Tools>Empty Cards""") else: warn = _("Type answer: unknown field %s") % fld return re.sub(self.typeAnsPat, warn, buf) diff --git a/aqt/sync.py b/aqt/sync.py index 87946f7c2..8dd6de412 100644 --- a/aqt/sync.py +++ b/aqt/sync.py @@ -88,7 +88,7 @@ automatically.""")) self._didFullUp = False showWarning(_("""\ The upload was aborted because errors were found in your collection. \ -Please check your collection with Tools>Maintenance>Check Database.""")) +Please check your collection with Tools>Check Database.""")) elif evt == "sync": m = None; t = args[0] if t == "login": diff --git a/designer/main.ui b/designer/main.ui index c853846f1..ccfbc445a 100644 --- a/designer/main.ui +++ b/designer/main.ui @@ -91,22 +91,12 @@ - - - Maintenance - - - - - - - - - - + + + @@ -172,16 +162,6 @@ &Open Add-ons Folder... - - - &Enable All - - - - - &Disable All - - &Support Anki... @@ -232,11 +212,6 @@ Ctrl+I - - - Full Sync... - - Study Deck... diff --git a/designer/preferences.ui b/designer/preferences.ui index f224bd524..43a7e71e8 100644 --- a/designer/preferences.ui +++ b/designer/preferences.ui @@ -6,8 +6,8 @@ 0 0 - 441 - 445 + 405 + 450 @@ -224,6 +224,13 @@ + + + + On next sync, force changes in one direction + + +