mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
feat: add title to some of the sync dialogs (#3838)
* refactor: accept window title in some dialog methods * feat: match sync initial title with state Sync iniates in the `Checked` state, so the initial title is changed to match it instead of using the generic `Anki` title * feat: use `Sync` as the tile of login screen Maybe a new string should be created for that. * feat: Use `Sync` as title of the sync conflict dialog Maybe a new string should be used for that * refactor: fix formatting * fix: alias in CONTRIBUTORS Even in 2025, the script isn't smart enough to handle different casing or use just the GitHub ID
This commit is contained in:
parent
a6426bebe2
commit
63c2a09ef6
5 changed files with 12 additions and 4 deletions
|
@ -98,7 +98,7 @@ gnnoh <gerongfenh@gmail.com>
|
||||||
Sachin Govind <sachin.govind.too@gmail.com>
|
Sachin Govind <sachin.govind.too@gmail.com>
|
||||||
Bruce Harris <github.com/bruceharris>
|
Bruce Harris <github.com/bruceharris>
|
||||||
Patric Cunha <patricc@agap2.pt>
|
Patric Cunha <patricc@agap2.pt>
|
||||||
Brayan Oliveira <github.com/BrayanDSO>
|
Brayan Oliveira <github.com/brayandso>
|
||||||
Luka Warren <github.com/lukawarren>
|
Luka Warren <github.com/lukawarren>
|
||||||
wisherhxl <wisherhxl@gmail.com>
|
wisherhxl <wisherhxl@gmail.com>
|
||||||
dobefore <1432338032@qq.com>
|
dobefore <1432338032@qq.com>
|
||||||
|
|
|
@ -139,6 +139,7 @@ class ProgressManager:
|
||||||
label: str | None = None,
|
label: str | None = None,
|
||||||
parent: QWidget | None = None,
|
parent: QWidget | None = None,
|
||||||
immediate: bool = False,
|
immediate: bool = False,
|
||||||
|
title: str = "Anki",
|
||||||
) -> ProgressDialog | None:
|
) -> ProgressDialog | None:
|
||||||
self._levels += 1
|
self._levels += 1
|
||||||
if self._levels > 1:
|
if self._levels > 1:
|
||||||
|
@ -154,7 +155,7 @@ class ProgressManager:
|
||||||
self._win.form.progressBar.setMaximum(max)
|
self._win.form.progressBar.setMaximum(max)
|
||||||
self._win.form.progressBar.setTextVisible(False)
|
self._win.form.progressBar.setTextVisible(False)
|
||||||
self._win.form.label.setText(label)
|
self._win.form.label.setText(label)
|
||||||
self._win.setWindowTitle("Anki")
|
self._win.setWindowTitle(title)
|
||||||
self._win.setWindowModality(Qt.WindowModality.ApplicationModal)
|
self._win.setWindowModality(Qt.WindowModality.ApplicationModal)
|
||||||
self._win.setMinimumWidth(300)
|
self._win.setMinimumWidth(300)
|
||||||
self._busy_cursor_timer = QTimer(self.mw)
|
self._busy_cursor_timer = QTimer(self.mw)
|
||||||
|
|
|
@ -131,6 +131,7 @@ def sync_collection(mw: aqt.main.AnkiQt, on_done: Callable[[], None]) -> None:
|
||||||
on_future_done,
|
on_future_done,
|
||||||
label=tr.sync_checking(),
|
label=tr.sync_checking(),
|
||||||
immediate=True,
|
immediate=True,
|
||||||
|
title=tr.sync_checking(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -164,6 +165,7 @@ def full_sync(
|
||||||
default_button=2,
|
default_button=2,
|
||||||
parent=mw,
|
parent=mw,
|
||||||
textFormat=Qt.TextFormat.MarkdownText,
|
textFormat=Qt.TextFormat.MarkdownText,
|
||||||
|
title=tr.qt_misc_sync(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -343,7 +345,7 @@ def get_id_and_pass_from_user(
|
||||||
password: str = "",
|
password: str = "",
|
||||||
) -> None:
|
) -> None:
|
||||||
diag = QDialog(mw)
|
diag = QDialog(mw)
|
||||||
diag.setWindowTitle("Anki")
|
diag.setWindowTitle(tr.qt_misc_sync())
|
||||||
disable_help_button(diag)
|
disable_help_button(diag)
|
||||||
diag.setWindowModality(Qt.WindowModality.WindowModal)
|
diag.setWindowModality(Qt.WindowModality.WindowModal)
|
||||||
vbox = QVBoxLayout()
|
vbox = QVBoxLayout()
|
||||||
|
|
|
@ -98,9 +98,12 @@ class TaskManager(QObject):
|
||||||
label: str | None = None,
|
label: str | None = None,
|
||||||
immediate: bool = False,
|
immediate: bool = False,
|
||||||
uses_collection=True,
|
uses_collection=True,
|
||||||
|
title: str = "Anki",
|
||||||
) -> None:
|
) -> None:
|
||||||
"Use QueryOp()/CollectionOp() in new code."
|
"Use QueryOp()/CollectionOp() in new code."
|
||||||
self.mw.progress.start(parent=parent, label=label, immediate=immediate)
|
self.mw.progress.start(
|
||||||
|
parent=parent, label=label, immediate=immediate, title=title
|
||||||
|
)
|
||||||
|
|
||||||
def wrapped_done(fut: Future) -> None:
|
def wrapped_done(fut: Future) -> None:
|
||||||
self.mw.progress.finish()
|
self.mw.progress.finish()
|
||||||
|
|
|
@ -217,6 +217,7 @@ def ask_user_dialog(
|
||||||
) = None,
|
) = None,
|
||||||
default_button: int = 1,
|
default_button: int = 1,
|
||||||
parent: QWidget | None = None,
|
parent: QWidget | None = None,
|
||||||
|
title: str = "Anki",
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> MessageBox:
|
) -> MessageBox:
|
||||||
"Shows a question to the user, passes the index of the button clicked to the callback."
|
"Shows a question to the user, passes the index of the button clicked to the callback."
|
||||||
|
@ -229,6 +230,7 @@ def ask_user_dialog(
|
||||||
buttons=buttons,
|
buttons=buttons,
|
||||||
default_button=default_button,
|
default_button=default_button,
|
||||||
parent=parent,
|
parent=parent,
|
||||||
|
title=title,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue