remove some obsolete actions, fix setting progress parent

This commit is contained in:
Damien Elmes 2009-02-04 22:05:04 +09:00
parent 13c5a398b3
commit 56e6b17e11
4 changed files with 3 additions and 39 deletions

View file

@ -643,12 +643,13 @@ where id in %s""" % ids2str(sf))
d = ChangeModelDialog(self, self.currentCard.fact.model,
self.currentCard.cardModel)
d.exec_()
self.parent.setProgressParent(self)
if d.ret:
n = _("Change Model")
self.parent.setProgressParent(self)
self.deck.setUndoStart(n)
self.deck.changeModel(sf, *d.ret)
self.deck.setUndoEnd(n)
self.parent.setProgressParent(None)
self.updateSearch()
self.updateAfterCardChange()

View file

@ -1671,7 +1671,6 @@ day = :d""", d=yesterday)
self.connect(m.actionRedo, s, self.onRedo)
self.connect(m.actionCheckDatabaseIntegrity, s, self.onCheckDB)
self.connect(m.actionOptimizeDatabase, s, self.onOptimizeDB)
self.connect(m.actionMergeModels, s, self.onMergeModels)
self.connect(m.actionCheckMediaDatabase, s, self.onCheckMediaDB)
self.connect(m.actionCram, s, self.onCram)
self.connect(m.actionGetPlugins, s, self.onGetPlugins)
@ -1974,7 +1973,6 @@ day = :d""", d=yesterday)
if self.progressWin:
self.progressWin.finish()
self.progressWin = None
self.progressParent = None
# Advanced features
##########################################################################
@ -2004,25 +2002,6 @@ Proceed?""")):
size = self.deck.optimize()
ui.utils.showInfo("Database optimized.\nShrunk by %d bytes" % size)
def onMergeModels(self):
ret = self.deck.canMergeModels()
if ret[0] == "ok":
if not ret[1]:
ui.utils.showInfo(_(
"No models found to merge. If you want to merge models,\n"
"all models must have the same name, and must not be\n"
"from another person's deck."))
return
if ui.utils.askUser(_(
"Would you like to merge models that have the same name?")):
self.deck.mergeModels(ret[1])
self.reset()
ui.utils.showInfo(_("Merge complete."))
else:
ui.utils.showWarning(_("""%s.
Anki can only merge models if they have exactly
the same field count and card count.""") % ret[1])
def onCheckMediaDB(self):
mb = QMessageBox(self)
mb.setWindowTitle(_("Anki"))

View file

@ -376,11 +376,6 @@
<string>Ctrl+End</string>
</property>
</action>
<action name="actionChangeTemplate" >
<property name="text" >
<string>Change &amp;Template...</string>
</property>
</action>
<action name="actionReverseOrder" >
<property name="checkable" >
<bool>true</bool>

View file

@ -457,7 +457,7 @@
</sizepolicy>
</property>
<property name="currentIndex" >
<number>4</number>
<number>0</number>
</property>
<widget class="QWidget" name="blankPage" >
<property name="geometry" >
@ -1227,8 +1227,6 @@
<addaction name="actionCacheLatex" />
<addaction name="actionUncacheLatex" />
<addaction name="separator" />
<addaction name="actionMergeModels" />
<addaction name="separator" />
<addaction name="actionRecordNoiseProfile" />
</widget>
<addaction name="actionGraphs" />
@ -1720,15 +1718,6 @@
<string>Optimize Database</string>
</property>
</action>
<action name="actionMergeModels" >
<property name="icon" >
<iconset resource="../icons.qrc" >
<normaloff>:/icons/khtml_kget.png</normaloff>:/icons/khtml_kget.png</iconset>
</property>
<property name="text" >
<string>Merge Models...</string>
</property>
</action>
<action name="actionCheckMediaDatabase" >
<property name="icon" >
<iconset resource="../icons.qrc" >