Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
wavelength_settings_widget.h
Go to the documentation of this file.
1#ifndef WAVELENGTH_SETTINGS_WIDGET_H
2#define WAVELENGTH_SETTINGS_WIDGET_H
3
4#include <QWidget>
5
6class QLineEdit;
7class QComboBox;
10
19class WavelengthSettingsWidget final : public QWidget {
20 Q_OBJECT
21
22public:
28 explicit WavelengthSettingsWidget(QWidget *parent = nullptr);
29
33 ~WavelengthSettingsWidget() override = default;
34
39 void LoadSettings() const;
40
45 void SaveSettings();
46
47private:
52 void SetupUi();
53
62 bool ValidateFrequencyInput(double &hz);
63
68
70 QComboBox *language_combo_;
71
76};
77
78#endif // WAVELENGTH_SETTINGS_WIDGET_H
Manages the loading and delivery of translations for applications.
Definition translation_manager.h:15
Manages application configuration settings using a singleton pattern.
Definition wavelength_config.h:36
QComboBox * frequency_unit_combo_
Combo box for selecting the unit (Hz, kHz, MHz) of the preferred frequency.
Definition wavelength_settings_widget.h:75
TranslationManager * translator_
Pointer to the TranslationManager singleton instance.
Definition wavelength_settings_widget.h:67
QComboBox * language_combo_
Combo box for selecting the application language.
Definition wavelength_settings_widget.h:70
QLineEdit * frequency_value_edit_
Input field for the numerical value of the preferred frequency.
Definition wavelength_settings_widget.h:73
~WavelengthSettingsWidget() override=default
Default destructor.
void SetupUi()
Creates and arranges all the UI elements (labels, inputs, layouts) for the widget....
Definition wavelength_settings_widget.cpp:33
WavelengthSettingsWidget(QWidget *parent=nullptr)
Constructs the WavelengthSettingsWidget. Initializes the UI, loads the current preferred frequency fr...
Definition wavelength_settings_widget.cpp:22
void LoadSettings() const
Loads the current preferred start frequency from WavelengthConfig and updates the UI elements....
Definition wavelength_settings_widget.cpp:112
void SaveSettings()
Validates the frequency input and saves the preferred start frequency back to WavelengthConfig....
Definition wavelength_settings_widget.cpp:220
bool ValidateFrequencyInput(double &hz)
Validates the frequency value and unit entered by the user. Checks if the value is a positive number,...
Definition wavelength_settings_widget.cpp:153
WavelengthConfig * config_
Pointer to the WavelengthConfig singleton instance.
Definition wavelength_settings_widget.h:65