From 1a3fbaf22975b1f130998841adb3109b8a543513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 5 Jan 2018 17:37:24 +0100 Subject: Make slots in NewDialog private --- qtmips_gui/newdialog.cpp | 16 ++++++++-------- qtmips_gui/newdialog.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'qtmips_gui') 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; -- cgit v1.2.3