VirtualBox

Changeset 107299 in vbox


Ignore:
Timestamp:
Dec 12, 2024 2:02:39 PM (5 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10814: VBox Manager: Make sure Chooser and Tool panes have no dependency from VBox Manager widget as it should be possible to create them from other widgets.

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

Legend:

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

    r107289 r107299  
    763763
    764764        /* Create Global Tools-menu: */
    765         m_pMenuToolsGlobal = new UITools(UIToolClass_Global, this);
     765        m_pMenuToolsGlobal = new UITools(this, UIToolClass_Global, actionPool());
    766766        /* Create Machine Tools-menu: */
    767         m_pMenuToolsMachine = new UITools(UIToolClass_Machine, this);
     767        m_pMenuToolsMachine = new UITools(this, UIToolClass_Machine, actionPool());
    768768    }
    769769
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r107289 r107299  
    804804
    805805        /* Create Global Tools-menu: */
    806         m_pMenuToolsGlobal = new UITools(UIToolClass_Global, this);
     806        m_pMenuToolsGlobal = new UITools(this, UIToolClass_Global, actionPool());
    807807        /* Create Machine Tools-menu: */
    808         m_pMenuToolsMachine = new UITools(UIToolClass_Machine, this);
     808        m_pMenuToolsMachine = new UITools(this, UIToolClass_Machine, actionPool());
    809809    }
    810810
     
    866866    connect(m_pPaneChooser, &UIChooser::sigMachineSearchWidgetVisibilityChanged,
    867867            this, &UIVirtualBoxManagerWidget::sigMachineSearchWidgetVisibilityChanged);
     868    connect(this, &UIVirtualBoxManagerWidget::sigToolBarHeightChange,
     869            m_pPaneChooser, &UIChooser::setGlobalItemHeightHint);
    868870
    869871    /* Details-pane connections: */
     
    11211123    disconnect(m_pPaneChooser, &UIChooser::sigMachineSearchWidgetVisibilityChanged,
    11221124               this, &UIVirtualBoxManagerWidget::sigMachineSearchWidgetVisibilityChanged);
     1125    disconnect(this, &UIVirtualBoxManagerWidget::sigToolBarHeightChange,
     1126               m_pPaneChooser, &UIChooser::setGlobalItemHeightHint);
    11231127
    11241128    /* Details-pane connections: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp

    r107286 r107299  
    3333#include "UIChooserModel.h"
    3434#include "UIChooserView.h"
    35 #ifndef VBOX_GUI_WITH_ADVANCED_WIDGETS
    36 # include "UIVirtualBoxManagerWidget.h"
    37 #else
    38 # include "UIVirtualBoxManagerAdvancedWidget.h"
    39 #endif
    4035#include "UIVirtualMachineItem.h"
    4136
    4237
    43 UIChooser::UIChooser(UIVirtualBoxManagerWidget *pParent, UIActionPool *pActionPool)
     38UIChooser::UIChooser(QWidget *pParent, UIActionPool *pActionPool)
    4439    : QWidget(pParent)
    45     , m_pParent(pParent)
    4640    , m_pActionPool(pActionPool)
    4741    , m_pChooserModel(0)
     
    283277    AssertPtrReturnVoid(model());
    284278    AssertPtrReturnVoid(view());
    285 
    286     /* Parent connections: */
    287     connect(m_pParent, &UIVirtualBoxManagerWidget::sigToolBarHeightChange,
    288             this, &UIChooser::setGlobalItemHeightHint);
    289279
    290280    /* Abstract Chooser-model connections: */
     
    369359    disconnect(view(), &UIChooserView::sigSearchWidgetVisibilityChanged,
    370360               this, &UIChooser::sigMachineSearchWidgetVisibilityChanged);
    371 
    372     /* Parent connections: */
    373     disconnect(m_pParent, &UIVirtualBoxManagerWidget::sigToolBarHeightChange,
    374                this, &UIChooser::setGlobalItemHeightHint);
    375361}
    376362
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h

    r107286 r107299  
    3737/* GUI includes: */
    3838#include "UIExtraDataDefs.h"
    39 #include "UIManagerDefs.h"
    4039
    4140/* Forward declarations: */
     
    4443class UIChooserView;
    4544class UIVirtualMachineItem;
    46 class UIVirtualBoxManagerWidget;
    4745class UIVirtualMachineItemCloud;
    4846
     
    106104    /** Constructs Chooser-pane passing @a pParent to the base-class.
    107105      * @param  pActionPool  Brings the action-pool reference.  */
    108     UIChooser(UIVirtualBoxManagerWidget *pParent, UIActionPool *pActionPool);
     106    UIChooser(QWidget *pParent, UIActionPool *pActionPool);
    109107    /** Destructs Chooser-pane. */
    110108    virtual ~UIChooser() RT_OVERRIDE;
     
    239237    /** @name General stuff.
    240238      * @{ */
    241         /** Holds the parent reference. */
    242         UIVirtualBoxManagerWidget *m_pParent;
    243 
    244239        /** Holds the action-pool reference. */
    245240        UIActionPool *m_pActionPool;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UITools.cpp

    r107286 r107299  
    3333#include "UIToolsModel.h"
    3434#include "UIToolsView.h"
    35 #ifndef VBOX_GUI_WITH_ADVANCED_WIDGETS
    36 # include "UIVirtualBoxManagerWidget.h"
    37 #else
    38 # include "UIVirtualBoxManagerAdvancedWidget.h"
    39 #endif
    4035
    4136/* Other VBox includes: */
     
    4338
    4439
    45 UITools::UITools(UIToolClass enmClass, UIVirtualBoxManagerWidget *pParent /* = 0 */)
     40UITools::UITools(QWidget *pParent, UIToolClass enmClass, UIActionPool *pActionPool)
    4641    : QWidget(pParent, Qt::Popup)
    4742    , m_enmClass(enmClass)
    48     , m_pManagerWidget(pParent)
     43    , m_pActionPool(pActionPool)
    4944    , m_pMainLayout(0)
    5045    , m_pToolsModel(0)
     
    5651UIActionPool *UITools::actionPool() const
    5752{
    58     return managerWidget()->actionPool();
     53    return m_pActionPool;
    5954}
    6055
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UITools.h

    r107286 r107299  
    3737/* GUI icludes: */
    3838#include "UIExtraDataDefs.h"
    39 #include "UIManagerDefs.h"
    4039
    4140/* Forward declarations: */
     
    4544class UIToolsModel;
    4645class UIToolsView;
    47 class UIVirtualBoxManagerWidget;
    4846
    4947/** QWidget extension used as VM Tools-pane. */
     
    6967
    7068    /** Constructs Tools-pane passing @a pParent to the base-class.
    71       * @param  Brings the tools class, it will be fixed one. */
    72     UITools(UIToolClass enmClass, UIVirtualBoxManagerWidget *pParent = 0);
     69      * @param  enmClass     Brings the tools class, it will be fixed one.
     70      * @param  pActionPool  Brings the action-pool reference. */
     71    UITools(QWidget *pParent, UIToolClass enmClass, UIActionPool *pActionPool);
    7372
    7473    /** @name General stuff.
    7574      * @{ */
    76         /** Returns the manager-widget reference. */
    77         UIVirtualBoxManagerWidget *managerWidget() const { return m_pManagerWidget; }
    78 
    7975        /** Returns the action-pool reference. */
    8076        UIActionPool *actionPool() const;
     
    130126        const UIToolClass  m_enmClass;
    131127
    132         /** Holds the manager-widget reference. */
    133         UIVirtualBoxManagerWidget *m_pManagerWidget;
     128        /** Holds the action-pool reference. */
     129        UIActionPool *m_pActionPool;
    134130
    135         /** Holds the main layout instane. */
     131        /** Holds the main layout instance. */
    136132        QVBoxLayout  *m_pMainLayout;
    137         /** Holds the Tools-model instane. */
     133        /** Holds the Tools-model instance. */
    138134        UIToolsModel *m_pToolsModel;
    139         /** Holds the Tools-view instane. */
     135        /** Holds the Tools-view instance. */
    140136        UIToolsView  *m_pToolsView;
    141137    /** @} */
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