diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index f1eb287048d..141f6e55a3a 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -385,9 +385,9 @@ public: if (m_activeSwitchToRect.contains(pos)) sessionModel->switchToSession(sessionName); else if (m_activeActionRects[0].contains(pos)) - sessionModel->cloneSession(sessionName); + sessionModel->cloneSession(ICore::mainWindow(), sessionName); else if (m_activeActionRects[1].contains(pos)) - sessionModel->renameSession(sessionName); + sessionModel->renameSession(ICore::mainWindow(), sessionName); else if (m_activeActionRects[2].contains(pos)) sessionModel->deleteSession(sessionName); return true; diff --git a/src/plugins/projectexplorer/sessiondialog.h b/src/plugins/projectexplorer/sessiondialog.h index e1ced4884d1..654736694ed 100644 --- a/src/plugins/projectexplorer/sessiondialog.h +++ b/src/plugins/projectexplorer/sessiondialog.h @@ -59,7 +59,7 @@ class SessionNameInputDialog : public QDialog Q_OBJECT public: - explicit SessionNameInputDialog(QWidget *parent = nullptr); + explicit SessionNameInputDialog(QWidget *parent); void setActionText(const QString &actionText, const QString &openActionText); void setValue(const QString &value); diff --git a/src/plugins/projectexplorer/sessionmodel.cpp b/src/plugins/projectexplorer/sessionmodel.cpp index 1f6064ffe4d..21b3ec3f48a 100644 --- a/src/plugins/projectexplorer/sessionmodel.cpp +++ b/src/plugins/projectexplorer/sessionmodel.cpp @@ -186,9 +186,9 @@ void SessionModel::resetSessions() endResetModel(); } -void SessionModel::newSession() +void SessionModel::newSession(QWidget *parent) { - SessionNameInputDialog sessionInputDialog; + SessionNameInputDialog sessionInputDialog(parent); sessionInputDialog.setWindowTitle(tr("New Session Name")); sessionInputDialog.setActionText(tr("&Create"), tr("Create and &Open")); @@ -197,9 +197,9 @@ void SessionModel::newSession() }); } -void SessionModel::cloneSession(const QString &session) +void SessionModel::cloneSession(QWidget *parent, const QString &session) { - SessionNameInputDialog sessionInputDialog; + SessionNameInputDialog sessionInputDialog(parent); sessionInputDialog.setWindowTitle(tr("New Session Name")); sessionInputDialog.setActionText(tr("&Clone"), tr("Clone and &Open")); sessionInputDialog.setValue(session + " (2)"); @@ -218,9 +218,9 @@ void SessionModel::deleteSession(const QString &session) endResetModel(); } -void SessionModel::renameSession(const QString &session) +void SessionModel::renameSession(QWidget *parent, const QString &session) { - SessionNameInputDialog sessionInputDialog; + SessionNameInputDialog sessionInputDialog(parent); sessionInputDialog.setWindowTitle(tr("Rename Session")); sessionInputDialog.setActionText(tr("&Rename"), tr("Rename and &Open")); sessionInputDialog.setValue(session); diff --git a/src/plugins/projectexplorer/sessionmodel.h b/src/plugins/projectexplorer/sessionmodel.h index 92c0f8b6aba..7feff2b433e 100644 --- a/src/plugins/projectexplorer/sessionmodel.h +++ b/src/plugins/projectexplorer/sessionmodel.h @@ -70,10 +70,10 @@ signals: public slots: void resetSessions(); - void newSession(); - void cloneSession(const QString &session); + void newSession(QWidget *parent); + void cloneSession(QWidget *parent, const QString &session); void deleteSession(const QString &session); - void renameSession(const QString &session); + void renameSession(QWidget *parent, const QString &session); void switchToSession(const QString &session); private: diff --git a/src/plugins/projectexplorer/sessionview.cpp b/src/plugins/projectexplorer/sessionview.cpp index ae72e34db50..3f99aa6794c 100644 --- a/src/plugins/projectexplorer/sessionview.cpp +++ b/src/plugins/projectexplorer/sessionview.cpp @@ -89,7 +89,7 @@ SessionView::SessionView(QWidget *parent) void SessionView::createNewSession() { - m_sessionModel.newSession(); + m_sessionModel.newSession(this); } void SessionView::deleteCurrentSession() @@ -99,12 +99,12 @@ void SessionView::deleteCurrentSession() void SessionView::cloneCurrentSession() { - m_sessionModel.cloneSession(currentSession()); + m_sessionModel.cloneSession(this, currentSession()); } void SessionView::renameCurrentSession() { - m_sessionModel.renameSession(currentSession()); + m_sessionModel.renameSession(this, currentSession()); } void SessionView::switchToCurrentSession()