Changeset 83643 in vbox
- Timestamp:
- Apr 9, 2020 9:43:07 AM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp
r83255 r83643 81 81 /* Return empty list by default: */ 82 82 return QList<UICloudMachine>(); 83 } 84 85 QVector<CCloudMachine> UICloudNetworkingStuff::listCloudMachines(CCloudClient &comCloudClient, 86 QString &strErrorMessage, 87 QWidget *pParent /* = 0 */) 88 { 89 /* Execute ReadCloudMachineList async method: */ 90 CProgress comProgress = comCloudClient.ReadCloudMachineList(); 91 if (!comCloudClient.isOk()) 92 { 93 if (pParent) 94 msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent); 95 else 96 strErrorMessage = UIErrorString::formatErrorInfo(comCloudClient); 97 } 98 else 99 { 100 /* Show "Read cloud machines" progress: */ 101 if (pParent) 102 msgCenter().showModalProgressDialog(comProgress, 103 UICommon::tr("Read cloud machines ..."), 104 ":/progress_reading_appliance_90px.png", pParent, 0); 105 else 106 comProgress.WaitForCompletion(-1); 107 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 108 { 109 if (pParent) 110 msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent); 111 else 112 strErrorMessage = UIErrorString::formatErrorInfo(comProgress); 113 } 114 else 115 { 116 /* Return acquired cloud machines: */ 117 return comCloudClient.GetCloudMachineList(); 118 } 119 } 120 121 /* Return empty list by default: */ 122 return QVector<CCloudMachine>(); 83 123 } 84 124 … … 176 216 } 177 217 218 void UICloudNetworkingStuff::refreshCloudMachineInfo(CCloudMachine &comCloudMachine, 219 QString &strErrorMessage, 220 QWidget *pParent /* = 0 */) 221 { 222 /* Execute ReadState async method: */ 223 CProgress comProgress = comCloudMachine.ReadState(); 224 if (!comCloudMachine.isOk()) 225 { 226 if (pParent) 227 msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent); 228 else 229 strErrorMessage = UIErrorString::formatErrorInfo(comCloudMachine); 230 } 231 else 232 { 233 /* Show "Read cloud machine state" progress: */ 234 if (pParent) 235 msgCenter().showModalProgressDialog(comProgress, 236 UICommon::tr("Read cloud machine state ..."), 237 ":/progress_reading_appliance_90px.png", pParent, 0); 238 else 239 comProgress.WaitForCompletion(-1); 240 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 241 { 242 if (pParent) 243 msgCenter().cannotAcquireCloudMachineParameter(comProgress, pParent); 244 else 245 strErrorMessage = UIErrorString::formatErrorInfo(comProgress); 246 } 247 } 248 } 249 178 250 QMap<QString, QString> UICloudNetworkingStuff::getImageInfo(const CCloudClient &comCloudClient, 179 251 const QString &strId, -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h
r83255 r83643 29 29 #include "COMEnums.h" 30 30 #include "CCloudClient.h" 31 #include "CCloudMachine.h" 31 32 32 33 /** Cloud networking stuff namespace. */ … … 41 42 QString &strErrorMessage, 42 43 QWidget *pParent = 0); 44 /** Acquires cloud machine list. 45 * @param comCloudClient Brings cloud client object. 46 * @param strErrorMessage Brings error message container. 47 * @param pWidget Brings parent widget to show messages according to, 48 * if no parent set, progress will be executed in blocking way. */ 49 SHARED_LIBRARY_STUFF QVector<CCloudMachine> listCloudMachines(CCloudClient &comCloudClient, 50 QString &strErrorMessage, 51 QWidget *pParent = 0); 43 52 44 53 /** Acquires instance info as a map. … … 63 72 QString &strErrorMessage, 64 73 QWidget *pParent = 0); 74 /** Refreshes cloud machine information. 75 * @param comCloudMachine Brings cloud machine object. 76 * @param strErrorMessage Brings error message container. 77 * @param pWidget Brings parent widget to show messages according to, 78 * if no parent set, progress will be executed in blocking way. */ 79 SHARED_LIBRARY_STUFF void refreshCloudMachineInfo(CCloudMachine &comCloudMachine, 80 QString &strErrorMessage, 81 QWidget *pParent = 0); 65 82 66 83 /** Acquires image info as a map. -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r83526 r83643 57 57 #include "CChoiceFormValue.h" 58 58 #include "CCloudClient.h" 59 #include "CCloudMachine.h" 59 60 #include "CCloudProfile.h" 60 61 #include "CCloudProvider.h" … … 1769 1770 } 1770 1771 1772 void UIMessageCenter::cannotAcquireCloudMachineParameter(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */) const 1773 { 1774 error(pParent, MessageType_Error, 1775 tr("Failed to acquire cloud machine parameter."), 1776 UIErrorString::formatErrorInfo(comMachine)); 1777 } 1778 1779 void UIMessageCenter::cannotAcquireCloudMachineParameter(const CProgress &comProgress, QWidget *pParent /* = 0 */) const 1780 { 1781 error(pParent, MessageType_Error, 1782 tr("Failed to acquire cloud machine parameter."), 1783 UIErrorString::formatErrorInfo(comProgress)); 1784 } 1785 1771 1786 bool UIMessageCenter::confirmCloudProfileRemoval(const QString &strName, QWidget *pParent /* = 0 */) const 1772 1787 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r83212 r83643 389 389 void cannotAcquireCloudClientParameter(const CCloudClient &comClient, QWidget *pParent = 0) const; 390 390 void cannotAcquireCloudClientParameter(const CProgress &comProgress, QWidget *pParent = 0) const; 391 void cannotAcquireCloudMachineParameter(const CCloudMachine &comMachine, QWidget *pParent = 0) const; 392 void cannotAcquireCloudMachineParameter(const CProgress &comProgress, QWidget *pParent = 0) const; 391 393 bool confirmCloudProfileRemoval(const QString &strName, QWidget *pParent = 0) const; 392 394 bool confirmCloudProfilesImport(QWidget *pParent = 0) const;
Note:
See TracChangeset
for help on using the changeset viewer.