VirtualBox

Changeset 108550 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 13, 2025 5:22:50 PM (5 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167947
Message:

FE/Qt: bugref:10814: VBox Manager: Cleanup for Global and Machine tool widgets.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIGlobalToolsWidget.cpp

    r108532 r108550  
    55
    66/*
    7  * Copyright (C) 2006-2024 Oracle and/or its affiliates.
     7 * Copyright (C) 2006-2025 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    7171}
    7272
    73 UIToolType UIGlobalToolsWidget::menuToolType() const
     73UIToolType UIGlobalToolsWidget::menuToolType(UIToolClass enmClass) const
    7474{
    7575    AssertPtrReturn(toolMenu(), UIToolType_Invalid);
    76     return toolMenu()->toolsType(UIToolClass_Global);
     76    return toolMenu()->toolsType(enmClass);
    7777}
    7878
     
    114114    toolPane()->openTool(enmType);
    115115
    116     /* Special handling for Machines global tool,
    117      * notify Machine tool-pane it's active: */
    118     if (enmType == UIToolType_Machines)
    119     {
    120         toolPane()->setActive(false);
    121         toolPaneMachine()->setActive(true);
    122     }
    123     /* Otherwise, notify Global tool-pane it's active: */
    124     else
    125     {
    126         toolPaneMachine()->setActive(false);
    127         toolPane()->setActive(true);
    128     }
     116    /* Notify corresponding tool-pane it's active: */
     117    toolPane()->setActive(enmType != UIToolType_Machines && enmType != UIToolType_Managers);
     118    toolPaneMachine()->setActive(enmType == UIToolType_Machines);
    129119
    130120    /* Special handling for Activities Global tool,
     
    226216    toolMenu()->setRestrictedToolTypes(UIToolClass_Global, restrictions);
    227217
    228     /* Close all restricted tools (besides the Machines): */
     218    /* Close all restricted tools (besides the Machines and Management): */
    229219    foreach (const UIToolType &enmRestrictedType, restrictedTypes)
    230         if (enmRestrictedType != UIToolType_Machines)
     220        if (   enmRestrictedType != UIToolType_Machines
     221            && enmRestrictedType != UIToolType_Managers)
    231222            toolPane()->closeTool(enmRestrictedType);
    232223}
     
    256247    toolMenu()->setRestrictedToolTypes(UIToolClass_Machine, restrictions);
    257248
     249    /// @todo finish that
    258250    // /* Disable even unrestricted tools for inacccessible VMs: */
    259251    // const bool fCurrentItemIsOk = isItemAccessible(pItem);
    260252    // toolMenu()->setItemsEnabled(fCurrentItemIsOk);
     253   
     254    /* Close all restricted tools: */
     255    foreach (const UIToolType &enmRestrictedType, restrictedTypes)
     256        toolPaneMachine()->closeTool(enmRestrictedType);
    261257}
    262258
     
    364360{
    365361    /* Acquire & select tools currently chosen in the menu: */
    366     const UIToolType enmTypeGlobal = toolMenu()->toolsType(UIToolClass_Global);
    367     const UIToolType enmTypeMachine = toolMenu()->toolsType(UIToolClass_Machine);
    368     sltHandleToolsMenuIndexChange(enmTypeGlobal);
    369     sltHandleToolsMenuIndexChange(enmTypeMachine);
     362    sltHandleToolsMenuIndexChange(toolMenu()->toolsType(UIToolClass_Global));
     363    sltHandleToolsMenuIndexChange(toolMenu()->toolsType(UIToolClass_Machine));
    370364
    371365    /* Update tools restrictions: */
     
    376370{
    377371    /* Global COM event handlers: */
     372    disconnect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineRegistered,
     373               this, &UIGlobalToolsWidget::sltHandleMachineRegistrationChanged);
    378374    disconnect(gEDataManager, &UIExtraDataManager::sigSettingsExpertModeChange,
    379375               this, &UIGlobalToolsWidget::sltHandleSettingsExpertModeChange);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIGlobalToolsWidget.h

    r108532 r108550  
    55
    66/*
    7  * Copyright (C) 2006-2024 Oracle and/or its affiliates.
     7 * Copyright (C) 2006-2025 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    7070    UIGlobalToolsWidget(QWidget *pParent, UIActionPool *pActionPool);
    7171
    72     /** @name Common stuff.
    73       * @{ */
    74         /** Returns the action-pool reference. */
    75         UIActionPool *actionPool() const { return m_pActionPool; }
    76     /** @} */
    77 
    7872    /** @name Tool-bar stuff.
    7973      * @{ */
     
    8983        UIMachineToolsWidget *machineToolsWidget() const;
    9084
    91         /** Returns menu tool type. */
    92         UIToolType menuToolType() const;
     85        /** Returns menu tool type for the @a enmClass specified. */
     86        UIToolType menuToolType(UIToolClass enmClass) const;
    9387        /** Defines menu tool @a enmType. */
    9488        void setMenuToolType(UIToolType enmType);
     
    171165    /** @} */
    172166
     167    /** @name Common stuff.
     168      * @{ */
     169        /** Returns the action-pool reference. */
     170        UIActionPool *actionPool() const { return m_pActionPool; }
     171    /** @} */
     172
    173173    /** @name Tools stuff.
    174174      * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineToolsWidget.cpp

    r108506 r108550  
    55
    66/*
    7  * Copyright (C) 2006-2024 Oracle and/or its affiliates.
     7 * Copyright (C) 2006-2025 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    528528    }
    529529
    530     /* Open tool last chosen in tools-menu: */
    531     switchToolTo(toolMenu()->toolsType(UIToolClass_Machine));
     530    /* Acquire & select tool currently chosen in the menu: */
     531    sltHandleToolsMenuIndexChange(toolMenu()->toolsType(UIToolClass_Machine));
    532532}
    533533
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineToolsWidget.h

    r108506 r108550  
    55
    66/*
    7  * Copyright (C) 2006-2024 Oracle and/or its affiliates.
     7 * Copyright (C) 2006-2025 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    9191    UIMachineToolsWidget(UIToolPane *pParent, UIActionPool *pActionPool);
    9292
    93     /** @name Common stuff.
    94       * @{ */
    95         /** Returns the action-pool reference. */
    96         UIActionPool *actionPool() const { return m_pActionPool; }
    97     /** @} */
    98 
    9993    /** @name Chooser pane stuff.
    10094      * @{ */
     
    232226    /** @} */
    233227
     228    /** @name Common stuff.
     229      * @{ */
     230        /** Returns the action-pool reference. */
     231        UIActionPool *actionPool() const { return m_pActionPool; }
     232    /** @} */
     233
    234234    /** @name Tools pane stuff.
    235235      * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxWidget.cpp

    r108532 r108550  
    225225{
    226226    AssertPtrReturn(globalToolsWidget(), UIToolType_Invalid);
    227     return globalToolsWidget()->menuToolType();
     227    return globalToolsWidget()->menuToolType(UIToolClass_Global);
    228228}
    229229
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