From 8b10b031db0a093f8daeaf940cc6cae2d9f2831c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 2 Dec 2010 23:17:23 +0900 Subject: [PATCH] make sure deck has a path before setting syncName --- ankiqt/ui/deckproperties.py | 3 +++ ankiqt/ui/main.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ankiqt/ui/deckproperties.py b/ankiqt/ui/deckproperties.py index 11bf2de71..53c69004d 100644 --- a/ankiqt/ui/deckproperties.py +++ b/ankiqt/ui/deckproperties.py @@ -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) diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index 47c6dc52b..a1b2fda1b 100755 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -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: