Changeset 107339 in vbox
- Timestamp:
- Dec 17, 2024 10:26:44 AM (2 months ago)
- svn:sync-xref-src-repo-rev:
- 166373
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIGlobalToolsManagerWidget.h
r107338 r107339 167 167 UIActionPool *m_pActionPool; 168 168 169 /** Holds the GlobalTools-menu instance. */169 /** Holds the Tools-menu instance. */ 170 170 UITools *m_pMenu; 171 /** Holds the GlobalTools-pane instance. */171 /** Holds the Tools-pane instance. */ 172 172 UIToolPaneGlobal *m_pPane; 173 173 }; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineManagerWidget.cpp
r107338 r107339 66 66 } 67 67 68 void UIMachineManagerWidget::setActive(bool fActive)69 {70 m_pPaneTools->setActive(fActive);71 }72 73 68 UIChooser *UIMachineManagerWidget::chooser() const 74 69 { … … 78 73 UIVirtualMachineItem *UIMachineManagerWidget::currentItem() const 79 74 { 80 return m_pPaneChooser->currentItem();75 return chooser()->currentItem(); 81 76 } 82 77 83 78 QList<UIVirtualMachineItem*> UIMachineManagerWidget::currentItems() const 84 79 { 85 return m_pPaneChooser->currentItems();80 return chooser()->currentItems(); 86 81 } 87 82 … … 95 90 bool UIMachineManagerWidget::isGroupItemSelected() const 96 91 { 97 return m_pPaneChooser->isGroupItemSelected();92 return chooser()->isGroupItemSelected(); 98 93 } 99 94 100 95 bool UIMachineManagerWidget::isMachineItemSelected() const 101 96 { 102 return m_pPaneChooser->isMachineItemSelected();97 return chooser()->isMachineItemSelected(); 103 98 } 104 99 105 100 bool UIMachineManagerWidget::isLocalMachineItemSelected() const 106 101 { 107 return m_pPaneChooser->isLocalMachineItemSelected();102 return chooser()->isLocalMachineItemSelected(); 108 103 } 109 104 110 105 bool UIMachineManagerWidget::isCloudMachineItemSelected() const 111 106 { 112 return m_pPaneChooser->isCloudMachineItemSelected(); 113 } 114 115 bool UIMachineManagerWidget::isSingleGroupSelected() const 116 { 117 return m_pPaneChooser->isSingleGroupSelected(); 107 return chooser()->isCloudMachineItemSelected(); 118 108 } 119 109 120 110 bool UIMachineManagerWidget::isSingleLocalGroupSelected() const 121 111 { 122 return m_pPaneChooser->isSingleLocalGroupSelected();112 return chooser()->isSingleLocalGroupSelected(); 123 113 } 124 114 125 115 bool UIMachineManagerWidget::isSingleCloudProviderGroupSelected() const 126 116 { 127 return m_pPaneChooser->isSingleCloudProviderGroupSelected();117 return chooser()->isSingleCloudProviderGroupSelected(); 128 118 } 129 119 130 120 bool UIMachineManagerWidget::isSingleCloudProfileGroupSelected() const 131 121 { 132 return m_pPaneChooser->isSingleCloudProfileGroupSelected(); 133 } 134 135 bool UIMachineManagerWidget::isAllItemsOfOneGroupSelected() const 136 { 137 return m_pPaneChooser->isAllItemsOfOneGroupSelected(); 122 return chooser()->isSingleCloudProfileGroupSelected(); 138 123 } 139 124 … … 151 136 } 152 137 153 QString UIMachineManagerWidget::fullGroupName() const154 {155 return m_pPaneChooser->fullGroupName();156 }157 158 bool UIMachineManagerWidget::isGroupSavingInProgress() const159 {160 return m_pPaneChooser->isGroupSavingInProgress();161 }162 163 bool UIMachineManagerWidget::isCloudProfileUpdateInProgress() const164 {165 return m_pPaneChooser->isCloudProfileUpdateInProgress();166 }167 168 void UIMachineManagerWidget::openGroupNameEditor()169 {170 m_pPaneChooser->openGroupNameEditor();171 }172 173 void UIMachineManagerWidget::disbandGroup()174 {175 m_pPaneChooser->disbandGroup();176 }177 178 void UIMachineManagerWidget::removeMachine()179 {180 m_pPaneChooser->removeMachine();181 }182 183 void UIMachineManagerWidget::moveMachineToGroup(const QString &strName /* = QString() */)184 {185 m_pPaneChooser->moveMachineToGroup(strName);186 }187 188 QStringList UIMachineManagerWidget::possibleGroupsForMachineToMove(const QUuid &uId)189 {190 return m_pPaneChooser->possibleGroupsForMachineToMove(uId);191 }192 193 QStringList UIMachineManagerWidget::possibleGroupsForGroupToMove(const QString &strFullName)194 {195 return m_pPaneChooser->possibleGroupsForGroupToMove(strFullName);196 }197 198 void UIMachineManagerWidget::refreshMachine()199 {200 m_pPaneChooser->refreshMachine();201 }202 203 void UIMachineManagerWidget::sortGroup()204 {205 m_pPaneChooser->sortGroup();206 }207 208 void UIMachineManagerWidget::setMachineSearchWidgetVisibility(bool fVisible)209 {210 m_pPaneChooser->setMachineSearchWidgetVisibility(fVisible);211 }212 213 138 UIToolPaneMachine *UIMachineManagerWidget::toolPane() const 214 139 { … … 218 143 UIToolType UIMachineManagerWidget::menuToolType() const 219 144 { 220 AssertPtrReturn( m_pMenuTools, UIToolType_Invalid);221 return m_pMenuTools->toolsType();145 AssertPtrReturn(toolMenu(), UIToolType_Invalid); 146 return toolMenu()->toolsType(); 222 147 } 223 148 … … 229 154 AssertReturnVoid(UIToolStuff::isTypeOfClass(enmType, UIToolClass_Machine)); 230 155 231 AssertPtrReturnVoid( m_pMenuTools);232 m_pMenuTools->setToolsType(enmType);156 AssertPtrReturnVoid(toolMenu()); 157 toolMenu()->setToolsType(enmType); 233 158 } 234 159 235 160 UIToolType UIMachineManagerWidget::toolType() const 236 161 { 237 AssertPtrReturn( m_pPaneTools, UIToolType_Invalid);238 return m_pPaneTools->currentTool();162 AssertPtrReturn(toolPane(), UIToolType_Invalid); 163 return toolPane()->currentTool(); 239 164 } 240 165 … … 246 171 AssertReturn(UIToolStuff::isTypeOfClass(enmType, UIToolClass_Machine), false); 247 172 248 AssertPtrReturn( m_pPaneTools, false);249 return m_pPaneTools->isToolOpened(enmType);173 AssertPtrReturn(toolPane(), false); 174 return toolPane()->isToolOpened(enmType); 250 175 } 251 176 … … 258 183 259 184 /* Open corresponding tool: */ 260 AssertPtrReturnVoid( m_pPaneTools);261 m_pPaneTools->openTool(enmType);185 AssertPtrReturnVoid(toolPane()); 186 toolPane()->openTool(enmType); 262 187 263 188 /* Let the parent know: */ … … 272 197 AssertReturnVoid(UIToolStuff::isTypeOfClass(enmType, UIToolClass_Machine)); 273 198 274 AssertPtrReturnVoid( m_pPaneTools);275 m_pPaneTools->closeTool(enmType);199 AssertPtrReturnVoid(toolPane()); 200 toolPane()->closeTool(enmType); 276 201 } 277 202 278 203 bool UIMachineManagerWidget::isCurrentStateItemSelected() const 279 204 { 280 AssertPtrReturn( m_pPaneTools, false);281 return m_pPaneTools->isCurrentStateItemSelected();205 AssertPtrReturn(toolPane(), false); 206 return toolPane()->isCurrentStateItemSelected(); 282 207 } 283 208 284 209 QUuid UIMachineManagerWidget::currentSnapshotId() 285 210 { 286 AssertPtrReturn( m_pPaneTools, QUuid());287 return m_pPaneTools->currentSnapshotId();211 AssertPtrReturn(toolPane(), QUuid()); 212 return toolPane()->currentSnapshotId(); 288 213 } 289 214 290 215 QString UIMachineManagerWidget::currentHelpKeyword() const 291 216 { 292 AssertPtrReturn( m_pPaneTools, QString());293 return m_pPaneTools->currentHelpKeyword();217 AssertPtrReturn(toolPane(), QString()); 218 return toolPane()->currentHelpKeyword(); 294 219 } 295 220 … … 404 329 { 405 330 /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */ 406 if ( m_pPaneTools->currentTool() == UIToolType_Error)407 switchToolTo( m_pMenuTools->toolsType());331 if (toolPane()->currentTool() == UIToolType_Error) 332 switchToolTo(toolMenu()->toolsType()); 408 333 409 334 /* If we still have same item selected: */ … … 411 336 { 412 337 /* Propagate current items to update the Details-pane: */ 413 m_pPaneTools->setItems(currentItems());338 toolPane()->setItems(currentItems()); 414 339 } 415 340 } … … 417 342 { 418 343 /* Make sure Error pane raised: */ 419 if ( m_pPaneTools->currentTool() != UIToolType_Error)420 m_pPaneTools->openTool(UIToolType_Error);344 if (toolPane()->currentTool() != UIToolType_Error) 345 toolPane()->openTool(UIToolType_Error); 421 346 422 347 /* If we still have same item selected: */ … … 424 349 { 425 350 /* Propagate current items to update the Details-pane (in any case): */ 426 m_pPaneTools->setItems(currentItems());351 toolPane()->setItems(currentItems()); 427 352 /* Propagate last access error to update the Error-pane (if machine selected but inaccessible): */ 428 m_pPaneTools->setErrorDetails(pItem->accessError());353 toolPane()->setErrorDetails(pItem->accessError()); 429 354 } 430 355 } … … 437 362 { 438 363 /* Update tools menu beforehand: */ 439 UITools *pMenu = pItem ? m_pMenuTools: 0;364 UITools *pMenu = pItem ? toolMenu() : 0; 440 365 AssertPtrReturnVoid(pMenu); 441 366 if (pItem) … … 464 389 void UIMachineManagerWidget::sltSwitchToVMActivityPane(const QUuid &uMachineId) 465 390 { 466 AssertPtrReturnVoid( m_pPaneChooser);467 AssertPtrReturnVoid( m_pMenuTools);468 m_pPaneChooser->setCurrentMachine(uMachineId);469 m_pMenuTools->setToolsType(UIToolType_VMActivity);391 AssertPtrReturnVoid(chooser()); 392 AssertPtrReturnVoid(toolMenu()); 393 chooser()->setCurrentMachine(uMachineId); 394 toolMenu()->setToolsType(UIToolType_VMActivity); 470 395 } 471 396 … … 504 429 /* Create Chooser-pane: */ 505 430 m_pPaneChooser = new UIChooser(this, actionPool()); 506 if ( m_pPaneChooser)431 if (chooser()) 507 432 { 508 433 /* Add into splitter: */ 509 m_pSplitter->addWidget( m_pPaneChooser);434 m_pSplitter->addWidget(chooser()); 510 435 } 511 436 512 437 /* Create Tools-pane: */ 513 438 m_pPaneTools = new UIToolPaneMachine(actionPool()); 514 if ( m_pPaneTools)439 if (toolPane()) 515 440 { 516 441 /// @todo make sure it's used properly 517 m_pPaneTools->setActive(true);442 toolPane()->setActive(true); 518 443 519 444 /* Add into splitter: */ 520 m_pSplitter->addWidget( m_pPaneTools);445 m_pSplitter->addWidget(toolPane()); 521 446 } 522 447 … … 534 459 535 460 /* Bring the VM list to the focus: */ 536 m_pPaneChooser->setFocus();461 chooser()->setFocus(); 537 462 } 538 463 … … 558 483 559 484 /* Chooser-pane connections: */ 560 connect( m_pPaneChooser, &UIChooser::sigSelectionChanged,485 connect(chooser(), &UIChooser::sigSelectionChanged, 561 486 this, &UIMachineManagerWidget::sltHandleChooserPaneIndexChange); 562 connect( m_pPaneChooser, &UIChooser::sigSelectionInvalidated,487 connect(chooser(), &UIChooser::sigSelectionInvalidated, 563 488 this, &UIMachineManagerWidget::sltHandleChooserPaneSelectionInvalidated); 564 connect( m_pPaneChooser, &UIChooser::sigToolMenuRequested,489 connect(chooser(), &UIChooser::sigToolMenuRequested, 565 490 this, &UIMachineManagerWidget::sltHandleToolMenuRequested); 566 connect( m_pPaneChooser, &UIChooser::sigCloudMachineStateChange,491 connect(chooser(), &UIChooser::sigCloudMachineStateChange, 567 492 this, &UIMachineManagerWidget::sltHandleCloudMachineStateChange); 568 connect( m_pPaneChooser, &UIChooser::sigToggleStarted,569 m_pPaneTools, &UIToolPaneMachine::sigToggleStarted);570 connect( m_pPaneChooser, &UIChooser::sigToggleFinished,571 m_pPaneTools, &UIToolPaneMachine::sigToggleFinished);493 connect(chooser(), &UIChooser::sigToggleStarted, 494 toolPane(), &UIToolPaneMachine::sigToggleStarted); 495 connect(chooser(), &UIChooser::sigToggleFinished, 496 toolPane(), &UIToolPaneMachine::sigToggleFinished); 572 497 573 498 /* Tools-pane connections: */ 574 connect( m_pPaneTools, &UIToolPaneMachine::sigLinkClicked,499 connect(toolPane(), &UIToolPaneMachine::sigLinkClicked, 575 500 this, &UIMachineManagerWidget::sigMachineSettingsLinkClicked); 576 501 577 502 /* Tools-menu connections: */ 578 connect( m_pMenuTools, &UITools::sigSelectionChanged,503 connect(toolMenu(), &UITools::sigSelectionChanged, 579 504 this, &UIMachineManagerWidget::sltHandleToolsMenuIndexChange); 580 505 } … … 595 520 596 521 /* Open tool last chosen in Tools-menu: */ 597 switchToolTo( m_pMenuTools->toolsType());522 switchToolTo(toolMenu()->toolsType()); 598 523 } 599 524 … … 601 526 { 602 527 /* Chooser-pane connections: */ 603 disconnect( m_pPaneChooser, &UIChooser::sigSelectionChanged,528 disconnect(chooser(), &UIChooser::sigSelectionChanged, 604 529 this, &UIMachineManagerWidget::sltHandleChooserPaneIndexChange); 605 disconnect( m_pPaneChooser, &UIChooser::sigSelectionInvalidated,530 disconnect(chooser(), &UIChooser::sigSelectionInvalidated, 606 531 this, &UIMachineManagerWidget::sltHandleChooserPaneSelectionInvalidated); 607 disconnect( m_pPaneChooser, &UIChooser::sigToolMenuRequested,532 disconnect(chooser(), &UIChooser::sigToolMenuRequested, 608 533 this, &UIMachineManagerWidget::sltHandleToolMenuRequested); 609 disconnect( m_pPaneChooser, &UIChooser::sigCloudMachineStateChange,534 disconnect(chooser(), &UIChooser::sigCloudMachineStateChange, 610 535 this, &UIMachineManagerWidget::sltHandleCloudMachineStateChange); 611 disconnect( m_pPaneChooser, &UIChooser::sigToggleStarted,612 m_pPaneTools, &UIToolPaneMachine::sigToggleStarted);613 disconnect( m_pPaneChooser, &UIChooser::sigToggleFinished,614 m_pPaneTools, &UIToolPaneMachine::sigToggleFinished);536 disconnect(chooser(), &UIChooser::sigToggleStarted, 537 toolPane(), &UIToolPaneMachine::sigToggleStarted); 538 disconnect(chooser(), &UIChooser::sigToggleFinished, 539 toolPane(), &UIToolPaneMachine::sigToggleFinished); 615 540 616 541 /* Tools-pane connections: */ 617 disconnect( m_pPaneTools, &UIToolPaneMachine::sigLinkClicked,542 disconnect(toolPane(), &UIToolPaneMachine::sigLinkClicked, 618 543 this, &UIMachineManagerWidget::sigMachineSettingsLinkClicked); 619 544 620 545 /* Tools-menu connections: */ 621 disconnect( m_pMenuTools, &UITools::sigSelectionChanged,546 disconnect(toolMenu(), &UITools::sigSelectionChanged, 622 547 this, &UIMachineManagerWidget::sltHandleToolsMenuIndexChange); 623 548 } … … 627 552 /* Ask sub-dialogs to commit data: */ 628 553 sltHandleCommitData(); 554 } 555 556 UITools *UIMachineManagerWidget::toolMenu() const 557 { 558 return m_pMenuTools; 629 559 } 630 560 … … 643 573 { 644 574 /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */ 645 if ( m_pPaneTools->currentTool() == UIToolType_Error)646 switchToolTo( m_pMenuTools->toolsType());575 if (toolPane()->currentTool() == UIToolType_Error) 576 switchToolTo(toolMenu()->toolsType()); 647 577 648 578 /* Propagate current items to the Tools pane: */ 649 m_pPaneTools->setItems(currentItems());579 toolPane()->setItems(currentItems()); 650 580 } 651 581 /* Otherwise if we were not asked separately to calm down: */ … … 653 583 { 654 584 /* Make sure Error pane raised: */ 655 if ( m_pPaneTools->currentTool() != UIToolType_Error)656 m_pPaneTools->openTool(UIToolType_Error);585 if (toolPane()->currentTool() != UIToolType_Error) 586 toolPane()->openTool(UIToolType_Error); 657 587 658 588 /* Propagate last access error to the Error-pane: */ 659 589 if (pItem) 660 m_pPaneTools->setErrorDetails(pItem->accessError());590 toolPane()->setErrorDetails(pItem->accessError()); 661 591 } 662 592 } … … 676 606 << UIToolType_Logs 677 607 << UIToolType_FileManager; 678 if (restrictedTypes.contains( m_pMenuTools->toolsType()))679 m_pMenuTools->setToolsType(UIToolType_Details);608 if (restrictedTypes.contains(toolMenu()->toolsType())) 609 toolMenu()->setToolsType(UIToolType_Details); 680 610 const QList restrictions(restrictedTypes.begin(), restrictedTypes.end()); 681 m_pMenuTools->setRestrictedToolTypes(restrictions);611 toolMenu()->setRestrictedToolTypes(restrictions); 682 612 /* Update machine menu items availability: */ 683 m_pMenuTools->setItemsEnabled(fCurrentItemIsOk);613 toolMenu()->setItemsEnabled(fCurrentItemIsOk); 684 614 685 615 /* Take restrictions into account, closing all restricted tools: */ 686 616 foreach (const UIToolType &enmRestrictedType, restrictedTypes) 687 m_pPaneTools->closeTool(enmRestrictedType);688 } 617 toolPane()->closeTool(enmRestrictedType); 618 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineManagerWidget.h
r107338 r107339 101 101 /** Returns the action-pool reference. */ 102 102 UIActionPool *actionPool() const { return m_pActionPool; } 103 104 /** Makes manager active. */105 void setActive(bool fActive);106 103 /** @} */ 107 104 … … 128 125 bool isCloudMachineItemSelected() const; 129 126 130 /** Returns whether single group is selected. */131 bool isSingleGroupSelected() const;132 127 /** Returns whether single local group is selected. */ 133 128 bool isSingleLocalGroupSelected() const; … … 136 131 /** Returns whether single cloud profile group is selected. */ 137 132 bool isSingleCloudProfileGroupSelected() const; 138 /** Returns whether all items of one group are selected. */139 bool isAllItemsOfOneGroupSelected() const;140 133 141 134 /** Returns current selection type. */ 142 135 SelectionType selectionType() const; 143 144 /** Returns full name of currently selected group. */145 QString fullGroupName() const;146 147 /** Returns whether group saving is in progress. */148 bool isGroupSavingInProgress() const;149 /** Returns whether at least one cloud profile currently being updated. */150 bool isCloudProfileUpdateInProgress() const;151 152 /** Opens group name editor. */153 void openGroupNameEditor();154 /** Disbands group. */155 void disbandGroup();156 /** Removes machine. */157 void removeMachine();158 /** Moves machine to a group with certain @a strName. */159 void moveMachineToGroup(const QString &strName = QString());160 /** Returns possible groups for machine with passed @a uId to move to. */161 QStringList possibleGroupsForMachineToMove(const QUuid &uId);162 /** Returns possible groups for group with passed @a strFullName to move to. */163 QStringList possibleGroupsForGroupToMove(const QString &strFullName);164 /** Refreshes machine. */165 void refreshMachine();166 /** Sorts group. */167 void sortGroup();168 /** Toggle machine search widget to be @a fVisible. */169 void setMachineSearchWidgetVisibility(bool fVisible);170 136 /** @} */ 171 137 … … 282 248 /** @name Tools stuff. 283 249 * @{ */ 250 /** Returns tool-menu instance. */ 251 UITools *toolMenu() const; 252 284 253 /** Recaches current machine item information. 285 254 * @param fDontRaiseErrorPane Brings whether we should not raise error-pane. */
Note:
See TracChangeset
for help on using the changeset viewer.