Changeset 75219 in vbox
- Timestamp:
- Nov 1, 2018 7:06:31 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp
r75216 r75219 146 146 void UIWizardExportAppPage2::populateAccounts() 147 147 { 148 /* Block signals while updating: */ 149 m_pAccountComboBox->blockSignals(true); 150 151 /* Remember current item data to be able to restore it: */ 152 QString strOldData; 153 if (m_pAccountComboBox->currentIndex() != -1) 154 strOldData = m_pAccountComboBox->itemData(m_pAccountComboBox->currentIndex(), AccountData_ProfileName).toString(); 155 148 156 /* Clear combo initially: */ 149 157 m_pAccountComboBox->clear(); … … 181 189 } 182 190 183 /* Set default: */ 184 if (m_pAccountComboBox->count() != 0) 185 m_pAccountComboBox->setCurrentIndex(0); 191 /* Set previous/default item if possible: */ 192 int iNewIndex = -1; 193 if ( iNewIndex == -1 194 && !strOldData.isNull()) 195 iNewIndex = m_pAccountComboBox->findData(strOldData, AccountData_ProfileName); 196 if ( iNewIndex == -1 197 && m_pAccountComboBox->count() > 0) 198 iNewIndex = 0; 199 if (iNewIndex != -1) 200 m_pAccountComboBox->setCurrentIndex(iNewIndex); 201 202 /* Unblock signals after update: */ 203 m_pAccountComboBox->blockSignals(false); 186 204 } 187 205
Note:
See TracChangeset
for help on using the changeset viewer.

