A widget for configuring keyboard shortcuts for various application actions.
More...
#include <shortcuts_settings_widget.h>
|
| void | RestoreDefaultShortcuts () |
| | Restores all keyboard shortcuts to their default values defined in WavelengthConfig. Prompts the user for confirmation before proceeding. Updates the UI to reflect the restored defaults.
|
| |
|
| void | SetupUi () |
| | Creates and arranges all the UI elements (labels, input fields, layouts, button) for the widget. Dynamically creates QKeySequenceEdit widgets based on the actions defined in WavelengthConfig.
|
| |
|
| static QString | GetActionDescription (const QString &action_id) |
| | Static utility function to get a user-friendly description for a given shortcut action ID.
|
| |
A widget for configuring keyboard shortcuts for various application actions.
This widget displays a list of available actions and their currently assigned keyboard shortcuts using QKeySequenceEdit widgets. Users can modify these shortcuts. It interacts with the WavelengthConfig singleton to load the current shortcuts and save the modified ones. A button is provided to restore all shortcuts to their default values. Changes require an application restart to take effect.
◆ ShortcutsSettingsWidget()
| ShortcutsSettingsWidget::ShortcutsSettingsWidget |
( |
QWidget * | parent = nullptr | ) |
|
|
explicit |
◆ ~ShortcutsSettingsWidget()
| ShortcutsSettingsWidget::~ShortcutsSettingsWidget |
( |
| ) |
|
|
overridedefault |
◆ GetActionDescription()
| QString ShortcutsSettingsWidget::GetActionDescription |
( |
const QString & | action_id | ) |
|
|
staticprivate |
Static utility function to get a user-friendly description for a given shortcut action ID.
- Parameters
-
| action_id | The internal identifier for the shortcut action (e.g., "MainWindow.CreateWavelength"). |
- Returns
- A human-readable string describing the action, or an empty string if the ID is unknown.
◆ LoadSettings()
| void ShortcutsSettingsWidget::LoadSettings |
( |
| ) |
const |
Loads the current shortcut settings from WavelengthConfig and updates the UI elements (QKeySequenceEdit widgets).
◆ RestoreDefaultShortcuts
| void ShortcutsSettingsWidget::RestoreDefaultShortcuts |
( |
| ) |
|
|
privateslot |
Restores all keyboard shortcuts to their default values defined in WavelengthConfig. Prompts the user for confirmation before proceeding. Updates the UI to reflect the restored defaults.
◆ SaveSettings()
| void ShortcutsSettingsWidget::SaveSettings |
( |
| ) |
const |
Saves the currently configured shortcuts from the UI (QKeySequenceEdit widgets) back to WavelengthConfig. Note: Changes are saved to the config object but require an application restart to become active.
◆ SetupUi()
| void ShortcutsSettingsWidget::SetupUi |
( |
| ) |
|
|
private |
Creates and arranges all the UI elements (labels, input fields, layouts, button) for the widget. Dynamically creates QKeySequenceEdit widgets based on the actions defined in WavelengthConfig.
◆ config_
◆ form_layout_
| QFormLayout* ShortcutsSettingsWidget::form_layout_ |
|
private |
Layout used to arrange the action labels and shortcut edit widgets.
◆ restore_button_
| QPushButton* ShortcutsSettingsWidget::restore_button_ |
|
private |
Button to trigger the restoration of default shortcuts.
◆ shortcut_edits_
| QMap<QString, QKeySequenceEdit *> ShortcutsSettingsWidget::shortcut_edits_ |
|
private |
Map storing pointers to the QKeySequenceEdit widgets, keyed by their corresponding action ID.
◆ translator_
The documentation for this class was generated from the following files: