diff options
Diffstat (limited to 'qtmips_gui')
-rw-r--r-- | qtmips_gui/newdialog.cpp | 16 | ||||
-rw-r--r-- | qtmips_gui/newdialog.h | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/qtmips_gui/newdialog.cpp b/qtmips_gui/newdialog.cpp index cc23e2f..d17d0c4 100644 --- a/qtmips_gui/newdialog.cpp +++ b/qtmips_gui/newdialog.cpp @@ -34,6 +34,14 @@ NewDialog::~NewDialog() { // Settings is freed by parent } +void NewDialog::closeEvent(QCloseEvent *) { + load_settings(); // Reset from settings + // Close main window if not already configured + MainWindow *prnt = (MainWindow*)parent(); + if (!prnt->configured()) + prnt->close(); +} + void NewDialog::cancel() { this->close(); } @@ -88,14 +96,6 @@ void NewDialog::set_custom_preset() { ui->preset_custom->setChecked(true); } -void NewDialog::closeEvent(QCloseEvent *) { - load_settings(); // Reset from settings - // Close main window if not already configured - MainWindow *prnt = (MainWindow*)parent(); - if (!prnt->configured()) - prnt->close(); -} - #define LOAD_BUTTON(NAME, DEF) ui->NAME->setChecked(settings->value(#NAME, DEF).toBool()) #define LOAD_LINE(NAME, DEF) ui->NAME->setText(settings->value(#NAME, DEF).toString()) diff --git a/qtmips_gui/newdialog.h b/qtmips_gui/newdialog.h index 1e266a1..f69bea1 100644 --- a/qtmips_gui/newdialog.h +++ b/qtmips_gui/newdialog.h @@ -14,16 +14,16 @@ public: NewDialog(QWidget *parent, QSettings *settings); ~NewDialog(); -public slots: +protected: + void closeEvent(QCloseEvent *); + +private slots: void cancel(); void create(); void browse_elf(); void preset(bool); void set_custom_preset(); -protected: - void closeEvent(QCloseEvent *); - private: Ui::NewDialog *ui; QSettings *settings; |