mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
add option to force full sync
This commit is contained in:
parent
be35f33301
commit
7fca98092c
2 changed files with 18 additions and 0 deletions
12
aqt/main.py
12
aqt/main.py
|
@ -58,6 +58,7 @@ class AnkiQt(QMainWindow):
|
|||
def setupUI(self):
|
||||
self.col = None
|
||||
self.state = "overview"
|
||||
self.forceFullSync = False
|
||||
self.setupKeys()
|
||||
self.setupThreads()
|
||||
self.setupMainWindow()
|
||||
|
@ -504,6 +505,13 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors")
|
|||
if not self.col:
|
||||
self.loadCollection()
|
||||
|
||||
def onFullSync(self):
|
||||
self.forceFullSync = True
|
||||
self.col.modSchema()
|
||||
self.col.setMod()
|
||||
self.forceFullSync = False
|
||||
self.onSync()
|
||||
|
||||
# Tools
|
||||
##########################################################################
|
||||
|
||||
|
@ -799,6 +807,7 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors")
|
|||
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)
|
||||
|
||||
def updateTitleBar(self):
|
||||
self.setWindowTitle("Anki")
|
||||
|
@ -847,6 +856,9 @@ the problem and restart Anki.""")
|
|||
# if triggered in sync, make sure we don't use the gui
|
||||
if not self.inMainThread():
|
||||
return True
|
||||
# if from the full sync menu, ignore
|
||||
if self.forceFullSync:
|
||||
return True
|
||||
return askUser(_("""\
|
||||
The requested change will require a full upload of the database when \
|
||||
you next synchronize your collection. If you have reviews or other changes \
|
||||
|
|
|
@ -105,6 +105,7 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFullDatabaseCheck"/>
|
||||
<addaction name="actionCheckMediaDatabase"/>
|
||||
<addaction name="actionFullSync"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menuPlugins"/>
|
||||
<addaction name="separator"/>
|
||||
|
@ -243,6 +244,11 @@
|
|||
<string>Ctrl+I</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFullSync">
|
||||
<property name="text">
|
||||
<string>Full Sync...</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="icons.qrc"/>
|
||||
|
|
Loading…
Reference in a new issue