- Timestamp:
- Oct 11, 2018 12:13:26 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp
r74758 r74766 80 80 AssertReturnVoid(m_pFormatComboBox->count() == 0); 81 81 82 /* Applyhardcoded format list: */82 /* Compose hardcoded format list: */ 83 83 QStringList formats; 84 84 formats << "ovf-0.9"; … … 87 87 formats << "opc-1.0"; 88 88 formats << "csp-1.0"; 89 m_pFormatComboBox->addItems(formats); 90 91 /* Duplicate non-translated names to data fields: */ 92 for (int i = 0; i < m_pFormatComboBox->count(); ++i) 93 m_pFormatComboBox->setItemData(i, m_pFormatComboBox->itemText(i)); 89 /* Add that list to combo: */ 90 foreach (const QString &strShortName, formats) 91 { 92 /* Compose empty item, fill it's data: */ 93 m_pFormatComboBox->addItem(QString()); 94 m_pFormatComboBox->setItemData(m_pFormatComboBox->count() - 1, strShortName, FormatData_ShortName); 95 } 94 96 95 97 /* Set default: */ … … 117 119 AssertReturnVoid(m_pAccountComboBox->count() == 0); 118 120 119 /* Acquire provider list: */120 QVector<CCloudProvider> comProviders = m_comCloudProviderManager.GetProviders();121 122 121 /* Iterate through providers: */ 123 foreach (const CCloudProvider &com Provider, comProviders)122 foreach (const CCloudProvider &comCloudProvider, m_comCloudProviderManager.GetProviders()) 124 123 { 125 124 /* Skip if we have nothing to populate (file missing?): */ 126 if (com Provider.isNull())125 if (comCloudProvider.isNull()) 127 126 continue; 128 127 129 128 /* Iterate through profile names: */ 130 foreach (const QString &strProfileName, com Provider.GetProfileNames())129 foreach (const QString &strProfileName, comCloudProvider.GetProfileNames()) 131 130 { 132 131 m_pAccountComboBox->addItem(QString()); 133 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, com Provider.GetId(),ProviderID);134 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, com Provider.GetName(),ProviderName);135 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, com Provider.GetShortName(),ProviderShortName);136 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, strProfileName, ProfileName);132 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, comCloudProvider.GetId(), AccountData_ProviderID); 133 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, comCloudProvider.GetName(), AccountData_ProviderName); 134 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, comCloudProvider.GetShortName(), AccountData_ProviderShortName); 135 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, strProfileName, AccountData_ProfileName); 137 136 } 138 137 } … … 145 144 void UIWizardExportAppPage2::populateAccountProperties() 146 145 { 146 /* Clear table initially: */ 147 m_pAccountPropertyTable->clear(); 148 147 149 /* Acquire Cloud Provider: */ 148 150 CCloudProvider comCloudProvider = m_comCloudProviderManager.GetProviderById(providerId()); … … 156 158 if (m_comCloudProfile.isNull()) 157 159 return; 158 159 /* Clear table initially: */160 m_pAccountPropertyTable->clear();161 160 162 161 /* Acquire properties: */ … … 365 364 void UIWizardExportAppPage2::setFormat(const QString &strFormat) 366 365 { 367 const int iIndex = m_pFormatComboBox->findData(strFormat );366 const int iIndex = m_pFormatComboBox->findData(strFormat, FormatData_ShortName); 368 367 AssertMsg(iIndex != -1, ("Data not found!")); 369 368 m_pFormatComboBox->setCurrentIndex(iIndex); 370 369 } 370 371 371 QString UIWizardExportAppPage2::format() const 372 372 { 373 373 const int iIndex = m_pFormatComboBox->currentIndex(); 374 return m_pFormatComboBox->itemData(iIndex ).toString();374 return m_pFormatComboBox->itemData(iIndex, FormatData_ShortName).toString(); 375 375 } 376 376 … … 420 420 void UIWizardExportAppPage2::setProviderById(const QString &strId) 421 421 { 422 const int iIndex = m_pAccountComboBox->findData(strId, ProviderID);422 const int iIndex = m_pAccountComboBox->findData(strId, AccountData_ProviderID); 423 423 AssertMsg(iIndex != -1, ("Data not found!")); 424 424 m_pAccountComboBox->setCurrentIndex(iIndex); … … 428 428 { 429 429 const int iIndex = m_pAccountComboBox->currentIndex(); 430 return m_pAccountComboBox->itemData(iIndex, ProviderID).toString();430 return m_pAccountComboBox->itemData(iIndex, AccountData_ProviderID).toString(); 431 431 } 432 432 … … 434 434 { 435 435 const int iIndex = m_pAccountComboBox->currentIndex(); 436 return m_pAccountComboBox->itemData(iIndex, ProviderShortName).toString();436 return m_pAccountComboBox->itemData(iIndex, AccountData_ProviderShortName).toString(); 437 437 } 438 438 … … 440 440 { 441 441 const int iIndex = m_pAccountComboBox->currentIndex(); 442 return m_pAccountComboBox->itemData(iIndex, ProfileName).toString();442 return m_pAccountComboBox->itemData(iIndex, AccountData_ProfileName).toString(); 443 443 } 444 444 … … 753 753 m_pFileSelector->setFileDialogTitle(UIWizardExportApp::tr("Please choose a file to export the virtual appliance to")); 754 754 755 /* Translate Format combo-box: */755 /* Translate hardcoded values of Format combo-box: */ 756 756 m_pFormatComboBoxLabel->setText(UIWizardExportApp::tr("F&ormat:")); 757 757 m_pFormatComboBox->setItemText(0, UIWizardExportApp::tr("Open Virtualization Format 0.9")); … … 797 797 { 798 798 m_pAccountComboBox->setItemText(i, UIWizardExportApp::tr("%1: %2", "provider: profile") 799 .arg(m_pAccountComboBox->itemData(i, ProviderName).toString())800 .arg(m_pAccountComboBox->itemData(i, ProfileName).toString()));799 .arg(m_pAccountComboBox->itemData(i, AccountData_ProviderName).toString()) 800 .arg(m_pAccountComboBox->itemData(i, AccountData_ProfileName).toString())); 801 801 } 802 802 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.h
r74758 r74766 53 53 Q_DECLARE_METATYPE(MACAddressPolicy); 54 54 55 /** Format combo data fields. */ 56 enum 57 { 58 FormatData_ShortName = Qt::UserRole + 1 59 }; 60 55 61 /** Account combo data fields. */ 56 62 enum 57 63 { 58 ProviderID = Qt::UserRole + 1,59 ProviderName = Qt::UserRole + 2,60 ProviderShortName = Qt::UserRole + 3,61 ProfileName = Qt::UserRole + 464 AccountData_ProviderID = Qt::UserRole + 1, 65 AccountData_ProviderName = Qt::UserRole + 2, 66 AccountData_ProviderShortName = Qt::UserRole + 3, 67 AccountData_ProfileName = Qt::UserRole + 4 62 68 }; 63 69 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r74558 r74766 390 390 m_pFileSelector->setFileDialogTitle(UIWizardExportApp::tr("Please choose a file to export the virtual appliance to")); 391 391 392 /* Translate Format combo-box: */392 /* Translate hard-coded values of Format combo-box: */ 393 393 m_pFormatComboBoxLabel->setText(UIWizardExportApp::tr("F&ormat:")); 394 394 m_pFormatComboBox->setItemText(0, UIWizardExportApp::tr("Open Virtualization Format 0.9")); … … 434 434 { 435 435 m_pAccountComboBox->setItemText(i, UIWizardExportApp::tr("%1: %2", "provider: profile") 436 .arg(m_pAccountComboBox->itemData(i, ProviderName).toString())437 .arg(m_pAccountComboBox->itemData(i, ProfileName).toString()));436 .arg(m_pAccountComboBox->itemData(i, AccountData_ProviderName).toString()) 437 .arg(m_pAccountComboBox->itemData(i, AccountData_ProfileName).toString())); 438 438 } 439 439
Note:
See TracChangeset
for help on using the changeset viewer.