1#ifndef WAVELENGTH_CONFIG_H
2#define WAVELENGTH_CONFIG_H
302 [[nodiscard]] QKeySequence
GetShortcut(
const QString &action_id,
303 const QKeySequence &default_sequence = QKeySequence())
const;
311 void SetShortcut(
const QString &action_id,
const QKeySequence &sequence);
343 [[nodiscard]] QVariant
GetSetting(
const QString &key)
const;
int grid_spacing_
The spacing between background grid lines in pixels.
Definition wavelength_config.h:432
QColor blob_color_
The color used for the blob animation.
Definition wavelength_config.h:428
void RestoreDefaults()
Restores all configuration settings to their default values. Also clears saved shortcuts in persisten...
Definition wavelength_config.cpp:158
~WavelengthConfig() override=default
Default destructor.
void SetRelayServerAddress(const QString &address)
Sets the relay server address. Emits configChanged("relayServerAddress") if the value changes.
Definition wavelength_config.cpp:208
void SetBlobColor(const QColor &color)
Sets the color for the blob animation. Adds the color to recent colors. Emits configChanged("blob_col...
Definition wavelength_config.cpp:230
QSettings settings_
QSettings object used for reading and writing configuration data.
Definition wavelength_config.h:405
void LoadDefaultShortcuts()
Loads the hardcoded default keyboard shortcuts into the default_shortcuts_ map.
Definition wavelength_config.cpp:46
void SaveSettings()
Saves all current configuration settings to persistent storage (QSettings).
Definition wavelength_config.cpp:115
static constexpr int kMaxRecentColors
Maximum number of recently used colors to store.
Definition wavelength_config.h:42
QColor GetTitleBorderColor() const
Gets the color for the title label border.
Definition wavelength_config.cpp:178
QColor GetBackgroundColor() const
Gets the main background color.
Definition wavelength_config.cpp:171
bool IsDebugMode() const
Checks if debug mode is enabled.
Definition wavelength_config.cpp:184
void SetRelayServerPort(int port)
Sets the relay server port. Emits configChanged("relayServerPort") if the value changes.
Definition wavelength_config.cpp:215
bool debug_mode_
Flag indicating if debug mode is enabled.
Definition wavelength_config.h:426
void LoadSettings()
Loads settings from the persistent storage (QSettings) into the member variables, overwriting the def...
Definition wavelength_config.cpp:68
QVariant GetSetting(const QString &key) const
Gets a configuration setting value by its key. This provides a generic way to access settings,...
Definition wavelength_config.cpp:333
QString preferred_start_frequency_
The preferred starting frequency for new Wavelengths.
Definition wavelength_config.h:436
void SetTitleGlowColor(const QColor &color)
Sets the color for the title label glow effect. Adds the color to recent colors. Emits configChanged(...
Definition wavelength_config.cpp:277
QString relay_server_address_
The address of the relay server.
Definition wavelength_config.h:421
void SetKeepAliveInterval(int interval)
Sets the keep-alive interval in milliseconds. Emits configChanged("keepAliveInterval") if the value c...
Definition wavelength_config.cpp:306
QMap< QString, QKeySequence > GetAllShortcuts() const
Gets a map of all currently configured shortcuts.
Definition wavelength_config.cpp:185
int GetConnectionTimeout() const
Gets the connection timeout in milliseconds.
Definition wavelength_config.cpp:181
QString language_code_
The selected language code (e.g., "en", "pl")
Definition wavelength_config.h:437
int GetRelayServerPort() const
Gets the configured relay server port.
Definition wavelength_config.cpp:170
void LoadDefaults()
Loads the hardcoded default values for all settings into the member variables. Also copies the defaul...
Definition wavelength_config.cpp:23
QString GetLanguageCode() const
Gets the currently configured language code (e.g., "en", "pl").
Definition wavelength_config.cpp:180
int max_reconnect_attempts_
The maximum number of reconnection attempts.
Definition wavelength_config.h:425
void SetBackgroundColor(const QColor &color)
Sets the main background color. Adds the color to recent colors. Emits configChanged("background_colo...
Definition wavelength_config.cpp:222
int connection_timeout_
The connection timeout in milliseconds.
Definition wavelength_config.h:423
int GetMaxReconnectAttempts() const
Gets the maximum number of reconnection attempts.
Definition wavelength_config.cpp:183
WavelengthConfig & operator=(const WavelengthConfig &)=delete
Deleted assignment operator.
const QString kShortcutsPrefix
Prefix used for storing shortcut keys within QSettings.
Definition wavelength_config.h:47
QColor GetTitleTextColor() const
Gets the color for the title label text.
Definition wavelength_config.cpp:177
QColor GetStreamColor() const
Gets the color used for stream visualization elements.
Definition wavelength_config.cpp:173
void AddRecentColor(const QColor &color)
Adds a color to the list of recently used colors. If the color already exists, it's moved to the fron...
Definition wavelength_config.cpp:285
QColor GetGridColor() const
Gets the color for the background grid lines.
Definition wavelength_config.cpp:175
void SetTitleBorderColor(const QColor &color)
Sets the color for the title label border. Adds the color to recent colors. Emits configChanged("titl...
Definition wavelength_config.cpp:269
WavelengthConfig(const WavelengthConfig &)=delete
Deleted copy constructor.
QStringList recent_colors_
List of recently used colors (hex codes)
Definition wavelength_config.h:430
void SetDebugMode(bool enabled)
Enables or disables debug mode. Emits configChanged("debugMode") if the value changes.
Definition wavelength_config.cpp:320
QMap< QString, QKeySequence > GetDefaultShortcutsMap() const
Gets a map of the default shortcuts defined within the application.
Definition wavelength_config.cpp:186
int keep_alive_interval_
The keep-alive interval in milliseconds.
Definition wavelength_config.h:424
int GetGridSpacing() const
Gets the spacing between background grid lines in pixels.
Definition wavelength_config.cpp:176
QMap< QString, QKeySequence > default_shortcuts_
Map storing the default keyboard shortcuts. Key: Action ID (e.g., "MainWindow.OpenSettings")....
Definition wavelength_config.h:411
void SetStreamColor(const QColor &color)
Sets the color for stream visualization elements. Adds the color to recent colors....
Definition wavelength_config.cpp:238
QColor title_glow_color_
The color for the title label glow effect.
Definition wavelength_config.h:435
void SetLanguageCode(const QString &code)
Sets the application language code. Emits configChanged("languageCode") if the value changes....
Definition wavelength_config.cpp:201
static WavelengthConfig * instance_
Static pointer to the singleton instance.
Definition wavelength_config.h:400
QString GetPreferredStartFrequency() const
Gets the preferred starting frequency for new Wavelengths.
Definition wavelength_config.cpp:187
void recentColorsChanged()
Emitted when the list of recent colors changes (a color was added).
void SetGridSpacing(int spacing)
Sets the spacing between background grid lines. Emits configChanged("grid_spacing") if the value chan...
Definition wavelength_config.cpp:254
QMap< QString, QKeySequence > shortcuts_
Map storing the currently active keyboard shortcuts (loaded from settings or defaults).
Definition wavelength_config.h:420
QColor GetTitleGlowColor() const
Gets the color for the title label glow effect.
Definition wavelength_config.cpp:179
void configChanged(const QString &key)
Emitted when a configuration setting changes.
static WavelengthConfig * GetInstance()
Gets the singleton instance of the WavelengthConfig.
Definition wavelength_config.cpp:6
int relay_server_port_
The port of the relay server.
Definition wavelength_config.h:422
QColor title_border_color_
The color for the title label border.
Definition wavelength_config.h:434
QColor title_text_color_
The color for the title label text.
Definition wavelength_config.h:433
QColor GetBlobColor() const
Gets the color used for the blob animation.
Definition wavelength_config.cpp:172
QString GetRelayServerUrl() const
Constructs the full WebSocket URL for the relay server.
Definition wavelength_config.cpp:189
QColor stream_color_
The color used for stream visualization elements.
Definition wavelength_config.h:429
QStringList GetRecentColors() const
Gets the list of recently used colors.
Definition wavelength_config.cpp:174
QColor background_color_
The main background color of the application.
Definition wavelength_config.h:427
void SetConnectionTimeout(int timeout)
Sets the connection timeout in milliseconds. Emits configChanged("connectionTimeout") if the value ch...
Definition wavelength_config.cpp:299
void SetGridColor(const QColor &color)
Sets the color for the background grid lines. Adds the color to recent colors. Emits configChanged("g...
Definition wavelength_config.cpp:246
void SetMaxReconnectAttempts(int attempts)
Sets the maximum number of reconnection attempts. Emits configChanged("maxReconnectAttempts") if the ...
Definition wavelength_config.cpp:313
void SetPreferredStartFrequency(const QString &frequency)
Sets the preferred starting frequency. Validates that the frequency is a number >= 130....
Definition wavelength_config.cpp:355
void SetTitleTextColor(const QColor &color)
Sets the color for the title label text. Adds the color to recent colors. Emits configChanged("title_...
Definition wavelength_config.cpp:261
QString GetRelayServerAddress() const
Gets the configured relay server address.
Definition wavelength_config.cpp:169
void SetShortcut(const QString &action_id, const QKeySequence &sequence)
Sets the keyboard shortcut for a specific action. This updates the internal map; SaveSettings() must ...
Definition wavelength_config.cpp:327
QKeySequence GetShortcut(const QString &action_id, const QKeySequence &default_sequence=QKeySequence()) const
Gets the configured keyboard shortcut for a specific action. If no shortcut is configured for the act...
Definition wavelength_config.cpp:193
int GetKeepAliveInterval() const
Gets the keep-alive interval in milliseconds.
Definition wavelength_config.cpp:182
QColor grid_color_
The color for the background grid lines.
Definition wavelength_config.h:431
Default configuration values for the Wavelength application.
Definition wavelength_config.h:10
constexpr bool kIsDebugMode
Default debug mode status.
Definition wavelength_config.h:16
constexpr int kRelayServerPort
Default relay server port.
Definition wavelength_config.h:12
const auto kTitleTextColor
White color for title text.
Definition wavelength_config.h:23
const QString kPreferredStartFrequency
Default preferred starting frequency.
Definition wavelength_config.h:26
constexpr auto kGridColor
Grid color with transparency.
Definition wavelength_config.h:21
constexpr int kGridSpacing
Default grid spacing in pixels.
Definition wavelength_config.h:22
const auto kTitleBorderColor
Light Purple color for a title border.
Definition wavelength_config.h:24
const auto kStreamColor
Light Blue color for stream visualization.
Definition wavelength_config.h:20
const auto kMessageColor
Light Gray color for messages.
Definition wavelength_config.h:19
const auto kBackgroundColor
Dark Blue background color.
Definition wavelength_config.h:17
constexpr int kMaxReconnectAttempts
Default maximum number of reconnection attempts.
Definition wavelength_config.h:15
const auto kTitleGlowColor
Light Purple color for a title glow.
Definition wavelength_config.h:25
constexpr int kConnectionTimeout
Default connection timeout in milliseconds.
Definition wavelength_config.h:13
const auto kBlobColor
Steel Blue color for blob animation.
Definition wavelength_config.h:18
constexpr int kKeepAliveInterval
Default keep-alive interval in milliseconds.
Definition wavelength_config.h:14
const QString kRelayServerAddress
Default relay server address.
Definition wavelength_config.h:11