mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
make it clear to use why anki's suggesting a download
avoid showing the upload button to prevent accidental data loss; user can add a card if they want to upload
This commit is contained in:
parent
c653e39dbe
commit
fe0954beba
1 changed files with 16 additions and 13 deletions
11
aqt/sync.py
11
aqt/sync.py
|
@ -229,6 +229,12 @@ enter your details below.""") %
|
|||
return (u, p)
|
||||
|
||||
def _confirmFullSync(self):
|
||||
if self.thread.localIsEmpty:
|
||||
diag = askUserDialog(
|
||||
_("Local collection has no cards. Download from AnkiWeb?"),
|
||||
[_("Download from AnkiWeb"), _("Cancel")])
|
||||
diag.setDefault(1)
|
||||
else:
|
||||
diag = askUserDialog(_("""\
|
||||
Your decks here and on AnkiWeb differ in such a way that they can't \
|
||||
be merged together, so it's necessary to overwrite the decks on one \
|
||||
|
@ -374,13 +380,10 @@ class SyncThread(QThread):
|
|||
self._syncMedia()
|
||||
|
||||
def _fullSync(self):
|
||||
# if the local deck is empty, assume user is trying to download
|
||||
if self.col.isEmpty():
|
||||
f = "download"
|
||||
else:
|
||||
# tell the calling thread we need a decision on sync direction, and
|
||||
# wait for a reply
|
||||
self.fullSyncChoice = False
|
||||
self.localIsEmpty = self.col.isEmpty()
|
||||
self.fireEvent("fullSync")
|
||||
while not self.fullSyncChoice:
|
||||
time.sleep(0.1)
|
||||
|
|
Loading…
Reference in a new issue