Changeset 86199 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Sep 21, 2020 2:33:29 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp
r86076 r86199 476 476 } 477 477 return false; 478 }479 480 bool UICloudNetworkingStuff::refreshCloudMachineInfo(CCloudMachine comCloudMachine,481 QWidget *pParent /* = 0 */)482 {483 /* Acquire machine name first: */484 QString strMachineName;485 if (!cloudMachineName(comCloudMachine, strMachineName))486 return false;487 488 /* Now execute Refresh async method: */489 CProgress comProgress = comCloudMachine.Refresh();490 if (!comCloudMachine.isOk())491 {492 msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);493 return false;494 }495 496 /* Show "Refresh cloud machine information" progress: */497 msgCenter().showModalProgressDialog(comProgress,498 strMachineName,499 ":/progress_reading_appliance_90px.png", pParent, 0);500 if (!comProgress.isOk() || comProgress.GetResultCode() != 0)501 {502 msgCenter().cannotAcquireCloudMachineParameter(comProgress, pParent);503 return false;504 }505 506 /* Return result: */507 return true;508 }509 510 bool UICloudNetworkingStuff::refreshCloudMachineInfo(CCloudMachine comCloudMachine,511 QString &strErrorMessage)512 {513 /* Execute Refresh async method: */514 CProgress comProgress = comCloudMachine.Refresh();515 if (!comCloudMachine.isOk())516 {517 strErrorMessage = UIErrorString::formatErrorInfo(comCloudMachine);518 return false;519 }520 521 /* Show "Refresh cloud machine information" progress: */522 comProgress.WaitForCompletion(-1);523 if (!comProgress.isOk() || comProgress.GetResultCode() != 0)524 {525 strErrorMessage = UIErrorString::formatErrorInfo(comProgress);526 return false;527 }528 529 /* Return result: */530 return true;531 478 } 532 479 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h
r86076 r86199 147 147 QWidget *pParent = 0); 148 148 149 /** Refreshes @a comCloudMachine information, using @a pParent to show messages according to.150 * @note Be aware, this is a blocking function, corresponding progress dialog will be executed. */151 SHARED_LIBRARY_STUFF bool refreshCloudMachineInfo(CCloudMachine comCloudMachine,152 QWidget *pParent = 0);153 /** Refreshes @a comCloudMachine information, using @a pParent to show messages according to.154 * @note Be aware, this is a blocking function, it will hang for a time of progress being executed. */155 SHARED_LIBRARY_STUFF bool refreshCloudMachineInfo(CCloudMachine comCloudMachine,156 QString &strErrorMessage);157 149 /** Acquires @a comCloudMachine settings form as a @a comResult, using @a pParent to show messages according to. 158 150 * @note Be aware, this is a blocking function, corresponding progress dialog will be executed. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudRefreshMachineInfo.cpp
r83691 r86199 18 18 /* GUI includes: */ 19 19 #include "UICloudNetworkingStuff.h" 20 #include "UIErrorString.h" 21 #include "UIProgressDialog.h" 20 22 #include "UITaskCloudRefreshMachineInfo.h" 21 23 … … 38 40 { 39 41 m_mutex.lock(); 40 refreshCloudMachineInfo(m_comCloudMachine, m_strErrorInfo); 42 43 /* Execute Refresh async method: */ 44 m_comCloudMachineRefreshProgress = m_comCloudMachine.Refresh(); 45 if (m_comCloudMachine.isOk()) 46 { 47 /* Show "Refresh cloud machine information" progress: */ 48 QPointer<UIProgress> pObject = new UIProgress(m_comCloudMachineRefreshProgress, this); 49 pObject->run(); 50 if (pObject) 51 delete pObject; 52 else 53 { 54 // Premature application shutdown, 55 // exit immediately: 56 return; 57 } 58 if (!m_comCloudMachineRefreshProgress.isOk() || m_comCloudMachineRefreshProgress.GetResultCode() != 0) 59 m_strErrorInfo = UIErrorString::formatErrorInfo(m_comCloudMachineRefreshProgress); 60 } 61 else 62 m_strErrorInfo = UIErrorString::formatErrorInfo(m_comCloudMachine); 63 41 64 m_mutex.unlock(); 42 65 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudRefreshMachineInfo.h
r83658 r86199 32 32 #include "COMEnums.h" 33 33 #include "CCloudMachine.h" 34 #include "CProgress.h" 34 35 35 36 … … 60 61 /** Holds the cloud machine object. */ 61 62 CCloudMachine m_comCloudMachine; 63 /** Holds the cloud machine refresh progress object. */ 64 CProgress m_comCloudMachineRefreshProgress; 62 65 63 66 /** Holds the error info. */
Note:
See TracChangeset
for help on using the changeset viewer.