Settings page was added
This commit is contained in:
@@ -1,18 +1,40 @@
|
||||
#ifndef SETTINGSSERVICE_H
|
||||
#define SETTINGSSERVICE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QSettings>
|
||||
|
||||
class SettingsService
|
||||
class SettingsService : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QString serverAddress READ serverAddress WRITE setServerAddress NOTIFY serverAddressChanged)
|
||||
Q_PROPERTY(QString selectedUserId READ selectedUserId WRITE setSelectedUserId NOTIFY selectedUserIdChanged)
|
||||
|
||||
public:
|
||||
static SettingsService *instance()
|
||||
{
|
||||
static SettingsService i;
|
||||
return &i;
|
||||
}
|
||||
|
||||
QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const;
|
||||
void setValue(const QString &key, const QVariant &value);
|
||||
|
||||
QString serverAddress() const;
|
||||
void setServerAddress(const QString &address);
|
||||
|
||||
QString selectedUserId() const;
|
||||
void setSelectedUserId(const QString &userId);
|
||||
|
||||
signals:
|
||||
void serverAddressChanged();
|
||||
void selectedUserIdChanged();
|
||||
|
||||
private:
|
||||
SettingsService() = default;
|
||||
~SettingsService() = default;
|
||||
|
||||
QSettings m_settings = QSettings("DedSoft", "BeerLog");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user