SILICON
Loading...
Searching...
No Matches
SettingsWindow Class Reference

Dialog for editing persisted application settings and shortcuts. More...

#include <settingsWindow.hpp>

Inheritance diagram for SettingsWindow:
Collaboration diagram for SettingsWindow:

Public Member Functions

 SettingsWindow (const QString &appName, QVector< ShortcutSetting > shortcuts, QWidget *parent=nullptr)
 Builds the settings dialog for one application namespace.

Private Member Functions

void loadSettings ()
 Loads persisted settings into the visible editors.
bool saveSettings ()
 Writes the current editor state to disk and applies it to the app.
void importSettings ()
 Imports settings from an external TOML file into the active store.
void exportSettings ()
 Exports the current settings to an external TOML file.
bool importSettingsStore (QSettings &importedSettings)
 Applies settings from another settings store.
QByteArray exportSettingsContent ()
 Serializes the visible settings to TOML bytes.
void restoreDefaults ()
 Resets the visible editors to their declared default values.
void addShortcutEditor (const ShortcutSetting &shortcut)
 Adds one key sequence editor row for a shortcut setting.
void applySettings ()
 Applies the visible settings to the running application state.
void writeVisibleSettings (QSettings &target) const
 Writes the currently visible values to a target settings store.

Private Attributes

SiliconSettings settings
QVector< ShortcutSetting > shortcuts
QVector< QKeySequenceEdit * > shortcutEditors
QComboBox * themeCombo
QSpinBox * maxSimulationStepsSpinBox
QSpinBox * maxTransitionsPerDeltaCycleSpinBox
QFormLayout * keybindingsLayout
QPushButton * importButton
QPushButton * exportButton
QPushButton * restoreDefaultsButton
QDialogButtonBox * buttonBox
CallbackScope callbacks

Detailed Description

Dialog for editing persisted application settings and shortcuts.

Definition at line 52 of file settingsWindow.hpp.

Constructor & Destructor Documentation

◆ SettingsWindow()

SettingsWindow ( const QString & appName,
QVector< ShortcutSetting > shortcuts,
QWidget * parent = nullptr )
explicit

Builds the settings dialog for one application namespace.

Parameters
appNameApplication-specific settings namespace.
shortcutsShortcut definitions exposed in the keybindings section.
parentParent widget.

Definition at line 77 of file settingsWindow.cpp.

Member Function Documentation

◆ addShortcutEditor()

void addShortcutEditor ( const ShortcutSetting & shortcut)
private

Adds one key sequence editor row for a shortcut setting.

Definition at line 287 of file settingsWindow.cpp.

◆ applySettings()

void applySettings ( )
private

Applies the visible settings to the running application state.

Definition at line 294 of file settingsWindow.cpp.

◆ exportSettings()

void exportSettings ( )
private

Exports the current settings to an external TOML file.

Definition at line 278 of file settingsWindow.cpp.

◆ exportSettingsContent()

QByteArray exportSettingsContent ( )
private

Serializes the visible settings to TOML bytes.

Definition at line 223 of file settingsWindow.cpp.

◆ importSettings()

void importSettings ( )
private

Imports settings from an external TOML file into the active store.

Definition at line 256 of file settingsWindow.cpp.

◆ importSettingsStore()

bool importSettingsStore ( QSettings & importedSettings)
private

Applies settings from another settings store.

Definition at line 200 of file settingsWindow.cpp.

◆ loadSettings()

void loadSettings ( )
private

Loads persisted settings into the visible editors.

Definition at line 152 of file settingsWindow.cpp.

◆ restoreDefaults()

void restoreDefaults ( )
private

Resets the visible editors to their declared default values.

Definition at line 171 of file settingsWindow.cpp.

◆ saveSettings()

bool saveSettings ( )
private

Writes the current editor state to disk and applies it to the app.

Definition at line 186 of file settingsWindow.cpp.

◆ writeVisibleSettings()

void writeVisibleSettings ( QSettings & target) const
private

Writes the currently visible values to a target settings store.

Definition at line 309 of file settingsWindow.cpp.

Member Data Documentation

◆ buttonBox

QDialogButtonBox* buttonBox
private

Definition at line 99 of file settingsWindow.hpp.

◆ callbacks

CallbackScope callbacks
private

Definition at line 100 of file settingsWindow.hpp.

◆ exportButton

QPushButton* exportButton
private

Definition at line 97 of file settingsWindow.hpp.

◆ importButton

QPushButton* importButton
private

Definition at line 96 of file settingsWindow.hpp.

◆ keybindingsLayout

QFormLayout* keybindingsLayout
private

Definition at line 95 of file settingsWindow.hpp.

◆ maxSimulationStepsSpinBox

QSpinBox* maxSimulationStepsSpinBox
private

Definition at line 93 of file settingsWindow.hpp.

◆ maxTransitionsPerDeltaCycleSpinBox

QSpinBox* maxTransitionsPerDeltaCycleSpinBox
private

Definition at line 94 of file settingsWindow.hpp.

◆ restoreDefaultsButton

QPushButton* restoreDefaultsButton
private

Definition at line 98 of file settingsWindow.hpp.

◆ settings

SiliconSettings settings
private

Definition at line 87 of file settingsWindow.hpp.

◆ shortcutEditors

QVector<QKeySequenceEdit*> shortcutEditors
private

Definition at line 90 of file settingsWindow.hpp.

◆ shortcuts

QVector<ShortcutSetting> shortcuts
private

Definition at line 89 of file settingsWindow.hpp.

◆ themeCombo

QComboBox* themeCombo
private

Definition at line 92 of file settingsWindow.hpp.


The documentation for this class was generated from the following files: