From 71a5f645a882ea4e46a543af8c99758eceee20d1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 7 Feb 2009 16:38:49 +0900 Subject: [PATCH] force save on close if sync set --- ankiqt/ui/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index dbed33659..d03019f65 100644 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -719,6 +719,8 @@ To upgrade an old deck, download Anki 0.9.8.7.""")) break # auto sync (saving automatically) if self.config['syncOnClose'] and self.deck.syncName: + # force save, the user may not have set passwd/etc + self.deck.save() self.syncDeck(False, reload=False) while self.deckPath: self.app.processEvents() @@ -771,8 +773,9 @@ To upgrade an old deck, download Anki 0.9.8.7.""")) passwd.setEchoMode(QLineEdit.Password) g.addWidget(passwd, 1, 1) vbox.addLayout(g) - bb = QDialogButtonBox(QDialogButtonBox.Ok) + bb = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Cancel) self.connect(bb, SIGNAL("accepted()"), d.accept) + self.connect(bb, SIGNAL("rejected()"), d.reject) vbox.addWidget(bb) d.setLayout(vbox) d.exec_()