VirtualBox

Ignore:
Timestamp:
Jan 10, 2024 12:27:28 PM (11 months ago)
Author:
vboxsync
Message:

FE/Qt: More cleanup for UITools; Make sure selection change signal contains tool type info as well; A bit of renames also.

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

Legend:

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

    r102787 r102813  
    247247}
    248248
    249 void UIVirtualBoxManagerWidget::switchToGlobalTool(UIToolType enmType)
     249void UIVirtualBoxManagerWidget::switchGlobalToolTo(UIToolType enmType)
    250250{
    251251    /* Open corresponding tool: */
     
    259259}
    260260
    261 void UIVirtualBoxManagerWidget::switchToMachineTool(UIToolType enmType)
     261void UIVirtualBoxManagerWidget::switchMachineToolTo(UIToolType enmType)
    262262{
    263263    /* Open corresponding tool: */
     
    517517        if (fCurrentItemIsOk)
    518518        {
    519             /* If Error-pane is chosen currently => open tool currently chosen in Tools-pane: */
     519            /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */
    520520            if (m_pPaneToolsMachine->currentTool() == UIToolType_Error)
    521                 sltHandleMachineToolsPaneIndexChange();
     521                switchMachineToolTo(m_pMenuToolsMachine->toolsType());
    522522
    523523            /* If we still have same item selected: */
     
    572572    // smaller size often being ignored until it is actually shown.
    573573    pMenu->resize(ourGeo.size());
    574 }
    575 
    576 void UIVirtualBoxManagerWidget::sltHandleGlobalToolsPaneIndexChange()
    577 {
    578     switchToGlobalTool(m_pMenuToolsGlobal->toolsType());
    579 }
    580 
    581 void UIVirtualBoxManagerWidget::sltHandleMachineToolsPaneIndexChange()
    582 {
    583     switchToMachineTool(m_pMenuToolsMachine->toolsType());
    584574}
    585575
     
    820810    /* Tools-pane connections: */
    821811    connect(m_pMenuToolsGlobal, &UITools::sigSelectionChanged,
    822             this, &UIVirtualBoxManagerWidget::sltHandleGlobalToolsPaneIndexChange);
     812            this, &UIVirtualBoxManagerWidget::sltHandleGlobalToolsMenuIndexChange);
    823813    connect(m_pMenuToolsMachine, &UITools::sigSelectionChanged,
    824             this, &UIVirtualBoxManagerWidget::sltHandleMachineToolsPaneIndexChange);
     814            this, &UIVirtualBoxManagerWidget::sltHandleMachineToolsMenuIndexChange);
    825815}
    826816
     
    846836    }
    847837
    848     /* Open tools last chosen in Tools-pane: */
    849     switchToGlobalTool(m_pMenuToolsGlobal->toolsType());
    850     switchToMachineTool(m_pMenuToolsMachine->toolsType());
     838    /* Open tools last chosen in Tools-menu: */
     839    switchGlobalToolTo(m_pMenuToolsGlobal->toolsType());
     840    switchMachineToolTo(m_pMenuToolsMachine->toolsType());
    851841}
    852842
     
    10741064    /* Tools-pane connections: */
    10751065    disconnect(m_pMenuToolsGlobal, &UITools::sigSelectionChanged,
    1076                this, &UIVirtualBoxManagerWidget::sltHandleGlobalToolsPaneIndexChange);
     1066               this, &UIVirtualBoxManagerWidget::sltHandleGlobalToolsMenuIndexChange);
    10771067    disconnect(m_pMenuToolsMachine, &UITools::sigSelectionChanged,
    1078                this, &UIVirtualBoxManagerWidget::sltHandleMachineToolsPaneIndexChange);
     1068               this, &UIVirtualBoxManagerWidget::sltHandleMachineToolsMenuIndexChange);
    10791069}
    10801070
     
    11501140    if (fCurrentItemIsOk)
    11511141    {
    1152         /* If Error-pane is chosen currently => open tool currently chosen in Tools-pane: */
     1142        /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */
    11531143        if (m_pPaneToolsMachine->currentTool() == UIToolType_Error)
    1154             sltHandleMachineToolsPaneIndexChange();
     1144            switchMachineToolTo(m_pMenuToolsMachine->toolsType());
    11551145
    11561146        /* Propagate current items to the Tools pane: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r102787 r102813  
    222222        /** Returns whether Machine tool of passed @a enmType is opened. */
    223223        bool isMachineToolOpened(UIToolType enmType) const;
    224         /** Switches to Global tool of passed @a enmType. */
    225         void switchToGlobalTool(UIToolType enmType);
    226         /** Switches to Machine tool of passed @a enmType. */
    227         void switchToMachineTool(UIToolType enmType);
     224        /** Switches Global tool to passed @a enmType. */
     225        void switchGlobalToolTo(UIToolType enmType);
     226        /** Switches Machine tool to passed @a enmType. */
     227        void switchMachineToolTo(UIToolType enmType);
    228228        /** Closes Global tool of passed @a enmType. */
    229229        void closeGlobalTool(UIToolType enmType);
     
    324324        void sltHandleToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem);
    325325
    326         /** Handles signal about global Tools-pane index change. */
    327         void sltHandleGlobalToolsPaneIndexChange();
    328         /** Handles signal about machine Tools-pane index change. */
    329         void sltHandleMachineToolsPaneIndexChange();
     326        /** Handles signal about global Tools-menu index change.
     327          * @param  enmType  Brings current tool type. */
     328        void sltHandleGlobalToolsMenuIndexChange(UIToolType enmType) { switchGlobalToolTo(enmType); }
     329        /** Handles signal about machine Tools-menu index change.
     330          * @param  enmType  Brings current tool type. */
     331        void sltHandleMachineToolsMenuIndexChange(UIToolType enmType) { switchMachineToolTo(enmType); }
    330332
    331333        /** Handles signal requesting switch to Activity pane of machine with @a uMachineId. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UITools.h

    r102107 r102813  
    5555    /** @name General stuff.
    5656      * @{ */
    57         /** Notifies listeners about selection changed. */
    58         void sigSelectionChanged();
     57        /** Notifies listeners about selection changed.
     58          * @param  enmType  Brings current tool type. */
     59        void sigSelectionChanged(UIToolType enmType);
    5960
    6061        /** Notifies listeners about expanding started. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp

    r102812 r102813  
    219219
    220220    /* Notify about selection change: */
    221     emit sigSelectionChanged();
     221    emit sigSelectionChanged(toolsType());
    222222
    223223    /* Move focus to current-item: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.h

    r102812 r102813  
    7272    /** @name Selection stuff.
    7373      * @{ */
    74         /** Notifies about selection changed. */
    75         void sigSelectionChanged();
     74        /** Notifies about selection changed.
     75          * @param  enmType  Brings current tool type. */
     76        void sigSelectionChanged(UIToolType enmType);
    7677        /** Notifies about focus changed. */
    7778        void sigFocusChanged();
Note: See TracChangeset for help on using the changeset viewer.

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