VirtualBox

Ignore:
Timestamp:
Dec 12, 2024 2:24:24 PM (5 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166332
Message:

FE/Qt: bugref:10814: VBox Manager: Clone out Machine Manager code from the Advanced VBox Manager widget.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r107287 r107301  
    706706else
    707707 VirtualBox_QT_MOCHDRS += \
     708        src/manager/UIMachineManagerWidget.h \
    708709        src/manager/UIVirtualBoxManagerAdvancedWidget.h
    709710endif
     
    12401241else
    12411242 VirtualBox_SOURCES += \
     1243        src/manager/UIMachineManagerWidget.cpp \
    12421244        src/manager/UIVirtualBoxManagerAdvancedWidget.cpp
    12431245endif
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineManagerWidget.cpp

    r107299 r107301  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVirtualBoxManagerAdvancedWidget class implementation.
     3 * VBox Qt GUI - UIMachineManagerWidget class implementation.
    44 */
    55
     
    2727
    2828/* Qt includes: */
    29 #include <QApplication>
    3029#include <QHBoxLayout>
    31 #include <QStackedWidget>
    32 #include <QStyle>
    3330#include <QTimer>
    34 #include <QToolButton>
    3531#include <QVBoxLayout>
    3632
    3733/* GUI includes: */
    3834#include "QISplitter.h"
    39 #include "QIToolBar.h"
    40 #include "UIActionPoolManager.h"
    4135#include "UIChooser.h"
    4236#include "UICommon.h"
     
    4539#include "UIGlobalSession.h"
    4640#include "UILoggingDefs.h"
    47 #include "UIMessageCenter.h"
    4841#include "UINotificationCenter.h"
    49 #include "UISlidingAnimation.h"
    50 #include "UITabBar.h"
    51 #include "UIToolPaneGlobal.h"
    5242#include "UIToolPaneMachine.h"
    5343#include "UITools.h"
    5444#include "UITranslationEventListener.h"
    5545#include "UIVirtualBoxEventHandler.h"
    56 #include "UIVirtualBoxManager.h"
    57 #include "UIVirtualBoxManagerAdvancedWidget.h"
    58 #include "UIVirtualMachineItemCloud.h"
     46#include "UIMachineManagerWidget.h"
    5947#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
     50UIMachineManagerWidget::UIMachineManagerWidget(UIToolPaneMachine *pParent)
    7551    : m_pActionPool(pParent->actionPool())
    7652    , m_pSplitter(0)
    77     , m_pToolBar(0)
    7853    , 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)
    8456    , m_enmSelectionType(SelectionType_Invalid)
    8557    , m_fSelectedMachineItemAccessible(false)
     
    8961}
    9062
    91 UIVirtualBoxManagerAdvancedWidget::~UIVirtualBoxManagerAdvancedWidget()
     63UIMachineManagerWidget::~UIMachineManagerWidget()
    9264{
    9365    cleanup();
    9466}
    9567
    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
     68void UIMachineManagerWidget::setActive(bool fActive)
     69{
     70    m_pPaneTools->setActive(fActive);
     71}
     72
     73UIVirtualMachineItem *UIMachineManagerWidget::currentItem() const
    10474{
    10575    return m_pPaneChooser->currentItem();
    10676}
    10777
    108 QList<UIVirtualMachineItem*> UIVirtualBoxManagerAdvancedWidget::currentItems() const
     78QList<UIVirtualMachineItem*> UIMachineManagerWidget::currentItems() const
    10979{
    11080    return m_pPaneChooser->currentItems();
    11181}
    11282
    113 bool UIVirtualBoxManagerAdvancedWidget::isItemAccessible(UIVirtualMachineItem *pItem /* = 0 */) const
     83bool UIMachineManagerWidget::isItemAccessible(UIVirtualMachineItem *pItem /* = 0 */) const
    11484{
    11585    if (!pItem)
     
    11888}
    11989
    120 bool UIVirtualBoxManagerAdvancedWidget::isGroupItemSelected() const
     90bool UIMachineManagerWidget::isGroupItemSelected() const
    12191{
    12292    return m_pPaneChooser->isGroupItemSelected();
    12393}
    12494
    125 bool UIVirtualBoxManagerAdvancedWidget::isGlobalItemSelected() const
    126 {
    127     return m_pPaneChooser->isGlobalItemSelected();
    128 }
    129 
    130 bool UIVirtualBoxManagerAdvancedWidget::isMachineItemSelected() const
     95bool UIMachineManagerWidget::isMachineItemSelected() const
    13196{
    13297    return m_pPaneChooser->isMachineItemSelected();
    13398}
    13499
    135 bool UIVirtualBoxManagerAdvancedWidget::isLocalMachineItemSelected() const
     100bool UIMachineManagerWidget::isLocalMachineItemSelected() const
    136101{
    137102    return m_pPaneChooser->isLocalMachineItemSelected();
    138103}
    139104
    140 bool UIVirtualBoxManagerAdvancedWidget::isCloudMachineItemSelected() const
     105bool UIMachineManagerWidget::isCloudMachineItemSelected() const
    141106{
    142107    return m_pPaneChooser->isCloudMachineItemSelected();
    143108}
    144109
    145 bool UIVirtualBoxManagerAdvancedWidget::isSingleGroupSelected() const
     110bool UIMachineManagerWidget::isSingleGroupSelected() const
    146111{
    147112    return m_pPaneChooser->isSingleGroupSelected();
    148113}
    149114
    150 bool UIVirtualBoxManagerAdvancedWidget::isSingleLocalGroupSelected() const
     115bool UIMachineManagerWidget::isSingleLocalGroupSelected() const
    151116{
    152117    return m_pPaneChooser->isSingleLocalGroupSelected();
    153118}
    154119
    155 bool UIVirtualBoxManagerAdvancedWidget::isSingleCloudProviderGroupSelected() const
     120bool UIMachineManagerWidget::isSingleCloudProviderGroupSelected() const
    156121{
    157122    return m_pPaneChooser->isSingleCloudProviderGroupSelected();
    158123}
    159124
    160 bool UIVirtualBoxManagerAdvancedWidget::isSingleCloudProfileGroupSelected() const
     125bool UIMachineManagerWidget::isSingleCloudProfileGroupSelected() const
    161126{
    162127    return m_pPaneChooser->isSingleCloudProfileGroupSelected();
    163128}
    164129
    165 bool UIVirtualBoxManagerAdvancedWidget::isAllItemsOfOneGroupSelected() const
     130bool UIMachineManagerWidget::isAllItemsOfOneGroupSelected() const
    166131{
    167132    return m_pPaneChooser->isAllItemsOfOneGroupSelected();
    168133}
    169134
    170 UIVirtualBoxManagerAdvancedWidget::SelectionType UIVirtualBoxManagerAdvancedWidget::selectionType() const
     135UIMachineManagerWidget::SelectionType UIMachineManagerWidget::selectionType() const
    171136{
    172137    return   isSingleLocalGroupSelected()
     
    174139           : isSingleCloudProviderGroupSelected() || isSingleCloudProfileGroupSelected()
    175140           ? SelectionType_SingleCloudGroupItem
    176            : isGlobalItemSelected()
    177            ? SelectionType_FirstIsGlobalItem
    178141           : isLocalMachineItemSelected()
    179142           ? SelectionType_FirstIsLocalMachineItem
     
    183146}
    184147
    185 QString UIVirtualBoxManagerAdvancedWidget::fullGroupName() const
     148QString UIMachineManagerWidget::fullGroupName() const
    186149{
    187150    return m_pPaneChooser->fullGroupName();
    188151}
    189152
    190 bool UIVirtualBoxManagerAdvancedWidget::isGroupSavingInProgress() const
     153bool UIMachineManagerWidget::isGroupSavingInProgress() const
    191154{
    192155    return m_pPaneChooser->isGroupSavingInProgress();
    193156}
    194157
    195 bool UIVirtualBoxManagerAdvancedWidget::isCloudProfileUpdateInProgress() const
     158bool UIMachineManagerWidget::isCloudProfileUpdateInProgress() const
    196159{
    197160    return m_pPaneChooser->isCloudProfileUpdateInProgress();
    198161}
    199162
    200 void UIVirtualBoxManagerAdvancedWidget::openGroupNameEditor()
     163void UIMachineManagerWidget::openGroupNameEditor()
    201164{
    202165    m_pPaneChooser->openGroupNameEditor();
    203166}
    204167
    205 void UIVirtualBoxManagerAdvancedWidget::disbandGroup()
     168void UIMachineManagerWidget::disbandGroup()
    206169{
    207170    m_pPaneChooser->disbandGroup();
    208171}
    209172
    210 void UIVirtualBoxManagerAdvancedWidget::removeMachine()
     173void UIMachineManagerWidget::removeMachine()
    211174{
    212175    m_pPaneChooser->removeMachine();
    213176}
    214177
    215 void UIVirtualBoxManagerAdvancedWidget::moveMachineToGroup(const QString &strName /* = QString() */)
     178void UIMachineManagerWidget::moveMachineToGroup(const QString &strName /* = QString() */)
    216179{
    217180    m_pPaneChooser->moveMachineToGroup(strName);
    218181}
    219182
    220 QStringList UIVirtualBoxManagerAdvancedWidget::possibleGroupsForMachineToMove(const QUuid &uId)
     183QStringList UIMachineManagerWidget::possibleGroupsForMachineToMove(const QUuid &uId)
    221184{
    222185    return m_pPaneChooser->possibleGroupsForMachineToMove(uId);
    223186}
    224187
    225 QStringList UIVirtualBoxManagerAdvancedWidget::possibleGroupsForGroupToMove(const QString &strFullName)
     188QStringList UIMachineManagerWidget::possibleGroupsForGroupToMove(const QString &strFullName)
    226189{
    227190    return m_pPaneChooser->possibleGroupsForGroupToMove(strFullName);
    228191}
    229192
    230 void UIVirtualBoxManagerAdvancedWidget::refreshMachine()
     193void UIMachineManagerWidget::refreshMachine()
    231194{
    232195    m_pPaneChooser->refreshMachine();
    233196}
    234197
    235 void UIVirtualBoxManagerAdvancedWidget::sortGroup()
     198void UIMachineManagerWidget::sortGroup()
    236199{
    237200    m_pPaneChooser->sortGroup();
    238201}
    239202
    240 void UIVirtualBoxManagerAdvancedWidget::setMachineSearchWidgetVisibility(bool fVisible)
     203void UIMachineManagerWidget::setMachineSearchWidgetVisibility(bool fVisible)
    241204{
    242205    m_pPaneChooser->setMachineSearchWidgetVisibility(fVisible);
    243206}
    244207
    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)
     208UIToolType UIMachineManagerWidget::menuToolType() const
     209{
     210    return m_pMenuTools ? m_pMenuTools->toolsType() : UIToolType_Invalid;
     211}
     212
     213void UIMachineManagerWidget::setMenuToolType(UIToolType enmType)
     214{
     215    m_pMenuTools->setToolsType(enmType);
     216}
     217
     218UIToolType UIMachineManagerWidget::toolType() const
     219{
     220    return m_pPaneTools ? m_pPaneTools->currentTool() : UIToolType_Invalid;
     221}
     222
     223bool UIMachineManagerWidget::isToolOpened(UIToolType enmType) const
     224{
     225    return m_pPaneTools ? m_pPaneTools->isToolOpened(enmType) : false;
     226}
     227
     228void UIMachineManagerWidget::switchToolTo(UIToolType enmType)
    297229{
    298230    /* Open corresponding tool: */
    299     m_pPaneToolsGlobal->openTool(enmType);
     231    m_pPaneTools->openTool(enmType);
    300232
    301233    /* 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
     237void UIMachineManagerWidget::closeTool(UIToolType enmType)
     238{
     239    m_pPaneTools->closeTool(enmType);
     240}
     241
     242bool UIMachineManagerWidget::isCurrentStateItemSelected() const
     243{
     244    return m_pPaneTools->isCurrentStateItemSelected();
     245}
     246
     247QUuid UIMachineManagerWidget::currentSnapshotId()
     248{
     249    return m_pPaneTools->currentSnapshotId();
     250}
     251
     252QString UIMachineManagerWidget::currentHelpKeyword() const
    347253{
    348254    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();
    353257    return strHelpKeyword;
    354258}
    355259
    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()
     260void UIMachineManagerWidget::sltRetranslateUI()
    387261{
    388262    /* Make sure chosen item fetched: */
     
    390264}
    391265
    392 void UIVirtualBoxManagerAdvancedWidget::sltHandleCommitData()
     266void UIMachineManagerWidget::sltHandleCommitData()
    393267{
    394268    // WORKAROUND:
     
    398272}
    399273
    400 void UIVirtualBoxManagerAdvancedWidget::sltHandleMachineStateChange(const QUuid &uId)
     274void UIMachineManagerWidget::sltHandleMachineStateChange(const QUuid &uId)
    401275{
    402276    // WORKAROUND:
     
    420294}
    421295
    422 void UIVirtualBoxManagerAdvancedWidget::sltHandleSettingsExpertModeChange()
    423 {
    424     /* Update toolbar to show/hide corresponding actions: */
    425     updateToolbar();
    426 
     296void UIMachineManagerWidget::sltHandleSettingsExpertModeChange()
     297{
    427298    /* 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
     304void UIMachineManagerWidget::sltHandleSplitterMove()
    435305{
    436306    /* Create timer if isn't exist already: */
     
    443313            m_pSplitterSettingsSaveTimer->setSingleShot(true);
    444314            connect(m_pSplitterSettingsSaveTimer, &QTimer::timeout,
    445                     this, &UIVirtualBoxManagerAdvancedWidget::sltSaveSplitterSettings);
     315                    this, &UIMachineManagerWidget::sltHandleSplitterSettingsSave);
    446316        }
    447317    }
     
    450320}
    451321
    452 void UIVirtualBoxManagerAdvancedWidget::sltSaveSplitterSettings()
     322void UIMachineManagerWidget::sltHandleSplitterSettingsSave()
    453323{
    454324    const QList<int> splitterSizes = m_pSplitter->sizes();
    455     LogRel2(("GUI: UIVirtualBoxManagerAdvancedWidget: Saving splitter as: Size=%d,%d\n",
     325    LogRel2(("GUI: UIMachineManagerWidget: Saving splitter as: Size=%d,%d\n",
    456326             splitterSizes.at(0), splitterSizes.at(1)));
    457327    gEDataManager->setSelectorWindowSplitterHints(splitterSizes);
    458328}
    459329
    460 void UIVirtualBoxManagerAdvancedWidget::sltHandleToolBarResize(const QSize &newSize)
    461 {
    462     emit sigToolBarHeightChange(newSize.height());
    463 }
    464 
    465 void UIVirtualBoxManagerAdvancedWidget::sltHandleChooserPaneIndexChange()
     330void UIMachineManagerWidget::sltHandleChooserPaneIndexChange()
    466331{
    467332    /* Let the parent know: */
    468333    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     else
    482 
    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     }
    493334
    494335    /* Update tools restrictions for currently selected item: */
    495336    UIVirtualMachineItem *pItem = currentItem();
    496337    if (pItem)
    497         updateToolsMenuMachine(pItem);
    498     else
    499         updateToolsMenuGlobal();
     338        updateToolsMenu(pItem);
    500339
    501340    /* Recache current machine item information: */
     
    509348    if (   m_enmSelectionType != enmSelectedItemType
    510349        || m_fSelectedMachineItemAccessible != fCurrentItemIsOk)
    511         updateToolbar();
     350        emit sigChooserPaneSelectionChange();
    512351
    513352    /* Remember selection type and item accessibility status: */
     
    516355}
    517356
    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 
     357void UIMachineManagerWidget::sltHandleChooserPaneSelectionInvalidated()
     358{
     359    recacheCurrentMachineItemInformation(true /* fDontRaiseErrorPane */);
     360}
     361
     362void UIMachineManagerWidget::sltHandleCloudMachineStateChange(const QUuid &uId)
     363{
    535364    /* Acquire current item: */
    536365    UIVirtualMachineItem *pItem = currentItem();
     
    541370    {
    542371        /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */
    543         if (m_pPaneToolsMachine->currentTool() == UIToolType_Error)
    544             switchMachineToolTo(m_pMenuToolsMachine->toolsType());
     372        if (m_pPaneTools->currentTool() == UIToolType_Error)
     373            switchToolTo(m_pMenuTools->toolsType());
    545374
    546375        /* If we still have same item selected: */
     
    548377        {
    549378            /* Propagate current items to update the Details-pane: */
    550             m_pPaneToolsMachine->setItems(currentItems());
     379            m_pPaneTools->setItems(currentItems());
    551380        }
    552381    }
     
    554383    {
    555384        /* Make sure Error pane raised: */
    556         if (m_pPaneToolsMachine->currentTool() != UIToolType_Error)
    557             m_pPaneToolsMachine->openTool(UIToolType_Error);
     385        if (m_pPaneTools->currentTool() != UIToolType_Error)
     386            m_pPaneTools->openTool(UIToolType_Error);
    558387
    559388        /* If we still have same item selected: */
     
    561390        {
    562391            /* Propagate current items to update the Details-pane (in any case): */
    563             m_pPaneToolsMachine->setItems(currentItems());
     392            m_pPaneTools->setItems(currentItems());
    564393            /* Propagate last access error to update the Error-pane (if machine selected but inaccessible): */
    565             m_pPaneToolsMachine->setErrorDetails(pItem->accessError());
     394            m_pPaneTools->setErrorDetails(pItem->accessError());
    566395        }
    567396    }
     
    571400}
    572401
    573 void UIVirtualBoxManagerAdvancedWidget::sltHandleToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem)
     402void UIMachineManagerWidget::sltHandleToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem)
    574403{
    575404    /* Update tools menu beforehand: */
    576     UITools *pMenu = pItem ? m_pMenuToolsMachine : m_pMenuToolsGlobal;
     405    UITools *pMenu = pItem ? m_pMenuTools : 0;
    577406    AssertPtrReturnVoid(pMenu);
    578407    if (pItem)
    579         updateToolsMenuMachine(pItem);
    580     else
    581         updateToolsMenuGlobal();
     408        updateToolsMenu(pItem);
    582409
    583410    /* Compose popup-menu geometry first of all: */
     
    596423}
    597424
    598 void UIVirtualBoxManagerAdvancedWidget::sltSwitchToMachineActivityPane(const QUuid &uMachineId)
     425void UIMachineManagerWidget::sltSwitchToVMActivityPane(const QUuid &uMachineId)
    599426{
    600427    AssertPtrReturnVoid(m_pPaneChooser);
    601     AssertPtrReturnVoid(m_pMenuToolsMachine);
     428    AssertPtrReturnVoid(m_pMenuTools);
    602429    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
     433void UIMachineManagerWidget::prepare()
    615434{
    616435    /* Prepare everything: */
     
    624443    sltRetranslateUI();
    625444    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
    626             this, &UIVirtualBoxManagerAdvancedWidget::sltRetranslateUI);
     445            this, &UIMachineManagerWidget::sltRetranslateUI);
    627446
    628447    /* Make sure current Chooser-pane index fetched: */
     
    630449}
    631450
    632 void UIVirtualBoxManagerAdvancedWidget::prepareWidgets()
     451void UIMachineManagerWidget::prepareWidgets()
    633452{
    634453    /* Create main-layout: */
     
    664483                    pLayoutRight->setContentsMargins(0, 0, 0, 0);
    665484
    666                     /* Create Main toolbar: */
    667                     m_pToolBar = new QIToolBar;
    668                     if (m_pToolBar)
     485                    /* Create Tools-pane: */
     486                    m_pPaneTools = new UIToolPaneMachine(actionPool());
     487                    if (m_pPaneTools)
    669488                    {
    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);
    746496
    747497                        /* Add into layout: */
    748                         pLayoutRight->addWidget(m_pStackedWidget, 1);
     498                        pLayoutRight->addWidget(m_pPaneTools, 1);
    749499                    }
    750500                }
     
    762512        }
    763513
    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());
    768516    }
    769517
     
    771519    UINotificationCenter::create(this);
    772520
    773     /* Update toolbar finally: */
    774     updateToolbar();
    775 
    776521    /* Bring the VM list to the focus: */
    777522    m_pPaneChooser->setFocus();
    778523}
    779524
    780 void UIVirtualBoxManagerAdvancedWidget::prepareConnections()
     525void UIMachineManagerWidget::prepareConnections()
    781526{
    782527    /* UICommon connections: */
    783528    connect(&uiCommon(), &UICommon::sigAskToCommitData,
    784             this, &UIVirtualBoxManagerAdvancedWidget::sltHandleCommitData);
    785 
    786     /* Global VBox event handlers: */
     529            this, &UIMachineManagerWidget::sltHandleCommitData);
     530
     531    /* Global COM event handlers: */
    787532    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange,
    788             this, &UIVirtualBoxManagerAdvancedWidget::sltHandleMachineStateChange);
    789 
    790     /* Global VBox extra-data event handlers: */
     533            this, &UIMachineManagerWidget::sltHandleMachineStateChange);
    791534    connect(gEDataManager, &UIExtraDataManager::sigSettingsExpertModeChange,
    792             this, &UIVirtualBoxManagerAdvancedWidget::sltHandleSettingsExpertModeChange);
     535            this, &UIMachineManagerWidget::sltHandleSettingsExpertModeChange);
    793536
    794537    /* Splitter connections: */
    795538    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);
    803540
    804541    /* Chooser-pane connections: */
    805542    connect(m_pPaneChooser, &UIChooser::sigSelectionChanged,
    806             this, &UIVirtualBoxManagerAdvancedWidget::sltHandleChooserPaneIndexChange);
     543            this, &UIMachineManagerWidget::sltHandleChooserPaneIndexChange);
    807544    connect(m_pPaneChooser, &UIChooser::sigSelectionInvalidated,
    808             this, &UIVirtualBoxManagerAdvancedWidget::sltHandleChooserPaneSelectionInvalidated);
     545            this, &UIMachineManagerWidget::sltHandleChooserPaneSelectionInvalidated);
    809546    connect(m_pPaneChooser, &UIChooser::sigToggleStarted,
    810             m_pPaneToolsMachine, &UIToolPaneMachine::sigToggleStarted);
     547            m_pPaneTools, &UIToolPaneMachine::sigToggleStarted);
    811548    connect(m_pPaneChooser, &UIChooser::sigToggleFinished,
    812             m_pPaneToolsMachine, &UIToolPaneMachine::sigToggleFinished);
     549            m_pPaneTools, &UIToolPaneMachine::sigToggleFinished);
    813550    connect(m_pPaneChooser, &UIChooser::sigGroupSavingStateChanged,
    814             this, &UIVirtualBoxManagerAdvancedWidget::sigGroupSavingStateChanged);
     551            this, &UIMachineManagerWidget::sigGroupSavingStateChanged);
    815552    connect(m_pPaneChooser, &UIChooser::sigCloudUpdateStateChanged,
    816             this, &UIVirtualBoxManagerAdvancedWidget::sigCloudUpdateStateChanged);
     553            this, &UIMachineManagerWidget::sigCloudUpdateStateChanged);
    817554    connect(m_pPaneChooser, &UIChooser::sigToolMenuRequested,
    818             this, &UIVirtualBoxManagerAdvancedWidget::sltHandleToolMenuRequested);
     555            this, &UIMachineManagerWidget::sltHandleToolMenuRequested);
    819556    connect(m_pPaneChooser, &UIChooser::sigCloudProfileStateChange,
    820             this, &UIVirtualBoxManagerAdvancedWidget::sltHandleCloudProfileStateChange);
     557            this, &UIMachineManagerWidget::sigCloudProfileStateChange);
    821558    connect(m_pPaneChooser, &UIChooser::sigCloudMachineStateChange,
    822             this, &UIVirtualBoxManagerAdvancedWidget::sltHandleCloudMachineStateChange);
     559            this, &UIMachineManagerWidget::sltHandleCloudMachineStateChange);
    823560    connect(m_pPaneChooser, &UIChooser::sigStartOrShowRequest,
    824             this, &UIVirtualBoxManagerAdvancedWidget::sigStartOrShowRequest);
     561            this, &UIMachineManagerWidget::sigStartOrShowRequest);
    825562    connect(m_pPaneChooser, &UIChooser::sigMachineSearchWidgetVisibilityChanged,
    826             this, &UIVirtualBoxManagerAdvancedWidget::sigMachineSearchWidgetVisibilityChanged);
     563            this, &UIMachineManagerWidget::sigMachineSearchWidgetVisibilityChanged);
    827564
    828565    /* Details-pane connections: */
    829     connect(m_pPaneToolsMachine, &UIToolPaneMachine::sigLinkClicked,
    830             this, &UIVirtualBoxManagerAdvancedWidget::sigMachineSettingsLinkClicked);
     566    connect(m_pPaneTools, &UIToolPaneMachine::sigLinkClicked,
     567            this, &UIMachineManagerWidget::sigMachineSettingsLinkClicked);
    831568
    832569    /* 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
     574void UIMachineManagerWidget::loadSettings()
    840575{
    841576    /* Restore splitter handle position: */
     
    848583            sizes[1] = (int)(width() * .9 * (2.0 / 3));
    849584        }
    850         LogRel2(("GUI: UIVirtualBoxManagerAdvancedWidget: Restoring splitter to: Size=%d,%d\n",
     585        LogRel2(("GUI: UIMachineManagerWidget: Restoring splitter to: Size=%d,%d\n",
    851586                 sizes.at(0), sizes.at(1)));
    852587        m_pSplitter->setSizes(sizes);
    853588    }
    854589
    855     /* Restore toolbar settings: */
    856     {
    857         m_pToolBar->setUseTextLabels(gEDataManager->selectorWindowToolBarTextVisible());
    858     }
    859 
    860590    /* 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
     594void UIMachineManagerWidget::cleanupConnections()
     595{
    1059596    /* Chooser-pane connections: */
    1060597    disconnect(m_pPaneChooser, &UIChooser::sigSelectionChanged,
    1061                this, &UIVirtualBoxManagerAdvancedWidget::sltHandleChooserPaneIndexChange);
     598               this, &UIMachineManagerWidget::sltHandleChooserPaneIndexChange);
    1062599    disconnect(m_pPaneChooser, &UIChooser::sigSelectionInvalidated,
    1063                this, &UIVirtualBoxManagerAdvancedWidget::sltHandleChooserPaneSelectionInvalidated);
     600               this, &UIMachineManagerWidget::sltHandleChooserPaneSelectionInvalidated);
    1064601    disconnect(m_pPaneChooser, &UIChooser::sigToggleStarted,
    1065                m_pPaneToolsMachine, &UIToolPaneMachine::sigToggleStarted);
     602               m_pPaneTools, &UIToolPaneMachine::sigToggleStarted);
    1066603    disconnect(m_pPaneChooser, &UIChooser::sigToggleFinished,
    1067                m_pPaneToolsMachine, &UIToolPaneMachine::sigToggleFinished);
     604               m_pPaneTools, &UIToolPaneMachine::sigToggleFinished);
    1068605    disconnect(m_pPaneChooser, &UIChooser::sigGroupSavingStateChanged,
    1069                this, &UIVirtualBoxManagerAdvancedWidget::sigGroupSavingStateChanged);
     606               this, &UIMachineManagerWidget::sigGroupSavingStateChanged);
    1070607    disconnect(m_pPaneChooser, &UIChooser::sigCloudUpdateStateChanged,
    1071                this, &UIVirtualBoxManagerAdvancedWidget::sigCloudUpdateStateChanged);
     608               this, &UIMachineManagerWidget::sigCloudUpdateStateChanged);
    1072609    disconnect(m_pPaneChooser, &UIChooser::sigToolMenuRequested,
    1073                this, &UIVirtualBoxManagerAdvancedWidget::sltHandleToolMenuRequested);
     610               this, &UIMachineManagerWidget::sltHandleToolMenuRequested);
    1074611    disconnect(m_pPaneChooser, &UIChooser::sigCloudProfileStateChange,
    1075                this, &UIVirtualBoxManagerAdvancedWidget::sltHandleCloudProfileStateChange);
     612               this, &UIMachineManagerWidget::sigCloudProfileStateChange);
    1076613    disconnect(m_pPaneChooser, &UIChooser::sigCloudMachineStateChange,
    1077                this, &UIVirtualBoxManagerAdvancedWidget::sltHandleCloudMachineStateChange);
     614               this, &UIMachineManagerWidget::sltHandleCloudMachineStateChange);
    1078615    disconnect(m_pPaneChooser, &UIChooser::sigStartOrShowRequest,
    1079                this, &UIVirtualBoxManagerAdvancedWidget::sigStartOrShowRequest);
     616               this, &UIMachineManagerWidget::sigStartOrShowRequest);
    1080617    disconnect(m_pPaneChooser, &UIChooser::sigMachineSearchWidgetVisibilityChanged,
    1081                this, &UIVirtualBoxManagerAdvancedWidget::sigMachineSearchWidgetVisibilityChanged);
     618               this, &UIMachineManagerWidget::sigMachineSearchWidgetVisibilityChanged);
    1082619
    1083620    /* Details-pane connections: */
    1084     disconnect(m_pPaneToolsMachine, &UIToolPaneMachine::sigLinkClicked,
    1085                this, &UIVirtualBoxManagerAdvancedWidget::sigMachineSettingsLinkClicked);
     621    disconnect(m_pPaneTools, &UIToolPaneMachine::sigLinkClicked,
     622               this, &UIMachineManagerWidget::sigMachineSettingsLinkClicked);
    1086623
    1087624    /* 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
     629void UIMachineManagerWidget::cleanupWidgets()
    1095630{
    1096631    UINotificationCenter::destroy();
    1097632}
    1098633
    1099 void UIVirtualBoxManagerAdvancedWidget::cleanup()
     634void UIMachineManagerWidget::cleanup()
    1100635{
    1101636    /* Ask sub-dialogs to commit data: */
     
    1106641}
    1107642
    1108 void UIVirtualBoxManagerAdvancedWidget::recacheCurrentMachineItemInformation(bool fDontRaiseErrorPane /* = false */)
     643void UIMachineManagerWidget::recacheCurrentMachineItemInformation(bool fDontRaiseErrorPane /* = false */)
    1109644{
    1110645    /* Sanity check, this method is for machine or group of machine items: */
     
    1120655    {
    1121656        /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */
    1122         if (m_pPaneToolsMachine->currentTool() == UIToolType_Error)
    1123             switchMachineToolTo(m_pMenuToolsMachine->toolsType());
     657        if (m_pPaneTools->currentTool() == UIToolType_Error)
     658            switchToolTo(m_pMenuTools->toolsType());
    1124659
    1125660        /* Propagate current items to the Tools pane: */
    1126         m_pPaneToolsMachine->setItems(currentItems());
     661        m_pPaneTools->setItems(currentItems());
    1127662    }
    1128663    /* Otherwise if we were not asked separately to calm down: */
     
    1130665    {
    1131666        /* Make sure Error pane raised: */
    1132         if (m_pPaneToolsMachine->currentTool() != UIToolType_Error)
    1133             m_pPaneToolsMachine->openTool(UIToolType_Error);
     667        if (m_pPaneTools->currentTool() != UIToolType_Error)
     668            m_pPaneTools->openTool(UIToolType_Error);
    1134669
    1135670        /* Propagate last access error to the Error-pane: */
    1136671        if (pItem)
    1137             m_pPaneToolsMachine->setErrorDetails(pItem->accessError());
     672            m_pPaneTools->setErrorDetails(pItem->accessError());
    1138673    }
    1139674}
    1140675
    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)
     676void UIMachineManagerWidget::updateToolsMenu(UIVirtualMachineItem *pItem)
    1160677{
    1161678    /* Get current item state: */
     
    1171688                        << UIToolType_Logs
    1172689                        << UIToolType_FileManager;
    1173     if (restrictedTypes.contains(m_pMenuToolsMachine->toolsType()))
    1174         m_pMenuToolsMachine->setToolsType(UIToolType_Details);
     690    if (restrictedTypes.contains(m_pMenuTools->toolsType()))
     691        m_pMenuTools->setToolsType(UIToolType_Details);
    1175692    const QList restrictions(restrictedTypes.begin(), restrictedTypes.end());
    1176     m_pMenuToolsMachine->setRestrictedToolTypes(restrictions);
     693    m_pMenuTools->setRestrictedToolTypes(restrictions);
    1177694    /* Update machine menu items availability: */
    1178     m_pMenuToolsMachine->setItemsEnabled(fCurrentItemIsOk);
     695    m_pMenuTools->setItemsEnabled(fCurrentItemIsOk);
    1179696
    1180697    /* Take restrictions into account, closing all restricted tools: */
    1181698    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  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVirtualBoxManagerAdvancedWidget class declaration.
     3 * VBox Qt GUI - UIMachineManagerWidget class declaration.
    44 */
    55
     
    2626 */
    2727
    28 #ifndef FEQT_INCLUDED_SRC_manager_UIVirtualBoxManagerAdvancedWidget_h
    29 #define FEQT_INCLUDED_SRC_manager_UIVirtualBoxManagerAdvancedWidget_h
     28#ifndef FEQT_INCLUDED_SRC_manager_UIMachineManagerWidget_h
     29#define FEQT_INCLUDED_SRC_manager_UIMachineManagerWidget_h
    3030#ifndef RT_WITHOUT_PRAGMA_ONCE
    3131# pragma once
     
    4040
    4141/* Forward declarations: */
    42 class QStackedWidget;
    4342class QTimer;
    4443class QISplitter;
    45 class QIToolBar;
    4644class UIActionPool;
    4745class UIChooser;
    48 class UIToolPaneGlobal;
    4946class UIToolPaneMachine;
    5047class UITools;
    51 class UIVirtualBoxManager;
    5248class UIVirtualMachineItem;
    5349
    54 /** QWidget extension used as VirtualBox Manager Widget instance. */
    55 class UIVirtualBoxManagerAdvancedWidget : public QWidget
     50/** QWidget extension used as Machine Manager Widget instance. */
     51class UIMachineManagerWidget : public QWidget
    5652{
    5753    Q_OBJECT;
     
    6359        SelectionType_SingleLocalGroupItem,
    6460        SelectionType_SingleCloudGroupItem,
    65         SelectionType_FirstIsGlobalItem,
    6661        SelectionType_FirstIsLocalMachineItem,
    6762        SelectionType_FirstIsCloudMachineItem
     
    7065signals:
    7166
    72     /** @name Tool-bar stuff.
    73       * @{ */
    74         /* Notifies listeners about tool-bar height change. */
    75         void sigToolBarHeightChange(int iHeight);
    76     /** @} */
    77 
    7867    /** @name Chooser pane stuff.
    7968      * @{ */
    8069        /** Notifies about Chooser-pane index change. */
    8170        void sigChooserPaneIndexChange();
     71        /** Notifies about Chooser-pane selection change. */
     72        void sigChooserPaneSelectionChange();
    8273        /** Notifies about Chooser-pane group saving change. */
    8374        void sigGroupSavingStateChanged();
     
    8576        void sigCloudUpdateStateChanged();
    8677
     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);
    8783        /** Notifies about state change for cloud machine with certain @a uId. */
    8884        void sigCloudMachineStateChange(const QUuid &uId);
     
    9692    /** @name Tools pane stuff.
    9793      * @{ */
    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);
    110102    /** @} */
    111103
     
    122114    /** @} */
    123115
    124     /** @name Tools / Generic pane stuff.
    125       * @{ */
    126         /** Notifies listeners about request to detach pane with tool type @p enmToolType. */
    127         void sigDetachToolPane(UIToolType enmToolType);
     116    /** @name Tools / VM Activity pane stuff.
     117      * @{ */
     118        /** Notifies listeners about request to switch to Activity Overview pane. */
     119        void sigSwitchToActivityOverviewPane();
    128120    /** @} */
    129121
    130122public:
    131123
    132     /** Constructs VirtualBox Manager widget. */
    133     UIVirtualBoxManagerAdvancedWidget(UIVirtualBoxManager *pParent);
    134     /** Destructs VirtualBox Manager widget. */
    135     virtual ~UIVirtualBoxManagerAdvancedWidget() RT_OVERRIDE;
     124    /** Constructs Virtual Machine Manager widget. */
     125    UIMachineManagerWidget(UIToolPaneMachine *pParent);
     126    /** Destructs Virtual Machine Manager widget. */
     127    virtual ~UIMachineManagerWidget() RT_OVERRIDE;
    136128
    137129    /** @name Common stuff.
    138130      * @{ */
    139         /** Returns the action-pool instance. */
     131        /** Returns the action-pool reference. */
    140132        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);
    147136    /** @} */
    148137
     
    159148        /** Returns whether group item is selected. */
    160149        bool isGroupItemSelected() const;
    161         /** Returns whether global item is selected. */
    162         bool isGlobalItemSelected() const;
    163150        /** Returns whether machine item is selected. */
    164151        bool isMachineItemSelected() const;
     
    212199    /** @name Tools pane stuff.
    213200      * @{ */
    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);
    240214    /** @} */
    241215
     
    255229    /** @} */
    256230
    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 
    265231private slots:
    266232
     
    277243    /** @} */
    278244
    279     /** @name CVirtualBox event handling stuff.
     245    /** @name COM event handling stuff.
    280246      * @{ */
    281247        /** Handles CVirtualBox event about state change for machine with @a uId. */
    282248        void sltHandleMachineStateChange(const QUuid &uId);
    283     /** @} */
    284 
    285     /** @name CVirtualBox extra-data event handling stuff.
    286       * @{ */
     249
    287250        /** Handles signal about settings expert mode change. */
    288251        void sltHandleSettingsExpertModeChange();
     
    294257        void sltHandleSplitterMove();
    295258        /** 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();
    303260    /** @} */
    304261
     
    309266
    310267        /** 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
    316270        /** Handles state change for cloud machine with certain @a uId. */
    317271        void sltHandleCloudMachineStateChange(const QUuid &uId);
     
    323277        void sltHandleToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem);
    324278
    325         /** Handles signal about global Tools-menu index change.
     279        /** Handles signal about Tools-menu index change.
    326280          * @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);
    336285    /** @} */
    337286
     
    349298        void loadSettings();
    350299
    351         /** Updates toolbar. */
    352         void updateToolbar();
    353 
    354300        /** Cleanups connections. */
    355301        void cleanupConnections();
     
    366312        void recacheCurrentMachineItemInformation(bool fDontRaiseErrorPane = false);
    367313
    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. */
    378319    UIActionPool *m_pActionPool;
    379320
    380321    /** 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;
    386323    /** 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;
    398329
    399330    /** Holds the last selection type. */
     
    406337};
    407338
    408 #endif /* !FEQT_INCLUDED_SRC_manager_UIVirtualBoxManagerAdvancedWidget_h */
     339#endif /* !FEQT_INCLUDED_SRC_manager_UIMachineManagerWidget_h */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette