mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
allow for the fact that opening the deck while syncing may disable syncing
This commit is contained in:
parent
6f676c8f03
commit
b336671236
1 changed files with 8 additions and 2 deletions
|
@ -190,11 +190,15 @@ sync was aborted. Please report this error.""")
|
||||||
self.deck = None
|
self.deck = None
|
||||||
try:
|
try:
|
||||||
self.deck = DeckStorage.Deck(path)
|
self.deck = DeckStorage.Deck(path)
|
||||||
|
disable = False
|
||||||
|
if deck and not self.deck.syncName:
|
||||||
|
# multi-mode sync and syncing has been disabled by upgrade
|
||||||
|
disable = True
|
||||||
client = SyncClient(self.deck)
|
client = SyncClient(self.deck)
|
||||||
client.setServer(proxy)
|
client.setServer(proxy)
|
||||||
# need to do anything?
|
# need to do anything?
|
||||||
start = time.time()
|
start = time.time()
|
||||||
if client.prepareSync(proxy.timediff):
|
if client.prepareSync(proxy.timediff) and not disable:
|
||||||
if self.deck.lastSync <= 0:
|
if self.deck.lastSync <= 0:
|
||||||
if client.remoteTime > client.localTime:
|
if client.remoteTime > client.localTime:
|
||||||
self.conflictResolution = "keepRemote"
|
self.conflictResolution = "keepRemote"
|
||||||
|
@ -260,7 +264,9 @@ sync was aborted. Please report this error.""")
|
||||||
self.setStatus(_("Sync complete."))
|
self.setStatus(_("Sync complete."))
|
||||||
else:
|
else:
|
||||||
changes = False
|
changes = False
|
||||||
if not deck:
|
if disable:
|
||||||
|
self.setStatus(_("Disabled by upgrade."))
|
||||||
|
elif not deck:
|
||||||
self.setStatus(_("No changes found."))
|
self.setStatus(_("No changes found."))
|
||||||
# close and send signal to main thread
|
# close and send signal to main thread
|
||||||
self.deck.close()
|
self.deck.close()
|
||||||
|
|
Loading…
Reference in a new issue