Changeset 83158 in vbox
- Timestamp:
- Feb 26, 2020 11:39:17 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136279
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp
r83157 r83158 183 183 return getInstanceInfo(comCloudClient, strId, pParent).value(enmType, QString()); 184 184 } 185 186 QString UICloudNetworkingStuff::fetchOsType(const QMap<KVirtualSystemDescriptionType, QString> &infoMap) 187 { 188 /* Prepare a map of known OS types: */ 189 QMap<QString, QString> osTypes; 190 osTypes["Custom"] = QString("Other"); 191 osTypes["Oracle Linux"] = QString("Oracle_64"); 192 osTypes["Canonical Ubuntu"] = QString("Ubuntu_64"); 193 194 /* Return OS type value: */ 195 return osTypes.value(infoMap.value(KVirtualSystemDescriptionType_OS), "Other"); 196 } 197 198 KMachineState UICloudNetworkingStuff::fetchMachineState(const QMap<KVirtualSystemDescriptionType, QString> &infoMap) 199 { 200 /* Prepare a map of known machine states: */ 201 QMap<QString, KMachineState> machineStates; 202 machineStates["RUNNING"] = KMachineState_Running; 203 machineStates["STOPPED"] = KMachineState_Paused; 204 machineStates["STOPPING"] = KMachineState_Stopping; 205 machineStates["STARTING"] = KMachineState_Starting; 206 207 /* Return machine state value: */ 208 return machineStates.value(infoMap.value(KVirtualSystemDescriptionType_CloudInstanceState), KMachineState_PoweredOff); 209 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h
r83157 r83158 57 57 const QString &strId, 58 58 QWidget *pParent = 0); 59 60 /** Fetches cloud VM OS type from the passed @a info. */ 61 SHARED_LIBRARY_STUFF QString fetchOsType(const QMap<KVirtualSystemDescriptionType, QString> &infoMap); 62 /** Fetches cloud VM state from the passed @a info. */ 63 SHARED_LIBRARY_STUFF KMachineState fetchMachineState(const QMap<KVirtualSystemDescriptionType, QString> &infoMap); 59 64 } 60 65 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp
r83150 r83158 326 326 { 327 327 /* Update info: */ 328 updateOsType(infoMap.value(KVirtualSystemDescriptionType_OS));329 updateState(infoMap.value(KVirtualSystemDescriptionType_CloudInstanceState));328 m_strOSTypeId = fetchOsType(infoMap); 329 m_enmMachineState = fetchMachineState(infoMap); 330 330 331 331 /* Recache: */ … … 335 335 emit sigStateChange(); 336 336 } 337 338 void UIVirtualMachineItemCloud::updateOsType(const QString &strInfo)339 {340 /* Prepare a map of known OS types: */341 QMap<QString, QString> osTypes;342 osTypes["Custom"] = QString("Other");343 osTypes["Oracle Linux"] = QString("Oracle_64");344 osTypes["Canonical Ubuntu"] = QString("Ubuntu_64");345 346 /* Update OS type value: */347 m_strOSTypeId = osTypes.value(strInfo, "Other");348 }349 350 void UIVirtualMachineItemCloud::updateState(const QString &strInfo)351 {352 /* Prepare a map of known states: */353 QMap<QString, KMachineState> states;354 states["RUNNING"] = KMachineState_Running;355 states["STOPPED"] = KMachineState_Paused;356 states["STOPPING"] = KMachineState_Stopping;357 states["STARTING"] = KMachineState_Starting;358 359 /* Update state value: */360 m_enmMachineState = states.value(strInfo, KMachineState_PoweredOff);361 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.h
r83147 r83158 137 137 /** Updates cloud VM info on the basis of @a infoMap value. */ 138 138 void updateInfo(const QMap<KVirtualSystemDescriptionType, QString> &infoMap); 139 140 /** Updates cloud VM OS type on the basis of @a strInfo value. */141 void updateOsType(const QString &strInfo);142 /** Updates cloud VM state on the basis of @a strInfo value. */143 void updateState(const QString &strInfo);144 139 /** @} */ 145 140
Note:
See TracChangeset
for help on using the changeset viewer.