mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
remove separate optimize db option, report new size on db check
This commit is contained in:
parent
d18d73b21b
commit
986d605a44
2 changed files with 13 additions and 36 deletions
|
@ -2505,7 +2505,6 @@ This deck already exists on your computer. Overwrite the local copy?"""),
|
|||
self.connect(m.actionUndo, s, self.onUndo)
|
||||
self.connect(m.actionRedo, s, self.onRedo)
|
||||
self.connect(m.actionFullDatabaseCheck, s, self.onCheckDB)
|
||||
self.connect(m.actionOptimizeDatabase, s, self.onOptimizeDB)
|
||||
self.connect(m.actionCheckMediaDatabase, s, self.onCheckMediaDB)
|
||||
self.connect(m.actionDownloadMissingMedia, s, self.onDownloadMissingMedia)
|
||||
self.connect(m.actionLocalizeMedia, s, self.onLocalizeMedia)
|
||||
|
@ -3069,31 +3068,22 @@ Any changes on the server since your last sync will be lost.<br>
|
|||
Proceed?""")):
|
||||
return
|
||||
ret = self.deck.fixIntegrity()
|
||||
if ret == "ok":
|
||||
ret = True
|
||||
ui.utils.showInfo(_("No problems found."))
|
||||
else:
|
||||
ret = _("Problems found:\n%s") % ret
|
||||
diag = QDialog(self)
|
||||
diag.setWindowTitle("Anki")
|
||||
layout = QVBoxLayout(diag)
|
||||
diag.setLayout(layout)
|
||||
text = QTextEdit()
|
||||
text.setReadOnly(True)
|
||||
text.setPlainText(ret)
|
||||
layout.addWidget(text)
|
||||
box = QDialogButtonBox(QDialogButtonBox.Close)
|
||||
layout.addWidget(box)
|
||||
self.connect(box, SIGNAL("rejected()"), diag, SLOT("reject()"))
|
||||
diag.exec_()
|
||||
ret = False
|
||||
diag = QDialog(self)
|
||||
diag.setWindowTitle("Anki")
|
||||
layout = QVBoxLayout(diag)
|
||||
diag.setLayout(layout)
|
||||
text = QTextEdit()
|
||||
text.setReadOnly(True)
|
||||
text.setPlainText(ret)
|
||||
layout.addWidget(text)
|
||||
box = QDialogButtonBox(QDialogButtonBox.Close)
|
||||
layout.addWidget(box)
|
||||
self.connect(box, SIGNAL("rejected()"), diag, SLOT("reject()"))
|
||||
diag.exec_()
|
||||
ret = False
|
||||
self.reset()
|
||||
return ret
|
||||
|
||||
def onOptimizeDB(self):
|
||||
size = self.deck.optimize()
|
||||
ui.utils.showInfo(_("Database optimized.\nShrunk by %dKB") % (size/1024.0))
|
||||
|
||||
def onCheckMediaDB(self):
|
||||
mb = QMessageBox(self)
|
||||
mb.setWindowTitle(_("Anki"))
|
||||
|
|
|
@ -3081,7 +3081,6 @@
|
|||
<string>Ad&vanced</string>
|
||||
</property>
|
||||
<addaction name="actionFullDatabaseCheck"/>
|
||||
<addaction name="actionOptimizeDatabase"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCheckMediaDatabase"/>
|
||||
<addaction name="actionRecordNoiseProfile"/>
|
||||
|
@ -3504,18 +3503,6 @@
|
|||
<string>Save this deck, giving it a new name</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOptimizeDatabase">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/games-solve.png</normaloff>:/icons/games-solve.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Optimize Database</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Remove unused space, making the database file smaller</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCheckMediaDatabase">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
|
|
Loading…
Reference in a new issue