From 986d605a44ec8a294af81e18431228d722d21b0e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 12 Feb 2011 07:56:36 +0900 Subject: [PATCH] remove separate optimize db option, report new size on db check --- ankiqt/ui/main.py | 36 +++++++++++++----------------------- designer/main.ui | 13 ------------- 2 files changed, 13 insertions(+), 36 deletions(-) diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index 74106c85c..c73d7069e 100755 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -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.
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")) diff --git a/designer/main.ui b/designer/main.ui index aadca3482..bd83f1bbb 100644 --- a/designer/main.ui +++ b/designer/main.ui @@ -3081,7 +3081,6 @@ Ad&vanced - @@ -3504,18 +3503,6 @@ Save this deck, giving it a new name - - - - :/icons/games-solve.png:/icons/games-solve.png - - - &Optimize Database - - - Remove unused space, making the database file smaller - -