mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
add string for media log title, and add button in prefs to access it
This commit is contained in:
parent
b4c3bf99ab
commit
e439e8cdec
5 changed files with 42 additions and 7 deletions
|
@ -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)
|
||||
|
|
|
@ -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("")
|
||||
|
|
|
@ -371,6 +371,30 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="media_log">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -542,10 +566,10 @@
|
|||
<tabstop>lrnCutoff</tabstop>
|
||||
<tabstop>timeLimit</tabstop>
|
||||
<tabstop>numBackups</tabstop>
|
||||
<tabstop>syncOnProgramOpen</tabstop>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>fullSync</tabstop>
|
||||
<tabstop>syncMedia</tabstop>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>syncOnProgramOpen</tabstop>
|
||||
<tabstop>fullSync</tabstop>
|
||||
<tabstop>syncDeauth</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Sync</string>
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue