aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
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