diff --git a/qt/aqt/mediasync.py b/qt/aqt/mediasync.py index 6cd5a063e..889eec80a 100644 --- a/qt/aqt/mediasync.py +++ b/qt/aqt/mediasync.py @@ -158,10 +158,12 @@ class MediaSyncDialog(QDialog): self._close_when_done = close_when_done self.form = aqt.forms.synclog.Ui_Dialog() self.form.setupUi(self) + self.setWindowTitle(tr(FString.SYNC_MEDIA_LOG_TITLE)) self.abort_button = QPushButton(tr(FString.SYNC_ABORT_BUTTON)) self.abort_button.clicked.connect(self._on_abort) # type: ignore self.abort_button.setAutoDefault(False) self.form.buttonBox.addButton(self.abort_button, QDialogButtonBox.ActionRole) + self.abort_button.setHidden(not self._syncer.is_syncing()) gui_hooks.media_sync_did_progress.append(self._on_log_entry) gui_hooks.media_sync_did_start_or_stop.append(self._on_start_stop) diff --git a/qt/aqt/preferences.py b/qt/aqt/preferences.py index 7c5b924e6..81170f681 100644 --- a/qt/aqt/preferences.py +++ b/qt/aqt/preferences.py @@ -10,7 +10,7 @@ import aqt from anki.lang import _ from aqt import AnkiQt from aqt.qt import * -from aqt.utils import askUser, openHelp, showInfo, showWarning +from aqt.utils import askUser, openHelp, showInfo, showWarning, tr, FString class Preferences(QDialog): @@ -177,6 +177,8 @@ class Preferences(QDialog): ###################################################################### def setupNetwork(self): + self.form.media_log.setText(tr(FString.SYNC_MEDIA_LOG_BUTTON)) + self.form.media_log.clicked.connect(self.on_media_log) self.form.syncOnProgramOpen.setChecked(self.prof["autoSync"]) self.form.syncMedia.setChecked(self.prof["syncMedia"]) if not self.prof["syncKey"]: @@ -185,6 +187,9 @@ class Preferences(QDialog): self.form.syncUser.setText(self.prof.get("syncUser", "")) self.form.syncDeauth.clicked.connect(self.onSyncDeauth) + def on_media_log(self): + self.mw.media_syncer.show_sync_log() + def _hideAuth(self): self.form.syncDeauth.setVisible(False) self.form.syncUser.setText("") diff --git a/qt/designer/preferences.ui b/qt/designer/preferences.ui index 2e87ce297..03ec7d8eb 100644 --- a/qt/designer/preferences.ui +++ b/qt/designer/preferences.ui @@ -371,6 +371,30 @@ + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -542,10 +566,10 @@ lrnCutoff timeLimit numBackups - syncOnProgramOpen - tabWidget - fullSync syncMedia + tabWidget + syncOnProgramOpen + fullSync syncDeauth diff --git a/qt/designer/synclog.ui b/qt/designer/synclog.ui index adb8120a9..e0d93b35a 100644 --- a/qt/designer/synclog.ui +++ b/qt/designer/synclog.ui @@ -11,7 +11,7 @@ - Sync + diff --git a/rslib/ftl/sync.ftl b/rslib/ftl/sync.ftl index 9a8c2db71..97dec7e7e 100644 --- a/rslib/ftl/sync.ftl +++ b/rslib/ftl/sync.ftl @@ -12,11 +12,15 @@ sync-media-failed = Media sync failed. sync-media-aborting = Media sync aborting... sync-media-aborted = Media sync aborted. -# shown in the sync log to indicate media syncing will not be done because it -# was previously disabled by the user in the preferences screen +# Shown in the sync log to indicate media syncing will not be done, because it +# was previously disabled by the user in the preferences screen. sync-media-disabled = Media sync disabled. sync-abort-button = Abort +sync-media-log-button = Media Log + +# Title of the screen that shows syncing progress history +sync-media-log-title = Media Sync Log ## Error messages