Skip to content

Commit

Permalink
Update the Settings screen - reload theme, restore defaults (#463)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Crystalwarrior authored Feb 11, 2021
1 parent 3ac6b33 commit b78479f
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 56 deletions.
8 changes: 8 additions & 0 deletions include/aooptionsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QDialog>
#include <QtWidgets/QDialogButtonBox>
#include <QtWidgets/QFormLayout>
Expand All @@ -24,6 +25,9 @@
#include <QDirIterator>
#include <QTextStream>

class Lobby;
class Courtroom;

class AOOptionsDialog : public QDialog {
Q_OBJECT
public:
Expand All @@ -41,6 +45,7 @@ class AOOptionsDialog : public QDialog {
QFormLayout *ui_gameplay_form;
QLabel *ui_theme_label;
QComboBox *ui_theme_combobox;
QPushButton *ui_theme_reload_button;
QFrame *ui_theme_log_divider;
QLabel *ui_downwards_lbl;
QCheckBox *ui_downwards_cb;
Expand Down Expand Up @@ -159,12 +164,15 @@ class AOOptionsDialog : public QDialog {
QCheckBox *ui_log_cb;

bool needs_default_audiodev();
void update_values();

signals:

public slots:
void save_pressed();
void discard_pressed();
void button_clicked(QAbstractButton *button);
void on_reload_theme_clicked();
};

#endif // AOOPTIONSDIALOG_H
2 changes: 1 addition & 1 deletion include/courtroom.h
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ public slots:

void case_called(QString msg, bool def, bool pro, bool jud, bool jur,
bool steno);
void on_reload_theme_clicked();

private slots:
void start_chat_ticking();
Expand Down Expand Up @@ -911,7 +912,6 @@ private slots:
void on_guilty_clicked();

void on_change_character_clicked();
void on_reload_theme_clicked();
void on_call_mod_clicked();
void on_settings_clicked();
void on_announce_casing_clicked();
Expand Down
Loading

0 comments on commit b78479f

Please sign in to comment.