Changeset 107301 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Dec 12, 2024 2:24:24 PM (5 months ago)
- svn:sync-xref-src-repo-rev:
- 166332
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r107287 r107301 706 706 else 707 707 VirtualBox_QT_MOCHDRS += \ 708 src/manager/UIMachineManagerWidget.h \ 708 709 src/manager/UIVirtualBoxManagerAdvancedWidget.h 709 710 endif … … 1240 1241 else 1241 1242 VirtualBox_SOURCES += \ 1243 src/manager/UIMachineManagerWidget.cpp \ 1242 1244 src/manager/UIVirtualBoxManagerAdvancedWidget.cpp 1243 1245 endif -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineManagerWidget.cpp
r107299 r107301 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI VirtualBoxManagerAdvancedWidget class implementation.3 * VBox Qt GUI - UIMachineManagerWidget class implementation. 4 4 */ 5 5 … … 27 27 28 28 /* Qt includes: */ 29 #include <QApplication>30 29 #include <QHBoxLayout> 31 #include <QStackedWidget>32 #include <QStyle>33 30 #include <QTimer> 34 #include <QToolButton>35 31 #include <QVBoxLayout> 36 32 37 33 /* GUI includes: */ 38 34 #include "QISplitter.h" 39 #include "QIToolBar.h"40 #include "UIActionPoolManager.h"41 35 #include "UIChooser.h" 42 36 #include "UICommon.h" … … 45 39 #include "UIGlobalSession.h" 46 40 #include "UILoggingDefs.h" 47 #include "UIMessageCenter.h"48 41 #include "UINotificationCenter.h" 49 #include "UISlidingAnimation.h"50 #include "UITabBar.h"51 #include "UIToolPaneGlobal.h"52 42 #include "UIToolPaneMachine.h" 53 43 #include "UITools.h" 54 44 #include "UITranslationEventListener.h" 55 45 #include "UIVirtualBoxEventHandler.h" 56 #include "UIVirtualBoxManager.h" 57 #include "UIVirtualBoxManagerAdvancedWidget.h" 58 #include "UIVirtualMachineItemCloud.h" 46 #include "UIMachineManagerWidget.h" 59 47 #include "UIVirtualMachineItemLocal.h" 60 #if defined(VBOX_WS_MAC) && (defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)) 61 # include "UIIconPool.h" 62 # include "UIVersion.h" 63 #endif /* VBOX_WS_MAC && (RT_ARCH_ARM64 || RT_ARCH_ARM32) */ 64 #ifndef VBOX_WS_MAC 65 # include "UIMenuBar.h" 66 #endif 67 68 /* COM includes: */ 69 #if defined(VBOX_WS_MAC) && (defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)) 70 # include "CSystemProperties.h" 71 #endif /* VBOX_WS_MAC && (RT_ARCH_ARM64 || RT_ARCH_ARM32) */ 72 73 74 UIVirtualBoxManagerAdvancedWidget::UIVirtualBoxManagerAdvancedWidget(UIVirtualBoxManager *pParent) 48 49 50 UIMachineManagerWidget::UIMachineManagerWidget(UIToolPaneMachine *pParent) 75 51 : m_pActionPool(pParent->actionPool()) 76 52 , m_pSplitter(0) 77 , m_pToolBar(0)78 53 , m_pPaneChooser(0) 79 , m_pStackedWidget(0) 80 , m_pPaneToolsGlobal(0) 81 , m_pPaneToolsMachine(0) 82 , m_pMenuToolsGlobal(0) 83 , m_pMenuToolsMachine(0) 54 , m_pPaneTools(0) 55 , m_pMenuTools(0) 84 56 , m_enmSelectionType(SelectionType_Invalid) 85 57 , m_fSelectedMachineItemAccessible(false) … … 89 61 } 90 62 91 UI VirtualBoxManagerAdvancedWidget::~UIVirtualBoxManagerAdvancedWidget()63 UIMachineManagerWidget::~UIMachineManagerWidget() 92 64 { 93 65 cleanup(); 94 66 } 95 67 96 void UIVirtualBoxManagerAdvancedWidget::updateToolBarMenuButtons(bool fSeparateMenuSection) 97 { 98 QToolButton *pButton = qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow))); 99 if (pButton) 100 pButton->setPopupMode(fSeparateMenuSection ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup); 101 } 102 103 UIVirtualMachineItem *UIVirtualBoxManagerAdvancedWidget::currentItem() const 68 void UIMachineManagerWidget::setActive(bool fActive) 69 { 70 m_pPaneTools->setActive(fActive); 71 } 72 73 UIVirtualMachineItem *UIMachineManagerWidget::currentItem() const 104 74 { 105 75 return m_pPaneChooser->currentItem(); 106 76 } 107 77 108 QList<UIVirtualMachineItem*> UI VirtualBoxManagerAdvancedWidget::currentItems() const78 QList<UIVirtualMachineItem*> UIMachineManagerWidget::currentItems() const 109 79 { 110 80 return m_pPaneChooser->currentItems(); 111 81 } 112 82 113 bool UI VirtualBoxManagerAdvancedWidget::isItemAccessible(UIVirtualMachineItem *pItem /* = 0 */) const83 bool UIMachineManagerWidget::isItemAccessible(UIVirtualMachineItem *pItem /* = 0 */) const 114 84 { 115 85 if (!pItem) … … 118 88 } 119 89 120 bool UI VirtualBoxManagerAdvancedWidget::isGroupItemSelected() const90 bool UIMachineManagerWidget::isGroupItemSelected() const 121 91 { 122 92 return m_pPaneChooser->isGroupItemSelected(); 123 93 } 124 94 125 bool UIVirtualBoxManagerAdvancedWidget::isGlobalItemSelected() const 126 { 127 return m_pPaneChooser->isGlobalItemSelected(); 128 } 129 130 bool UIVirtualBoxManagerAdvancedWidget::isMachineItemSelected() const 95 bool UIMachineManagerWidget::isMachineItemSelected() const 131 96 { 132 97 return m_pPaneChooser->isMachineItemSelected(); 133 98 } 134 99 135 bool UI VirtualBoxManagerAdvancedWidget::isLocalMachineItemSelected() const100 bool UIMachineManagerWidget::isLocalMachineItemSelected() const 136 101 { 137 102 return m_pPaneChooser->isLocalMachineItemSelected(); 138 103 } 139 104 140 bool UI VirtualBoxManagerAdvancedWidget::isCloudMachineItemSelected() const105 bool UIMachineManagerWidget::isCloudMachineItemSelected() const 141 106 { 142 107 return m_pPaneChooser->isCloudMachineItemSelected(); 143 108 } 144 109 145 bool UI VirtualBoxManagerAdvancedWidget::isSingleGroupSelected() const110 bool UIMachineManagerWidget::isSingleGroupSelected() const 146 111 { 147 112 return m_pPaneChooser->isSingleGroupSelected(); 148 113 } 149 114 150 bool UI VirtualBoxManagerAdvancedWidget::isSingleLocalGroupSelected() const115 bool UIMachineManagerWidget::isSingleLocalGroupSelected() const 151 116 { 152 117 return m_pPaneChooser->isSingleLocalGroupSelected(); 153 118 } 154 119 155 bool UI VirtualBoxManagerAdvancedWidget::isSingleCloudProviderGroupSelected() const120 bool UIMachineManagerWidget::isSingleCloudProviderGroupSelected() const 156 121 { 157 122 return m_pPaneChooser->isSingleCloudProviderGroupSelected(); 158 123 } 159 124 160 bool UI VirtualBoxManagerAdvancedWidget::isSingleCloudProfileGroupSelected() const125 bool UIMachineManagerWidget::isSingleCloudProfileGroupSelected() const 161 126 { 162 127 return m_pPaneChooser->isSingleCloudProfileGroupSelected(); 163 128 } 164 129 165 bool UI VirtualBoxManagerAdvancedWidget::isAllItemsOfOneGroupSelected() const130 bool UIMachineManagerWidget::isAllItemsOfOneGroupSelected() const 166 131 { 167 132 return m_pPaneChooser->isAllItemsOfOneGroupSelected(); 168 133 } 169 134 170 UI VirtualBoxManagerAdvancedWidget::SelectionType UIVirtualBoxManagerAdvancedWidget::selectionType() const135 UIMachineManagerWidget::SelectionType UIMachineManagerWidget::selectionType() const 171 136 { 172 137 return isSingleLocalGroupSelected() … … 174 139 : isSingleCloudProviderGroupSelected() || isSingleCloudProfileGroupSelected() 175 140 ? SelectionType_SingleCloudGroupItem 176 : isGlobalItemSelected()177 ? SelectionType_FirstIsGlobalItem178 141 : isLocalMachineItemSelected() 179 142 ? SelectionType_FirstIsLocalMachineItem … … 183 146 } 184 147 185 QString UI VirtualBoxManagerAdvancedWidget::fullGroupName() const148 QString UIMachineManagerWidget::fullGroupName() const 186 149 { 187 150 return m_pPaneChooser->fullGroupName(); 188 151 } 189 152 190 bool UI VirtualBoxManagerAdvancedWidget::isGroupSavingInProgress() const153 bool UIMachineManagerWidget::isGroupSavingInProgress() const 191 154 { 192 155 return m_pPaneChooser->isGroupSavingInProgress(); 193 156 } 194 157 195 bool UI VirtualBoxManagerAdvancedWidget::isCloudProfileUpdateInProgress() const158 bool UIMachineManagerWidget::isCloudProfileUpdateInProgress() const 196 159 { 197 160 return m_pPaneChooser->isCloudProfileUpdateInProgress(); 198 161 } 199 162 200 void UI VirtualBoxManagerAdvancedWidget::openGroupNameEditor()163 void UIMachineManagerWidget::openGroupNameEditor() 201 164 { 202 165 m_pPaneChooser->openGroupNameEditor(); 203 166 } 204 167 205 void UI VirtualBoxManagerAdvancedWidget::disbandGroup()168 void UIMachineManagerWidget::disbandGroup() 206 169 { 207 170 m_pPaneChooser->disbandGroup(); 208 171 } 209 172 210 void UI VirtualBoxManagerAdvancedWidget::removeMachine()173 void UIMachineManagerWidget::removeMachine() 211 174 { 212 175 m_pPaneChooser->removeMachine(); 213 176 } 214 177 215 void UI VirtualBoxManagerAdvancedWidget::moveMachineToGroup(const QString &strName /* = QString() */)178 void UIMachineManagerWidget::moveMachineToGroup(const QString &strName /* = QString() */) 216 179 { 217 180 m_pPaneChooser->moveMachineToGroup(strName); 218 181 } 219 182 220 QStringList UI VirtualBoxManagerAdvancedWidget::possibleGroupsForMachineToMove(const QUuid &uId)183 QStringList UIMachineManagerWidget::possibleGroupsForMachineToMove(const QUuid &uId) 221 184 { 222 185 return m_pPaneChooser->possibleGroupsForMachineToMove(uId); 223 186 } 224 187 225 QStringList UI VirtualBoxManagerAdvancedWidget::possibleGroupsForGroupToMove(const QString &strFullName)188 QStringList UIMachineManagerWidget::possibleGroupsForGroupToMove(const QString &strFullName) 226 189 { 227 190 return m_pPaneChooser->possibleGroupsForGroupToMove(strFullName); 228 191 } 229 192 230 void UI VirtualBoxManagerAdvancedWidget::refreshMachine()193 void UIMachineManagerWidget::refreshMachine() 231 194 { 232 195 m_pPaneChooser->refreshMachine(); 233 196 } 234 197 235 void UI VirtualBoxManagerAdvancedWidget::sortGroup()198 void UIMachineManagerWidget::sortGroup() 236 199 { 237 200 m_pPaneChooser->sortGroup(); 238 201 } 239 202 240 void UI VirtualBoxManagerAdvancedWidget::setMachineSearchWidgetVisibility(bool fVisible)203 void UIMachineManagerWidget::setMachineSearchWidgetVisibility(bool fVisible) 241 204 { 242 205 m_pPaneChooser->setMachineSearchWidgetVisibility(fVisible); 243 206 } 244 207 245 void UIVirtualBoxManagerAdvancedWidget::setToolsTypeGlobal(UIToolType enmType, bool fMakeSureItsVisible /* = false */) 246 { 247 /* Make sure global item is selected if requested: */ 248 if (fMakeSureItsVisible) 249 { 250 AssertPtrReturnVoid(m_pPaneChooser); 251 m_pPaneChooser->setCurrentGlobal(); 252 } 253 254 /* Change the tool to requested type: */ 255 AssertPtrReturnVoid(m_pMenuToolsGlobal); 256 m_pMenuToolsGlobal->setToolsType(enmType); 257 } 258 259 UIToolType UIVirtualBoxManagerAdvancedWidget::toolsTypeGlobal() const 260 { 261 return m_pMenuToolsGlobal ? m_pMenuToolsGlobal->toolsType() : UIToolType_Invalid; 262 } 263 264 void UIVirtualBoxManagerAdvancedWidget::setToolsTypeMachine(UIToolType enmType) 265 { 266 /* Change the tool to requested type: */ 267 AssertPtrReturnVoid(m_pMenuToolsMachine); 268 m_pMenuToolsMachine->setToolsType(enmType); 269 } 270 271 UIToolType UIVirtualBoxManagerAdvancedWidget::toolsTypeMachine() const 272 { 273 return m_pMenuToolsMachine ? m_pMenuToolsMachine->toolsType() : UIToolType_Invalid; 274 } 275 276 UIToolType UIVirtualBoxManagerAdvancedWidget::currentGlobalTool() const 277 { 278 return m_pPaneToolsGlobal ? m_pPaneToolsGlobal->currentTool() : UIToolType_Invalid; 279 } 280 281 UIToolType UIVirtualBoxManagerAdvancedWidget::currentMachineTool() const 282 { 283 return m_pPaneToolsMachine ? m_pPaneToolsMachine->currentTool() : UIToolType_Invalid; 284 } 285 286 bool UIVirtualBoxManagerAdvancedWidget::isGlobalToolOpened(UIToolType enmType) const 287 { 288 return m_pPaneToolsGlobal ? m_pPaneToolsGlobal->isToolOpened(enmType) : false; 289 } 290 291 bool UIVirtualBoxManagerAdvancedWidget::isMachineToolOpened(UIToolType enmType) const 292 { 293 return m_pPaneToolsMachine ? m_pPaneToolsMachine->isToolOpened(enmType) : false; 294 } 295 296 void UIVirtualBoxManagerAdvancedWidget::switchGlobalToolTo(UIToolType enmType) 208 UIToolType UIMachineManagerWidget::menuToolType() const 209 { 210 return m_pMenuTools ? m_pMenuTools->toolsType() : UIToolType_Invalid; 211 } 212 213 void UIMachineManagerWidget::setMenuToolType(UIToolType enmType) 214 { 215 m_pMenuTools->setToolsType(enmType); 216 } 217 218 UIToolType UIMachineManagerWidget::toolType() const 219 { 220 return m_pPaneTools ? m_pPaneTools->currentTool() : UIToolType_Invalid; 221 } 222 223 bool UIMachineManagerWidget::isToolOpened(UIToolType enmType) const 224 { 225 return m_pPaneTools ? m_pPaneTools->isToolOpened(enmType) : false; 226 } 227 228 void UIMachineManagerWidget::switchToolTo(UIToolType enmType) 297 229 { 298 230 /* Open corresponding tool: */ 299 m_pPaneTools Global->openTool(enmType);231 m_pPaneTools->openTool(enmType); 300 232 301 233 /* Let the parent know: */ 302 emit sigToolTypeChangeGlobal(); 303 304 /* Update toolbar: */ 305 updateToolbar(); 306 307 /* Handle current tool type change: */ 308 handleCurrentToolTypeChange(enmType); 309 } 310 311 void UIVirtualBoxManagerAdvancedWidget::switchMachineToolTo(UIToolType enmType) 312 { 313 /* Open corresponding tool: */ 314 m_pPaneToolsMachine->openTool(enmType); 315 316 /* Let the parent know: */ 317 emit sigToolTypeChangeMachine(); 318 319 /* Update toolbar: */ 320 updateToolbar(); 321 322 /* Handle current tool type change: */ 323 handleCurrentToolTypeChange(enmType); 324 } 325 326 void UIVirtualBoxManagerAdvancedWidget::closeGlobalTool(UIToolType enmType) 327 { 328 m_pPaneToolsGlobal->closeTool(enmType); 329 } 330 331 void UIVirtualBoxManagerAdvancedWidget::closeMachineTool(UIToolType enmType) 332 { 333 m_pPaneToolsMachine->closeTool(enmType); 334 } 335 336 bool UIVirtualBoxManagerAdvancedWidget::isCurrentStateItemSelected() const 337 { 338 return m_pPaneToolsMachine->isCurrentStateItemSelected(); 339 } 340 341 QUuid UIVirtualBoxManagerAdvancedWidget::currentSnapshotId() 342 { 343 return m_pPaneToolsMachine->currentSnapshotId(); 344 } 345 346 QString UIVirtualBoxManagerAdvancedWidget::currentHelpKeyword() const 234 emit sigToolTypeChange(); 235 } 236 237 void UIMachineManagerWidget::closeTool(UIToolType enmType) 238 { 239 m_pPaneTools->closeTool(enmType); 240 } 241 242 bool UIMachineManagerWidget::isCurrentStateItemSelected() const 243 { 244 return m_pPaneTools->isCurrentStateItemSelected(); 245 } 246 247 QUuid UIMachineManagerWidget::currentSnapshotId() 248 { 249 return m_pPaneTools->currentSnapshotId(); 250 } 251 252 QString UIMachineManagerWidget::currentHelpKeyword() const 347 253 { 348 254 QString strHelpKeyword; 349 if (isGlobalItemSelected()) 350 strHelpKeyword = m_pPaneToolsGlobal->currentHelpKeyword(); 351 else if (isMachineItemSelected()) 352 strHelpKeyword = m_pPaneToolsMachine->currentHelpKeyword(); 255 if (isMachineItemSelected()) 256 strHelpKeyword = m_pPaneTools->currentHelpKeyword(); 353 257 return strHelpKeyword; 354 258 } 355 259 356 void UIVirtualBoxManagerAdvancedWidget::sltHandleToolBarContextMenuRequest(const QPoint &position) 357 { 358 /* Populate toolbar actions: */ 359 QList<QAction*> actions; 360 /* Add 'Show Toolbar Text' action: */ 361 QAction *pShowToolBarText = new QAction(UIVirtualBoxManager::tr("Show Toolbar Text"), 0); 362 if (pShowToolBarText) 363 { 364 pShowToolBarText->setCheckable(true); 365 pShowToolBarText->setChecked(m_pToolBar->toolButtonStyle() == Qt::ToolButtonTextUnderIcon); 366 actions << pShowToolBarText; 367 } 368 369 /* Prepare the menu position: */ 370 QPoint globalPosition = position; 371 QWidget *pSender = qobject_cast<QWidget*>(sender()); 372 if (pSender) 373 globalPosition = pSender->mapToGlobal(position); 374 375 /* Execute the menu: */ 376 QAction *pResult = QMenu::exec(actions, globalPosition); 377 378 /* Handle the menu execution result: */ 379 if (pResult == pShowToolBarText) 380 { 381 m_pToolBar->setUseTextLabels(pResult->isChecked()); 382 gEDataManager->setSelectorWindowToolBarTextVisible(pResult->isChecked()); 383 } 384 } 385 386 void UIVirtualBoxManagerAdvancedWidget::sltRetranslateUI() 260 void UIMachineManagerWidget::sltRetranslateUI() 387 261 { 388 262 /* Make sure chosen item fetched: */ … … 390 264 } 391 265 392 void UI VirtualBoxManagerAdvancedWidget::sltHandleCommitData()266 void UIMachineManagerWidget::sltHandleCommitData() 393 267 { 394 268 // WORKAROUND: … … 398 272 } 399 273 400 void UI VirtualBoxManagerAdvancedWidget::sltHandleMachineStateChange(const QUuid &uId)274 void UIMachineManagerWidget::sltHandleMachineStateChange(const QUuid &uId) 401 275 { 402 276 // WORKAROUND: … … 420 294 } 421 295 422 void UIVirtualBoxManagerAdvancedWidget::sltHandleSettingsExpertModeChange() 423 { 424 /* Update toolbar to show/hide corresponding actions: */ 425 updateToolbar(); 426 296 void UIMachineManagerWidget::sltHandleSettingsExpertModeChange() 297 { 427 298 /* Update tools restrictions for currently selected item: */ 428 if (currentItem()) 429 updateToolsMenuMachine(currentItem()); 430 else 431 updateToolsMenuGlobal(); 432 } 433 434 void UIVirtualBoxManagerAdvancedWidget::sltHandleSplitterMove() 299 UIVirtualMachineItem *pItem = currentItem(); 300 if (pItem) 301 updateToolsMenu(pItem); 302 } 303 304 void UIMachineManagerWidget::sltHandleSplitterMove() 435 305 { 436 306 /* Create timer if isn't exist already: */ … … 443 313 m_pSplitterSettingsSaveTimer->setSingleShot(true); 444 314 connect(m_pSplitterSettingsSaveTimer, &QTimer::timeout, 445 this, &UI VirtualBoxManagerAdvancedWidget::sltSaveSplitterSettings);315 this, &UIMachineManagerWidget::sltHandleSplitterSettingsSave); 446 316 } 447 317 } … … 450 320 } 451 321 452 void UI VirtualBoxManagerAdvancedWidget::sltSaveSplitterSettings()322 void UIMachineManagerWidget::sltHandleSplitterSettingsSave() 453 323 { 454 324 const QList<int> splitterSizes = m_pSplitter->sizes(); 455 LogRel2(("GUI: UI VirtualBoxManagerAdvancedWidget: Saving splitter as: Size=%d,%d\n",325 LogRel2(("GUI: UIMachineManagerWidget: Saving splitter as: Size=%d,%d\n", 456 326 splitterSizes.at(0), splitterSizes.at(1))); 457 327 gEDataManager->setSelectorWindowSplitterHints(splitterSizes); 458 328 } 459 329 460 void UIVirtualBoxManagerAdvancedWidget::sltHandleToolBarResize(const QSize &newSize) 461 { 462 emit sigToolBarHeightChange(newSize.height()); 463 } 464 465 void UIVirtualBoxManagerAdvancedWidget::sltHandleChooserPaneIndexChange() 330 void UIMachineManagerWidget::sltHandleChooserPaneIndexChange() 466 331 { 467 332 /* Let the parent know: */ 468 333 emit sigChooserPaneIndexChange(); 469 470 /* If global item is selected and we are on machine tools pane => switch to global tools pane: */471 if ( isGlobalItemSelected()472 && m_pStackedWidget->currentWidget() != m_pPaneToolsGlobal)473 {474 m_pStackedWidget->setCurrentWidget(m_pPaneToolsGlobal);475 m_pPaneToolsMachine->setActive(false);476 m_pPaneToolsGlobal->setActive(true);477 /* Handle current tool type change: */478 handleCurrentToolTypeChange(m_pMenuToolsGlobal->toolsType());479 }480 481 else482 483 /* If machine or group item is selected and we are on global tools pane => switch to machine tools pane: */484 if ( (isMachineItemSelected() || isGroupItemSelected())485 && m_pStackedWidget->currentWidget() != m_pPaneToolsMachine)486 {487 m_pStackedWidget->setCurrentWidget(m_pPaneToolsMachine);488 m_pPaneToolsGlobal->setActive(false);489 m_pPaneToolsMachine->setActive(true);490 /* Handle current tool type change: */491 handleCurrentToolTypeChange(m_pMenuToolsMachine->toolsType());492 }493 334 494 335 /* Update tools restrictions for currently selected item: */ 495 336 UIVirtualMachineItem *pItem = currentItem(); 496 337 if (pItem) 497 updateToolsMenuMachine(pItem); 498 else 499 updateToolsMenuGlobal(); 338 updateToolsMenu(pItem); 500 339 501 340 /* Recache current machine item information: */ … … 509 348 if ( m_enmSelectionType != enmSelectedItemType 510 349 || m_fSelectedMachineItemAccessible != fCurrentItemIsOk) 511 updateToolbar();350 emit sigChooserPaneSelectionChange(); 512 351 513 352 /* Remember selection type and item accessibility status: */ … … 516 355 } 517 356 518 void UIVirtualBoxManagerAdvancedWidget::sltHandleCloudProfileStateChange(const QString &strProviderShortName, 519 const QString &strProfileName) 520 { 521 RT_NOREF(strProviderShortName, strProfileName); 522 523 /* If Global Activity Overview tool is currently chosen: */ 524 if ( m_pStackedWidget->currentWidget() == m_pPaneToolsGlobal 525 && m_pPaneToolsGlobal->currentTool() == UIToolType_Activities) 526 m_pPaneToolsGlobal->setCloudMachineItems(m_pPaneChooser->cloudMachineItems()); 527 } 528 529 void UIVirtualBoxManagerAdvancedWidget::sltHandleCloudMachineStateChange(const QUuid &uId) 530 { 531 /* Not for global items: */ 532 if (isGlobalItemSelected()) 533 return; 534 357 void UIMachineManagerWidget::sltHandleChooserPaneSelectionInvalidated() 358 { 359 recacheCurrentMachineItemInformation(true /* fDontRaiseErrorPane */); 360 } 361 362 void UIMachineManagerWidget::sltHandleCloudMachineStateChange(const QUuid &uId) 363 { 535 364 /* Acquire current item: */ 536 365 UIVirtualMachineItem *pItem = currentItem(); … … 541 370 { 542 371 /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */ 543 if (m_pPaneTools Machine->currentTool() == UIToolType_Error)544 switch MachineToolTo(m_pMenuToolsMachine->toolsType());372 if (m_pPaneTools->currentTool() == UIToolType_Error) 373 switchToolTo(m_pMenuTools->toolsType()); 545 374 546 375 /* If we still have same item selected: */ … … 548 377 { 549 378 /* Propagate current items to update the Details-pane: */ 550 m_pPaneTools Machine->setItems(currentItems());379 m_pPaneTools->setItems(currentItems()); 551 380 } 552 381 } … … 554 383 { 555 384 /* Make sure Error pane raised: */ 556 if (m_pPaneTools Machine->currentTool() != UIToolType_Error)557 m_pPaneTools Machine->openTool(UIToolType_Error);385 if (m_pPaneTools->currentTool() != UIToolType_Error) 386 m_pPaneTools->openTool(UIToolType_Error); 558 387 559 388 /* If we still have same item selected: */ … … 561 390 { 562 391 /* Propagate current items to update the Details-pane (in any case): */ 563 m_pPaneTools Machine->setItems(currentItems());392 m_pPaneTools->setItems(currentItems()); 564 393 /* Propagate last access error to update the Error-pane (if machine selected but inaccessible): */ 565 m_pPaneTools Machine->setErrorDetails(pItem->accessError());394 m_pPaneTools->setErrorDetails(pItem->accessError()); 566 395 } 567 396 } … … 571 400 } 572 401 573 void UI VirtualBoxManagerAdvancedWidget::sltHandleToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem)402 void UIMachineManagerWidget::sltHandleToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem) 574 403 { 575 404 /* Update tools menu beforehand: */ 576 UITools *pMenu = pItem ? m_pMenuTools Machine : m_pMenuToolsGlobal;405 UITools *pMenu = pItem ? m_pMenuTools : 0; 577 406 AssertPtrReturnVoid(pMenu); 578 407 if (pItem) 579 updateToolsMenuMachine(pItem); 580 else 581 updateToolsMenuGlobal(); 408 updateToolsMenu(pItem); 582 409 583 410 /* Compose popup-menu geometry first of all: */ … … 596 423 } 597 424 598 void UI VirtualBoxManagerAdvancedWidget::sltSwitchToMachineActivityPane(const QUuid &uMachineId)425 void UIMachineManagerWidget::sltSwitchToVMActivityPane(const QUuid &uMachineId) 599 426 { 600 427 AssertPtrReturnVoid(m_pPaneChooser); 601 AssertPtrReturnVoid(m_pMenuTools Machine);428 AssertPtrReturnVoid(m_pMenuTools); 602 429 m_pPaneChooser->setCurrentMachine(uMachineId); 603 m_pMenuToolsMachine->setToolsType(UIToolType_VMActivity); 604 } 605 606 void UIVirtualBoxManagerAdvancedWidget::sltSwitchToActivityOverviewPane() 607 { 608 AssertPtrReturnVoid(m_pPaneChooser); 609 AssertPtrReturnVoid(m_pMenuToolsGlobal); 610 m_pMenuToolsGlobal->setToolsType(UIToolType_Activities); 611 m_pPaneChooser->setCurrentGlobal(); 612 } 613 614 void UIVirtualBoxManagerAdvancedWidget::prepare() 430 m_pMenuTools->setToolsType(UIToolType_VMActivity); 431 } 432 433 void UIMachineManagerWidget::prepare() 615 434 { 616 435 /* Prepare everything: */ … … 624 443 sltRetranslateUI(); 625 444 connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI, 626 this, &UI VirtualBoxManagerAdvancedWidget::sltRetranslateUI);445 this, &UIMachineManagerWidget::sltRetranslateUI); 627 446 628 447 /* Make sure current Chooser-pane index fetched: */ … … 630 449 } 631 450 632 void UI VirtualBoxManagerAdvancedWidget::prepareWidgets()451 void UIMachineManagerWidget::prepareWidgets() 633 452 { 634 453 /* Create main-layout: */ … … 664 483 pLayoutRight->setContentsMargins(0, 0, 0, 0); 665 484 666 /* Create Main toolbar: */667 m_p ToolBar = new QIToolBar;668 if (m_p ToolBar)485 /* Create Tools-pane: */ 486 m_pPaneTools = new UIToolPaneMachine(actionPool()); 487 if (m_pPaneTools) 669 488 { 670 /* Configure toolbar: */ 671 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize); 672 m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric)); 673 m_pToolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 674 m_pToolBar->setContextMenuPolicy(Qt::CustomContextMenu); 675 m_pToolBar->setUseTextLabels(true); 676 677 #if defined(VBOX_WS_MAC) && (defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)) 678 /* Check whether we should show Dev Preview tag: */ 679 bool fShowDevPreviewTag = false; 680 const CVirtualBox comVBox = gpGlobalSession->virtualBox(); 681 if (comVBox.isNotNull()) 682 { 683 const CSystemProperties comSystemProps = comVBox.GetSystemProperties(); 684 if (comVBox.isOk() && comSystemProps.isNotNull()) 685 fShowDevPreviewTag = 686 comSystemProps.GetSupportedPlatformArchitectures().contains(KPlatformArchitecture_x86); 687 } 688 /* Enable Dev Preview tag: */ 689 if (fShowDevPreviewTag) 690 { 691 m_pToolBar->emulateMacToolbar(); 692 m_pToolBar->enableBranding(UIIconPool::iconSet(":/explosion_hazard_32px.png"), 693 "Dev Preview", // do we need to make it NLS? 694 QColor(246, 179, 0), 695 74 /* width of BETA label */); 696 } 697 #endif /* VBOX_WS_MAC && (RT_ARCH_ARM64 || RT_ARCH_ARM32) */ 698 699 /* Add toolbar into layout: */ 700 pLayoutRight->addWidget(m_pToolBar); 701 } 702 703 /* Create stacked-widget: */ 704 m_pStackedWidget = new QStackedWidget; 705 if (m_pStackedWidget) 706 { 707 /* Create Global Tools-pane: */ 708 m_pPaneToolsGlobal = new UIToolPaneGlobal(actionPool()); 709 if (m_pPaneToolsGlobal) 710 { 711 if (m_pPaneChooser->isGlobalItemSelected()) 712 m_pPaneToolsGlobal->setActive(true); 713 connect(m_pPaneToolsGlobal, &UIToolPaneGlobal::sigCreateMedium, 714 this, &UIVirtualBoxManagerAdvancedWidget::sigCreateMedium); 715 connect(m_pPaneToolsGlobal, &UIToolPaneGlobal::sigCopyMedium, 716 this, &UIVirtualBoxManagerAdvancedWidget::sigCopyMedium); 717 connect(m_pPaneToolsGlobal, &UIToolPaneGlobal::sigSwitchToMachineActivityPane, 718 this, &UIVirtualBoxManagerAdvancedWidget::sltSwitchToMachineActivityPane); 719 720 /* Add into stack: */ 721 m_pStackedWidget->addWidget(m_pPaneToolsGlobal); 722 } 723 724 /* Create Machine Tools-pane: */ 725 m_pPaneToolsMachine = new UIToolPaneMachine(actionPool()); 726 if (m_pPaneToolsMachine) 727 { 728 if (!m_pPaneChooser->isGlobalItemSelected()) 729 m_pPaneToolsMachine->setActive(true); 730 connect(m_pPaneToolsMachine, &UIToolPaneMachine::sigCurrentSnapshotItemChange, 731 this, &UIVirtualBoxManagerAdvancedWidget::sigCurrentSnapshotItemChange); 732 connect(m_pPaneToolsMachine, &UIToolPaneMachine::sigSwitchToActivityOverviewPane, 733 this, &UIVirtualBoxManagerAdvancedWidget::sltSwitchToActivityOverviewPane); 734 connect(m_pPaneToolsMachine, &UIToolPaneMachine::sigDetachToolPane, 735 this, &UIVirtualBoxManagerAdvancedWidget::sigDetachToolPane); 736 737 /* Add into stack: */ 738 m_pStackedWidget->addWidget(m_pPaneToolsMachine); 739 } 740 741 /* Choose which pane should be active initially: */ 742 if (m_pPaneChooser->isGlobalItemSelected()) 743 m_pStackedWidget->setCurrentWidget(m_pPaneToolsGlobal); 744 else 745 m_pStackedWidget->setCurrentWidget(m_pPaneToolsMachine); 489 m_pPaneTools->setActive(true); 490 connect(m_pPaneTools, &UIToolPaneMachine::sigDetachToolPane, 491 this, &UIMachineManagerWidget::sigDetachToolPane); 492 connect(m_pPaneTools, &UIToolPaneMachine::sigCurrentSnapshotItemChange, 493 this, &UIMachineManagerWidget::sigCurrentSnapshotItemChange); 494 connect(m_pPaneTools, &UIToolPaneMachine::sigSwitchToActivityOverviewPane, 495 this, &UIMachineManagerWidget::sigSwitchToActivityOverviewPane); 746 496 747 497 /* Add into layout: */ 748 pLayoutRight->addWidget(m_p StackedWidget, 1);498 pLayoutRight->addWidget(m_pPaneTools, 1); 749 499 } 750 500 } … … 762 512 } 763 513 764 /* Create Global Tools-menu: */ 765 m_pMenuToolsGlobal = new UITools(this, UIToolClass_Global, actionPool()); 766 /* Create Machine Tools-menu: */ 767 m_pMenuToolsMachine = new UITools(this, UIToolClass_Machine, actionPool()); 514 /* Create Tools-menu: */ 515 m_pMenuTools = new UITools(this, UIToolClass_Machine, actionPool()); 768 516 } 769 517 … … 771 519 UINotificationCenter::create(this); 772 520 773 /* Update toolbar finally: */774 updateToolbar();775 776 521 /* Bring the VM list to the focus: */ 777 522 m_pPaneChooser->setFocus(); 778 523 } 779 524 780 void UI VirtualBoxManagerAdvancedWidget::prepareConnections()525 void UIMachineManagerWidget::prepareConnections() 781 526 { 782 527 /* UICommon connections: */ 783 528 connect(&uiCommon(), &UICommon::sigAskToCommitData, 784 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleCommitData);785 786 /* Global VBoxevent handlers: */529 this, &UIMachineManagerWidget::sltHandleCommitData); 530 531 /* Global COM event handlers: */ 787 532 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange, 788 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleMachineStateChange); 789 790 /* Global VBox extra-data event handlers: */ 533 this, &UIMachineManagerWidget::sltHandleMachineStateChange); 791 534 connect(gEDataManager, &UIExtraDataManager::sigSettingsExpertModeChange, 792 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleSettingsExpertModeChange);535 this, &UIMachineManagerWidget::sltHandleSettingsExpertModeChange); 793 536 794 537 /* Splitter connections: */ 795 538 connect(m_pSplitter, &QISplitter::splitterMoved, 796 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleSplitterMove); 797 798 /* Tool-bar connections: */ 799 connect(m_pToolBar, &QIToolBar::customContextMenuRequested, 800 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleToolBarContextMenuRequest); 801 connect(m_pToolBar, &QIToolBar::sigResized, 802 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleToolBarResize); 539 this, &UIMachineManagerWidget::sltHandleSplitterMove); 803 540 804 541 /* Chooser-pane connections: */ 805 542 connect(m_pPaneChooser, &UIChooser::sigSelectionChanged, 806 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleChooserPaneIndexChange);543 this, &UIMachineManagerWidget::sltHandleChooserPaneIndexChange); 807 544 connect(m_pPaneChooser, &UIChooser::sigSelectionInvalidated, 808 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleChooserPaneSelectionInvalidated);545 this, &UIMachineManagerWidget::sltHandleChooserPaneSelectionInvalidated); 809 546 connect(m_pPaneChooser, &UIChooser::sigToggleStarted, 810 m_pPaneTools Machine, &UIToolPaneMachine::sigToggleStarted);547 m_pPaneTools, &UIToolPaneMachine::sigToggleStarted); 811 548 connect(m_pPaneChooser, &UIChooser::sigToggleFinished, 812 m_pPaneTools Machine, &UIToolPaneMachine::sigToggleFinished);549 m_pPaneTools, &UIToolPaneMachine::sigToggleFinished); 813 550 connect(m_pPaneChooser, &UIChooser::sigGroupSavingStateChanged, 814 this, &UI VirtualBoxManagerAdvancedWidget::sigGroupSavingStateChanged);551 this, &UIMachineManagerWidget::sigGroupSavingStateChanged); 815 552 connect(m_pPaneChooser, &UIChooser::sigCloudUpdateStateChanged, 816 this, &UI VirtualBoxManagerAdvancedWidget::sigCloudUpdateStateChanged);553 this, &UIMachineManagerWidget::sigCloudUpdateStateChanged); 817 554 connect(m_pPaneChooser, &UIChooser::sigToolMenuRequested, 818 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleToolMenuRequested);555 this, &UIMachineManagerWidget::sltHandleToolMenuRequested); 819 556 connect(m_pPaneChooser, &UIChooser::sigCloudProfileStateChange, 820 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleCloudProfileStateChange);557 this, &UIMachineManagerWidget::sigCloudProfileStateChange); 821 558 connect(m_pPaneChooser, &UIChooser::sigCloudMachineStateChange, 822 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleCloudMachineStateChange);559 this, &UIMachineManagerWidget::sltHandleCloudMachineStateChange); 823 560 connect(m_pPaneChooser, &UIChooser::sigStartOrShowRequest, 824 this, &UI VirtualBoxManagerAdvancedWidget::sigStartOrShowRequest);561 this, &UIMachineManagerWidget::sigStartOrShowRequest); 825 562 connect(m_pPaneChooser, &UIChooser::sigMachineSearchWidgetVisibilityChanged, 826 this, &UI VirtualBoxManagerAdvancedWidget::sigMachineSearchWidgetVisibilityChanged);563 this, &UIMachineManagerWidget::sigMachineSearchWidgetVisibilityChanged); 827 564 828 565 /* Details-pane connections: */ 829 connect(m_pPaneTools Machine, &UIToolPaneMachine::sigLinkClicked,830 this, &UI VirtualBoxManagerAdvancedWidget::sigMachineSettingsLinkClicked);566 connect(m_pPaneTools, &UIToolPaneMachine::sigLinkClicked, 567 this, &UIMachineManagerWidget::sigMachineSettingsLinkClicked); 831 568 832 569 /* Tools-pane connections: */ 833 connect(m_pMenuToolsGlobal, &UITools::sigSelectionChanged, 834 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleGlobalToolsMenuIndexChange); 835 connect(m_pMenuToolsMachine, &UITools::sigSelectionChanged, 836 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleMachineToolsMenuIndexChange); 837 } 838 839 void UIVirtualBoxManagerAdvancedWidget::loadSettings() 570 connect(m_pMenuTools, &UITools::sigSelectionChanged, 571 this, &UIMachineManagerWidget::sltHandleToolsMenuIndexChange); 572 } 573 574 void UIMachineManagerWidget::loadSettings() 840 575 { 841 576 /* Restore splitter handle position: */ … … 848 583 sizes[1] = (int)(width() * .9 * (2.0 / 3)); 849 584 } 850 LogRel2(("GUI: UI VirtualBoxManagerAdvancedWidget: Restoring splitter to: Size=%d,%d\n",585 LogRel2(("GUI: UIMachineManagerWidget: Restoring splitter to: Size=%d,%d\n", 851 586 sizes.at(0), sizes.at(1))); 852 587 m_pSplitter->setSizes(sizes); 853 588 } 854 589 855 /* Restore toolbar settings: */856 {857 m_pToolBar->setUseTextLabels(gEDataManager->selectorWindowToolBarTextVisible());858 }859 860 590 /* Open tools last chosen in Tools-menu: */ 861 switchGlobalToolTo(m_pMenuToolsGlobal->toolsType()); 862 switchMachineToolTo(m_pMenuToolsMachine->toolsType()); 863 } 864 865 void UIVirtualBoxManagerAdvancedWidget::updateToolbar() 866 { 867 /* Make sure toolbar exists: */ 868 AssertPtrReturnVoid(m_pToolBar); 869 870 /* Clear initially: */ 871 m_pToolBar->clear(); 872 873 /* If global item selected: */ 874 if (isGlobalItemSelected()) 875 { 876 switch (currentGlobalTool()) 877 { 878 case UIToolType_Welcome: 879 { 880 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Application_S_Preferences)); 881 m_pToolBar->addSeparator(); 882 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_File_S_ImportAppliance)); 883 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_File_S_ExportAppliance)); 884 m_pToolBar->addSeparator(); 885 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Welcome_S_New)); 886 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Welcome_S_Add)); 887 break; 888 } 889 case UIToolType_Extensions: 890 { 891 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Extension_S_Install)); 892 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Extension_S_Uninstall)); 893 break; 894 } 895 case UIToolType_Media: 896 { 897 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_S_Add)); 898 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_S_Create)); 899 m_pToolBar->addSeparator(); 900 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_S_Copy)); 901 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_S_Move)); 902 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_S_Remove)); 903 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_S_Release)); 904 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_S_Clear)); 905 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_T_Search)); 906 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_T_Details)); 907 m_pToolBar->addSeparator(); 908 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Medium_S_Refresh)); 909 break; 910 } 911 case UIToolType_Network: 912 { 913 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Network_S_Create)); 914 m_pToolBar->addSeparator(); 915 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Network_S_Remove)); 916 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Network_T_Details)); 917 //m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Network_S_Refresh)); 918 break; 919 } 920 case UIToolType_Cloud: 921 { 922 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Cloud_S_Add)); 923 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Cloud_S_Import)); 924 m_pToolBar->addSeparator(); 925 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Cloud_S_Remove)); 926 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Cloud_T_Details)); 927 m_pToolBar->addSeparator(); 928 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Cloud_S_TryPage)); 929 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Cloud_S_Help)); 930 break; 931 } 932 case UIToolType_Activities: 933 { 934 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_VMActivityOverview_M_Columns)); 935 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachineActivity)); 936 QToolButton *pButton = 937 qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexMN_M_VMActivityOverview_M_Columns))); 938 if (pButton) 939 { 940 pButton->setPopupMode(QToolButton::InstantPopup); 941 pButton->setAutoRaise(true); 942 } 943 break; 944 } 945 946 default: 947 break; 948 } 949 } 950 951 else 952 953 /* If machine or group item selected: */ 954 if (isMachineItemSelected() || isGroupItemSelected()) 955 { 956 switch (currentMachineTool()) 957 { 958 case UIToolType_Details: 959 { 960 if (isSingleGroupSelected()) 961 { 962 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_New)); 963 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Add)); 964 m_pToolBar->addSeparator(); 965 if (isSingleLocalGroupSelected()) 966 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Discard)); 967 else if ( isSingleCloudProviderGroupSelected() 968 || isSingleCloudProfileGroupSelected()) 969 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Group_M_Stop_S_Terminate)); 970 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Group_M_StartOrShow)); 971 } 972 else 973 { 974 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_New)); 975 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Add)); 976 m_pToolBar->addSeparator(); 977 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Settings)); 978 if (isLocalMachineItemSelected()) 979 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Discard)); 980 else if (isCloudMachineItemSelected()) 981 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_M_Stop_S_Terminate)); 982 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)); 983 } 984 break; 985 } 986 case UIToolType_Snapshots: 987 { 988 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Snapshot_S_Take)); 989 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Snapshot_S_Delete)); 990 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Snapshot_S_Restore)); 991 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Snapshot_T_Properties)); 992 if (gEDataManager->isSettingsInExpertMode()) 993 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Snapshot_S_Clone)); 994 m_pToolBar->addSeparator(); 995 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Settings)); 996 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Discard)); 997 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)); 998 break; 999 } 1000 case UIToolType_Logs: 1001 { 1002 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_S_Save)); 1003 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_T_Find)); 1004 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_T_Filter)); 1005 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_T_Bookmark)); 1006 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_T_Preferences)); 1007 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_S_Refresh)); 1008 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_S_Reload)); 1009 m_pToolBar->addSeparator(); 1010 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Settings)); 1011 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Discard)); 1012 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)); 1013 break; 1014 } 1015 case UIToolType_VMActivity: 1016 { 1017 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Activity_S_Export)); 1018 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Activity_S_ToVMActivityOverview)); 1019 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Activity_T_Preferences)); 1020 m_pToolBar->addSeparator(); 1021 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Settings)); 1022 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Discard)); 1023 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)); 1024 break; 1025 } 1026 case UIToolType_FileManager: 1027 { 1028 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_FileManager_T_Preferences)); 1029 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_FileManager_T_Operations)); 1030 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_FileManager_T_Log)); 1031 m_pToolBar->addSeparator(); 1032 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Settings)); 1033 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Discard)); 1034 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)); 1035 break; 1036 } 1037 case UIToolType_Error: 1038 { 1039 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_New)); 1040 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Add)); 1041 m_pToolBar->addSeparator(); 1042 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Refresh)); 1043 break; 1044 } 1045 default: 1046 break; 1047 } 1048 } 1049 } 1050 1051 void UIVirtualBoxManagerAdvancedWidget::cleanupConnections() 1052 { 1053 /* Tool-bar connections: */ 1054 disconnect(m_pToolBar, &QIToolBar::customContextMenuRequested, 1055 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleToolBarContextMenuRequest); 1056 disconnect(m_pToolBar, &QIToolBar::sigResized, 1057 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleToolBarResize); 1058 591 switchToolTo(m_pMenuTools->toolsType()); 592 } 593 594 void UIMachineManagerWidget::cleanupConnections() 595 { 1059 596 /* Chooser-pane connections: */ 1060 597 disconnect(m_pPaneChooser, &UIChooser::sigSelectionChanged, 1061 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleChooserPaneIndexChange);598 this, &UIMachineManagerWidget::sltHandleChooserPaneIndexChange); 1062 599 disconnect(m_pPaneChooser, &UIChooser::sigSelectionInvalidated, 1063 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleChooserPaneSelectionInvalidated);600 this, &UIMachineManagerWidget::sltHandleChooserPaneSelectionInvalidated); 1064 601 disconnect(m_pPaneChooser, &UIChooser::sigToggleStarted, 1065 m_pPaneTools Machine, &UIToolPaneMachine::sigToggleStarted);602 m_pPaneTools, &UIToolPaneMachine::sigToggleStarted); 1066 603 disconnect(m_pPaneChooser, &UIChooser::sigToggleFinished, 1067 m_pPaneTools Machine, &UIToolPaneMachine::sigToggleFinished);604 m_pPaneTools, &UIToolPaneMachine::sigToggleFinished); 1068 605 disconnect(m_pPaneChooser, &UIChooser::sigGroupSavingStateChanged, 1069 this, &UI VirtualBoxManagerAdvancedWidget::sigGroupSavingStateChanged);606 this, &UIMachineManagerWidget::sigGroupSavingStateChanged); 1070 607 disconnect(m_pPaneChooser, &UIChooser::sigCloudUpdateStateChanged, 1071 this, &UI VirtualBoxManagerAdvancedWidget::sigCloudUpdateStateChanged);608 this, &UIMachineManagerWidget::sigCloudUpdateStateChanged); 1072 609 disconnect(m_pPaneChooser, &UIChooser::sigToolMenuRequested, 1073 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleToolMenuRequested);610 this, &UIMachineManagerWidget::sltHandleToolMenuRequested); 1074 611 disconnect(m_pPaneChooser, &UIChooser::sigCloudProfileStateChange, 1075 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleCloudProfileStateChange);612 this, &UIMachineManagerWidget::sigCloudProfileStateChange); 1076 613 disconnect(m_pPaneChooser, &UIChooser::sigCloudMachineStateChange, 1077 this, &UI VirtualBoxManagerAdvancedWidget::sltHandleCloudMachineStateChange);614 this, &UIMachineManagerWidget::sltHandleCloudMachineStateChange); 1078 615 disconnect(m_pPaneChooser, &UIChooser::sigStartOrShowRequest, 1079 this, &UI VirtualBoxManagerAdvancedWidget::sigStartOrShowRequest);616 this, &UIMachineManagerWidget::sigStartOrShowRequest); 1080 617 disconnect(m_pPaneChooser, &UIChooser::sigMachineSearchWidgetVisibilityChanged, 1081 this, &UI VirtualBoxManagerAdvancedWidget::sigMachineSearchWidgetVisibilityChanged);618 this, &UIMachineManagerWidget::sigMachineSearchWidgetVisibilityChanged); 1082 619 1083 620 /* Details-pane connections: */ 1084 disconnect(m_pPaneTools Machine, &UIToolPaneMachine::sigLinkClicked,1085 this, &UI VirtualBoxManagerAdvancedWidget::sigMachineSettingsLinkClicked);621 disconnect(m_pPaneTools, &UIToolPaneMachine::sigLinkClicked, 622 this, &UIMachineManagerWidget::sigMachineSettingsLinkClicked); 1086 623 1087 624 /* Tools-pane connections: */ 1088 disconnect(m_pMenuToolsGlobal, &UITools::sigSelectionChanged, 1089 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleGlobalToolsMenuIndexChange); 1090 disconnect(m_pMenuToolsMachine, &UITools::sigSelectionChanged, 1091 this, &UIVirtualBoxManagerAdvancedWidget::sltHandleMachineToolsMenuIndexChange); 1092 } 1093 1094 void UIVirtualBoxManagerAdvancedWidget::cleanupWidgets() 625 disconnect(m_pMenuTools, &UITools::sigSelectionChanged, 626 this, &UIMachineManagerWidget::sltHandleToolsMenuIndexChange); 627 } 628 629 void UIMachineManagerWidget::cleanupWidgets() 1095 630 { 1096 631 UINotificationCenter::destroy(); 1097 632 } 1098 633 1099 void UI VirtualBoxManagerAdvancedWidget::cleanup()634 void UIMachineManagerWidget::cleanup() 1100 635 { 1101 636 /* Ask sub-dialogs to commit data: */ … … 1106 641 } 1107 642 1108 void UI VirtualBoxManagerAdvancedWidget::recacheCurrentMachineItemInformation(bool fDontRaiseErrorPane /* = false */)643 void UIMachineManagerWidget::recacheCurrentMachineItemInformation(bool fDontRaiseErrorPane /* = false */) 1109 644 { 1110 645 /* Sanity check, this method is for machine or group of machine items: */ … … 1120 655 { 1121 656 /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */ 1122 if (m_pPaneTools Machine->currentTool() == UIToolType_Error)1123 switch MachineToolTo(m_pMenuToolsMachine->toolsType());657 if (m_pPaneTools->currentTool() == UIToolType_Error) 658 switchToolTo(m_pMenuTools->toolsType()); 1124 659 1125 660 /* Propagate current items to the Tools pane: */ 1126 m_pPaneTools Machine->setItems(currentItems());661 m_pPaneTools->setItems(currentItems()); 1127 662 } 1128 663 /* Otherwise if we were not asked separately to calm down: */ … … 1130 665 { 1131 666 /* Make sure Error pane raised: */ 1132 if (m_pPaneTools Machine->currentTool() != UIToolType_Error)1133 m_pPaneTools Machine->openTool(UIToolType_Error);667 if (m_pPaneTools->currentTool() != UIToolType_Error) 668 m_pPaneTools->openTool(UIToolType_Error); 1134 669 1135 670 /* Propagate last access error to the Error-pane: */ 1136 671 if (pItem) 1137 m_pPaneTools Machine->setErrorDetails(pItem->accessError());672 m_pPaneTools->setErrorDetails(pItem->accessError()); 1138 673 } 1139 674 } 1140 675 1141 void UIVirtualBoxManagerAdvancedWidget::updateToolsMenuGlobal() 1142 { 1143 /* Update global tools restrictions: */ 1144 QSet<UIToolType> restrictedTypes; 1145 const bool fExpertMode = gEDataManager->isSettingsInExpertMode(); 1146 if (!fExpertMode) 1147 restrictedTypes << UIToolType_Media 1148 << UIToolType_Network; 1149 if (restrictedTypes.contains(m_pMenuToolsGlobal->toolsType())) 1150 m_pMenuToolsGlobal->setToolsType(UIToolType_Welcome); 1151 const QList restrictions(restrictedTypes.begin(), restrictedTypes.end()); 1152 m_pMenuToolsGlobal->setRestrictedToolTypes(restrictions); 1153 1154 /* Take restrictions into account, closing all restricted tools: */ 1155 foreach (const UIToolType &enmRestrictedType, restrictedTypes) 1156 m_pPaneToolsGlobal->closeTool(enmRestrictedType); 1157 } 1158 1159 void UIVirtualBoxManagerAdvancedWidget::updateToolsMenuMachine(UIVirtualMachineItem *pItem) 676 void UIMachineManagerWidget::updateToolsMenu(UIVirtualMachineItem *pItem) 1160 677 { 1161 678 /* Get current item state: */ … … 1171 688 << UIToolType_Logs 1172 689 << UIToolType_FileManager; 1173 if (restrictedTypes.contains(m_pMenuTools Machine->toolsType()))1174 m_pMenuTools Machine->setToolsType(UIToolType_Details);690 if (restrictedTypes.contains(m_pMenuTools->toolsType())) 691 m_pMenuTools->setToolsType(UIToolType_Details); 1175 692 const QList restrictions(restrictedTypes.begin(), restrictedTypes.end()); 1176 m_pMenuTools Machine->setRestrictedToolTypes(restrictions);693 m_pMenuTools->setRestrictedToolTypes(restrictions); 1177 694 /* Update machine menu items availability: */ 1178 m_pMenuTools Machine->setItemsEnabled(fCurrentItemIsOk);695 m_pMenuTools->setItemsEnabled(fCurrentItemIsOk); 1179 696 1180 697 /* Take restrictions into account, closing all restricted tools: */ 1181 698 foreach (const UIToolType &enmRestrictedType, restrictedTypes) 1182 m_pPaneToolsMachine->closeTool(enmRestrictedType); 1183 } 1184 1185 void UIVirtualBoxManagerAdvancedWidget::handleCurrentToolTypeChange(UIToolType enmType) 1186 { 1187 /* This method's behavior depends first of all of currently selected tool class. 1188 * But keep in mind, it is called for both Global and Machine type changes. */ 1189 1190 /* If Global tools currently chosen: */ 1191 if (m_pStackedWidget->currentWidget() == m_pPaneToolsGlobal) 1192 { 1193 /* For the Global tool type changes, 1194 * start unconditionally updating all cloud VMs, 1195 * if Activity Overview tool currently chosen (even if VMs are not selected): */ 1196 if (UIToolStuff::isTypeOfClass(enmType, UIToolClass_Global)) 1197 { 1198 bool fActivityOverviewActive = enmType == UIToolType_Activities; 1199 m_pPaneChooser->setKeepCloudNodesUpdated(fActivityOverviewActive); 1200 if (fActivityOverviewActive) 1201 m_pPaneToolsGlobal->setCloudMachineItems(m_pPaneChooser->cloudMachineItems()); 1202 } 1203 } 1204 /* If Machine tools currently chosen: */ 1205 else 1206 { 1207 /* Stop unconditionally updating all cloud VMs, 1208 * (tho they will still be updated if selected): */ 1209 m_pPaneChooser->setKeepCloudNodesUpdated(false); 1210 } 1211 } 699 m_pPaneTools->closeTool(enmRestrictedType); 700 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineManagerWidget.h
r107295 r107301 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI VirtualBoxManagerAdvancedWidget class declaration.3 * VBox Qt GUI - UIMachineManagerWidget class declaration. 4 4 */ 5 5 … … 26 26 */ 27 27 28 #ifndef FEQT_INCLUDED_SRC_manager_UI VirtualBoxManagerAdvancedWidget_h29 #define FEQT_INCLUDED_SRC_manager_UI VirtualBoxManagerAdvancedWidget_h28 #ifndef FEQT_INCLUDED_SRC_manager_UIMachineManagerWidget_h 29 #define FEQT_INCLUDED_SRC_manager_UIMachineManagerWidget_h 30 30 #ifndef RT_WITHOUT_PRAGMA_ONCE 31 31 # pragma once … … 40 40 41 41 /* Forward declarations: */ 42 class QStackedWidget;43 42 class QTimer; 44 43 class QISplitter; 45 class QIToolBar;46 44 class UIActionPool; 47 45 class UIChooser; 48 class UIToolPaneGlobal;49 46 class UIToolPaneMachine; 50 47 class UITools; 51 class UIVirtualBoxManager;52 48 class UIVirtualMachineItem; 53 49 54 /** QWidget extension used as VirtualBoxManager Widget instance. */55 class UI VirtualBoxManagerAdvancedWidget : public QWidget50 /** QWidget extension used as Machine Manager Widget instance. */ 51 class UIMachineManagerWidget : public QWidget 56 52 { 57 53 Q_OBJECT; … … 63 59 SelectionType_SingleLocalGroupItem, 64 60 SelectionType_SingleCloudGroupItem, 65 SelectionType_FirstIsGlobalItem,66 61 SelectionType_FirstIsLocalMachineItem, 67 62 SelectionType_FirstIsCloudMachineItem … … 70 65 signals: 71 66 72 /** @name Tool-bar stuff.73 * @{ */74 /* Notifies listeners about tool-bar height change. */75 void sigToolBarHeightChange(int iHeight);76 /** @} */77 78 67 /** @name Chooser pane stuff. 79 68 * @{ */ 80 69 /** Notifies about Chooser-pane index change. */ 81 70 void sigChooserPaneIndexChange(); 71 /** Notifies about Chooser-pane selection change. */ 72 void sigChooserPaneSelectionChange(); 82 73 /** Notifies about Chooser-pane group saving change. */ 83 74 void sigGroupSavingStateChanged(); … … 85 76 void sigCloudUpdateStateChanged(); 86 77 78 /** Notifies listeners about cloud profile state change. 79 * @param strProviderShortName Brings the cloud provider short name. 80 * @param strProfileName Brings the cloud profile name. */ 81 void sigCloudProfileStateChange(const QString &strProviderShortName, 82 const QString &strProfileName); 87 83 /** Notifies about state change for cloud machine with certain @a uId. */ 88 84 void sigCloudMachineStateChange(const QUuid &uId); … … 96 92 /** @name Tools pane stuff. 97 93 * @{ */ 98 /** Notifies about Global Tool type change. */ 99 void sigToolTypeChangeGlobal(); 100 /** Notifies about Machine Tool type change. */ 101 void sigToolTypeChangeMachine(); 102 /** @} */ 103 104 /** @name Tools / Media pane stuff. 105 * @{ */ 106 /** Notifies listeners about creation procedure was requested. */ 107 void sigCreateMedium(); 108 /** Notifies listeners about copy procedure was requested for medium with specified @a uMediumId. */ 109 void sigCopyMedium(const QUuid &uMediumId); 94 /** Notifies about Tool type change. */ 95 void sigToolTypeChange(); 96 /** @} */ 97 98 /** @name Tools / Generic pane stuff. 99 * @{ */ 100 /** Notifies listeners about request to detach pane with tool type @p enmToolType. */ 101 void sigDetachToolPane(UIToolType enmToolType); 110 102 /** @} */ 111 103 … … 122 114 /** @} */ 123 115 124 /** @name Tools / Genericpane stuff.125 * @{ */ 126 /** Notifies listeners about request to detach pane with tool type @p enmToolType. */127 void sig DetachToolPane(UIToolType enmToolType);116 /** @name Tools / VM Activity pane stuff. 117 * @{ */ 118 /** Notifies listeners about request to switch to Activity Overview pane. */ 119 void sigSwitchToActivityOverviewPane(); 128 120 /** @} */ 129 121 130 122 public: 131 123 132 /** Constructs Virtual BoxManager widget. */133 UI VirtualBoxManagerAdvancedWidget(UIVirtualBoxManager*pParent);134 /** Destructs Virtual BoxManager widget. */135 virtual ~UI VirtualBoxManagerAdvancedWidget() RT_OVERRIDE;124 /** Constructs Virtual Machine Manager widget. */ 125 UIMachineManagerWidget(UIToolPaneMachine *pParent); 126 /** Destructs Virtual Machine Manager widget. */ 127 virtual ~UIMachineManagerWidget() RT_OVERRIDE; 136 128 137 129 /** @name Common stuff. 138 130 * @{ */ 139 /** Returns the action-pool instance. */131 /** Returns the action-pool reference. */ 140 132 UIActionPool *actionPool() const { return m_pActionPool; } 141 /** @} */ 142 143 /** @name Tool-bar stuff. 144 * @{ */ 145 /** Updates tool-bar menu buttons. */ 146 void updateToolBarMenuButtons(bool fSeparateMenuSection); 133 134 /** Makes manager active. */ 135 void setActive(bool fActive); 147 136 /** @} */ 148 137 … … 159 148 /** Returns whether group item is selected. */ 160 149 bool isGroupItemSelected() const; 161 /** Returns whether global item is selected. */162 bool isGlobalItemSelected() const;163 150 /** Returns whether machine item is selected. */ 164 151 bool isMachineItemSelected() const; … … 212 199 /** @name Tools pane stuff. 213 200 * @{ */ 214 /** Defines Global tools @a enmType and @a fMakeSureItsVisible if requested. */ 215 void setToolsTypeGlobal(UIToolType enmType, bool fMakeSureItsVisible = false); 216 /** Returns Global tools type. */ 217 UIToolType toolsTypeGlobal() const; 218 219 /** Defines Machine tools @a enmType. */ 220 void setToolsTypeMachine(UIToolType enmType); 221 /** Returns Machine tools type. */ 222 UIToolType toolsTypeMachine() const; 223 224 /** Returns a type of curent Global tool. */ 225 UIToolType currentGlobalTool() const; 226 /** Returns a type of curent Machine tool. */ 227 UIToolType currentMachineTool() const; 228 /** Returns whether Global tool of passed @a enmType is opened. */ 229 bool isGlobalToolOpened(UIToolType enmType) const; 230 /** Returns whether Machine tool of passed @a enmType is opened. */ 231 bool isMachineToolOpened(UIToolType enmType) const; 232 /** Switches Global tool to passed @a enmType. */ 233 void switchGlobalToolTo(UIToolType enmType); 234 /** Switches Machine tool to passed @a enmType. */ 235 void switchMachineToolTo(UIToolType enmType); 236 /** Closes Global tool of passed @a enmType. */ 237 void closeGlobalTool(UIToolType enmType); 238 /** Closes Machine tool of passed @a enmType. */ 239 void closeMachineTool(UIToolType enmType); 201 /** Returns menu tool type. */ 202 UIToolType menuToolType() const; 203 /** Defines menu tool @a enmType. */ 204 void setMenuToolType(UIToolType enmType); 205 206 /** Returns pane tool type. */ 207 UIToolType toolType() const; 208 /** Returns whether pane has tool of passed @a enmType. */ 209 bool isToolOpened(UIToolType enmType) const; 210 /** Switches pane to passed tool @a enmType. */ 211 void switchToolTo(UIToolType enmType); 212 /** Closes pane tool of passed @a enmType. */ 213 void closeTool(UIToolType enmType); 240 214 /** @} */ 241 215 … … 255 229 /** @} */ 256 230 257 public slots:258 259 /** @name Tool-bar stuff.260 * @{ */261 /** Handles tool-bar context-menu request for passed @a position. */262 void sltHandleToolBarContextMenuRequest(const QPoint &position);263 /** @} */264 265 231 private slots: 266 232 … … 277 243 /** @} */ 278 244 279 /** @name C VirtualBoxevent handling stuff.245 /** @name COM event handling stuff. 280 246 * @{ */ 281 247 /** Handles CVirtualBox event about state change for machine with @a uId. */ 282 248 void sltHandleMachineStateChange(const QUuid &uId); 283 /** @} */ 284 285 /** @name CVirtualBox extra-data event handling stuff. 286 * @{ */ 249 287 250 /** Handles signal about settings expert mode change. */ 288 251 void sltHandleSettingsExpertModeChange(); … … 294 257 void sltHandleSplitterMove(); 295 258 /** Handles request to save splitter settings. */ 296 void sltSaveSplitterSettings(); 297 /** @} */ 298 299 /** @name Tool-bar stuff. 300 * @{ */ 301 /** Handles signal about tool-bar resize to @a newSize. */ 302 void sltHandleToolBarResize(const QSize &newSize); 259 void sltHandleSplitterSettingsSave(); 303 260 /** @} */ 304 261 … … 309 266 310 267 /** Handles signal about Chooser-pane selection invalidated. */ 311 void sltHandleChooserPaneSelectionInvalidated() { recacheCurrentMachineItemInformation(true /* fDontRaiseErrorPane */); } 312 313 /** Handles state change for cloud profile with certain @a strProviderShortName and @a strProfileName. */ 314 void sltHandleCloudProfileStateChange(const QString &strProviderShortName, 315 const QString &strProfileName); 268 void sltHandleChooserPaneSelectionInvalidated(); 269 316 270 /** Handles state change for cloud machine with certain @a uId. */ 317 271 void sltHandleCloudMachineStateChange(const QUuid &uId); … … 323 277 void sltHandleToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem); 324 278 325 /** Handles signal about globalTools-menu index change.279 /** Handles signal about Tools-menu index change. 326 280 * @param enmType Brings current tool type. */ 327 void sltHandleGlobalToolsMenuIndexChange(UIToolType enmType) { switchGlobalToolTo(enmType); } 328 /** Handles signal about machine Tools-menu index change. 329 * @param enmType Brings current tool type. */ 330 void sltHandleMachineToolsMenuIndexChange(UIToolType enmType) { switchMachineToolTo(enmType); } 331 332 /** Handles signal requesting switch to Activity pane of machine with @a uMachineId. */ 333 void sltSwitchToMachineActivityPane(const QUuid &uMachineId); 334 /** Handles signal requesting switch to Resources pane. */ 335 void sltSwitchToActivityOverviewPane(); 281 void sltHandleToolsMenuIndexChange(UIToolType enmType) { switchToolTo(enmType); } 282 283 /** Handles signal requesting switch to VM Activity pane of machine with @a uMachineId. */ 284 void sltSwitchToVMActivityPane(const QUuid &uMachineId); 336 285 /** @} */ 337 286 … … 349 298 void loadSettings(); 350 299 351 /** Updates toolbar. */352 void updateToolbar();353 354 300 /** Cleanups connections. */ 355 301 void cleanupConnections(); … … 366 312 void recacheCurrentMachineItemInformation(bool fDontRaiseErrorPane = false); 367 313 368 /** Updates Global tools menu. */ 369 void updateToolsMenuGlobal(); 370 /** Updates Machine tools menu for @a pItem specified. */ 371 void updateToolsMenuMachine(UIVirtualMachineItem *pItem); 372 373 /** Handles current tool @a enmType change. */ 374 void handleCurrentToolTypeChange(UIToolType enmType); 375 /** @} */ 376 377 /** Holds the action-pool instance. */ 314 /** Updates tools menu for @a pItem specified. */ 315 void updateToolsMenu(UIVirtualMachineItem *pItem); 316 /** @} */ 317 318 /** Holds the action-pool reference. */ 378 319 UIActionPool *m_pActionPool; 379 320 380 321 /** Holds the central splitter instance. */ 381 QISplitter *m_pSplitter; 382 383 /** Holds the main toolbar instance. */ 384 QIToolBar *m_pToolBar; 385 322 QISplitter *m_pSplitter; 386 323 /** Holds the Chooser-pane instance. */ 387 UIChooser *m_pPaneChooser; 388 /** Holds the stacked-widget. */ 389 QStackedWidget *m_pStackedWidget; 390 /** Holds the Global Tools-pane instance. */ 391 UIToolPaneGlobal *m_pPaneToolsGlobal; 392 /** Holds the Machine Tools-pane instance. */ 393 UIToolPaneMachine *m_pPaneToolsMachine; 394 /** Holds the Global Tools-menu instance. */ 395 UITools *m_pMenuToolsGlobal; 396 /** Holds the Machine Tools-menu instance. */ 397 UITools *m_pMenuToolsMachine; 324 UIChooser *m_pPaneChooser; 325 /** Holds the Tools-pane instance. */ 326 UIToolPaneMachine *m_pPaneTools; 327 /** Holds the Tools-menu instance. */ 328 UITools *m_pMenuTools; 398 329 399 330 /** Holds the last selection type. */ … … 406 337 }; 407 338 408 #endif /* !FEQT_INCLUDED_SRC_manager_UI VirtualBoxManagerAdvancedWidget_h */339 #endif /* !FEQT_INCLUDED_SRC_manager_UIMachineManagerWidget_h */
Note:
See TracChangeset
for help on using the changeset viewer.