fix open online when no initial password

This commit is contained in:
Damien Elmes 2009-02-26 01:06:21 +09:00
parent 1e9c3ff253
commit d1e8a1d18a

View file

@ -760,7 +760,7 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
return self.app.activeWindow() == self return self.app.activeWindow() == self
def onNew(self, initial=False, path=None): def onNew(self, initial=False, path=None):
if not self.inMainWindow(): return if not self.inMainWindow() and not path: return
if not self.saveAndClose(hideWelcome=True): return if not self.saveAndClose(hideWelcome=True): return
if initial: if initial:
path = os.path.join(self.documentDir, "mydeck.anki") path = os.path.join(self.documentDir, "mydeck.anki")
@ -817,7 +817,7 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
self.deck.syncName = u"something" self.deck.syncName = u"something"
self.deck.lastLoaded = self.deck.modified self.deck.lastLoaded = self.deck.modified
if self.config['syncUsername'] and self.config['syncPassword']: if self.config['syncUsername'] and self.config['syncPassword']:
if self.syncDeck(onlyMerge=True, reload=2): if self.syncDeck(onlyMerge=True, reload=2, interactive=False):
return return
self.deck = None self.deck = None
self.moveToState("initial") self.moveToState("initial")