Add option to restore last session at startup

* Add an option to the session manager to restore the last
   session on startup of creator.
 * Align close button on session manager dialog with the other
   buttons.
 * Clean up handling of session restoration in the ProjectExplorer:
   Move all the relevant code into determineSessionToRestoreAtStartup,
   since most was there already.

Task-number: QTCREATORBUG-2324
This commit is contained in:
Tobias Hunger
2010-09-14 11:37:54 +02:00
parent b85597da6f
commit 563c542a2f
5 changed files with 75 additions and 21 deletions

View File

@@ -149,6 +149,17 @@ SessionDialog::SessionDialog(SessionManager *sessionManager)
markItems();
}
void SessionDialog::setAutoLoadSession(bool check)
{
m_ui.autoLoadCheckBox->setChecked(check ? Qt::Checked : Qt::Unchecked);
}
bool SessionDialog::autoLoadSession() const
{
return m_ui.autoLoadCheckBox->checkState() == Qt::Checked;
}
void SessionDialog::addItems(bool setDefaultSession)
{
QStringList sessions = m_sessionManager->sessions();