Changeset 83654 in vbox
- Timestamp:
- Apr 9, 2020 4:48:37 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudAcquireInstances.cpp
r83212 r83654 28 28 } 29 29 30 Q List<UICloudMachine> UITaskCloudAcquireInstances::result() const30 QVector<CCloudMachine> UITaskCloudAcquireInstances::result() const 31 31 { 32 32 m_mutex.lock(); 33 const Q List<UICloudMachine> resultList= m_result;33 const QVector<CCloudMachine> resultVector = m_result; 34 34 m_mutex.unlock(); 35 return result List;35 return resultVector; 36 36 } 37 37 … … 47 47 { 48 48 m_mutex.lock(); 49 m_result = list Instances(m_comCloudClient, m_strErrorInfo);49 m_result = listCloudMachines(m_comCloudClient, m_strErrorInfo); 50 50 m_mutex.unlock(); 51 51 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudAcquireInstances.h
r83212 r83654 26 26 27 27 /* GUI includes: */ 28 #include "UICloudMachine.h"29 28 #include "UITask.h" 30 29 … … 32 31 #include "COMEnums.h" 33 32 #include "CCloudClient.h" 33 #include "CCloudMachine.h" 34 34 35 35 /* Forward declaratiuons: */ … … 57 57 58 58 /** Returns the task result. */ 59 Q List<UICloudMachine> result() const;59 QVector<CCloudMachine> result() const; 60 60 61 61 protected: … … 78 78 79 79 /** Holds the task result. */ 80 Q List<UICloudMachine> m_result;80 QVector<CCloudMachine> m_result; 81 81 }; 82 82 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudGetInstanceInfo.cpp
r83644 r83654 17 17 18 18 /* GUI includes: */ 19 #include "UICloudNetworkingStuff.h" 19 20 #include "UITaskCloudGetInstanceInfo.h" 20 21 21 22 22 UITaskCloudGetInstanceInfo::UITaskCloudGetInstanceInfo(const UICloudMachine &guiCloudMachine)23 UITaskCloudGetInstanceInfo::UITaskCloudGetInstanceInfo(const CCloudMachine &comCloudMachine) 23 24 : UITask(Type_CloudGetInstanceState) 24 , m_ guiCloudMachine(guiCloudMachine)25 , m_comCloudMachine(comCloudMachine) 25 26 { 26 27 } … … 37 38 { 38 39 m_mutex.lock(); 39 m_guiCloudMachine.refresh();40 refreshCloudMachineInfo(m_comCloudMachine, m_strErrorInfo); 40 41 m_mutex.unlock(); 41 42 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudGetInstanceInfo.h
r83644 r83654 27 27 28 28 /* GUI includes: */ 29 #include "UICloudMachine.h"30 29 #include "UITask.h" 30 31 /* COM includes: */ 32 #include "COMEnums.h" 33 #include "CCloudMachine.h" 31 34 32 35 … … 38 41 public: 39 42 40 /** Constructs task taking @a guiCloudMachine as data.41 * @param guiCloudMachine Brings the cloud VM wrapper. */42 UITaskCloudGetInstanceInfo(const UICloudMachine &guiCloudMachine);43 /** Constructs task taking @a comCloudMachine as data. 44 * @param comCloudMachine Brings the cloud VM wrapper. */ 45 UITaskCloudGetInstanceInfo(const CCloudMachine &comCloudMachine); 43 46 44 47 /** Returns error info. */ … … 52 55 private: 53 56 54 /** Holds the mutex to access m_ guiCloudMachine member. */57 /** Holds the mutex to access m_comCloudMachine member. */ 55 58 mutable QMutex m_mutex; 56 59 57 /** Holds the cloud clientobject. */58 UICloudMachine m_guiCloudMachine;60 /** Holds the cloud machine object. */ 61 CCloudMachine m_comCloudMachine; 59 62 60 63 /** Holds the error info. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp
r83290 r83654 41 41 } 42 42 43 UIVirtualMachineItemCloud::UIVirtualMachineItemCloud(const UICloudMachine &guiCloudMachine)43 UIVirtualMachineItemCloud::UIVirtualMachineItemCloud(const CCloudMachine &comCloudMachine) 44 44 : UIVirtualMachineItem(ItemType_CloudReal) 45 , m_ guiCloudMachine(guiCloudMachine)45 , m_comCloudMachine(comCloudMachine) 46 46 , m_enmFakeCloudItemState(FakeCloudItemState_NotApplicable) 47 47 , m_pTask(0) … … 71 71 void UIVirtualMachineItemCloud::pauseOrResume(bool fPause, QWidget *pParent) 72 72 { 73 /* Acquire cloud client: */ 74 CCloudClient comCloudClient = m_guiCloudMachine.client(); 75 76 /* Now execute async method: */ 73 /* Execute async method: */ 77 74 CProgress comProgress; 78 75 if (fPause) 79 comProgress = comCloudClient.PauseInstance(m_strInstanceId);80 else 81 comProgress = comCloudClient.StartInstance(m_strInstanceId);82 if (! comCloudClient.isOk())83 msgCenter().cannotAcquireCloud ClientParameter(comCloudClient);76 comProgress = m_comCloudMachine.PowerDown(); 77 else 78 comProgress = m_comCloudMachine.PowerUp(); 79 if (!m_comCloudMachine.isOk()) 80 msgCenter().cannotAcquireCloudMachineParameter(m_comCloudMachine); 84 81 else 85 82 { … … 102 99 { 103 100 /* Determine attributes which are always available: */ 104 if (!m_guiCloudMachine.isNull()) 105 { 106 m_strInstanceId = m_guiCloudMachine.instanceId(); 107 m_strName = m_guiCloudMachine.instanceName(); 108 m_uId = m_guiCloudMachine.id(); 101 if (!m_comCloudMachine.isNull()) 102 { 103 m_uId = m_comCloudMachine.GetId(); 104 m_strName = m_comCloudMachine.GetName(); 109 105 } 110 106 111 107 /* Now determine whether VM is accessible: */ 112 m_fAccessible = !m_guiCloudMachine.isNull()113 ? m_ guiCloudMachine.accessible()114 : true;115 m_strAccessError = !m_guiCloudMachine.isNull()116 ? m_ guiCloudMachine.accessError()117 : QString();108 m_fAccessible = /*!m_comCloudMachine.isNull() 109 ? m_comCloudMachine.accessible() 110 : */true; 111 m_strAccessError = /*!m_comCloudMachine.isNull() 112 ? m_comCloudMachine.accessError() 113 : */QString(); 118 114 119 115 /* Determine own VM attributes: */ 120 m_strOSTypeId = !m_ guiCloudMachine.isNull()121 ? m_ guiCloudMachine.osType()116 m_strOSTypeId = !m_comCloudMachine.isNull() 117 ? m_comCloudMachine.GetOSTypeId() 122 118 : "Other"; 123 119 124 120 /* Determine VM states: */ 125 m_enmMachineState = !m_ guiCloudMachine.isNull()126 ? m_ guiCloudMachine.machineState()121 m_enmMachineState = !m_comCloudMachine.isNull() 122 ? m_comCloudMachine.GetState() 127 123 : KMachineState_PoweredOff; 128 124 m_strMachineStateName = gpConverter->toString(m_enmMachineState); … … 283 279 if (!m_pTask) 284 280 { 285 m_pTask = new UITaskCloudGetInstanceInfo(m_ guiCloudMachine);281 m_pTask = new UITaskCloudGetInstanceInfo(m_comCloudMachine); 286 282 connect(uiCommon().threadPoolCloud(), &UIThreadPool::sigTaskComplete, 287 283 this, &UIVirtualMachineItemCloud::sltHandleGetCloudInstanceInfoDone); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.h
r83290 r83654 23 23 24 24 /* GUI includes: */ 25 #include "UICloudMachine.h"26 25 #include "UIVirtualMachineItem.h" 26 27 /* COM includes: */ 28 #include "COMEnums.h" 29 #include "CCloudMachine.h" 27 30 28 31 /* Forward declarations: */ … … 51 54 /** Constructs fake cloud VM item. */ 52 55 UIVirtualMachineItemCloud(); 53 /** Constructs real cloud VM item on the basis of taken @a guiCloudMachine. */54 UIVirtualMachineItemCloud(const UICloudMachine &guiCloudMachine);56 /** Constructs real cloud VM item on the basis of taken @a comCloudMachine. */ 57 UIVirtualMachineItemCloud(const CCloudMachine &comCloudMachine); 55 58 /** Destructs cloud VM item. */ 56 59 virtual ~UIVirtualMachineItemCloud(); … … 58 61 /** @name Arguments. 59 62 * @{ */ 60 /** Returns cached cloud VMobject. */61 UICloudMachine machine() const { return m_guiCloudMachine; }63 /** Returns cached cloud machine object. */ 64 CCloudMachine machine() const { return m_comCloudMachine; } 62 65 /** @} */ 63 66 … … 131 134 /** @name Arguments. 132 135 * @{ */ 133 /** Holds cached cloud VM object reference. */ 134 UICloudMachine m_guiCloudMachine; 135 /** @} */ 136 137 /** @name Basic attributes. 138 * @{ */ 139 /** Holds the cloud instance id. */ 140 QString m_strInstanceId; 136 /** Holds cached cloud machine object. */ 137 CCloudMachine m_comCloudMachine; 141 138 /** @} */ 142 139 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r83351 r83654 29 29 #include "UIVirtualMachineItem.h" 30 30 #ifdef VBOX_GUI_WITH_CLOUD_VMS 31 # include "UICloudMachine.h"32 31 # include "UITaskCloudAcquireInstances.h" 33 32 # include "UIThreadPool.h" … … 39 38 #ifdef VBOX_GUI_WITH_CLOUD_VMS 40 39 # include "CCloudClient.h" 40 # include "CCloudMachine.h" 41 41 # include "CCloudProfile.h" 42 42 # include "CCloudProvider.h" … … 297 297 AssertReturnVoid(pFirstChildNodeMachine->cache()->itemType() == UIVirtualMachineItem::ItemType_CloudFake); 298 298 299 /* And if we have at least one cloud instance: */300 const Q List<UICloudMachine> instances = pAcquiringTask->result();301 if (! instances.isEmpty())299 /* And if we have at least one cloud machine: */ 300 const QVector<CCloudMachine> machines = pAcquiringTask->result(); 301 if (!machines.isEmpty()) 302 302 { 303 303 /* Remove the "Empty" node: */ … … 306 306 /* Add real cloud VM nodes: */ 307 307 int iPosition = 0; 308 foreach (const UICloudMachine &guiCloudMachine, instances)308 foreach (const CCloudMachine &comCloudMachine, machines) 309 309 { 310 310 /* Create new node: */ … … 312 312 false /* favorite */, 313 313 iPosition++ /* position */, 314 guiCloudMachine);314 comCloudMachine); 315 315 /* Request async node update: */ 316 316 pNode->cache()->toCloud()->updateInfoAsync(false /* delayed? */); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp
r83316 r83654 41 41 bool fFavorite, 42 42 int iPosition, 43 const UICloudMachine &guiCloudMachine)43 const CCloudMachine &comCloudMachine) 44 44 : UIChooserNode(pParent, fFavorite) 45 , m_pCache(new UIVirtualMachineItemCloud( guiCloudMachine))45 , m_pCache(new UIVirtualMachineItemCloud(comCloudMachine)) 46 46 { 47 47 /* Add to parent: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.h
r83055 r83654 26 26 27 27 /* Forward declarations: */ 28 class UICloudMachine;29 28 class UIVirtualMachineItem; 29 class CCloudMachine; 30 30 class CMachine; 31 31 … … 49 49 * @param fFavorite Brings whether the node is favorite. 50 50 * @param iPosition Brings initial node position. 51 * @param guiCloudMachine Brings cloud VMobject. */51 * @param comCloudMachine Brings COM cloud machine object. */ 52 52 UIChooserNodeMachine(UIChooserNode *pParent, 53 53 bool fFavorite, 54 54 int iPosition, 55 const UICloudMachine &guiCloudMachine);55 const CCloudMachine &comCloudMachine); 56 56 /** Constructs chooser node for fake cloud VM passing @a pParent to the base-class. 57 57 * @param fFavorite Brings whether the node is favorite. -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp
r83352 r83654 106 106 { 107 107 /* Get cloud machine: */ 108 m_cloudMachine = m_pMachineItem->toCloud()->machine();108 // m_cloudMachine = m_pMachineItem->toCloud()->machine(); 109 109 110 110 /* Compose a list of types to build: */
Note:
See TracChangeset
for help on using the changeset viewer.