mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
show server message if present
This commit is contained in:
parent
529152aef6
commit
058ff1b71a
1 changed files with 6 additions and 2 deletions
|
@ -26,7 +26,7 @@ from aqt.qt import (
|
||||||
QVBoxLayout,
|
QVBoxLayout,
|
||||||
qconnect,
|
qconnect,
|
||||||
)
|
)
|
||||||
from aqt.utils import askUser, askUserDialog, showWarning, tr
|
from aqt.utils import askUser, askUserDialog, showText, showWarning, tr
|
||||||
|
|
||||||
|
|
||||||
class FullSyncChoice(enum.Enum):
|
class FullSyncChoice(enum.Enum):
|
||||||
|
@ -63,6 +63,8 @@ def sync(mw: aqt.main.AnkiQt) -> None:
|
||||||
return
|
return
|
||||||
|
|
||||||
mw.pm.set_host_number(out.host_number)
|
mw.pm.set_host_number(out.host_number)
|
||||||
|
if out.server_message:
|
||||||
|
showText(out.server_message)
|
||||||
if out.required == out.NO_CHANGES:
|
if out.required == out.NO_CHANGES:
|
||||||
# all done
|
# all done
|
||||||
return
|
return
|
||||||
|
@ -109,7 +111,9 @@ def on_full_sync_timer(mw: aqt.main.AnkiQt) -> None:
|
||||||
return
|
return
|
||||||
|
|
||||||
assert isinstance(progress.val, FullSyncProgress)
|
assert isinstance(progress.val, FullSyncProgress)
|
||||||
mw.progress.update(value=progress.val.transferred, max=progress.val.total, process=False)
|
mw.progress.update(
|
||||||
|
value=progress.val.transferred, max=progress.val.total, process=False
|
||||||
|
)
|
||||||
|
|
||||||
if mw.progress.want_cancel():
|
if mw.progress.want_cancel():
|
||||||
mw.col.backend.abort_sync()
|
mw.col.backend.abort_sync()
|
||||||
|
|
Loading…
Reference in a new issue