Changeset 84053 in vbox
- Timestamp:
- Apr 28, 2020 3:59:22 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 137631
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp
r84051 r84053 49 49 } 50 50 51 CCloudProviderManager UICloudNetworkingStuff::cloudProviderManager(QString &strErrorMessage) 52 { 53 /* Acquire VBox: */ 54 const CVirtualBox comVBox = uiCommon().virtualBox(); 55 if (comVBox.isNotNull()) 56 { 57 /* Acquire cloud provider manager: */ 58 CCloudProviderManager comProviderManager = comVBox.GetCloudProviderManager(); 59 if (!comVBox.isOk()) 60 strErrorMessage = UIErrorString::formatErrorInfo(comVBox); 61 else 62 return comProviderManager; 63 } 64 /* Null by default: */ 65 return CCloudProviderManager(); 66 } 67 51 68 CCloudProvider UICloudNetworkingStuff::cloudProviderByShortName(const QString &strProviderShortName, 52 69 QWidget *pParent /* = 0 */) … … 67 84 } 68 85 86 CCloudProvider UICloudNetworkingStuff::cloudProviderByShortName(const QString &strProviderShortName, 87 QString &strErrorMessage) 88 { 89 /* Acquire cloud provider manager: */ 90 CCloudProviderManager comProviderManager = cloudProviderManager(strErrorMessage); 91 if (comProviderManager.isNotNull()) 92 { 93 /* Acquire cloud provider: */ 94 CCloudProvider comProvider = comProviderManager.GetProviderByShortName(strProviderShortName); 95 if (!comProviderManager.isOk()) 96 strErrorMessage = UIErrorString::formatErrorInfo(comProviderManager); 97 else 98 return comProvider; 99 } 100 /* Null by default: */ 101 return CCloudProvider(); 102 } 103 69 104 CCloudProfile UICloudNetworkingStuff::cloudProfileByName(const QString &strProviderShortName, 70 105 const QString &strProfileName, … … 86 121 } 87 122 123 CCloudProfile UICloudNetworkingStuff::cloudProfileByName(const QString &strProviderShortName, 124 const QString &strProfileName, 125 QString &strErrorMessage) 126 { 127 /* Acquire cloud provider: */ 128 CCloudProvider comProvider = cloudProviderByShortName(strProviderShortName, strErrorMessage); 129 if (comProvider.isNotNull()) 130 { 131 /* Acquire cloud profile: */ 132 CCloudProfile comProfile = comProvider.GetProfileByName(strProfileName); 133 if (!comProvider.isOk()) 134 strErrorMessage = UIErrorString::formatErrorInfo(comProvider); 135 else 136 return comProfile; 137 } 138 /* Null by default: */ 139 return CCloudProfile(); 140 } 141 88 142 CCloudClient UICloudNetworkingStuff::cloudClientByName(const QString &strProviderShortName, 89 143 const QString &strProfileName, … … 105 159 } 106 160 161 CCloudClient UICloudNetworkingStuff::cloudClientByName(const QString &strProviderShortName, 162 const QString &strProfileName, 163 QString &strErrorMessage) 164 { 165 /* Acquire cloud profile: */ 166 CCloudProfile comProfile = cloudProfileByName(strProviderShortName, strProfileName, strErrorMessage); 167 if (comProfile.isNotNull()) 168 { 169 /* Create cloud client: */ 170 CCloudClient comClient = comProfile.CreateCloudClient(); 171 if (!comProfile.isOk()) 172 strErrorMessage = UIErrorString::formatErrorInfo(comProfile); 173 else 174 return comClient; 175 } 176 /* Null by default: */ 177 return CCloudClient(); 178 } 179 107 180 CCloudMachine UICloudNetworkingStuff::cloudMachineById(const QString &strProviderShortName, 108 181 const QString &strProfileName, … … 118 191 if (!comClient.isOk()) 119 192 msgCenter().cannotAcquireCloudClientParameter(comClient, pParent); 193 else 194 return comMachine; 195 } 196 /* Null by default: */ 197 return CCloudMachine(); 198 } 199 200 CCloudMachine UICloudNetworkingStuff::cloudMachineById(const QString &strProviderShortName, 201 const QString &strProfileName, 202 const QUuid &uMachineId, 203 QString &strErrorMessage) 204 { 205 /* Acquire cloud client: */ 206 CCloudClient comClient = cloudClientByName(strProviderShortName, strProfileName, strErrorMessage); 207 if (comClient.isNotNull()) 208 { 209 /* Acquire cloud machine: */ 210 CCloudMachine comMachine = comClient.GetCloudMachine(uMachineId); 211 if (!comClient.isOk()) 212 strErrorMessage = UIErrorString::formatErrorInfo(comClient); 120 213 else 121 214 return comMachine; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h
r84051 r84053 40 40 * using @a pParent to show messages according to. */ 41 41 SHARED_LIBRARY_STUFF CCloudProviderManager cloudProviderManager(QWidget *pParent = 0); 42 /** Acquires cloud provider manager, 43 * using @a strErrorMessage to store messages to. */ 44 SHARED_LIBRARY_STUFF CCloudProviderManager cloudProviderManager(QString &strErrorMessage); 42 45 /** Acquires cloud provider specified by @a strProviderShortName, 43 46 * using @a pParent to show messages according to. */ 44 47 SHARED_LIBRARY_STUFF CCloudProvider cloudProviderByShortName(const QString &strProviderShortName, 45 48 QWidget *pParent = 0); 49 /** Acquires cloud provider specified by @a strProviderShortName, 50 * using @a strErrorMessage to store messages to. */ 51 SHARED_LIBRARY_STUFF CCloudProvider cloudProviderByShortName(const QString &strProviderShortName, 52 QString &strErrorMessage); 46 53 /** Acquires cloud profile specified by @a strProviderShortName and @a strProfileName, 47 54 * using @a pParent to show messages according to. */ … … 49 56 const QString &strProfileName, 50 57 QWidget *pParent = 0); 58 /** Acquires cloud profile specified by @a strProviderShortName and @a strProfileName, 59 * using @a strErrorMessage to store messages to. */ 60 SHARED_LIBRARY_STUFF CCloudProfile cloudProfileByName(const QString &strProviderShortName, 61 const QString &strProfileName, 62 QString &strErrorMessage); 51 63 /** Acquires cloud client specified by @a strProviderShortName and @a strProfileName, 52 64 * using @a pParent to show messages according to. */ … … 54 66 const QString &strProfileName, 55 67 QWidget *pParent = 0); 68 /** Acquires cloud client specified by @a strProviderShortName and @a strProfileName, 69 * using @a strErrorMessage to store messages to. */ 70 SHARED_LIBRARY_STUFF CCloudClient cloudClientByName(const QString &strProviderShortName, 71 const QString &strProfileName, 72 QString &strErrorMessage); 56 73 /** Acquires cloud machine specified by @a strProviderShortName, @a strProfileName and @a uMachineId, 57 74 * using @a pParent to show messages according to. */ … … 60 77 const QUuid &uMachineId, 61 78 QWidget *pParent = 0); 79 /** Acquires cloud machine specified by @a strProviderShortName, @a strProfileName and @a uMachineId, 80 * using @a strErrorMessage to store messages to. */ 81 SHARED_LIBRARY_STUFF CCloudMachine cloudMachineById(const QString &strProviderShortName, 82 const QString &strProfileName, 83 const QUuid &uMachineId, 84 QString &strErrorMessage); 62 85 63 86 /** 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.