show sync errors in popup

This commit is contained in:
Damien Elmes 2008-10-11 18:29:29 +09:00
parent 0a4b97c780
commit 87195130c6
6 changed files with 25 additions and 3 deletions

View file

@ -1090,7 +1090,7 @@ class AnkiQt(QMainWindow):
self.syncThread = ui.sync.Sync(self, u, p, interactive, create, self.syncThread = ui.sync.Sync(self, u, p, interactive, create,
onlyMerge, self.sourcesToCheck) onlyMerge, self.sourcesToCheck)
self.connect(self.syncThread, SIGNAL("setStatus"), self.setSyncStatus) self.connect(self.syncThread, SIGNAL("setStatus"), self.setSyncStatus)
self.connect(self.syncThread, SIGNAL("showWarning"), ui.utils.showWarning) self.connect(self.syncThread, SIGNAL("showWarning"), self.showSyncWarning)
self.connect(self.syncThread, SIGNAL("moveToState"), self.moveToState) self.connect(self.syncThread, SIGNAL("moveToState"), self.moveToState)
self.connect(self.syncThread, SIGNAL("noMatchingDeck"), self.selectSyncDeck) self.connect(self.syncThread, SIGNAL("noMatchingDeck"), self.selectSyncDeck)
self.connect(self.syncThread, SIGNAL("syncClockOff"), self.syncClockOff) self.connect(self.syncThread, SIGNAL("syncClockOff"), self.syncClockOff)
@ -1148,6 +1148,10 @@ class AnkiQt(QMainWindow):
% diff) % diff)
self.syncFinished() self.syncFinished()
def showSyncWarning(self, text):
ui.utils.showWarning(text, self)
self.setStatus("")
# Menu, title bar & status # Menu, title bar & status
########################################################################## ##########################################################################

View file

@ -35,7 +35,8 @@ class Sync(QThread):
self.syncDeck() self.syncDeck()
def error(self, error): def error(self, error):
self.setStatus(self.getErrorMessage(error)) error = self.getErrorMessage(error)
self.emit(SIGNAL("showWarning"), error)
if self.onlyMerge: if self.onlyMerge:
# new file needs cleaning up # new file needs cleaning up
self.emit(SIGNAL("cleanNewDeck")) self.emit(SIGNAL("cleanNewDeck"))

View file

@ -369,6 +369,7 @@
<addaction name="separator" /> <addaction name="separator" />
<addaction name="actionReportbug" /> <addaction name="actionReportbug" />
<addaction name="actionForum" /> <addaction name="actionForum" />
<addaction name="actionRelease_Notes" />
<addaction name="separator" /> <addaction name="separator" />
<addaction name="actionAbout" /> <addaction name="actionAbout" />
<addaction name="separator" /> <addaction name="separator" />
@ -923,14 +924,27 @@
<normaloff>:/icons/document-open-remote.png</normaloff>:/icons/document-open-remote.png</iconset> <normaloff>:/icons/document-open-remote.png</normaloff>:/icons/document-open-remote.png</iconset>
</property> </property>
<property name="text" > <property name="text" >
<string>Open Online..</string> <string>Open On&amp;line..</string>
</property> </property>
</action> </action>
<action name="actionCram" > <action name="actionCram" >
<property name="icon" >
<iconset resource="../icons.qrc" >
<normaloff>:/icons/chronometer.png</normaloff>:/icons/chronometer.png</iconset>
</property>
<property name="text" > <property name="text" >
<string>C&amp;ram..</string> <string>C&amp;ram..</string>
</property> </property>
</action> </action>
<action name="actionRelease_Notes" >
<property name="icon" >
<iconset resource="../icons.qrc" >
<normaloff>:/icons/kblogger.png</normaloff>:/icons/kblogger.png</iconset>
</property>
<property name="text" >
<string>Release Notes..</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="../icons.qrc" /> <include location="../icons.qrc" />

View file

@ -1,5 +1,8 @@
<RCC> <RCC>
<qresource prefix="/" > <qresource prefix="/" >
<file>icons/kblogger.png</file>
<file>icons/chronometer.png</file>
<file>icons/Anki_Card.png</file>
<file>icons/document-open-remote.png</file> <file>icons/document-open-remote.png</file>
<file>icons/document-open-recent.png</file> <file>icons/document-open-recent.png</file>
<file>icons/khtml_kget.png</file> <file>icons/khtml_kget.png</file>

BIN
icons/chronometer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

BIN
icons/kblogger.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB