Changeset 83050 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 11, 2020 3:41:55 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r83033 r83050 615 615 src/hostnetwork/UIHostNetworkDetailsWidget.h \ 616 616 src/hostnetwork/UIHostNetworkManager.h \ 617 src/manager/UICloudMachine.h \ 617 618 src/manager/UIErrorPane.h \ 618 619 src/manager/UIToolPaneGlobal.h \ … … 1061 1062 src/hostnetwork/UIHostNetworkManager.cpp \ 1062 1063 src/hostnetwork/UIHostNetworkUtils.cpp \ 1064 src/manager/UICloudMachine.cpp \ 1063 1065 src/manager/UIErrorPane.cpp \ 1064 1066 src/manager/UIToolPaneGlobal.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp
r83015 r83050 17 17 18 18 /* GUI includes: */ 19 #include "UICloudMachine.h" 19 20 #include "UICommon.h" 20 21 #include "UIConverter.h" … … 25 26 UIVirtualMachineItemCloud::UIVirtualMachineItemCloud() 26 27 : UIVirtualMachineItem(ItemType_CloudFake) 28 , m_pCloudMachine(0) 27 29 , m_enmFakeCloudItemState(FakeCloudItemState_Loading) 28 30 { … … 30 32 } 31 33 32 UIVirtualMachineItemCloud::UIVirtualMachineItemCloud(const QString &strName)34 UIVirtualMachineItemCloud::UIVirtualMachineItemCloud(const UICloudMachine &guiCloudMachine) 33 35 : UIVirtualMachineItem(ItemType_CloudReal) 36 , m_pCloudMachine(new UICloudMachine(guiCloudMachine)) 34 37 , m_enmFakeCloudItemState(FakeCloudItemState_NotApplicable) 35 38 { 36 m_strName = strName;37 39 recache(); 38 40 } … … 40 42 UIVirtualMachineItemCloud::~UIVirtualMachineItemCloud() 41 43 { 44 delete m_pCloudMachine; 42 45 } 43 46 … … 45 48 { 46 49 /* Determine attributes which are always available: */ 47 /// @todo is there something? 50 if (itemType() == ItemType_CloudReal) 51 { 52 AssertPtrReturnVoid(m_pCloudMachine); 53 m_strId = m_pCloudMachine->id(); 54 m_strName = m_pCloudMachine->name(); 55 } 48 56 49 57 /* Now determine whether VM is accessible: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.h
r83012 r83050 25 25 #include "UIVirtualMachineItem.h" 26 26 27 /* Forward declarations: */ 28 class UICloudMachine; 29 27 30 /** UIVirtualMachineItem sub-class used as cloud Virtual Machine item interface. */ 28 31 class UIVirtualMachineItemCloud : public UIVirtualMachineItem … … 42 45 /** Constructs fake cloud VM item. */ 43 46 UIVirtualMachineItemCloud(); 44 /** Constructs real cloud VM item . */45 UIVirtualMachineItemCloud(const QString &strName);47 /** Constructs real cloud VM item on the basis of taken @a guiCloudMachine. */ 48 UIVirtualMachineItemCloud(const UICloudMachine &guiCloudMachine); 46 49 /** Destructs cloud VM item. */ 47 50 virtual ~UIVirtualMachineItemCloud(); … … 91 94 /** @} */ 92 95 96 private: 97 98 /** @name Arguments. 99 * @{ */ 100 /** Holds cached cloud machine object reference. */ 101 UICloudMachine *m_pCloudMachine; 102 /** @} */ 103 93 104 /** @name State attributes. 94 105 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r83041 r83050 29 29 #include "UIVirtualMachineItem.h" 30 30 #ifdef VBOX_GUI_WITH_CLOUD_VMS 31 # include "UICloudMachine.h" 31 32 # include "UITaskCloudAcquireInstances.h" 32 33 # include "UIThreadPool.h" … … 300 301 /* Add real cloud VM items: */ 301 302 int iPosition = 1; /* we've got item with index 0 already, the "Empty" one .. */ 302 foreach (const QString &strInstanceName, pAcquiringTask->instanceNames()) 303 { 303 foreach (const UICloudMachine &guiCloudMachine, pAcquiringTask->instances()) 304 304 new UIChooserNodeMachine(pParentNode, 305 305 false /* favorite */, 306 306 iPosition++ /* position */, 307 strInstanceName); 308 } 307 guiCloudMachine); 309 308 } 310 309 #endif /* VBOX_GUI_WITH_CLOUD_VMS */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp
r83046 r83050 37 37 bool fFavorite, 38 38 int iPosition, 39 const QString &strName)39 const UICloudMachine &guiCloudMachine) 40 40 : UIChooserNode(pParent, fFavorite) 41 , m_pCache(new UIVirtualMachineItemCloud( strName))41 , m_pCache(new UIVirtualMachineItemCloud(guiCloudMachine)) 42 42 { 43 43 if (parentNode()) -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.h
r83040 r83050 26 26 27 27 /* Forward declarations: */ 28 class UICloudMachine; 28 29 class UIVirtualMachineItem; 29 30 class CMachine; … … 39 40 /** Constructs chooser node for local VM passing @a pParent to the base-class. 40 41 * @param fFavorite Brings whether the node is favorite. 41 * @param iPosition Brings theinitial node position.42 * @param iPosition Brings initial node position. 42 43 * @param comMachine Brings COM machine object. */ 43 44 UIChooserNodeMachine(UIChooserNode *pParent, … … 46 47 const CMachine &comMachine); 47 48 /** Constructs chooser node for real cloud VM passing @a pParent to the base-class. 48 * @param fFavorite Brings whether the node is favorite.49 * @param iPosition Brings theinitial node position.50 * @param strName Brings the cloud VM name. */49 * @param fFavorite Brings whether the node is favorite. 50 * @param iPosition Brings initial node position. 51 * @param guiCloudMachine Brings cloud VM object. */ 51 52 UIChooserNodeMachine(UIChooserNode *pParent, 52 53 bool fFavorite, 53 54 int iPosition, 54 const QString &strName);55 const UICloudMachine &guiCloudMachine); 55 56 /** Constructs chooser node for fake cloud VM passing @a pParent to the base-class. 56 57 * @param fFavorite Brings whether the node is favorite. -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UITaskCloudAcquireInstances.cpp
r83008 r83050 31 31 } 32 32 33 Q StringList UITaskCloudAcquireInstances::instanceNames() const33 QList<UICloudMachine> UITaskCloudAcquireInstances::instances() const 34 34 { 35 35 m_mutex.lock(); 36 const Q StringList instanceNames = m_instanceNames;36 const QList<UICloudMachine> instances = m_instances; 37 37 m_mutex.unlock(); 38 return instanceNames; 39 } 40 41 QStringList UITaskCloudAcquireInstances::instanceIds() const 42 { 43 m_mutex.lock(); 44 const QStringList instanceIds = m_instanceIds; 45 m_mutex.unlock(); 46 return instanceIds; 38 return instances; 47 39 } 48 40 … … 85 77 } 86 78 87 /* Fetch acquired names/ids to lists: */ 88 m_instanceNames = comNames.GetValues().toList(); 89 m_instanceIds = comIDs.GetValues().toList(); 79 /* Fetch acquired objects to lists: */ 80 const QVector<QString> instanceIds = comIDs.GetValues(); 81 const QVector<QString> instanceNames = comNames.GetValues(); 82 for (int i = 0; i < instanceIds.size(); ++i) 83 m_instances << UICloudMachine(m_comCloudClient, instanceIds.at(i), instanceNames.at(i)); 90 84 } 91 85 while (0); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UITaskCloudAcquireInstances.h
r83008 r83050 26 26 27 27 /* GUI includes: */ 28 #include "UICloudMachine.h" 28 29 #include "UITask.h" 29 30 … … 54 55 CVirtualBoxErrorInfo errorInfo(); 55 56 56 /** Returns the instance name list. */ 57 QStringList instanceNames() const; 58 /** Returns the instance ID list. */ 59 QStringList instanceIds() const; 57 /** Returns the instance object list. */ 58 QList<UICloudMachine> instances() const; 60 59 61 60 protected: … … 77 76 CVirtualBoxErrorInfo m_comErrorInfo; 78 77 79 /** Holds the instance name list. */ 80 QStringList m_instanceNames; 81 /** Holds the instance ID list. */ 82 QStringList m_instanceIds; 78 /** Holds the instance object list. */ 79 QList<UICloudMachine> m_instances; 83 80 }; 84 81
Note:
See TracChangeset
for help on using the changeset viewer.