VirtualBox

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


Ignore:
Timestamp:
Dec 17, 2024 10:11:13 AM (4 weeks ago)
Author:
vboxsync
Message:

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

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

Legend:

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

    r107337 r107338  
    2727
    2828/* Qt includes: */
    29 // #include <QApplication>
    3029#include <QHBoxLayout>
    31 // #include <QStyle>
    32 // #include <QToolButton>
    33 // #include <QVBoxLayout>
    3430
    3531/* GUI includes: */
    36 #include "UIActionPoolManager.h"
    3732#include "UIChooser.h"
    3833#include "UICommon.h"
    3934#include "UIExtraDataManager.h"
    40 // #include "UILoggingDefs.h"
     35#include "UIGlobalToolsManagerWidget.h"
    4136#include "UIMachineManagerWidget.h"
    42 // #include "UIMessageCenter.h"
    43 #include "UINotificationCenter.h"
    44 // #include "UISlidingAnimation.h"
    45 // #include "UITabBar.h"
    4637#include "UIToolPaneGlobal.h"
    4738#include "UIToolPaneMachine.h"
    4839#include "UITools.h"
    49 // #include "UITranslationEventListener.h"
    50 // #include "UIVirtualBoxEventHandler.h"
    5140#include "UIVirtualBoxManagerAdvancedWidget.h"
    52 #include "UIGlobalToolsManagerWidget.h"
    53 // #include "UIVirtualMachineItemCloud.h"
    54 // #include "UIVirtualMachineItemLocal.h"
    55 #ifndef VBOX_WS_MAC
    56 // # include "UIMenuBar.h"
    57 #endif
     41
     42/* Other VBox includes: */
     43#include "iprt/assert.h"
    5844
    5945
     
    176162{
    177163    /* Update tools restrictions: */
    178     updateToolsMenuGlobal();
     164    updateToolsMenu();
    179165}
    180166
     
    238224        }
    239225    }
    240 
    241     /* Create notification-center: */
    242     UINotificationCenter::create(this);
    243226}
    244227
     
    291274}
    292275
    293 void UIGlobalToolsManagerWidget::cleanupWidgets()
    294 {
    295     UINotificationCenter::destroy();
    296 }
    297 
    298276void UIGlobalToolsManagerWidget::cleanup()
    299277{
    300278    /* Ask sub-dialogs to commit data: */
    301279    sltHandleCommitData();
    302 
    303     /* Cleanup everything: */
    304     cleanupWidgets();
    305280}
    306281
     
    330305}
    331306
    332 void UIGlobalToolsManagerWidget::updateToolsMenuGlobal()
     307void UIGlobalToolsManagerWidget::updateToolsMenu()
    333308{
    334309    /* Update global tools restrictions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIGlobalToolsManagerWidget.h

    r107337 r107338  
    143143        /** Cleanups connections. */
    144144        void cleanupConnections();
    145         /** Cleanups widgets. */
    146         void cleanupWidgets();
    147145        /** Cleanups all. */
    148146        void cleanup();
     
    162160        UIToolPaneMachine *toolPaneMachine() const;
    163161
    164         /** Updates Global tools menu. */
    165         void updateToolsMenuGlobal();
     162        /** Updates tools menu. */
     163        void updateToolsMenu();
    166164    /** @} */
    167165
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineManagerWidget.cpp

    r107335 r107338  
    2929#include <QHBoxLayout>
    3030#include <QTimer>
    31 #include <QVBoxLayout>
    3231
    3332/* GUI includes: */
     
    3837#include "UIExtraDataManager.h"
    3938#include "UIGlobalSession.h"
    40 #include "UILoggingDefs.h"
    41 #include "UINotificationCenter.h"
     39#include "UIMachineManagerWidget.h"
    4240#include "UIToolPaneGlobal.h"
    4341#include "UIToolPaneMachine.h"
     
    4543#include "UITranslationEventListener.h"
    4644#include "UIVirtualBoxEventHandler.h"
    47 #include "UIMachineManagerWidget.h"
    4845#include "UIVirtualMachineItemLocal.h"
    4946
     
    362359{
    363360    const QList<int> splitterSizes = m_pSplitter->sizes();
    364     LogRel2(("GUI: UIMachineManagerWidget: Saving splitter as: Size=%d,%d\n",
    365              splitterSizes.at(0), splitterSizes.at(1)));
    366361    gEDataManager->setSelectorWindowSplitterHints(splitterSizes);
    367362}
     
    495490void UIMachineManagerWidget::prepareWidgets()
    496491{
    497     /* Create main-layout: */
    498     QHBoxLayout *pLayoutMain = new QHBoxLayout(this);
    499     if (pLayoutMain)
     492    /* Create layout: */
     493    QHBoxLayout *pLayout = new QHBoxLayout(this);
     494    if (pLayout)
    500495    {
    501496        /* Configure layout: */
    502         pLayoutMain->setSpacing(0);
    503         pLayoutMain->setContentsMargins(0, 0, 0, 0);
     497        pLayout->setSpacing(0);
     498        pLayout->setContentsMargins(0, 0, 0, 0);
    504499
    505500        /* Create splitter: */
     
    515510            }
    516511
    517             /* Create right widget: */
    518             QWidget *pWidgetRight = new QWidget;
    519             if (pWidgetRight)
     512            /* Create Tools-pane: */
     513            m_pPaneTools = new UIToolPaneMachine(actionPool());
     514            if (m_pPaneTools)
    520515            {
    521                 /* Create right-layout: */
    522                 QVBoxLayout *pLayoutRight = new QVBoxLayout(pWidgetRight);
    523                 if(pLayoutRight)
    524                 {
    525                     /* Configure layout: */
    526                     pLayoutRight->setSpacing(0);
    527                     pLayoutRight->setContentsMargins(0, 0, 0, 0);
    528 
    529                     /* Create Tools-pane: */
    530                     m_pPaneTools = new UIToolPaneMachine(actionPool());
    531                     if (m_pPaneTools)
    532                     {
    533                         /// @todo make sure it's used properly
    534                         m_pPaneTools->setActive(true);
    535 
    536                         /* Add into layout: */
    537                         pLayoutRight->addWidget(m_pPaneTools, 1);
    538                     }
    539                 }
     516                /// @todo make sure it's used properly
     517                m_pPaneTools->setActive(true);
    540518
    541519                /* Add into splitter: */
    542                 m_pSplitter->addWidget(pWidgetRight);
     520                m_pSplitter->addWidget(m_pPaneTools);
    543521            }
    544522
     
    548526
    549527            /* Add into layout: */
    550             pLayoutMain->addWidget(m_pSplitter);
     528            pLayout->addWidget(m_pSplitter);
    551529        }
    552530
     
    554532        m_pMenuTools = new UITools(this, UIToolClass_Machine, actionPool());
    555533    }
    556 
    557     /* Create notification-center: */
    558     UINotificationCenter::create(this);
    559534
    560535    /* Bring the VM list to the focus: */
     
    616591            sizes[1] = (int)(width() * .9 * (2.0 / 3));
    617592        }
    618         LogRel2(("GUI: UIMachineManagerWidget: Restoring splitter to: Size=%d,%d\n",
    619                  sizes.at(0), sizes.at(1)));
    620593        m_pSplitter->setSizes(sizes);
    621594    }
     
    650623}
    651624
    652 void UIMachineManagerWidget::cleanupWidgets()
    653 {
    654     UINotificationCenter::destroy();
    655 }
    656 
    657625void UIMachineManagerWidget::cleanup()
    658626{
    659627    /* Ask sub-dialogs to commit data: */
    660628    sltHandleCommitData();
    661 
    662     /* Cleanup everything: */
    663     cleanupWidgets();
    664629}
    665630
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineManagerWidget.h

    r107335 r107338  
    276276        /** Cleanups connections. */
    277277        void cleanupConnections();
    278         /** Cleanups widgets. */
    279         void cleanupWidgets();
    280278        /** Cleanups all. */
    281279        void cleanup();
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