make sure deck has a path before setting syncName

This commit is contained in:
Damien Elmes 2010-12-02 23:17:23 +09:00
parent 43e5f08805
commit 8b10b031db
2 changed files with 6 additions and 0 deletions

View file

@ -25,6 +25,9 @@ class DeckProperties(QDialog):
self.d = deck
self.onFinish = onFinish
self.origMod = self.d.modified
if not self.d.path:
ui.utils.showInfo(_("Please save the deck first."))
return
self.dialog = ankiqt.forms.deckproperties.Ui_DeckProperties()
self.dialog.setupUi(self)
self.dialog.buttonBox.button(QDialogButtonBox.Help).setAutoDefault(False)

View file

@ -2152,6 +2152,9 @@ it to your friends.
return
if self.deck and not self.deck.syncName:
if interactive:
if not self.deck.path:
ui.utils.showInfo(_("Please save the deck first."))
return
# enable syncing
self.deck.enableSyncing()
else: