diff --git a/qt/MainWindow.cc b/qt/MainWindow.cc index abb26f211..7c6009f3b 100644 --- a/qt/MainWindow.cc +++ b/qt/MainWindow.cc @@ -530,7 +530,7 @@ MainWindow::openProperties () void MainWindow::setLocation () { - QDialog * d = new RelocateDialog (mySession, myModel, getSelectedTorrents (), this); + RelocateDialog * d = new RelocateDialog (mySession, myModel, getSelectedTorrents (), this); d->setAttribute (Qt::WA_DeleteOnClose, true); d->show (); } diff --git a/qt/SessionDialog.cc b/qt/SessionDialog.cc index ea1a30f98..f4be00d6e 100644 --- a/qt/SessionDialog.cc +++ b/qt/SessionDialog.cc @@ -16,7 +16,7 @@ ***/ void -SessionDialog::onAccepted () +SessionDialog::accept () { myPrefs.set (Prefs::SESSION_IS_REMOTE, ui.remoteSessionRadio->isChecked ()); myPrefs.set (Prefs::SESSION_REMOTE_HOST, ui.hostEdit->text ()); @@ -25,7 +25,7 @@ SessionDialog::onAccepted () myPrefs.set (Prefs::SESSION_REMOTE_USERNAME, ui.usernameEdit->text ()); myPrefs.set (Prefs::SESSION_REMOTE_PASSWORD, ui.passwordEdit->text ()); mySession.restart (); - hide (); + BaseDialog::accept (); } void @@ -75,7 +75,4 @@ SessionDialog::SessionDialog (Session& session, Prefs& prefs, QWidget * parent): myAuthWidgets << ui.passwordLabel << ui.passwordEdit; resensitize (); - - connect (ui.dialogButtons, SIGNAL (rejected ()), this, SLOT (hide ())); - connect (ui.dialogButtons, SIGNAL (accepted ()), this, SLOT (onAccepted ())); } diff --git a/qt/SessionDialog.h b/qt/SessionDialog.h index 3c837b158..5415b9c64 100644 --- a/qt/SessionDialog.h +++ b/qt/SessionDialog.h @@ -27,8 +27,11 @@ class SessionDialog: public BaseDialog SessionDialog (Session& session, Prefs& prefs, QWidget * parent = nullptr); virtual ~SessionDialog () {} + public slots: + // QDialog + virtual void accept (); + private slots: - void onAccepted (); void resensitize (); private: diff --git a/qt/SessionDialog.ui b/qt/SessionDialog.ui index e9849d1c9..fc8949d9e 100644 --- a/qt/SessionDialog.ui +++ b/qt/SessionDialog.ui @@ -131,5 +131,38 @@ - + + + dialogButtons + accepted() + SessionDialog + accept() + + + 124 + 244 + + + 124 + 132 + + + + + dialogButtons + rejected() + SessionDialog + reject() + + + 124 + 244 + + + 124 + 132 + + + + diff --git a/qt/StatsDialog.cc b/qt/StatsDialog.cc index 92a993d39..c2c778955 100644 --- a/qt/StatsDialog.cc +++ b/qt/StatsDialog.cc @@ -49,7 +49,7 @@ StatsDialog::setVisible (bool visible) myTimer->stop (); if (visible) myTimer->start (REFRESH_INTERVAL_MSEC); - QDialog::setVisible (visible); + BaseDialog::setVisible (visible); } void