Changeset 83190 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 3, 2020 12:25:47 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136318
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudMachine.cpp ¶
r83182 r83190 84 84 m_strBootingFirmware = fetchBootingFirmware(instanceInfoMap); 85 85 m_strImageId = fetchImageId(instanceInfoMap); 86 87 /* Acquire image info sync way, be aware, this is blocking stuff, it takes some time: */ 88 const QMap<QString, QString> imageInfoMap = getImageInfo(m_comCloudClient, m_strImageId); 89 //printf("Image info:\n"); 90 //foreach (const QString &strKey, imageInfoMap.keys()) 91 // printf("key = %s, value = %s\n", strKey.toUtf8().constData(), imageInfoMap.value(strKey).toUtf8().constData()); 92 //printf("\n"); 93 94 /* Sorry, but these are hardcoded in Main: */ 95 m_strImageName = imageInfoMap.value("display name"); 96 m_strImageSize = imageInfoMap.value("size"); 86 97 } 87 98 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudMachine.h ¶
r83182 r83190 81 81 /** Returns cloud VM image id. */ 82 82 QString imageId() const { return m_strImageId; } 83 /** Returns cloud VM image name. */ 84 QString imageName() const { return m_strImageName; } 85 /** Returns cloud VM image size. */ 86 QString imageSize() const { return m_strImageSize; } 83 87 84 88 private: … … 112 116 /** Holds the cloud VM image id. */ 113 117 QString m_strImageId; 118 /** Holds the cloud VM image name. */ 119 QString m_strImageName; 120 /** Holds the cloud VM image size. */ 121 QString m_strImageSize; 114 122 }; 115 123 … … 168 176 /** Returns cloud VM image id. */ 169 177 QString imageId() const { return d->imageId(); } 178 /** Returns cloud VM image name. */ 179 QString imageName() const { return d->imageName(); } 180 /** Returns cloud VM image size. */ 181 QString imageSize() const { return d->imageSize(); } 170 182 171 183 private: -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp ¶
r83182 r83190 184 184 } 185 185 186 QMap<QString, QString> UICloudNetworkingStuff::getImageInfo(const CCloudClient &comCloudClient, 187 const QString &strId, 188 QWidget *pParent /* = 0 */) 189 { 190 /* Prepare result: */ 191 QMap<QString, QString> resultMap; 192 193 /* Execute GetImageInfo async method: */ 194 CStringArray comStringArray; 195 CProgress comProgress = comCloudClient.GetImageInfo(strId, comStringArray); 196 if (!comCloudClient.isOk()) 197 { 198 if (pParent) 199 msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent); 200 else 201 { 202 /// @todo fetch error info 203 } 204 } 205 else 206 { 207 /* Show "Acquire image info" progress: */ 208 if (pParent) 209 msgCenter().showModalProgressDialog(comProgress, 210 UICommon::tr("Acquire cloud image info ..."), 211 ":/progress_reading_appliance_90px.png", pParent, 0); 212 else 213 comProgress.WaitForCompletion(-1); 214 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 215 { 216 if (pParent) 217 msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent); 218 else 219 { 220 /// @todo fetch error info 221 } 222 } 223 else 224 { 225 /* Append resulting list values we have, split them by pairs: */ 226 foreach (const QString &strPair, comStringArray.GetValues()) 227 { 228 const QList<QString> pair = strPair.split(" = "); 229 AssertReturn(pair.size() == 2, resultMap); 230 resultMap[pair.at(0)] = pair.at(1); 231 } 232 } 233 } 234 235 /* Return result: */ 236 return resultMap; 237 } 238 186 239 QString UICloudNetworkingStuff::fetchOsType(const QMap<KVirtualSystemDescriptionType, QString> &infoMap) 187 240 { -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h ¶
r83182 r83190 58 58 QWidget *pParent = 0); 59 59 60 /** Acquires image info as a map. 61 * @param comCloudClient Brings cloud client object. 62 * @param strId Brings cloud image id. 63 * @param pWidget Brings parent widget to show messages according to, 64 * if no parent set, progress will be executed in blocking way. */ 65 SHARED_LIBRARY_STUFF QMap<QString, QString> getImageInfo(const CCloudClient &comCloudClient, 66 const QString &strId, 67 QWidget *pParent = 0); 68 60 69 /** Fetches cloud instance OS type from the passed @a info. */ 61 70 SHARED_LIBRARY_STUFF QString fetchOsType(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
Note:
See TracChangeset
for help on using the changeset viewer.