From e7d44054e151beacf4f4d4cc582ff2618c9a8914 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 23 Jan 2018 19:02:46 +0100 Subject: [PATCH] Require parent for SessionNameInputDialog ...so the dialog does not appear as a separate application. Change-Id: I4e9b76bf70f860d7decf8836f6a9885fb5748028 Reviewed-by: Eike Ziller Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/projectwelcomepage.cpp | 4 ++-- src/plugins/projectexplorer/sessiondialog.h | 2 +- src/plugins/projectexplorer/sessionmodel.cpp | 12 ++++++------ src/plugins/projectexplorer/sessionmodel.h | 6 +++--- src/plugins/projectexplorer/sessionview.cpp | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) 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()