Changeset 84056 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 28, 2020 4:28:30 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp
r84053 r84056 216 216 /* Null by default: */ 217 217 return CCloudMachine(); 218 } 219 220 QVector<CCloudProvider> UICloudNetworkingStuff::listCloudProviders(QWidget *pParent /* = 0 */) 221 { 222 /* Acquire cloud provider manager: */ 223 CCloudProviderManager comProviderManager = cloudProviderManager(); 224 if (comProviderManager.isNotNull()) 225 { 226 /* Acquire cloud providers: */ 227 QVector<CCloudProvider> providers = comProviderManager.GetProviders(); 228 if (!comProviderManager.isOk()) 229 msgCenter().cannotAcquireCloudProviderManagerParameter(comProviderManager, pParent); 230 else 231 return providers; 232 } 233 /* Return empty list by default: */ 234 return QVector<CCloudProvider>(); 235 } 236 237 QVector<CCloudProvider> UICloudNetworkingStuff::listCloudProviders(QString &strErrorMessage) 238 { 239 /* Acquire cloud provider manager: */ 240 CCloudProviderManager comProviderManager = cloudProviderManager(); 241 if (comProviderManager.isNotNull()) 242 { 243 /* Acquire cloud providers: */ 244 QVector<CCloudProvider> providers = comProviderManager.GetProviders(); 245 if (!comProviderManager.isOk()) 246 strErrorMessage = UIErrorString::formatErrorInfo(comProviderManager); 247 else 248 return providers; 249 } 250 /* Return empty list by default: */ 251 return QVector<CCloudProvider>(); 252 } 253 254 bool UICloudNetworkingStuff::cloudProviderShortName(const CCloudProvider &comCloudProvider, 255 QString &strResult, 256 QWidget *pParent /* = 0 */) 257 { 258 const QString strShortName = comCloudProvider.GetShortName(); 259 if (!comCloudProvider.isOk()) 260 msgCenter().cannotAcquireCloudProviderParameter(comCloudProvider, pParent); 261 else 262 { 263 strResult = strShortName; 264 return true; 265 } 266 return false; 267 } 268 269 QVector<CCloudProfile> UICloudNetworkingStuff::listCloudProfiles(CCloudProvider comCloudProvider, 270 QWidget *pParent /* = 0 */) 271 { 272 /* Check cloud provider: */ 273 if (comCloudProvider.isNotNull()) 274 { 275 /* Acquire cloud providers: */ 276 QVector<CCloudProfile> profiles = comCloudProvider.GetProfiles(); 277 if (!comCloudProvider.isOk()) 278 msgCenter().cannotAcquireCloudProviderParameter(comCloudProvider, pParent); 279 else 280 return profiles; 281 } 282 /* Return empty list by default: */ 283 return QVector<CCloudProfile>(); 284 } 285 286 QVector<CCloudProfile> UICloudNetworkingStuff::listCloudProfiles(CCloudProvider comCloudProvider, 287 QString &strErrorMessage) 288 { 289 /* Check cloud provider: */ 290 if (comCloudProvider.isNotNull()) 291 { 292 /* Acquire cloud providers: */ 293 QVector<CCloudProfile> profiles = comCloudProvider.GetProfiles(); 294 if (!comCloudProvider.isOk()) 295 strErrorMessage = UIErrorString::formatErrorInfo(comCloudProvider); 296 else 297 return profiles; 298 } 299 /* Return empty list by default: */ 300 return QVector<CCloudProfile>(); 301 } 302 303 bool UICloudNetworkingStuff::cloudProfileName(const CCloudProfile &comCloudProfile, 304 QString &strResult, 305 QWidget *pParent /* = 0 */) 306 { 307 const QString strName = comCloudProfile.GetName(); 308 if (!comCloudProfile.isOk()) 309 msgCenter().cannotAcquireCloudProfileParameter(comCloudProfile, pParent); 310 else 311 { 312 strResult = strName; 313 return true; 314 } 315 return false; 218 316 } 219 317 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h
r84053 r84056 83 83 const QUuid &uMachineId, 84 84 QString &strErrorMessage); 85 86 /** Acquires cloud providers, using @a pParent to show messages according to. */ 87 SHARED_LIBRARY_STUFF QVector<CCloudProvider> listCloudProviders(QWidget *pParent = 0); 88 /** Acquires cloud providers, using @a strErrorMessage to store messages to. */ 89 SHARED_LIBRARY_STUFF QVector<CCloudProvider> listCloudProviders(QString &strErrorMessage); 90 91 /** Acquires @a comCloudProvider short name as a @a strResult, using @a pParent to show messages according to. */ 92 SHARED_LIBRARY_STUFF bool cloudProviderShortName(const CCloudProvider &comCloudProvider, 93 QString &strResult, 94 QWidget *pParent = 0); 95 96 /** Acquires cloud profiles of certain @a comCloudProvider, using @a pParent to show messages according to. */ 97 SHARED_LIBRARY_STUFF QVector<CCloudProfile> listCloudProfiles(CCloudProvider comCloudProvider, 98 QWidget *pParent = 0); 99 /** Acquires cloud profiles of certain @a comCloudProvider, using @a strErrorMessage to store messages to. */ 100 SHARED_LIBRARY_STUFF QVector<CCloudProfile> listCloudProfiles(CCloudProvider comCloudProvider, 101 QString &strErrorMessage); 102 103 /** Acquires @a comCloudProfile name as a @a strResult, using @a pParent to show messages according to. */ 104 SHARED_LIBRARY_STUFF bool cloudProfileName(const CCloudProfile &comCloudProfile, 105 QString &strResult, 106 QWidget *pParent = 0); 85 107 86 108 /** Acquires cloud machines of certain @a comCloudClient, using @a pParent to show messages according to. */
Note:
See TracChangeset
for help on using the changeset viewer.