Skip to content

Commit

Permalink
Changes about preferencewindow (#69)
Browse files Browse the repository at this point in the history
* chore(preferencewindow.ui): use lowercase letter in the middle of setting

* feat(preferencewindow): use OK/Cancel/Apply instead of Apply/Exit

OK: apply & close
Cancel: close only
Apply: apply only

Apply is helpful if the user wants to try a setting to see if it's good or not.
  • Loading branch information
ouuan authored and coder3101 committed Jan 8, 2020
1 parent 5bfc33c commit 0488da9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
4 changes: 3 additions & 1 deletion include/preferencewindow.hpp
Expand Up @@ -25,7 +25,9 @@ class PreferenceWindow : public QMainWindow

private slots:

void on_exit_clicked();
void on_ok_clicked();

void on_cancel_clicked();

void on_apply_clicked();

Expand Down
10 changes: 8 additions & 2 deletions src/preferencewindow.cpp
Expand Up @@ -189,15 +189,21 @@ PreferenceWindow::~PreferenceWindow()
delete ui;
}

void PreferenceWindow::on_exit_clicked()
void PreferenceWindow::on_ok_clicked()
{
extractSettingsFromUi();
close();
emit settingsApplied();
}

void PreferenceWindow::on_cancel_clicked()
{
close();
}

void PreferenceWindow::on_apply_clicked()
{
extractSettingsFromUi();
close();
emit settingsApplied();
}

Expand Down
41 changes: 24 additions & 17 deletions ui/preferencewindow.ui
Expand Up @@ -196,7 +196,7 @@
<item row="6" column="0">
<widget class="QCheckBox" name="tabs">
<property name="text">
<string>Always Replace tabs with spaces</string>
<string>Always replace tabs with spaces</string>
</property>
</widget>
</item>
Expand All @@ -210,7 +210,7 @@
<item row="8" column="0">
<widget class="QCheckBox" name="savetest">
<property name="text">
<string>Save and Load Input and Expected along with Source</string>
<string>Save and load input and expected along with source</string>
</property>
</widget>
</item>
Expand All @@ -220,7 +220,7 @@
<bool>false</bool>
</property>
<property name="text">
<string>Automatically Format source on save</string>
<string>Automatically format source on save</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -842,20 +842,27 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="apply">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="exit">
<property name="text">
<string>Exit</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ok">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="apply">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down

0 comments on commit 0488da9

Please sign in to comment.