aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-03-15 16:26:38 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-03-15 16:26:38 +0100
commit44421abbe89be2c6a6290182571fff82dfec9651 (patch)
tree69d7980953968f900411db190254a4d05acd2cae /config
parentAdd missing AUTOUIC in ProfileEditor (diff)
downloadsmolbote-44421abbe89be2c6a6290182571fff82dfec9651.tar.xz
Moved Configuration class into library
Diffstat (limited to 'config')
-rw-r--r--config/CMakeLists.txt11
-rw-r--r--config/settingsdialog.cpp3
-rw-r--r--config/settingsdialog.h8
3 files changed, 14 insertions, 8 deletions
diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
index cde4648..9ae0381 100644
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -10,12 +10,15 @@ add_executable(poi-config
main.cpp
settingsdialog.cpp
settingsdialog.h
- ../src/configuration.h
- ../src/configuration.cpp
- )
+)
+
+target_include_directories(poi-config
+ PRIVATE ../lib/configuration
+)
target_link_libraries(poi-config
Qt5::Core Qt5::Widgets
- ${Boost_LIBRARIES})
+ configuration
+)
install(TARGETS poi-config RUNTIME DESTINATION bin CONFIGURATIONS Release)
diff --git a/config/settingsdialog.cpp b/config/settingsdialog.cpp
index 56acc01..ef21a47 100644
--- a/config/settingsdialog.cpp
+++ b/config/settingsdialog.cpp
@@ -24,6 +24,7 @@ SettingsDialog::SettingsDialog(QWidget *parent)
setCentralWidget(&treeWidget);
treeWidget.setColumnCount(2);
+ treeWidget.setHeaderLabels({ tr("setting"), tr("value") });
//config.read()
@@ -32,6 +33,8 @@ SettingsDialog::SettingsDialog(QWidget *parent)
item->setText(0, QString::fromStdString(option->long_name()));
item->setText(1, QString::fromStdString(config.value<std::string>(option->long_name().c_str()).value_or(std::string())));
}
+
+ treeWidget.resizeColumnToContents(0);
}
SettingsDialog::~SettingsDialog() = default;
diff --git a/config/settingsdialog.h b/config/settingsdialog.h
index 82cd1be..dc3cc08 100644
--- a/config/settingsdialog.h
+++ b/config/settingsdialog.h
@@ -6,13 +6,13 @@
* SPDX-License-Identifier: GPL-3.0
*/
-#ifndef SETTINGSDIALOG_H
-#define SETTINGSDIALOG_H
+#ifndef SMOLBOTE_SETTINGSDIALOG_H
+#define SMOLBOTE_SETTINGSDIALOG_H
-#include "../src/configuration.h"
#include <QMainWindow>
#include <QMenu>
#include <QTreeWidget>
+#include <configuration.h>
class SettingsDialog : public QMainWindow
{
@@ -28,4 +28,4 @@ private:
Configuration config;
};
-#endif // SETTINGSDIALOG_H
+#endif // SMOLBOTE_SETTINGSDIALOG_H