| 1 | // For license of this file, see <project-root-folder>/LICENSE.md. |
| 2 | |
| 3 | #ifndef SETTINGSDATABASE_H |
| 4 | #define SETTINGSDATABASE_H |
| 5 | |
| 6 | #include "gui/settings/settingspanel.h" |
| 7 | |
| 8 | #include "ui_settingsdatabase.h" |
| 9 | |
| 10 | class SettingsDatabase : public SettingsPanel { |
| 11 | Q_OBJECT |
| 12 | |
| 13 | public: |
| 14 | explicit SettingsDatabase(Settings* settings, QWidget* parent = nullptr); |
| 15 | virtual ~SettingsDatabase(); |
| 16 | |
| 17 | virtual QIcon icon() const; |
| 18 | virtual QString title() const; |
| 19 | virtual void loadSettings(); |
| 20 | virtual void saveSettings(); |
| 21 | |
| 22 | private: |
| 23 | void mysqlTestConnection(); |
| 24 | void onMysqlHostnameChanged(const QString& new_hostname); |
| 25 | void onMysqlUsernameChanged(const QString& new_username); |
| 26 | void onMysqlPasswordChanged(const QString& new_password); |
| 27 | void onMysqlDatabaseChanged(const QString& new_database); |
| 28 | void selectSqlBackend(int index); |
| 29 | |
| 30 | Ui::SettingsDatabase* m_ui; |
| 31 | }; |
| 32 | |
| 33 | inline QString SettingsDatabase::title() const { |
| 34 | return tr("Data storage"); |
| 35 | } |
| 36 | |
| 37 | #endif // SETTINGSDATABASE_H |