Changeset 73716 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 16, 2018 3:58:57 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r73029 r73716 1380 1380 fFirst ? "Property: " : " ", 1381 1381 names[i], value.raw()); 1382 fFirst = false; 1382 1383 } 1383 1384 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r73664 r73716 449 449 " hostinfo|hostcpuids|hddbackends|hdds|dvds|floppies|\n" 450 450 " usbhost|usbfilters|systemproperties|extpacks|\n" 451 " groups|webcams|screenshotformats\n" 451 " groups|webcams|screenshotformats|cloudproviders|\n" 452 " cloudprofiles\n" 452 453 "\n", SEP); 453 454 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r72976 r73716 900 900 } 901 901 902 /** 903 * List available cloud providers. 904 * 905 * @returns See produceList. 906 * @param pVirtualBox Reference to the IVirtualBox pointer. 907 */ 908 static HRESULT listCloudProviders(const ComPtr<IVirtualBox> pVirtualBox) 909 { 910 HRESULT rc = S_OK; 911 ComPtr<ICloudProviderManager> pCloudProviderManager; 912 CHECK_ERROR(pVirtualBox, COMGETTER(CloudProviderManager)(pCloudProviderManager.asOutParam())); 913 com::SafeIfaceArray<ICloudProvider> apCloudProviders; 914 CHECK_ERROR(pCloudProviderManager, COMGETTER(Providers)(ComSafeArrayAsOutParam(apCloudProviders))); 915 916 RTPrintf("Supported %d cloud providers:\n", apCloudProviders.size()); 917 for (size_t i = 0; i < apCloudProviders.size(); ++i) 918 { 919 ComPtr<ICloudProvider> pCloudProvider = apCloudProviders[i]; 920 Bstr bstrProviderName; 921 pCloudProvider->COMGETTER(Name)(bstrProviderName.asOutParam()); 922 RTPrintf("Name: %ls\n", bstrProviderName.raw()); 923 pCloudProvider->COMGETTER(ShortName)(bstrProviderName.asOutParam()); 924 RTPrintf("Short Name: %ls\n", bstrProviderName.raw()); 925 Bstr bstrProviderID; 926 pCloudProvider->COMGETTER(Id)(bstrProviderID.asOutParam()); 927 RTPrintf("GUID: %ls\n", bstrProviderID.raw()); 928 929 RTPrintf("\n"); 930 } 931 return rc; 932 } 933 934 935 /** 936 * List all available cloud profiles (by iterating over the cloud providers). 937 * 938 * @returns See produceList. 939 * @param pVirtualBox Reference to the IVirtualBox pointer. 940 * @param fOptLong If true, list all profile properties. 941 */ 942 static HRESULT listCloudProfiles(const ComPtr<IVirtualBox> pVirtualBox, bool fOptLong) 943 { 944 HRESULT rc = S_OK; 945 ComPtr<ICloudProviderManager> pCloudProviderManager; 946 CHECK_ERROR(pVirtualBox, COMGETTER(CloudProviderManager)(pCloudProviderManager.asOutParam())); 947 com::SafeIfaceArray<ICloudProvider> apCloudProviders; 948 CHECK_ERROR(pCloudProviderManager, COMGETTER(Providers)(ComSafeArrayAsOutParam(apCloudProviders))); 949 950 for (size_t i = 0; i < apCloudProviders.size(); ++i) 951 { 952 ComPtr<ICloudProvider> pCloudProvider = apCloudProviders[i]; 953 com::SafeIfaceArray<ICloudProfile> apCloudProfiles; 954 CHECK_ERROR(pCloudProvider, COMGETTER(Profiles)(ComSafeArrayAsOutParam(apCloudProfiles))); 955 for (size_t j = 0; j < apCloudProfiles.size(); ++j) 956 { 957 ComPtr<ICloudProfile> pCloudProfile = apCloudProfiles[j]; 958 Bstr bstrProfileName; 959 pCloudProfile->COMGETTER(Name)(bstrProfileName.asOutParam()); 960 RTPrintf("Name: %ls\n", bstrProfileName.raw()); 961 Bstr bstrProviderID; 962 pCloudProfile->COMGETTER(ProviderId)(bstrProviderID.asOutParam()); 963 RTPrintf("Provider GUID: %ls\n", bstrProviderID.raw()); 964 965 if (fOptLong) 966 { 967 com::SafeArray<BSTR> names; 968 com::SafeArray<BSTR> values; 969 pCloudProfile->GetProperties(Bstr().raw(), ComSafeArrayAsOutParam(names), ComSafeArrayAsOutParam(values)); 970 size_t cNames = names.size(); 971 size_t cValues = values.size(); 972 bool fFirst = true; 973 for (size_t k = 0; k < cNames; k++) 974 { 975 Bstr value; 976 if (k < cValues) 977 value = values[k]; 978 RTPrintf("%s%ls=%ls\n", 979 fFirst ? "Property: " : " ", 980 names[k], value.raw()); 981 fFirst = false; 982 } 983 } 984 985 RTPrintf("\n"); 986 } 987 } 988 return rc; 989 } 990 902 991 903 992 /** … … 931 1020 kListNatNetworks, 932 1021 kListVideoInputDevices, 933 kListScreenShotFormats 1022 kListScreenShotFormats, 1023 kListCloudProviders, 1024 kListCloudProfiles, 934 1025 }; 935 1026 … … 1297 1388 break; 1298 1389 1390 case kListCloudProviders: 1391 rc = listCloudProviders(pVirtualBox); 1392 break; 1393 1394 case kListCloudProfiles: 1395 rc = listCloudProfiles(pVirtualBox, fOptLong); 1396 break; 1397 1299 1398 /* No default here, want gcc warnings. */ 1300 1399 … … 1349 1448 { "webcams", kListVideoInputDevices, RTGETOPT_REQ_NOTHING }, 1350 1449 { "screenshotformats", kListScreenShotFormats, RTGETOPT_REQ_NOTHING }, 1450 { "cloudproviders", kListCloudProviders, RTGETOPT_REQ_NOTHING }, 1451 { "cloudprofiles", kListCloudProfiles, RTGETOPT_REQ_NOTHING }, 1351 1452 }; 1352 1453 … … 1400 1501 case kListVideoInputDevices: 1401 1502 case kListScreenShotFormats: 1503 case kListCloudProviders: 1504 case kListCloudProfiles: 1402 1505 enmOptCommand = (enum enmListType)ch; 1403 1506 if (fOptMultiple) -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r73175 r73716 136 136 template<> SHARED_LIBRARY_STUFF bool canConvert<KChipsetType>(); 137 137 template<> SHARED_LIBRARY_STUFF bool canConvert<KNATProtocol>(); 138 template<> SHARED_LIBRARY_STUFF bool canConvert<KCloudProviderId>();139 138 140 139 … … 254 253 template<> SHARED_LIBRARY_STUFF QString toInternalString(const KNATProtocol &protocol); 255 254 template<> SHARED_LIBRARY_STUFF KNATProtocol fromInternalString<KNATProtocol>(const QString &strProtocol); 256 template<> SHARED_LIBRARY_STUFF QString toInternalString(const KCloudProviderId &enmProvider);257 255 258 256 -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp
r73175 r73716 59 59 template<> bool canConvert<KChipsetType>() { return true; } 60 60 template<> bool canConvert<KNATProtocol>() { return true; } 61 template<> bool canConvert<KCloudProviderId>() { return true; }62 61 63 62 … … 655 654 return values.at(keys.indexOf(QRegExp(strProtocol, Qt::CaseInsensitive))); 656 655 } 657 658 /* QString <= KCloudProviderId: */659 template<> QString toInternalString(const KCloudProviderId &enmProvider)660 {661 switch (enmProvider)662 {663 case KCloudProviderId_OCI: return "OCI";664 case KCloudProviderId_GCP: return "GCP";665 case KCloudProviderId_AWS: return "AWS";666 case KCloudProviderId_MicrosoftAzure: return "Microsoft Azure";667 case KCloudProviderId_IBMCloud: return "IBM Cloud";668 case KCloudProviderId_DigitalOcean: return "Digital Ocean";669 default: AssertMsgFailed(("No text for %d", enmProvider)); break;670 }671 return QString();672 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp
r73580 r73716 71 71 /* Init Cloud Provider Manager: */ 72 72 CVirtualBox comVBox = vboxGlobal().virtualBox(); 73 m_comCloudProviderManager = comVBox. CreateCloudProviderManager();73 m_comCloudProviderManager = comVBox.GetCloudProviderManager(); 74 74 AssertMsg(comVBox.isOk() && m_comCloudProviderManager.isNotNull(), 75 75 ("Unable to acquire Cloud Provider Manager")); … … 117 117 AssertReturnVoid(m_pAccountComboBox->count() == 0); 118 118 119 /* Acquire provider IDlist: */120 QVector< QString> providerIds = m_comCloudProviderManager.GetSupportedProviders();119 /* Acquire provider list: */ 120 QVector<CCloudProvider> comProviders = m_comCloudProviderManager.GetProviders(); 121 121 /* Make sure at least one provider is supported: */ 122 AssertReturnVoid(!providerIds.isEmpty()); 123 124 /* Iterate through provider IDs: */ 125 foreach (const QString &strProviderId, providerIds) 126 { 127 /* Acquire Cloud Provider: */ 128 const CCloudProvider comProvider = m_comCloudProviderManager.GetProfilesByProvider(strProviderId); 122 AssertReturnVoid(!comProviders.isEmpty()); 123 124 /* Iterate through providers: */ 125 foreach (const CCloudProvider &comProvider, comProviders) 126 { 129 127 /* Skip if we have nothing to populate (file missing?): */ 130 128 if (comProvider.isNull()) 131 129 continue; 130 QString strProviderId = comProvider.GetId(); 131 QString strProviderShortName = comProvider.GetShortName(); 132 132 133 133 /* Iterate through profile names: */ 134 foreach (const QString &strProfileName, comProvider.Get StoredProfilesNames())134 foreach (const QString &strProfileName, comProvider.GetProfileNames()) 135 135 { 136 136 m_pAccountComboBox->addItem(QString()); 137 137 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, strProviderId, ProviderID); 138 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, strProviderShortName, ProviderName); 138 139 m_pAccountComboBox->setItemData(m_pAccountComboBox->count() - 1, strProfileName, ProfileName); 139 140 } … … 142 143 /* Set default: */ 143 144 if (m_pAccountComboBox->count() != 0) 144 setProviderById(" OCI");145 setProviderById("54e11de4-afcc-47fb-9c39-b24244cfa044"); 145 146 } 146 147 … … 148 149 { 149 150 /* Acquire Cloud Provider: */ 150 m_comCloudProvider = m_comCloudProviderManager.GetProfilesByProvider(providerId());151 /* Return if we have nothing to populate (file missing?): */152 if ( m_comCloudProvider.isNull())151 CCloudProvider comCloudProvider = m_comCloudProviderManager.GetProviderById(providerId()); 152 /* Return if the provider has disappeared: */ 153 if (comCloudProvider.isNull()) 153 154 return; 155 156 m_comCloudProfile = comCloudProvider.GetProfileByName(profileName()); 157 /* Return if the profile has disappeared: */ 158 if (m_comCloudProfile.isNull()) 154 159 155 160 /* Clear table initially: */ … … 159 164 QVector<QString> keys; 160 165 QVector<QString> values; 161 values = m_comCloudPro vider.GetProfileProperties(profileName(), keys);166 values = m_comCloudProfile.GetProperties(QString(), keys); 162 167 163 168 /* Configure table: */ … … 177 182 178 183 /* Use non-translated description as tool-tip: */ 179 const QString strToolTip = m_comCloudPro vider.GetPropertyDescription(keys.at(i));184 const QString strToolTip = m_comCloudProfile.GetPropertyDescription(keys.at(i)); 180 185 pItemK->setData(Qt::UserRole, strToolTip); 181 186 … … 434 439 } 435 440 436 CCloudPro vider UIWizardExportAppPage2::provider() const437 { 438 return m_comCloudPro vider;441 CCloudProfile UIWizardExportAppPage2::profile() const 442 { 443 return m_comCloudProfile; 439 444 } 440 445 … … 786 791 for (int i = 0; i < m_pAccountComboBox->count(); ++i) 787 792 { 788 if (m_pAccountComboBox->itemData(i, ProviderID).toString() == " OCI")793 if (m_pAccountComboBox->itemData(i, ProviderID).toString() == "54e11de4-afcc-47fb-9c39-b24244cfa044") 789 794 { 790 795 m_pAccountComboBox->setItemText(i, UIWizardExportApp::tr("Oracle Cloud Infrastructure: %1", "provider: profile") … … 794 799 { 795 800 m_pAccountComboBox->setItemText(i, UIWizardExportApp::tr("%1: %2", "provider: profile") 796 .arg(m_pAccountComboBox->itemData(i, Provider ID).toString())801 .arg(m_pAccountComboBox->itemData(i, ProviderName).toString()) 797 802 .arg(m_pAccountComboBox->itemData(i, ProfileName).toString())); 798 803 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.h
r73580 r73716 27 27 /* COM includes: */ 28 28 #include "COMEnums.h" 29 #include "CCloudProfile.h" 29 30 #include "CCloudProvider.h" 30 31 #include "CCloudProviderManager.h" … … 55 56 enum 56 57 { 57 ProviderID = Qt::UserRole + 1, 58 ProfileName = Qt::UserRole + 2 58 ProviderID = Qt::UserRole + 1, 59 ProviderName = Qt::UserRole + 2, 60 ProfileName = Qt::UserRole + 3 59 61 }; 60 62 … … 131 133 /** Returns profile name. */ 132 134 QString profileName() const; 133 /** Returns Cloud Pro viderobject. */134 CCloudPro vider provider() const;135 /** Returns Cloud Profile object. */ 136 CCloudProfile profile() const; 135 137 136 138 /** Holds the Cloud Provider Manager reference. */ 137 139 CCloudProviderManager m_comCloudProviderManager; 138 /** Holds the Cloud Pro viderobject reference. */139 CCloudPro vider m_comCloudProvider;140 /** Holds the Cloud Profile object reference. */ 141 CCloudProfile m_comCloudProfile; 140 142 141 143 /** Holds the default appliance name. */ … … 197 199 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 198 200 Q_PROPERTY(bool includeISOsSelected READ isIncludeISOsSelected WRITE setIncludeISOsSelected); 199 Q_PROPERTY(CCloudPro vider provider READ provider);201 Q_PROPERTY(CCloudProfile profile READ profile); 200 202 Q_PROPERTY(QString profileName READ profileName); 201 203 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r73663 r73716 38 38 # include "CAppliance.h" 39 39 # include "CCloudClient.h" 40 # include "CCloudPro vider.h"40 # include "CCloudProfile.h" 41 41 # include "CMachine.h" 42 42 … … 57 57 m_listCloudClientParameters.clear(); 58 58 59 /* Acquire Cloud Pro vider: */60 CCloudPro vider comCloudProvider = fieldImp("provider").value<CCloudProvider>();61 AssertMsgReturnVoid(comCloudPro vider.isNotNull(),62 ("Cloud pro viderobject is undefined!"));59 /* Acquire Cloud Profile: */ 60 CCloudProfile comCloudProfile = fieldImp("profile").value<CCloudProfile>(); 61 AssertMsgReturnVoid(comCloudProfile.isNotNull(), 62 ("Cloud profile object is undefined!")); 63 63 64 64 /* Create Cloud Client: */ 65 CCloudClient comCloudClient = comCloudPro vider.CreateCloudClient(fieldImp("profileName").toString());66 AssertMsgReturnVoid(comCloudPro vider.isOk() && comCloudClient.isNotNull(),65 CCloudClient comCloudClient = comCloudProfile.CreateCloudClient(); 66 AssertMsgReturnVoid(comCloudProfile.isOk() && comCloudClient.isNotNull(), 67 67 ("Can't create Cloud Client object!")); 68 68 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r73580 r73716 41 41 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 42 42 Q_PROPERTY(bool includeISOsSelected READ isIncludeISOsSelected WRITE setIncludeISOsSelected); 43 Q_PROPERTY(CCloudPro vider provider READ provider);43 Q_PROPERTY(CCloudProfile profile READ profile); 44 44 Q_PROPERTY(QString profileName READ profileName); 45 45 Q_PROPERTY(ExportAppliancePointer applianceWidget READ applianceWidget);
Note:
See TracChangeset
for help on using the changeset viewer.