Changeset 73580 in vbox for trunk/src/VBox
- Timestamp:
- Aug 9, 2018 8:52:48 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 124218
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp
r73573 r73580 69 69 , m_pAccountPropertyTable(0) 70 70 { 71 /* Init Cloud User-profileManager: */71 /* Init Cloud Provider Manager: */ 72 72 CVirtualBox comVBox = vboxGlobal().virtualBox(); 73 73 m_comCloudProviderManager = comVBox.CreateCloudProviderManager(); … … 118 118 119 119 /* Acquire provider ID list: */ 120 // QVector<KCloudProviderId> providerIds = m_comCloudProviderManager.GetSupportedProviders();121 120 QVector<QString> providerIds = m_comCloudProviderManager.GetSupportedProviders(); 122 121 /* Make sure at least one provider is supported: */ 123 122 AssertReturnVoid(!providerIds.isEmpty()); 124 123 125 /* Iterate through provider types: */126 // foreach (KCloudProviderId enmType, providerIds)127 //{128 // /* Acquire Cloud User-profile List: */129 // CCloudUserProfiles comProfiles = m_comCloudProviderManager.GetProfilesByProvider(enmType);130 ///* Skip if we have nothing to populate (file missing?): */131 // if (comProfiles.isNull())132 //continue;133 // 134 ///* Iterate through profile names: */135 // foreach (const QString &strProfileName, comProfiles.GetStoredProfilesNames())136 //{137 //m_pAccountComboBox->addItem(QString());138 // m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, (int)enmType, ProviderID);139 //m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, strProfileName, ProfileName);140 //}141 //}142 // 143 ///* Set default: */144 //if (m_pAccountComboBox->count() != 0)145 // setProvider(KCloudProviderId_OCI);124 /* Iterate through provider IDs: */ 125 foreach (const QString &strProviderId, providerIds) 126 { 127 /* Acquire Cloud Provider: */ 128 const CCloudProvider comProvider = m_comCloudProviderManager.GetProfilesByProvider(strProviderId); 129 /* Skip if we have nothing to populate (file missing?): */ 130 if (comProvider.isNull()) 131 continue; 132 133 /* Iterate through profile names: */ 134 foreach (const QString &strProfileName, comProvider.GetStoredProfilesNames()) 135 { 136 m_pAccountComboBox->addItem(QString()); 137 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, strProviderId, ProviderID); 138 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, strProfileName, ProfileName); 139 } 140 } 141 142 /* Set default: */ 143 if (m_pAccountComboBox->count() != 0) 144 setProviderById("OCI"); 146 145 } 147 146 148 147 void UIWizardExportAppPage2::populateAccountProperties() 149 148 { 150 /* Acquire Cloud User-profile List: */151 m_comCloudProvider = m_comCloudProviderManager.GetProfilesByProvider(provider ());149 /* Acquire Cloud Provider: */ 150 m_comCloudProvider = m_comCloudProviderManager.GetProfilesByProvider(providerId()); 152 151 /* Return if we have nothing to populate (file missing?): */ 153 152 if (m_comCloudProvider.isNull()) … … 160 159 QVector<QString> keys; 161 160 QVector<QString> values; 162 values = m_comCloudProvider.GetProfileProperties(profile (), keys);161 values = m_comCloudProvider.GetProfileProperties(profileName(), keys); 163 162 164 163 /* Configure table: */ … … 369 368 { 370 369 const int iIndex = m_pFormatComboBox->findData(strFormat); 371 AssertMsg(iIndex != -1, (" Fieldnot found!"));370 AssertMsg(iIndex != -1, ("Data not found!")); 372 371 m_pFormatComboBox->setCurrentIndex(iIndex); 373 372 } … … 392 391 { 393 392 const int iIndex = m_pMACComboBox->findData((int)enmMACAddressPolicy); 394 AssertMsg(iIndex != -1, (" Fieldnot found!"));393 AssertMsg(iIndex != -1, ("Data not found!")); 395 394 m_pMACComboBox->setCurrentIndex(iIndex); 396 395 } … … 416 415 } 417 416 418 void UIWizardExportAppPage2::setProvider (KCloudProviderId enmProvider)419 { 420 const int iIndex = m_pAccountComboBox->findData( (int)enmProvider, ProviderID);421 AssertMsg(iIndex != -1, (" Fieldnot found!"));417 void UIWizardExportAppPage2::setProviderById(const QString &strId) 418 { 419 const int iIndex = m_pAccountComboBox->findData(strId, ProviderID); 420 AssertMsg(iIndex != -1, ("Data not found!")); 422 421 m_pAccountComboBox->setCurrentIndex(iIndex); 423 422 } 424 423 425 //KCloudProviderId UIWizardExportAppPage2::provider() const 426 //{ 427 // const int iIndex = m_pAccountComboBox->currentIndex(); 428 // return (KCloudProviderId)m_pAccountComboBox->itemData(iIndex, ProviderID).toInt(); 429 //} 430 431 QString UIWizardExportAppPage2::provider() const 432 { 433 return "OCI"; 434 //const int iIndex = m_pAccountComboBox->currentIndex(); 435 //return (KCloudProviderId)m_pAccountComboBox->itemData(iIndex, ProviderID).toInt(); 436 } 437 438 QString UIWizardExportAppPage2::profile() const 424 QString UIWizardExportAppPage2::providerId() const 425 { 426 const int iIndex = m_pAccountComboBox->currentIndex(); 427 return m_pAccountComboBox->itemData(iIndex, ProviderID).toString(); 428 } 429 430 QString UIWizardExportAppPage2::profileName() const 439 431 { 440 432 const int iIndex = m_pAccountComboBox->currentIndex(); … … 442 434 } 443 435 444 CCloudProvider UIWizardExportAppPage2::pro files() const436 CCloudProvider UIWizardExportAppPage2::provider() const 445 437 { 446 438 return m_comCloudProvider; … … 702 694 registerField("manifestSelected", this, "manifestSelected"); 703 695 registerField("includeISOsSelected", this, "includeISOsSelected"); 704 registerField("profile s", this, "profiles");705 registerField("pro file", this, "profile");696 registerField("profileName", this, "profileName"); 697 registerField("provider", this, "provider"); 706 698 } 707 699 … … 794 786 for (int i = 0; i < m_pAccountComboBox->count(); ++i) 795 787 { 796 if (m_pAccountComboBox->itemData(i, ProviderID).to Int() == KCloudProviderId_OCI)788 if (m_pAccountComboBox->itemData(i, ProviderID).toString() == "OCI") 797 789 { 798 790 m_pAccountComboBox->setItemText(i, UIWizardExportApp::tr("Oracle Cloud Infrastructure: %1", "provider: profile") … … 802 794 { 803 795 m_pAccountComboBox->setItemText(i, UIWizardExportApp::tr("%1: %2", "provider: profile") 804 .arg( gpConverter->toInternalInteger((KCloudProviderId)m_pAccountComboBox->itemData(i, ProviderID).toInt()))796 .arg(m_pAccountComboBox->itemData(i, ProviderID).toString()) 805 797 .arg(m_pAccountComboBox->itemData(i, ProfileName).toString())); 806 798 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.h
r73571 r73580 125 125 void setIncludeISOsSelected(bool fChecked); 126 126 127 /** Defines @a strProvider. */ 128 void setProvider(KCloudProviderId enmProvider); 129 /** Returns provider. */ 130 // KCloudProviderId provider() const; 131 QString provider() const; 132 /** Returns profile. */ 133 QString profile() const; 134 /** Returns Cloud User-profile object. */ 135 CCloudProvider profiles() const; 136 137 /** Holds the Cloud User-profile Manager reference. */ 127 /** Defines provider by @a strId. */ 128 void setProviderById(const QString &strId); 129 /** Returns provider ID. */ 130 QString providerId() const; 131 /** Returns profile name. */ 132 QString profileName() const; 133 /** Returns Cloud Provider object. */ 134 CCloudProvider provider() const; 135 136 /** Holds the Cloud Provider Manager reference. */ 138 137 CCloudProviderManager m_comCloudProviderManager; 139 /** Holds the Cloud User-profileobject reference. */140 CCloudProvider m_comCloudProvider;138 /** Holds the Cloud Provider object reference. */ 139 CCloudProvider m_comCloudProvider; 141 140 142 141 /** Holds the default appliance name. */ … … 198 197 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 199 198 Q_PROPERTY(bool includeISOsSelected READ isIncludeISOsSelected WRITE setIncludeISOsSelected); 200 Q_PROPERTY(CCloudProvider pro files READ profiles);201 Q_PROPERTY(QString profile READ profile);199 Q_PROPERTY(CCloudProvider provider READ provider); 200 Q_PROPERTY(QString profileName READ profileName); 202 201 203 202 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r73571 r73580 57 57 m_listCloudClientParameters.clear(); 58 58 59 /* Acquire Cloud User-profiles: */60 CCloudProvider comCloudProvider = fieldImp("pro files").value<CCloudProvider>();59 /* Acquire Cloud Provider: */ 60 CCloudProvider comCloudProvider = fieldImp("provider").value<CCloudProvider>(); 61 61 AssertMsgReturnVoid(comCloudProvider.isNotNull(), 62 62 ("Cloud provider object is undefined!")); 63 63 64 64 /* Create Cloud Client: */ 65 CCloudClient comCloudClient = comCloudProvider.CreateCloudClient(fieldImp("profile ").toString());65 CCloudClient comCloudClient = comCloudProvider.CreateCloudClient(fieldImp("profileName").toString()); 66 66 AssertMsgReturnVoid(comCloudProvider.isOk() && comCloudClient.isNotNull(), 67 67 ("Can't create Cloud Client object!")); … … 72 72 /* Create JSON document on the basis of it, make sure it isn't empty: */ 73 73 const QJsonDocument document = QJsonDocument::fromJson(strJSON.toUtf8()); 74 AssertMsgReturnVoid(!document.isEmpty(), (" Document is empty!"));74 AssertMsgReturnVoid(!document.isEmpty(), ("JSON document is empty!")); 75 75 76 76 /* Parse JSON document: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r73349 r73580 349 349 registerField("manifestSelected", this, "manifestSelected"); 350 350 registerField("includeISOsSelected", this, "includeISOsSelected"); 351 registerField("profile s", this, "profiles");352 registerField("pro file", this, "profile");351 registerField("profileName", this, "profileName"); 352 registerField("provider", this, "provider"); 353 353 registerField("applianceWidget", this, "applianceWidget"); 354 354 } … … 432 432 for (int i = 0; i < m_pAccountComboBox->count(); ++i) 433 433 { 434 if (m_pAccountComboBox->itemData(i, Qt::UserRole + 1).toInt() == KCloudProviderId_OCI)434 if (m_pAccountComboBox->itemData(i, ProviderID).toString() == "OCI") 435 435 { 436 436 m_pAccountComboBox->setItemText(i, UIWizardExportApp::tr("Oracle Cloud Infrastructure: %1", "provider: profile") 437 .arg(m_pAccountComboBox->itemData(i, Qt::UserRole + 2).toString()));437 .arg(m_pAccountComboBox->itemData(i, ProfileName).toString())); 438 438 } 439 439 else 440 440 { 441 441 m_pAccountComboBox->setItemText(i, UIWizardExportApp::tr("%1: %2", "provider: profile") 442 .arg( gpConverter->toInternalInteger((KCloudProviderId)m_pAccountComboBox->itemData(i, Qt::UserRole + 1).toInt()))443 .arg(m_pAccountComboBox->itemData(i, Qt::UserRole + 2).toString()));442 .arg(m_pAccountComboBox->itemData(i, ProviderID).toString()) 443 .arg(m_pAccountComboBox->itemData(i, ProfileName).toString())); 444 444 } 445 445 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r73571 r73580 41 41 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 42 42 Q_PROPERTY(bool includeISOsSelected READ isIncludeISOsSelected WRITE setIncludeISOsSelected); 43 Q_PROPERTY(CCloudProvider pro files READ profiles);44 Q_PROPERTY(QString profile READ profile);43 Q_PROPERTY(CCloudProvider provider READ provider); 44 Q_PROPERTY(QString profileName READ profileName); 45 45 Q_PROPERTY(ExportAppliancePointer applianceWidget READ applianceWidget); 46 46
Note:
See TracChangeset
for help on using the changeset viewer.