VirtualBox

Changeset 75219 in vbox


Ignore:
Timestamp:
Nov 1, 2018 7:06:31 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9152: Export appliance wizard: Page 2: Try to restore previously selected account if possible, do not update account properties table while updating account combo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp

    r75216 r75219  
    146146void UIWizardExportAppPage2::populateAccounts()
    147147{
     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
    148156    /* Clear combo initially: */
    149157    m_pAccountComboBox->clear();
     
    181189    }
    182190
    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);
    186204}
    187205
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette