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 it lands in is built by seven thousand lines of procedure with no schema to address. So this module navigates the BUILT dialog, by 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 was the version before this one, and it worked in exactly one language.
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.A STATIC outline for a few seconds rather than anything that moves: a mark that pulses would owe an answer to the Animation preferences, and this one owes none and is not lost on a reader who turned motion 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.