Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+71
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
*
|
||||
* MainWindow for settings editor
|
||||
*
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <nglwidgets/nglmainwindow.h>
|
||||
|
||||
#include <QMap>
|
||||
#include <QPair>
|
||||
#include <QTreeWidgetItem>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
namespace SettingsEditor
|
||||
{
|
||||
// --------------------------------------------------------------------------------
|
||||
// | Class MainWindow |
|
||||
// --------------------------------------------------------------------------------
|
||||
class MainWindow : public NGLMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
private slots:
|
||||
void oncurrentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
void onSaveSettings();
|
||||
void onExportSettings();
|
||||
void onLoadFromExport();
|
||||
void onLoadPresetFromTemplate();
|
||||
|
||||
private:
|
||||
bool saveSettings(const QString &filename);
|
||||
bool loadSettings(const QString &filename);
|
||||
enum SettingType
|
||||
{
|
||||
String = 1,
|
||||
StringList = 2,
|
||||
Json = 3,
|
||||
FunctionKeys = 4,
|
||||
Boolean = 5,
|
||||
};
|
||||
|
||||
void enableTextEdit(bool enabled = true);
|
||||
void enableFunctionKeyEdit();
|
||||
void enableBoolEdit();
|
||||
void setVersionView();
|
||||
static QString craftKey(const QString &group, const QString &key);
|
||||
static QString typeToString(SettingType t);
|
||||
static SettingType stringToType(const QString &s);
|
||||
|
||||
QMap<QString, QPair<SettingType, QVariant>> m_data;
|
||||
QString m_settingsFileName;
|
||||
|
||||
Ui::MainWindow *m_ui;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user