- Timestamp:
- Jan 11, 2024 12:27:44 PM (13 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r102814 r102838 257 257 /* Update toolbar: */ 258 258 updateToolbar(); 259 260 /* Handle current tool type change: */ 261 handleCurrentToolTypeChange(enmType); 259 262 } 260 263 … … 269 272 /* Update toolbar: */ 270 273 updateToolbar(); 274 275 /* Handle current tool type change: */ 276 handleCurrentToolTypeChange(enmType); 271 277 } 272 278 … … 488 494 case SlidingDirection_Forward: 489 495 { 496 /* Switch stacked widget to machine tool pane: */ 490 497 m_pStackedWidget->setCurrentWidget(m_pPaneToolsMachine); 491 498 m_pPaneToolsGlobal->setActive(false); 492 499 m_pPaneToolsMachine->setActive(true); 500 /* Handle current tool type change: */ 501 handleCurrentToolTypeChange(m_pMenuToolsMachine->toolsType()); 493 502 break; 494 503 } 495 504 case SlidingDirection_Reverse: 496 505 { 506 /* Switch stacked widget to global tool pane: */ 497 507 m_pStackedWidget->setCurrentWidget(m_pPaneToolsGlobal); 498 508 m_pPaneToolsMachine->setActive(false); 499 509 m_pPaneToolsGlobal->setActive(true); 510 /* Handle current tool type change: */ 511 handleCurrentToolTypeChange(m_pMenuToolsGlobal->toolsType()); 500 512 break; 501 513 } … … 1159 1171 m_pPaneToolsMachine->closeTool(enmRestrictedType); 1160 1172 } 1173 1174 void UIVirtualBoxManagerWidget::handleCurrentToolTypeChange(UIToolType enmType) 1175 { 1176 /* This method's behavior depends first of all of currently selected tool class. 1177 * But keep in mind, it is called for both Global and Machine type changes. */ 1178 1179 /* If Global tools currently chosen: */ 1180 if (m_pStackedWidget->currentWidget() == m_pPaneToolsGlobal) 1181 { 1182 /* For the Global tool type changes, 1183 * start unconditionally updating all cloud VMs, 1184 * if Activity Overview tool currently chosen (even if VMs are not selected): */ 1185 if (UIToolStuff::isTypeOfClass(enmType, UIToolClass_Global)) 1186 m_pPaneChooser->setKeepCloudNodesUpdated(enmType == UIToolType_VMActivityOverview); 1187 } 1188 /* If Machine tools currently chosen: */ 1189 else 1190 { 1191 /* Stop unconditionally updating all cloud VMs, 1192 * (tho they will still be updated if selected): */ 1193 m_pPaneChooser->setKeepCloudNodesUpdated(false); 1194 } 1195 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h
r102814 r102838 374 374 /** Updates Machine tools menu for @a pItem specified. */ 375 375 void updateToolsMenuMachine(UIVirtualMachineItem *pItem); 376 377 /** Handles current tool @a enmType change. */ 378 void handleCurrentToolTypeChange(UIToolType enmType); 376 379 /** @} */ 377 380 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp
r102836 r102838 114 114 , m_enmMachineState(KCloudMachineState_Invalid) 115 115 , m_enmFakeCloudItemState(enmState) 116 , m_fUpdateRequiredByGlobalReason(false) 116 117 , m_fUpdateRequiredByLocalReason(false) 117 118 , m_pProgressTaskRefresh(0) … … 125 126 , m_enmMachineState(KCloudMachineState_Invalid) 126 127 , m_enmFakeCloudItemState(UIFakeCloudVirtualMachineItemState_NotApplicable) 128 , m_fUpdateRequiredByGlobalReason(false) 127 129 , m_fUpdateRequiredByLocalReason(false) 128 130 , m_pProgressTaskRefresh(0) … … 146 148 m_strFakeCloudItemErrorMessage = strErrorMessage; 147 149 recache(); 150 } 151 152 void UIVirtualMachineItemCloud::setUpdateRequiredByGlobalReason(bool fRequired) 153 { 154 m_fUpdateRequiredByGlobalReason = fRequired; 148 155 } 149 156 … … 173 180 174 181 /* Mark update canceled in any case: */ 182 m_fUpdateRequiredByGlobalReason = false; 175 183 m_fUpdateRequiredByLocalReason = false; 176 184 … … 392 400 393 401 /* Refresh again if required: */ 394 if (m_fUpdateRequiredByLocalReason) 402 if ( m_fUpdateRequiredByGlobalReason 403 || m_fUpdateRequiredByLocalReason) 395 404 updateInfoAsync(true /* delayed? */); 396 405 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.h
r102836 r102838 84 84 QString fakeCloudItemErrorMessage() const { return m_strFakeCloudItemErrorMessage; } 85 85 86 /** Defines whether update is @a fRequired by global reason. */ 87 void setUpdateRequiredByGlobalReason(bool fRequired); 86 88 /** Defines whether update is @a fRequired by local reason. */ 87 89 void setUpdateRequiredByLocalReason(bool fRequired); … … 165 167 QString m_strFakeCloudItemErrorMessage; 166 168 169 /** Holds whether update is required by global reason. */ 170 bool m_fUpdateRequiredByGlobalReason; 167 171 /** Holds whether update is required by local reason. */ 168 172 bool m_fUpdateRequiredByLocalReason; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp
r102111 r102838 55 55 AssertPtrReturn(model(), false); 56 56 return model()->isGroupSavingInProgress(); 57 } 58 59 void UIChooser::setKeepCloudNodesUpdated(bool fUpdate) 60 { 61 AssertPtrReturnVoid(model()); 62 return model()->setKeepCloudNodesUpdated(fUpdate); 57 63 } 58 64 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h
r102111 r102838 123 123 /** @name Cloud update stuff. 124 124 * @{ */ 125 /** Defines whether real cloud nodes should be kept updated. */ 126 void setKeepCloudNodesUpdated(bool fUpdate); 127 125 128 /** Returns whether at least one cloud profile currently being updated. */ 126 129 bool isCloudProfileUpdateInProgress() const; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r102836 r102838 386 386 , m_pParent(pParent) 387 387 , m_pInvisibleRootNode(0) 388 , m_fKeepCloudNodesUpdated(false) 388 389 { 389 390 prepare(); … … 604 605 } 605 606 return QString(); 607 } 608 609 void UIChooserAbstractModel::setKeepCloudNodesUpdated(bool fUpdate) 610 { 611 /* Make sure something changed: */ 612 if (m_fKeepCloudNodesUpdated == fUpdate) 613 return; 614 615 /* Holds the value: */ 616 m_fKeepCloudNodesUpdated = fUpdate; 617 618 /* Search for a list of provider nodes: */ 619 QList<UIChooserNode*> providerNodes; 620 invisibleRoot()->searchForNodes(QString(), 621 UIChooserItemSearchFlag_CloudProvider, 622 providerNodes); 623 624 /* Search for a list of profile nodes: */ 625 QList<UIChooserNode*> profileNodes; 626 foreach (UIChooserNode *pProviderNode, providerNodes) 627 pProviderNode->searchForNodes(QString(), 628 UIChooserItemSearchFlag_CloudProfile, 629 profileNodes); 630 631 /* Search for a list of machine nodes: */ 632 QList<UIChooserNode*> machineNodes; 633 foreach (UIChooserNode *pProfileNode, profileNodes) 634 pProfileNode->searchForNodes(QString(), 635 UIChooserItemSearchFlag_Machine, 636 machineNodes); 637 638 /* Update all the real cloud items: */ 639 foreach (UIChooserNode *pNode, machineNodes) 640 { 641 AssertReturnVoid(pNode && pNode->type() == UIChooserNodeType_Machine); 642 UIChooserNodeMachine *pMachineNode = pNode->toMachineNode(); 643 AssertReturnVoid(pMachineNode); 644 if (pMachineNode->cacheType() != UIVirtualMachineItemType_CloudReal) 645 continue; 646 UIVirtualMachineItemCloud *pCloudMachineItem = pMachineNode->cache()->toCloud(); 647 pCloudMachineItem->setUpdateRequiredByGlobalReason(m_fKeepCloudNodesUpdated); 648 if (m_fKeepCloudNodesUpdated) 649 pCloudMachineItem->updateInfoAsync(false /* delayed? */); 650 } 606 651 } 607 652 … … 1644 1689 comMachine); 1645 1690 /* Request for async node update if necessary: */ 1646 if (!comMachine.GetAccessible()) 1691 if ( m_fKeepCloudNodesUpdated 1692 || !comMachine.GetAccessible()) 1647 1693 { 1648 1694 AssertReturnVoid(pNode && pNode->cacheType() == UIVirtualMachineItemType_CloudReal); 1649 1695 UIVirtualMachineItemCloud *pCloudMachineItem = pNode->cache()->toCloud(); 1696 pCloudMachineItem->setUpdateRequiredByGlobalReason(m_fKeepCloudNodesUpdated); 1650 1697 pCloudMachineItem->updateInfoAsync(false /* delayed? */); 1651 1698 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h
r98103 r102838 143 143 /** @name Cloud update stuff. 144 144 * @{ */ 145 /** Defines whether real cloud nodes should be kept updated. */ 146 void setKeepCloudNodesUpdated(bool fUpdate); 147 145 148 /** Inserts cloud entity @a key into a set of keys currently being updated. */ 146 149 void insertCloudEntityKey(const UICloudEntityKey &key); … … 400 403 /** @name Cloud update stuff. 401 404 * @{ */ 405 /** Holds whether real cloud nodes should be kept updated. */ 406 bool m_fKeepCloudNodesUpdated; 407 402 408 /** Holds the set of cloud entity keys currently being updated. */ 403 409 QSet<UICloudEntityKey> m_cloudEntityKeysBeingUpdated;
Note:
See TracChangeset
for help on using the changeset viewer.