forked from stijnherfst/HiveWE
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add settings GUI and ability to set extra arguments when testing
- Loading branch information
Showing
10 changed files
with
174 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "stdafx.h" | ||
|
||
SettingsEditor::SettingsEditor(QWidget* parent) : QDialog(parent) { | ||
ui.setupUi(this); | ||
QSettings settings; | ||
ui.testArgs->setText(settings.value("testArgs").toString()); | ||
|
||
connect(ui.buttonBox, &QDialogButtonBox::accepted, [&]() { | ||
save(); | ||
emit accept(); | ||
close(); | ||
}); | ||
|
||
connect(ui.buttonBox, &QDialogButtonBox::rejected, [&]() { | ||
emit reject(); | ||
close(); | ||
}); | ||
show(); | ||
} | ||
|
||
void SettingsEditor::save() const { | ||
QSettings settings; | ||
settings.setValue("testArgs", ui.testArgs->text()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include "ui_SettingsEditor.h" | ||
|
||
class SettingsEditor : public QDialog { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit SettingsEditor(QWidget* parent = nullptr); | ||
private: | ||
Ui::SettingsEditor ui; | ||
void save() const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>SettingsEditor</class> | ||
<widget class="QDialog" name="SettingsEditor"> | ||
<property name="windowModality"> | ||
<enum>Qt::ApplicationModal</enum> | ||
</property> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>376</width> | ||
<height>527</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Settings</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_1"> | ||
<item> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QTabWidget" name="tabs"> | ||
<property name="currentIndex"> | ||
<number>0</number> | ||
</property> | ||
<property name="usesScrollButtons"> | ||
<bool>false</bool> | ||
</property> | ||
<widget class="QWidget" name="tab"> | ||
<attribute name="title"> | ||
<string>General</string> | ||
</attribute> | ||
</widget> | ||
<widget class="QWidget" name="tab_1"> | ||
<attribute name="title"> | ||
<string>Testing</string> | ||
</attribute> | ||
<layout class="QFormLayout" name="formLayout"> | ||
<item row="0" column="0"> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>Arguments:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="0" column="1"> | ||
<widget class="QLineEdit" name="testArgs"/> | ||
</item> | ||
</layout> | ||
</widget> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<layoutdefault spacing="6" margin="11"/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters