Skip to content

Commit b78479f

Browse files
Update the Settings screen - reload theme, restore defaults (#463)
* Add a Reload Theme button to the settings screen (works with both lobby and courtroom) * Move all value updates on elements to "update_values" func in the settings screen Add a "restore to defaults" option that allows you to restore all the configuration to its default values. Set up a .temp settings file that allows you to undo the effects of restoring default options. * wtf why didn't this error
1 parent 3ac6b33 commit b78479f

3 files changed

Lines changed: 122 additions & 56 deletions

File tree

include/aooptionsdialog.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <QtWidgets/QApplication>
99
#include <QtWidgets/QCheckBox>
1010
#include <QtWidgets/QComboBox>
11+
#include <QtWidgets/QPushButton>
1112
#include <QtWidgets/QDialog>
1213
#include <QtWidgets/QDialogButtonBox>
1314
#include <QtWidgets/QFormLayout>
@@ -24,6 +25,9 @@
2425
#include <QDirIterator>
2526
#include <QTextStream>
2627

28+
class Lobby;
29+
class Courtroom;
30+
2731
class AOOptionsDialog : public QDialog {
2832
Q_OBJECT
2933
public:
@@ -41,6 +45,7 @@ class AOOptionsDialog : public QDialog {
4145
QFormLayout *ui_gameplay_form;
4246
QLabel *ui_theme_label;
4347
QComboBox *ui_theme_combobox;
48+
QPushButton *ui_theme_reload_button;
4449
QFrame *ui_theme_log_divider;
4550
QLabel *ui_downwards_lbl;
4651
QCheckBox *ui_downwards_cb;
@@ -159,12 +164,15 @@ class AOOptionsDialog : public QDialog {
159164
QCheckBox *ui_log_cb;
160165

161166
bool needs_default_audiodev();
167+
void update_values();
162168

163169
signals:
164170

165171
public slots:
166172
void save_pressed();
167173
void discard_pressed();
174+
void button_clicked(QAbstractButton *button);
175+
void on_reload_theme_clicked();
168176
};
169177

170178
#endif // AOOPTIONSDIALOG_H

include/courtroom.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ public slots:
801801

802802
void case_called(QString msg, bool def, bool pro, bool jud, bool jur,
803803
bool steno);
804+
void on_reload_theme_clicked();
804805

805806
private slots:
806807
void start_chat_ticking();
@@ -911,7 +912,6 @@ private slots:
911912
void on_guilty_clicked();
912913

913914
void on_change_character_clicked();
914-
void on_reload_theme_clicked();
915915
void on_call_mod_clicked();
916916
void on_settings_clicked();
917917
void on_announce_casing_clicked();

0 commit comments

Comments
 (0)