forked from qt-creator/qt-creator
Session manager will no longer try to load a session when clicking OK.
This double role of managing sessions *and* loading the active one was always a bit odd and confusing (unexpected behavior). Reviewed-By: dt
This commit is contained in:
@@ -139,15 +139,13 @@ void SessionDialog::updateActions()
|
|||||||
|
|
||||||
if (m_ui.sessionList->currentItem())
|
if (m_ui.sessionList->currentItem())
|
||||||
enableDelete = (m_ui.sessionList->currentItem()->text() != m_sessionManager->activeSession()
|
enableDelete = (m_ui.sessionList->currentItem()->text() != m_sessionManager->activeSession()
|
||||||
&& m_ui.sessionList->currentItem()->text() != "default");
|
&& (m_ui.sessionList->currentItem()->text() != QLatin1String("default")));
|
||||||
m_ui.btDelete->setEnabled(enableDelete);
|
m_ui.btDelete->setEnabled(enableDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SessionDialog::accept()
|
void SessionDialog::accept()
|
||||||
{
|
{
|
||||||
if (m_ui.sessionList->currentItem()) {
|
// do nothing
|
||||||
m_sessionManager->loadSession(m_ui.sessionList->currentItem()->text());
|
|
||||||
}
|
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,17 +14,10 @@
|
|||||||
<string>Session Manager</string>
|
<string>Session Manager</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Choose your session</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QListWidget" name="sessionList"/>
|
<widget class="QListWidget" name="sessionList"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="0" column="2">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btCreateNew">
|
<widget class="QPushButton" name="btCreateNew">
|
||||||
@@ -62,14 +55,14 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="whatsASessionLabel">
|
<widget class="QLabel" name="whatsASessionLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><a href="qthelp://com.nokia.qtcreator/doc/creator-quick-tour.html#session-management-in-qt-creator">What is a Session?</a></string>
|
<string><a href="qthelp://com.nokia.qtcreator/doc/creator-quick-tour.html#session-management-in-qt-creator">What is a Session?</a></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1" colspan="2">
|
<item row="1" column="1" colspan="2">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
|||||||
Reference in New Issue
Block a user