Manages application settings and provides access to them.
More...
#include <settings_manager.h>
|
| void | addRecentFile (const QString &s) |
| | Adds a file to the recent files list.
|
|
|
void | settingsChanged () |
| | Emitted when settings change.
|
|
| maki::SettingField | settingFromName (const QVector< maki::SettingField > &settings, const QString &fieldName) const |
| | Pointer to the ThemeManager.
|
Manages application settings and provides access to them.
◆ SettingsManager()
| SettingsManager::SettingsManager |
( |
oclero::qlementine::ThemeManager * | themeManager, |
|
|
QObject * | parent = nullptr ) |
Constructs a new SettingsManager object.
- Parameters
-
| themeManager | Pointer to the ThemeManager. |
| parent | Parent object. |
◆ addRecentFile
| void SettingsManager::addRecentFile |
( |
const QString & | s | ) |
|
|
slot |
Adds a file to the recent files list.
- Parameters
-
◆ appearance()
◆ applySettings()
| void SettingsManager::applySettings |
( |
| ) |
|
Applies the current temporary settings to the permanent settings and emits a signal indicating that settings have changed.
This function is called to save any changes made during the user interface session. It copies the temporary settings to their corresponding permanent settings, and then calls save() to persist these changes to storage.
◆ availableThemes()
| std::vector< oclero::qlementine::Theme > SettingsManager::availableThemes |
( |
| ) |
const |
Gets the list of available themes.
- Returns
- std::vector<oclero::qlementine::Theme> List of available themes.
◆ general()
Gets the general settings.
- Returns
- GeneralSettings The current general settings.
◆ generation()
◆ getPluginSettings()
| QVector< maki::SettingField > SettingsManager::getPluginSettings |
( |
const QString & | id | ) |
const |
|
override |
Gets the settings for a specific plugin.
- Parameters
-
- Returns
- QVector<maki::SettingField> List of settings for the plugin.
◆ plugins()
Gets the list of plugins.
- Returns
- PluginSettings The current plugin settings
◆ registerSettings()
| VoidResult SettingsManager::registerSettings |
( |
const QString & | id, |
|
|
const maki::PluginVersion | version, |
|
|
const QString & | iconPath, |
|
|
const QVector< maki::SettingField > & | settings ) |
|
override |
Registers settings for a plugin.
- Parameters
-
| id | ID of the plugin. |
| version | Version of the plugin. |
| settings | List of settings for the plugin. |
| callback | Callback function for the plugin. |
◆ setAppearance()
Sets the appearance settings.
- Parameters
-
| s | The new appearance settings. |
◆ setGeneral()
Sets the general settings.
- Parameters
-
| s | The new general settings. |
◆ setGeneration()
Sets the generation settings.
- Parameters
-
| s | The new generation settings. |
◆ setPlugins()
Sets the list of plugins.
- Parameters
-
| s | The new list of plugin information. |
◆ settingFromName()
| maki::SettingField SettingsManager::settingFromName |
( |
const QVector< maki::SettingField > & | settings, |
|
|
const QString & | fieldName ) const |
|
private |
Pointer to the ThemeManager.
Retrieves a setting field from a list of settings by its name.
This function searches through the provided vector of maki::SettingField objects to find one with a matching name.
- Parameters
-
| settings | The vector of settings to search through. |
| fieldName | The name of the setting field to retrieve. |
- Returns
- maki::SettingField A copy of the found setting field, or an empty field if not found.
◆ themeByName()
| Result< oclero::qlementine::Theme > SettingsManager::themeByName |
( |
const QString & | themeName | ) |
const |
Get a theme based on its metadata name.
- Returns
- In case the theme exists, it is returned. Otherwise Result is set to Failed
◆ themeCreated()
| void SettingsManager::themeCreated |
( |
const QString & | themePath | ) |
|
Handles a theme creation event.
- Parameters
-
| themePath | Path to the created theme. |
◆ mTmpGeneral
Current plugin settings.
Temporaty copies until apply is called
The documentation for this class was generated from the following files:
- /__w/maki/maki/app/widgets/settings_manager.h
- /__w/maki/maki/app/widgets/settings_manager.cpp