VirtualBox

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


Ignore:
Timestamp:
May 28, 2020 2:47:42 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: Tool-bar functionality cleanup.

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

Legend:

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

    r84558 r84595  
    15451545            this, &UIVirtualBoxManager::sltCurrentSnapshotItemChange);
    15461546    connect(menuBar(), &QMenuBar::customContextMenuRequested,
    1547             m_pWidget, &UIVirtualBoxManagerWidget::sltHandleContextMenuRequest);
     1547            m_pWidget, &UIVirtualBoxManagerWidget::sltHandleToolBarContextMenuRequest);
    15481548
    15491549    /* Global VBox event handlers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r84582 r84595  
    230230}
    231231
    232 void UIVirtualBoxManagerWidget::sltHandleContextMenuRequest(const QPoint &position)
     232void UIVirtualBoxManagerWidget::sltHandleToolBarContextMenuRequest(const QPoint &position)
    233233{
    234234    /* Populate toolbar actions: */
     
    277277    m_pToolBar->updateLayout();
    278278#endif
     279}
     280
     281void UIVirtualBoxManagerWidget::sltHandleToolBarResize(const QSize &newSize)
     282{
     283    emit sigToolBarHeightChange(newSize.height());
    279284}
    280285
     
    623628{
    624629    /* Tool-bar connections: */
     630    connect(m_pToolBar, &UIToolBar::customContextMenuRequested,
     631            this, &UIVirtualBoxManagerWidget::sltHandleToolBarContextMenuRequest);
    625632    connect(m_pToolBar, &UIToolBar::sigResized,
    626             m_pPaneChooser, &UIChooser::sltHandleToolbarResize);
    627     connect(m_pToolBar, &UIToolBar::customContextMenuRequested,
    628             this, &UIVirtualBoxManagerWidget::sltHandleContextMenuRequest);
     633            this, &UIVirtualBoxManagerWidget::sltHandleToolBarResize);
    629634
    630635    /* Chooser-pane connections: */
     636    connect(this, &UIVirtualBoxManagerWidget::sigToolBarHeightChange,
     637            m_pPaneChooser, &UIChooser::setGlobalItemHeightHint);
    631638    connect(m_pPaneChooser, &UIChooser::sigSelectionChanged,
    632639            this, &UIVirtualBoxManagerWidget::sltHandleChooserPaneIndexChange);
     
    877884{
    878885    /* Tool-bar connections: */
     886    disconnect(m_pToolBar, &UIToolBar::customContextMenuRequested,
     887               this, &UIVirtualBoxManagerWidget::sltHandleToolBarContextMenuRequest);
    879888    disconnect(m_pToolBar, &UIToolBar::sigResized,
    880                m_pPaneChooser, &UIChooser::sltHandleToolbarResize);
    881     disconnect(m_pToolBar, &UIToolBar::customContextMenuRequested,
    882                this, &UIVirtualBoxManagerWidget::sltHandleContextMenuRequest);
     889               this, &UIVirtualBoxManagerWidget::sltHandleToolBarResize);
    883890
    884891    /* Chooser-pane connections: */
     892    disconnect(this, &UIVirtualBoxManagerWidget::sigToolBarHeightChange,
     893               m_pPaneChooser, &UIChooser::setGlobalItemHeightHint);
    885894    disconnect(m_pPaneChooser, &UIChooser::sigSelectionChanged,
    886895               this, &UIVirtualBoxManagerWidget::sltHandleChooserPaneIndexChange);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r84557 r84595  
    5757
    5858signals:
     59
     60    /** @name Tool-bar stuff.
     61      * @{ */
     62        /* Notifies listeners about tool-bar height change. */
     63        void sigToolBarHeightChange(int iHeight);
     64    /** @} */
    5965
    6066    /** @name Chooser pane stuff.
     
    193199public slots:
    194200
    195     /** @name Chooser pane stuff.
    196       * @{ */
    197         /** Handles context-menu request for passed @a position. */
    198         void sltHandleContextMenuRequest(const QPoint &position);
     201    /** @name Tool-bar stuff.
     202      * @{ */
     203        /** Handles tool-bar context-menu request for passed @a position. */
     204        void sltHandleToolBarContextMenuRequest(const QPoint &position);
    199205    /** @} */
    200206
     
    208214
    209215private slots:
     216
     217    /** @name Tool-bar stuff.
     218      * @{ */
     219        /** Handles signal about tool-bar resize to @a newSize. */
     220        void sltHandleToolBarResize(const QSize &newSize);
     221    /** @} */
    210222
    211223    /** @name Chooser pane stuff.
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp

    r84592 r84595  
    4040}
    4141
     42bool UIChooser::isGroupSavingInProgress() const
     43{
     44    AssertPtrReturn(model(), false);
     45    return model()->isGroupSavingInProgress();
     46}
     47
    4248UIVirtualMachineItem *UIChooser::currentItem() const
    4349{
     
    100106}
    101107
    102 bool UIChooser::isGroupSavingInProgress() const
    103 {
    104     AssertPtrReturn(model(), false);
    105     return model()->isGroupSavingInProgress();
    106 }
    107 
    108108void UIChooser::openGroupNameEditor()
    109109{
     
    160160}
    161161
    162 void UIChooser::sltHandleToolbarResize(const QSize &newSize)
    163 {
    164     /* Pass height to a model: */
    165     AssertPtrReturnVoid(model());
    166     model()->setGlobalItemHeightHint(newSize.height());
     162void UIChooser::setGlobalItemHeightHint(int iHeight)
     163{
     164    AssertPtrReturnVoid(model());
     165    model()->setGlobalItemHeightHint(iHeight);
    167166}
    168167
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h

    r84592 r84595  
    9999    /** @} */
    100100
     101    /** @name Group saving stuff.
     102      * @{ */
     103        /** Returns whether group saving is in progress. */
     104        bool isGroupSavingInProgress() const;
     105    /** @} */
     106
    101107    /** @name Current-item stuff.
    102108      * @{ */
     
    124130        /** Returns full name of currently selected group. */
    125131        QString fullGroupName() const;
    126     /** @} */
    127 
    128     /** @name Group saving stuff.
    129       * @{ */
    130         /** Returns whether group saving is in progress. */
    131         bool isGroupSavingInProgress() const;
    132132    /** @} */
    133133
     
    156156public slots:
    157157
    158     /** @name General stuff.
    159       * @{ */
    160         /** Handles toolbar resize to @a newSize. */
    161         void sltHandleToolbarResize(const QSize &newSize);
     158    /** @name Layout stuff.
     159      * @{ */
     160        /** Defines global item @a iHeight. */
     161        void setGlobalItemHeightHint(int iHeight);
    162162    /** @} */
    163163
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