Changeset 86609 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 16, 2020 2:30:20 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp
r86199 r86609 368 368 else 369 369 return comCloudClient.GetCloudMachineList(); 370 } 371 /* Return empty list by default: */ 372 return QVector<CCloudMachine>(); 373 } 374 375 QVector<CCloudMachine> UICloudNetworkingStuff::listCloudMachineStubs(CCloudClient comCloudClient, 376 QWidget *pParent /* = 0 */) 377 { 378 /* Execute ReadCloudMachineStubList async method: */ 379 CProgress comProgress = comCloudClient.ReadCloudMachineStubList(); 380 if (!comCloudClient.isOk()) 381 msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent); 382 else 383 { 384 /* Show "Read cloud machine stubs" progress: */ 385 msgCenter().showModalProgressDialog(comProgress, 386 QString(), 387 ":/progress_reading_appliance_90px.png", pParent, 0); 388 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 389 msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent); 390 else 391 return comCloudClient.GetCloudMachineStubList(); 392 } 393 /* Return empty list by default: */ 394 return QVector<CCloudMachine>(); 395 } 396 397 QVector<CCloudMachine> UICloudNetworkingStuff::listCloudMachineStubs(CCloudClient comCloudClient, 398 QString &strErrorMessage) 399 { 400 /* Execute ReadCloudMachineStubList async method: */ 401 CProgress comProgress = comCloudClient.ReadCloudMachineStubList(); 402 if (!comCloudClient.isOk()) 403 strErrorMessage = UIErrorString::formatErrorInfo(comCloudClient); 404 else 405 { 406 /* Show "Read cloud machine stubs" progress: */ 407 comProgress.WaitForCompletion(-1); 408 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 409 strErrorMessage = UIErrorString::formatErrorInfo(comProgress); 410 else 411 return comCloudClient.GetCloudMachineStubList(); 370 412 } 371 413 /* Return empty list by default: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h
r86199 r86609 116 116 SHARED_LIBRARY_STUFF QVector<CCloudMachine> listCloudMachines(CCloudClient comCloudClient, 117 117 QString &strErrorMessage); 118 /** Acquires cloud machine stubs of certain @a comCloudClient, using @a pParent to show messages according to. */ 119 SHARED_LIBRARY_STUFF QVector<CCloudMachine> listCloudMachineStubs(CCloudClient comCloudClient, 120 QWidget *pParent = 0); 121 /** Acquires cloud machine stubs of certain @a comCloudClient, using @a strErrorMessage to store messages to. */ 122 SHARED_LIBRARY_STUFF QVector<CCloudMachine> listCloudMachineStubs(CCloudClient comCloudClient, 123 QString &strErrorMessage); 118 124 119 125 /** Acquires @a comCloudMachine ID as a @a uResult, using @a pParent to show messages according to. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudListMachines.cpp
r84058 r86609 24 24 25 25 26 UITaskCloudListMachines::UITaskCloudListMachines(const QString &strProviderShortName, const QString &strProfileName) 26 UITaskCloudListMachines::UITaskCloudListMachines(const QString &strProviderShortName, 27 const QString &strProfileName, 28 bool fWithRefresh) 27 29 : UITask(Type_CloudListMachines) 28 30 , m_strProviderShortName(strProviderShortName) 29 31 , m_strProfileName(strProfileName) 32 , m_fWithRefresh(fWithRefresh) 30 33 { 31 34 } … … 52 55 CCloudClient comCloudClient = cloudClientByName(m_strProviderShortName, m_strProfileName, m_strErrorInfo); 53 56 if (m_strErrorInfo.isNull()) 54 m_result = listCloudMachines(comCloudClient, m_strErrorInfo); 57 m_result = m_fWithRefresh 58 ? listCloudMachines(comCloudClient, m_strErrorInfo) 59 : listCloudMachineStubs(comCloudClient, m_strErrorInfo); 55 60 m_mutex.unlock(); 56 61 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudListMachines.h
r84058 r86609 41 41 /** Constructs task taking @a strProviderShortName and @a strProfileName as data. 42 42 * @param strProviderShortName Brings the provider short name. 43 * @param strProfileName Brings the profile name. */ 44 UITaskCloudListMachines(const QString &strProviderShortName, const QString &strProfileName); 43 * @param strProfileName Brings the profile name. 44 * @param fWithRefresh Brings whether the task includes refresh. */ 45 UITaskCloudListMachines(const QString &strProviderShortName, 46 const QString &strProfileName, 47 bool fWithRefresh); 45 48 46 49 /** Returns provider short name. */ … … 48 51 /** Returns profile name. */ 49 52 QString profileName() const { return m_strProfileName; } 53 /** Returns whether the task includes refresh. */ 54 bool withRefresh() const { return m_fWithRefresh; } 50 55 51 56 /** Returns error info. */ … … 69 74 /** Holds the profile name. */ 70 75 const QString m_strProfileName; 76 /** Holds whether the task includes refresh. */ 77 const bool m_fWithRefresh; 71 78 72 79 /** Holds the error info. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r86608 r86609 981 981 /* Create list cloud machines task: */ 982 982 UITaskCloudListMachines *pTask = new UITaskCloudListMachines(strProviderShortName, 983 strProfileName); 983 strProfileName, 984 true /* with refresh? */); 984 985 if (pTask) 985 986 uiCommon().threadPoolCloud()->enqueueTask(pTask); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r86608 r86609 923 923 AssertPtrReturnVoid(pParentOfParent); 924 924 UITaskCloudListMachines *pTask = new UITaskCloudListMachines(pParentOfParent->name(), 925 pParent->name()); 925 pParent->name(), 926 true /* with refresh? */); 926 927 AssertPtrReturnVoid(pTask); 927 928 uiCommon().threadPoolCloud()->enqueueTask(pTask);
Note:
See TracChangeset
for help on using the changeset viewer.