forked from qt-creator/qt-creator
Core: NewDialog: remember platform choice
Change-Id: I7e1e099cdd2997c1264e9fe5cbef5d4a5adbf791 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
committed by
Martin Kampas
parent
45b08e21a2
commit
435682d702
@@ -189,6 +189,7 @@ using namespace Core::Internal;
|
||||
|
||||
bool NewDialog::m_isRunning = false;
|
||||
QString NewDialog::m_lastCategory = QString();
|
||||
QString NewDialog::m_lastPlatform = QString();
|
||||
|
||||
NewDialog::NewDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
@@ -301,6 +302,9 @@ void NewDialog::showDialog()
|
||||
{
|
||||
QModelIndex idx;
|
||||
|
||||
if (!m_lastPlatform.isEmpty())
|
||||
m_ui->comboBox->setCurrentIndex(m_ui->comboBox->findData(m_lastPlatform));
|
||||
|
||||
if (!m_lastCategory.isEmpty())
|
||||
foreach (QStandardItem* item, m_categoryItems) {
|
||||
if (item->data(Qt::UserRole) == m_lastCategory)
|
||||
@@ -446,6 +450,7 @@ void NewDialog::saveState()
|
||||
QStandardItem *currentItem = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx));
|
||||
if (currentItem)
|
||||
m_lastCategory = currentItem->data(Qt::UserRole).toString();
|
||||
m_lastPlatform = m_ui->comboBox->currentData().toString();
|
||||
}
|
||||
|
||||
void NewDialog::accept()
|
||||
|
||||
Reference in New Issue
Block a user