Changeset 91145 in vbox
- Timestamp:
- Sep 7, 2021 7:10:39 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146799
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp
r89998 r91145 76 76 CCloudProvider comProvider = comProviderManager.GetProviderById(uProviderId); 77 77 if (!comProviderManager.isOk()) 78 msgCenter().cannot AcquireCloudProviderManagerParameter(comProviderManager, pParent);78 msgCenter().cannotFindCloudProvider(comProviderManager, uProviderId, pParent); 79 79 else 80 80 return comProvider; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp
r91144 r91145 176 176 { 177 177 /* (Re)initialize Cloud Provider: */ 178 m_comCloudProvider = m_comCloudProviderManager.GetProviderById(providerId()); 179 /* Show error message if necessary: */ 180 if (!m_comCloudProviderManager.isOk()) 181 msgCenter().cannotFindCloudProvider(m_comCloudProviderManager, providerId()); 182 else 178 m_comCloudProvider = cloudProviderById(providerId(), wizardImp()); 179 if (m_comCloudProvider.isNotNull()) 183 180 { 184 /* Acquire existing profile names: */ 185 const QVector<QString> profileNames = m_comCloudProvider.GetProfileNames(); 186 /* Show error message if necessary: */ 187 if (!m_comCloudProvider.isOk()) 188 msgCenter().cannotAcquireCloudProviderParameter(m_comCloudProvider); 189 else 190 { 191 /* Iterate through existing profile names: */ 192 foreach (const QString &strProfileName, profileNames) 181 /* Iterate through existing profile names: */ 182 foreach (const CCloudProfile &comProfile, listCloudProfiles(m_comCloudProvider, wizardImp())) 183 { 184 /* Acquire profile name: */ 185 QString strProfileName; 186 if (cloudProfileName(comProfile, strProfileName, wizardImp())) 193 187 { 194 /* Skip if we have nothing to show (wtf happened?): */195 if (strProfileName.isEmpty())196 continue;197 198 188 /* Compose item, fill it's data: */ 199 189 m_pProfileComboBox->addItem(strProfileName); … … 225 215 226 216 /* If both provider and profile chosen: */ 227 if (! m_comCloudProvider.isNull() && !profileName().isNull())217 if (!providerShortName().isNull() && !profileName().isNull()) 228 218 { 229 219 /* Acquire Cloud Profile: */ 230 m_comCloudProfile = m_comCloudProvider.GetProfileByName(profileName()); 231 /* Show error message if necessary: */ 232 if (!m_comCloudProvider.isOk()) 233 msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName()); 220 m_comCloudProfile = cloudProfileByName(providerShortName(), profileName(), wizardImp()); 234 221 } 235 222 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp
r91144 r91145 130 130 if (!sourceId().isNull()) 131 131 { 132 /* Main API request sequence, can be interrupted after any step: */ 133 do 134 { 135 /* (Re)initialize Cloud Provider: */ 136 m_comCloudProvider = m_comCloudProviderManager.GetProviderById(sourceId()); 137 if (!m_comCloudProviderManager.isOk()) 138 { 139 msgCenter().cannotFindCloudProvider(m_comCloudProviderManager, sourceId()); 140 break; 141 } 142 143 /* Acquire existing profile names: */ 144 const QVector<QString> profileNames = m_comCloudProvider.GetProfileNames(); 145 if (!m_comCloudProvider.isOk()) 146 { 147 msgCenter().cannotAcquireCloudProviderParameter(m_comCloudProvider); 148 break; 149 } 150 132 /* (Re)initialize Cloud Provider: */ 133 m_comCloudProvider = cloudProviderById(sourceId(), wizardImp()); 134 if (m_comCloudProvider.isNotNull()) 135 { 151 136 /* Iterate through existing profile names: */ 152 foreach (const QString &strProfileName, profileNames)153 { 154 /* Skip if we have nothing to show (wtf happened?): */155 if (strProfileName.isEmpty())156 continue;157 158 /* Compose item, fill it's data: */159 m_pProfileComboBox->addItem(strProfileName);160 m_pProfileComboBox->setItemData(m_pProfileComboBox->count() - 1, strProfileName, ProfileData_Name);161 }162 163 /* Set previous/default item if possible: */164 int iNewIndex = -1; 165 if ( iNewIndex == -1166 && !strOldData.isNull())167 iNewIndex = m_pProfileComboBox->findData(strOldData, ProfileData_Name);168 if ( iNewIndex == -1169 && m_pProfileComboBox->count() > 0)170 iNewIndex = 0;171 if (iNewIndex != -1)172 m_pProfileComboBox->setCurrentIndex(iNewIndex);173 }174 while (0);137 foreach (const CCloudProfile &comProfile, listCloudProfiles(m_comCloudProvider, wizardImp())) 138 { 139 /* Acquire profile name: */ 140 QString strProfileName; 141 if (cloudProfileName(comProfile, strProfileName, wizardImp())) 142 { 143 /* Compose item, fill it's data: */ 144 m_pProfileComboBox->addItem(strProfileName); 145 m_pProfileComboBox->setItemData(m_pProfileComboBox->count() - 1, strProfileName, ProfileData_Name); 146 } 147 } 148 } 149 150 /* Set previous/default item if possible: */ 151 int iNewIndex = -1; 152 if ( iNewIndex == -1 153 && !strOldData.isNull()) 154 iNewIndex = m_pProfileComboBox->findData(strOldData, ProfileData_Name); 155 if ( iNewIndex == -1 156 && m_pProfileComboBox->count() > 0) 157 iNewIndex = 0; 158 if (iNewIndex != -1) 159 m_pProfileComboBox->setCurrentIndex(iNewIndex); 175 160 } 176 161 … … 185 170 186 171 /* If both provider and profile chosen: */ 187 if ( m_comCloudProvider.isNotNull() && !profileName().isNull())172 if (!source().isNull() && !profileName().isNull()) 188 173 { 189 174 /* Acquire Cloud Profile: */ 190 m_comCloudProfile = m_comCloudProvider.GetProfileByName(profileName()); 191 /* Show error message if necessary: */ 192 if (!m_comCloudProvider.isOk()) 193 msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName()); 175 m_comCloudProfile = cloudProfileByName(source(), profileName(), wizardImp()); 194 176 } 195 177 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h
r86346 r91145 170 170 protected: 171 171 172 /** Allows access wizard from base part. */ 173 UIWizard *wizardImp() const { return UIWizardPage::wizard(); } 174 172 175 /** Handles translation event. */ 173 176 virtual void retranslateUi() /* override */;
Note:
See TracChangeset
for help on using the changeset viewer.