Changeset 96635 in vbox
- Timestamp:
- Sep 7, 2022 4:16:37 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r96407 r96635 175 175 connect(m_pPaneSnapshots, &UISnapshotPane::sigCurrentItemChange, 176 176 this, &UIToolPaneMachine::sigCurrentSnapshotItemChange); 177 m_pPaneSnapshots->setMachine (m_comMachine);177 m_pPaneSnapshots->setMachineItems(m_items); 178 178 179 179 /* Add into layout: */ … … 314 314 m_pPaneDetails->setItems(m_items); 315 315 } 316 /* Update snapshots pane if it is open: */ 317 if (isToolOpened(UIToolType_Snapshots)) 318 { 319 AssertPtrReturnVoid(m_pPaneSnapshots); 320 m_pPaneSnapshots->setMachineItems(m_items); 321 } 316 322 /* Update logs pane if it is open: */ 317 323 if (isToolOpened(UIToolType_Logs)) … … 334 340 } 335 341 336 void UIToolPaneMachine::setMachine(const CMachine &comMachine)337 {338 /* Cache passed value: */339 m_comMachine = comMachine;340 341 /* Update snapshots pane is it is open: */342 if (isToolOpened(UIToolType_Snapshots))343 {344 AssertPtrReturnVoid(m_pPaneSnapshots);345 m_pPaneSnapshots->setMachine(m_comMachine);346 }347 }348 349 342 bool UIToolPaneMachine::isCurrentStateItemSelected() const 350 343 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h
r96407 r96635 105 105 void setItems(const QList<UIVirtualMachineItem*> &items); 106 106 107 /** Defines the @a comMachine object. */108 void setMachine(const CMachine &comMachine);109 110 107 /** Returns whether current-state item of Snapshot pane is selected. */ 111 108 bool isCurrentStateItemSelected() const; … … 152 149 /** Holds the cache of passed items. */ 153 150 QList<UIVirtualMachineItem*> m_items; 154 /** Holds the cache of passed machine. */155 CMachine m_comMachine;156 151 }; 157 152 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r96407 r96635 1114 1114 if (m_pPaneToolsMachine->currentTool() == UIToolType_Error) 1115 1115 sltHandleToolsPaneIndexChange(); 1116 1117 /* Propagate current items to update the Details-pane: */1118 m_pPaneToolsMachine->setItems(currentItems());1119 /* Propagate current machine to update the Snapshots-pane or/and Logviewer-pane: */1120 if (pItem->itemType() == UIVirtualMachineItemType_Local)1121 m_pPaneToolsMachine->setMachine(pItem->toLocal()->machine());1122 1116 } 1123 1117 else … … 1133 1127 m_pPaneToolsMachine->setErrorDetails(pItem->accessError()); 1134 1128 } 1135 1136 /* Propagate current items to update the Details-pane (in any case): */ 1137 m_pPaneToolsMachine->setItems(currentItems()); 1138 /* Propagate current machine to update the Snapshots-pane or/and Logviewer-pane (in any case): */ 1139 m_pPaneToolsMachine->setMachine(CMachine()); 1140 } 1141 } 1129 } 1130 1131 /* Propagate current items to update the Details-pane: */ 1132 m_pPaneToolsMachine->setItems(currentItems()); 1133 } -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp
r96407 r96635 57 57 #include "UITranslator.h" 58 58 #include "UIVirtualBoxEventHandler.h" 59 #include "UIVirtualMachineItem.h" 60 #include "UIVirtualMachineItemLocal.h" 59 61 #include "UIWizardCloneVM.h" 60 62 … … 500 502 , m_pDetailsWidget(0) 501 503 { 502 /* Prepare: */503 504 prepare(); 504 505 } … … 506 507 UISnapshotPane::~UISnapshotPane() 507 508 { 508 /* Cleanup: */509 509 cleanup(); 510 510 } 511 511 512 void UISnapshotPane::setMachine (const CMachine &comMachine)512 void UISnapshotPane::setMachineItems(const QList<UIVirtualMachineItem*> &items) 513 513 { 514 514 /* Cache passed machine: */ 515 m_comMachine = comMachine;515 m_comMachine = items.isEmpty() ? CMachine() : items.first()->toLocal()->machine(); 516 516 517 517 /* Cache machine details: */ … … 524 524 else 525 525 { 526 m_uMachineId = comMachine.GetId();527 m_enmSessionState = comMachine.GetSessionState();526 m_uMachineId = m_comMachine.GetId(); 527 m_enmSessionState = m_comMachine.GetSessionState(); 528 528 m_fShapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(m_uMachineId); 529 529 } … … 1213 1213 loadSettings(); 1214 1214 1215 1215 /* Register help topic: */ 1216 1216 uiCommon().setHelpKeyword(this, "snapshots"); 1217 1217 … … 1432 1432 { 1433 1433 /* Create a child of passed item: */ 1434 UISnapshotItem *pSnapshotItem = pItem ? new UISnapshotItem(this, pItem, comSnapshot) :1435 1434 UISnapshotItem *pSnapshotItem = pItem ? new UISnapshotItem(this, pItem, comSnapshot) 1435 : new UISnapshotItem(this, m_pSnapshotTree, comSnapshot); 1436 1436 /* And recache it's content: */ 1437 1437 pSnapshotItem->recache(); -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.h
r96407 r96635 51 51 class UISnapshotItem; 52 52 class UISnapshotTree; 53 class UIVirtualMachineItem; 53 54 54 55 … … 81 82 virtual ~UISnapshotPane() RT_OVERRIDE; 82 83 83 /** Defines the @a comMachine objectto be parsed. */84 void setMachine (const CMachine &comMachine);84 /** Defines the machine @a items to be parsed. */ 85 void setMachineItems(const QList<UIVirtualMachineItem*> &items); 85 86 86 87 /** Returns cached snapshot-item icon depending on @a fOnline flag. */
Note:
See TracChangeset
for help on using the changeset viewer.