spacr.qt.preferences_navigation¶
Open the Preferences dialog on one tab, at one row.
A preference result in the Help search field has to land on the row the user asked for, and the dialog is built procedurally, with no schema to address. This module therefore navigates the built dialog, using the two handles the build leaves behind:
every page sets an object name –
PreferencesTabGeneral,PreferencesTabAnimation– and those names are whattools/build_help_search_index.pyreads out of the same source, so the index and the dialog agree by construction rather than by a second list;every row’s caption goes through
spacr.qt.i18n.tr(), so the English in the index is turned into the displayed caption the same way the dialog turned it, and a Korean interface is matched as well as an English one.
Matching the displayed caption against an English literal would work only in English.
Kept out of preferences.py on purpose: that module is imported headless,
and everything here needs live widgets.
Functions¶
|
The page whose object name is |
|
Scroll to the row captioned |
|
The field widget of the row captioned |
|
Bring the page named |
|
The dialog's tab bar. |
Module Contents¶
- spacr.qt.preferences_navigation.page_named(dialog: PySide6.QtWidgets.QWidget, object_name: str) → PySide6.QtWidgets.QWidget | None[source]¶
The page whose object name is
object_name.- Parameters:
dialog – the preferences dialog.
object_name – e.g.
"PreferencesTabTheme".
- Returns:
the page widget, or
None.
- spacr.qt.preferences_navigation.reveal_row(page: PySide6.QtWidgets.QWidget, label: str) → bool[source]¶
Scroll to the row captioned
labeland outline it.The outline is static and shown for a few seconds. Because it does not move, it does not depend on the Animation preferences and stays visible when motion is turned off.
- Parameters:
page – the preferences page.
label – the English caption.
- Returns:
True when the row was found.
- spacr.qt.preferences_navigation.row_field(page: PySide6.QtWidgets.QWidget, label: str) → PySide6.QtWidgets.QWidget | None[source]¶
The field widget of the row captioned
label.- Parameters:
page – the preferences page.
label – the English caption.
- Returns:
the field widget, or
Nonewhen no row carries that caption.
- spacr.qt.preferences_navigation.show_tab(dialog: PySide6.QtWidgets.QWidget, object_name: str, label: str = '') → bool[source]¶
Bring the page named
object_nameto the front, at rowlabel.- Parameters:
dialog – the preferences dialog, already built.
object_name – the page’s object name.
label – the English caption of the row to mark;
""marks none.
- Returns:
True when the page was found and shown.