mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 21:27:14 -05:00
improve check db warning, put it ahead
This commit is contained in:
parent
7a43754d74
commit
d5361b34db
1 changed files with 12 additions and 10 deletions
|
|
@ -1670,16 +1670,17 @@ Error was:\n%(f1)s\n...\n%(f2)s""") % {'f1': fmt1, 'f2': fmt2})
|
||||||
|
|
||||||
def onCheckDB(self):
|
def onCheckDB(self):
|
||||||
"True if no problems"
|
"True if no problems"
|
||||||
|
if not ui.utils.askUser(_("""\
|
||||||
|
This operation will find and fix some common problems.<br>
|
||||||
|
<br>
|
||||||
|
On the next sync, all cards will be sent to the server.<br>
|
||||||
|
Any changes on the server since your last sync will be lost.<br>
|
||||||
|
<br>
|
||||||
|
<b>This operation is not undoable.</b><br>
|
||||||
|
Proceed?""")):
|
||||||
|
return
|
||||||
ret = self.deck.fixIntegrity()
|
ret = self.deck.fixIntegrity()
|
||||||
if ret == "ok":
|
if ret == "ok":
|
||||||
ret = _("""\
|
|
||||||
No problems found. Some data structures have been rebuilt in case<br>
|
|
||||||
they were causing problems.<p>
|
|
||||||
<b>On the next sync, all cards will be sent to the server.</b><br>
|
|
||||||
If you have changes on the server and have not synced locally,<br>
|
|
||||||
do not sync your deck. Restore your deck from an automatic<br>
|
|
||||||
backup and then run this command again after syncing.""")
|
|
||||||
ui.utils.showInfo(ret)
|
|
||||||
ret = True
|
ret = True
|
||||||
else:
|
else:
|
||||||
ret = _("Problems found:\n%s") % ret
|
ret = _("Problems found:\n%s") % ret
|
||||||
|
|
@ -1717,12 +1718,13 @@ the same field count and card count.""") % ret[1])
|
||||||
mb.setIcon(QMessageBox.Warning)
|
mb.setIcon(QMessageBox.Warning)
|
||||||
mb.setText(_("""\
|
mb.setText(_("""\
|
||||||
This operation:<br>
|
This operation:<br>
|
||||||
- <b>deletes files</b> not referenced by cards<br>
|
- deletes files not referenced by cards<br>
|
||||||
- either tags cards, or deletes references to missing files<br>
|
- either tags cards, or deletes references to missing files<br>
|
||||||
- renames files to a string of numbers and letters<br>
|
- renames files to a string of numbers and letters<br>
|
||||||
- updates checksums for files which have been changed<br>
|
- updates checksums for files which have been changed<br>
|
||||||
<br>
|
<br>
|
||||||
If in doubt, backup your media directory first."""))
|
<b>This operation is not undoable.</b><br>
|
||||||
|
Consider backing up your media directory first."""))
|
||||||
bTag = QPushButton("Tag Cards")
|
bTag = QPushButton("Tag Cards")
|
||||||
mb.addButton(bTag, QMessageBox.RejectRole)
|
mb.addButton(bTag, QMessageBox.RejectRole)
|
||||||
bDelete = QPushButton("Delete Refs")
|
bDelete = QPushButton("Delete Refs")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue