Changeset 83149 in vbox
- Timestamp:
- Feb 25, 2020 12:33:39 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/details
- Files:
-
- 4 edited
-
UIDetailsElement.cpp (modified) (1 diff)
-
UIDetailsElement.h (modified) (2 diffs)
-
UIDetailsSet.cpp (modified) (5 diffs)
-
UIDetailsSet.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r82968 r83149 305 305 } 306 306 307 const UICloudMachine &UIDetailsElement::cloudMachine() 308 { 309 return m_pSet->cloudMachine(); 310 } 311 312 bool UIDetailsElement::isLocal() const 313 { 314 return m_pSet->isLocal(); 315 } 316 307 317 void UIDetailsElement::setName(const QString &strName) 308 318 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.h
r82968 r83149 34 34 class QStateMachine; 35 35 class QTextLayout; 36 class UICloudMachine; 36 37 class UIDetailsSet; 37 38 class UIGraphicsRotatorButton; … … 159 160 /** Returns cached machine reference. */ 160 161 const CMachine &machine(); 162 /** Returns cached cloud machine reference. */ 163 const UICloudMachine &cloudMachine(); 164 165 /** Returns whether element is of local type. */ 166 bool isLocal() const; 161 167 162 168 /** Defines element @a strName. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp
r82968 r83149 27 27 #include "UIDetailsSet.h" 28 28 #include "UIVirtualBoxEventHandler.h" 29 #include "UIVirtualMachineItemCloud.h" 29 30 #include "UIVirtualMachineItemLocal.h" 30 31 … … 38 39 , m_pMachineItem(0) 39 40 , m_fFullSet(true) 41 , m_fIsLocal(true) 40 42 , m_fHasDetails(false) 41 43 , m_configurationAccessLevel(ConfigurationAccessLevel_Null) … … 66 68 /* Remember passed arguments: */ 67 69 m_pMachineItem = pMachineItem; 68 m_ machine = m_pMachineItem->toLocal()->machine();70 m_fIsLocal = m_pMachineItem->itemType() == UIVirtualMachineItem::ItemType_Local; 69 71 m_fHasDetails = m_pMachineItem->hasDetails(); 70 72 m_fFullSet = fFullSet; … … 72 74 73 75 /* Cleanup superfluous items: */ 74 if (!m_fFullSet || !m_fHasDetails) 75 { 76 int iFirstItem = m_fHasDetails ? DetailsElementType_Display : DetailsElementType_General; 76 if ( !m_fHasDetails 77 || !m_fIsLocal 78 || !m_fFullSet) 79 { 80 int iFirstItem = !m_fHasDetails 81 ? DetailsElementType_General 82 : !m_fIsLocal 83 ? DetailsElementType_Preview 84 : DetailsElementType_Display; 77 85 int iLastItem = DetailsElementType_Description; 78 86 bool fCleanupPerformed = false; … … 97 105 } 98 106 99 /* Choose last-step number: */ 100 m_iLastStepNumber = m_fFullSet ? DetailsElementType_Description : DetailsElementType_Preview; 101 102 /* Fetch USB controller restrictions: */ 103 const CUSBDeviceFilters &filters = m_machine.GetUSBDeviceFilters(); 104 if (filters.isNull() || !m_machine.GetUSBProxyAvailable()) 105 m_settings.remove(DetailsElementType_USB); 107 /* Special handling wrt item type: */ 108 switch (m_pMachineItem->itemType()) 109 { 110 case UIVirtualMachineItem::ItemType_Local: 111 { 112 /* Get local machine: */ 113 m_machine = m_pMachineItem->toLocal()->machine(); 114 115 /* Choose last-step number: */ 116 m_iLastStepNumber = m_fFullSet ? DetailsElementType_Description : DetailsElementType_Preview; 117 118 /* Fetch USB controller restrictions: */ 119 const CUSBDeviceFilters &filters = m_machine.GetUSBDeviceFilters(); 120 if (filters.isNull() || !m_machine.GetUSBProxyAvailable()) 121 m_settings.remove(DetailsElementType_USB); 122 123 break; 124 } 125 case UIVirtualMachineItem::ItemType_CloudReal: 126 { 127 /* Get cloud machine: */ 128 m_cloudMachine = m_pMachineItem->toCloud()->machine(); 129 130 /* Choose last-step number: */ 131 m_iLastStepNumber = DetailsElementType_System; 132 133 break; 134 } 135 default: 136 break; 137 } 106 138 107 139 /* Start building set: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.h
r82968 r83149 23 23 24 24 /* GUI includes: */ 25 #include "UICloudMachine.h" 25 26 #include "UIDetailsItem.h" 26 27 #include "UIExtraDataDefs.h" … … 61 62 /** Returns cached machine. */ 62 63 const CMachine &machine() const { return m_machine; } 64 /** Returns cached cloud machine. */ 65 const UICloudMachine &cloudMachine() const { return m_cloudMachine; } 66 67 /** Returns whether set is of local type. */ 68 bool isLocal() const { return m_fIsLocal; } 63 69 /** Returns whether set has cached details. */ 64 70 bool hasDetails() const { return m_fHasDetails; } … … 198 204 199 205 /** Holds the machine reference. */ 200 CMachine m_machine; 206 CMachine m_machine; 207 /** Holds the cloud machine reference. */ 208 UICloudMachine m_cloudMachine; 209 210 /** Holds whether set is of local type. */ 211 bool m_fIsLocal; 201 212 /** Holds whether set has details. */ 202 213 bool m_fHasDetails;
Note:
See TracChangeset
for help on using the changeset viewer.

