llm-chat 0.0.0
LLM-Chat
Loading...
Searching...
No Matches
settings.h
Go to the documentation of this file.
1#pragma once
2
3#include <QSettings>
4#include <QString>
5
6class QObject;
7
8namespace llm_chat {
9
12class Settings : public QSettings {
13 Q_OBJECT
14
15 Q_PROPERTY(
16 QString language READ language WRITE setLanguage NOTIFY languageChanged)
17 Q_PROPERTY(qreal windowOpacity READ windowOpacity WRITE setWindowOpacity
19 Q_PROPERTY(bool fpsVisible READ isFpsVisible WRITE setFpsVisible NOTIFY
21
22 Q_PROPERTY(QString quitShortcut READ quitShortcut WRITE setQuitShortcut NOTIFY
24 Q_PROPERTY(QString optionsShortcut READ optionsShortcut WRITE
26 Q_PROPERTY(QString fullScreenShortcut READ fullScreenShortcut WRITE
28
29 public:
30 explicit Settings(QObject *parent = nullptr);
31
34 [[nodiscard]] QString defaultLanguage() const;
37 [[nodiscard]] QString language() const;
40 void setLanguage(const QString &language);
41
44 [[nodiscard]] qreal defaultWindowOpacity() const;
47 [[nodiscard]] qreal windowOpacity() const;
50 void setWindowOpacity(const qreal opacity);
51
54 [[nodiscard]] bool defaultFpsVisible() const;
57 [[nodiscard]] bool isFpsVisible() const;
60 void setFpsVisible(const bool fps_visible);
61
63 Q_INVOKABLE void resetShortcutsToDefaults();
64
67 [[nodiscard]] QString defaultQuitShortcut() const;
70 [[nodiscard]] QString quitShortcut() const;
73 void setQuitShortcut(const QString &shortcut);
74
77 [[nodiscard]] QString defaultOptionsShortcut() const;
80 [[nodiscard]] QString optionsShortcut() const;
83 void setOptionsShortcut(const QString &shortcut);
84
87 [[nodiscard]] QString defaultFullScreenShortcut() const;
90 [[nodiscard]] QString fullScreenShortcut() const;
93 void setFullScreenShortcut(const QString &shortcut);
94
95 signals:
102
109};
110
111} // namespace llm_chat
The Settings class is a wrapper around QSettings that provides a more convenient interface for access...
Definition settings.h:12
void fullScreenShortcutChanged()
Emitted when the full screen shortcut is changed.
qreal defaultWindowOpacity() const
Returns the default window opacity for the application.
Definition settings.cpp:26
bool defaultFpsVisible() const
Returns the default FPS visibility for the application.
Definition settings.cpp:39
void setWindowOpacity(const qreal opacity)
Sets the current window opacity for the application.
Definition settings.cpp:32
void setOptionsShortcut(const QString &shortcut)
Sets the current options shortcut for the application.
Definition settings.cpp:86
void setLanguage(const QString &language)
Sets the current language for the application.
Definition settings.cpp:19
void setFullScreenShortcut(const QString &shortcut)
Sets the current full screen shortcut for the application.
Definition settings.cpp:103
void setFpsVisible(const bool fps_visible)
Sets the current FPS visibility for the application.
Definition settings.cpp:46
QString defaultFullScreenShortcut() const
Returns the default full screen shortcut for the application.
Definition settings.cpp:95
bool fpsVisible
Definition settings.h:20
QString defaultLanguage() const
Returns the default language for the application.
Definition settings.cpp:13
QString defaultOptionsShortcut() const
Returns the default options shortcut for the application.
Definition settings.cpp:78
void setQuitShortcut(const QString &shortcut)
Sets the current quit shortcut for the application.
Definition settings.cpp:70
QString defaultQuitShortcut() const
Returns the default quit shortcut for the application.
Definition settings.cpp:62
void fpsVisibleChanged()
Emitted when the FPS visibility is changed.
bool isFpsVisible() const
Returns the current FPS visibility for the application.
Definition settings.cpp:41
QString language
Definition settings.h:16
void languageChanged()
Emitted when the language is changed.
QString fullScreenShortcut
Definition settings.h:27
QString optionsShortcut
Definition settings.h:25
void optionsShortcutChanged()
Emitted when the options shortcut is changed.
qreal windowOpacity
Definition settings.h:18
void windowOpacityChanged()
Emitted when the window opacity is changed.
void quitShortcutChanged()
Emitted when the quit shortcut is changed.
Q_INVOKABLE void resetShortcutsToDefaults()
Resets all shortcuts to their default values.
Definition settings.cpp:53
QString quitShortcut
Definition settings.h:23
Definition backend.cpp:11