forked from qt-creator/qt-creator
Require parent for SessionNameInputDialog
...so the dialog does not appear as a separate application. Change-Id: I4e9b76bf70f860d7decf8836f6a9885fb5748028 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -385,9 +385,9 @@ public:
|
|||||||
if (m_activeSwitchToRect.contains(pos))
|
if (m_activeSwitchToRect.contains(pos))
|
||||||
sessionModel->switchToSession(sessionName);
|
sessionModel->switchToSession(sessionName);
|
||||||
else if (m_activeActionRects[0].contains(pos))
|
else if (m_activeActionRects[0].contains(pos))
|
||||||
sessionModel->cloneSession(sessionName);
|
sessionModel->cloneSession(ICore::mainWindow(), sessionName);
|
||||||
else if (m_activeActionRects[1].contains(pos))
|
else if (m_activeActionRects[1].contains(pos))
|
||||||
sessionModel->renameSession(sessionName);
|
sessionModel->renameSession(ICore::mainWindow(), sessionName);
|
||||||
else if (m_activeActionRects[2].contains(pos))
|
else if (m_activeActionRects[2].contains(pos))
|
||||||
sessionModel->deleteSession(sessionName);
|
sessionModel->deleteSession(sessionName);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class SessionNameInputDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SessionNameInputDialog(QWidget *parent = nullptr);
|
explicit SessionNameInputDialog(QWidget *parent);
|
||||||
|
|
||||||
void setActionText(const QString &actionText, const QString &openActionText);
|
void setActionText(const QString &actionText, const QString &openActionText);
|
||||||
void setValue(const QString &value);
|
void setValue(const QString &value);
|
||||||
|
|||||||
@@ -186,9 +186,9 @@ void SessionModel::resetSessions()
|
|||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SessionModel::newSession()
|
void SessionModel::newSession(QWidget *parent)
|
||||||
{
|
{
|
||||||
SessionNameInputDialog sessionInputDialog;
|
SessionNameInputDialog sessionInputDialog(parent);
|
||||||
sessionInputDialog.setWindowTitle(tr("New Session Name"));
|
sessionInputDialog.setWindowTitle(tr("New Session Name"));
|
||||||
sessionInputDialog.setActionText(tr("&Create"), tr("Create and &Open"));
|
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.setWindowTitle(tr("New Session Name"));
|
||||||
sessionInputDialog.setActionText(tr("&Clone"), tr("Clone and &Open"));
|
sessionInputDialog.setActionText(tr("&Clone"), tr("Clone and &Open"));
|
||||||
sessionInputDialog.setValue(session + " (2)");
|
sessionInputDialog.setValue(session + " (2)");
|
||||||
@@ -218,9 +218,9 @@ void SessionModel::deleteSession(const QString &session)
|
|||||||
endResetModel();
|
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.setWindowTitle(tr("Rename Session"));
|
||||||
sessionInputDialog.setActionText(tr("&Rename"), tr("Rename and &Open"));
|
sessionInputDialog.setActionText(tr("&Rename"), tr("Rename and &Open"));
|
||||||
sessionInputDialog.setValue(session);
|
sessionInputDialog.setValue(session);
|
||||||
|
|||||||
@@ -70,10 +70,10 @@ signals:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void resetSessions();
|
void resetSessions();
|
||||||
void newSession();
|
void newSession(QWidget *parent);
|
||||||
void cloneSession(const QString &session);
|
void cloneSession(QWidget *parent, const QString &session);
|
||||||
void deleteSession(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);
|
void switchToSession(const QString &session);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ SessionView::SessionView(QWidget *parent)
|
|||||||
|
|
||||||
void SessionView::createNewSession()
|
void SessionView::createNewSession()
|
||||||
{
|
{
|
||||||
m_sessionModel.newSession();
|
m_sessionModel.newSession(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SessionView::deleteCurrentSession()
|
void SessionView::deleteCurrentSession()
|
||||||
@@ -99,12 +99,12 @@ void SessionView::deleteCurrentSession()
|
|||||||
|
|
||||||
void SessionView::cloneCurrentSession()
|
void SessionView::cloneCurrentSession()
|
||||||
{
|
{
|
||||||
m_sessionModel.cloneSession(currentSession());
|
m_sessionModel.cloneSession(this, currentSession());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SessionView::renameCurrentSession()
|
void SessionView::renameCurrentSession()
|
||||||
{
|
{
|
||||||
m_sessionModel.renameSession(currentSession());
|
m_sessionModel.renameSession(this, currentSession());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SessionView::switchToCurrentSession()
|
void SessionView::switchToCurrentSession()
|
||||||
|
|||||||
Reference in New Issue
Block a user