VirtualBox

Changeset 98874 in vbox for trunk/src


Ignore:
Timestamp:
Mar 8, 2023 9:34:42 AM (22 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Cleanup for UIVMInformationDialog related to UIMachine global pointer.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r98855 r98874  
    16181618
    16191619    if (!m_pVMInformationDialog)
    1620         m_pVMInformationDialog = new UIVMInformationDialog(uimachine());
     1620        m_pVMInformationDialog = new UIVMInformationDialog;
    16211621
    16221622    if (m_pVMInformationDialog)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.h

    r98769 r98874  
    5151public:
    5252
    53     /** Constructs information-tab passing @a pParent to the QWidget base-class constructor. */
     53    /** Constructs information-tab passing @a pParent to the base-class. */
    5454    UIInformationConfiguration(QWidget *pParent);
    5555
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r98803 r98874  
    515515*********************************************************************************************************************************/
    516516
    517 UIInformationRuntime::UIInformationRuntime(QWidget *pParent, const UIMachine *pMachine)
     517UIInformationRuntime::UIInformationRuntime(QWidget *pParent)
    518518    : QIWithRetranslateUI<QWidget>(pParent)
    519519    , m_pMainLayout(0)
     
    521521    , m_pCopyWholeTableAction(0)
    522522{
    523     connect(pMachine, &UIMachine::sigAdditionsStateChange, this, &UIInformationRuntime::sltGuestAdditionsStateChange);
    524     connect(pMachine, &UIMachine::sigGuestMonitorChange, this, &UIInformationRuntime::sltGuestMonitorChange);
    525     connect(pMachine, &UIMachine::sigVRDEChange, this, &UIInformationRuntime::sltVRDEChange);
    526     connect(pMachine, &UIMachine::sigClipboardModeChange, this, &UIInformationRuntime::sltClipboardChange);
    527     connect(pMachine, &UIMachine::sigDnDModeChange, this, &UIInformationRuntime::sltDnDModeChange);
     523    connect(gpMachine, &UIMachine::sigAdditionsStateChange, this, &UIInformationRuntime::sltGuestAdditionsStateChange);
     524    connect(gpMachine, &UIMachine::sigGuestMonitorChange, this, &UIInformationRuntime::sltGuestMonitorChange);
     525    connect(gpMachine, &UIMachine::sigVRDEChange, this, &UIInformationRuntime::sltVRDEChange);
     526    connect(gpMachine, &UIMachine::sigClipboardModeChange, this, &UIInformationRuntime::sltClipboardChange);
     527    connect(gpMachine, &UIMachine::sigDnDModeChange, this, &UIInformationRuntime::sltDnDModeChange);
    528528
    529529    prepareObjects();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h

    r98803 r98874  
    5252public:
    5353
    54     /** Constructs information-tab passing @a pParent to the QWidget base-class constructor. */
    55     UIInformationRuntime(QWidget *pParent, const UIMachine *pMachine);
     54    /** Constructs information-tab passing @a pParent to the base-class. */
     55    UIInformationRuntime(QWidget *pParent);
    5656
    5757protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r98803 r98874  
    5151#include "VBoxUtils.h"
    5252
    53 UIVMInformationDialog::UIVMInformationDialog(UIMachine *pMachine)
     53UIVMInformationDialog::UIVMInformationDialog()
    5454    : QMainWindowWithRestorableGeometryAndRetranslateUi(0)
    55     , m_pMachine(pMachine)
    5655    , m_pTabWidget(0)
    5756    , m_fCloseEmitted(false)
     
    156155void UIVMInformationDialog::prepare()
    157156{
    158     /* Load and clear: */
    159     AssertPtrReturnVoid(m_pMachine);
    160 
    161157    m_uMachineId = uiCommon().managedVMUuid();
    162     m_strMachineName = m_pMachine->machineName();
     158    m_strMachineName = gpMachine->machineName();
    163159#ifdef VBOX_WS_MAC
    164160    /* No window-icon on Mac OS X, because it acts as proxy icon which isn't necessary here. */
     
    218214        /* Create Runtime Information tab: */
    219215        UIInformationRuntime *pInformationRuntimeWidget =
    220             new UIInformationRuntime(this, m_pMachine);
     216            new UIInformationRuntime(this);
    221217        if (pInformationRuntimeWidget)
    222218        {
     
    227223        /* Create Performance Monitor tab: */
    228224        UIVMActivityMonitor *pVMActivityMonitorWidget =
    229             new UIVMActivityMonitor(EmbedTo_Dialog, this, m_pMachine->uisession()->machine());
     225            new UIVMActivityMonitor(EmbedTo_Dialog, this, gpMachine->uisession()->machine());
    230226        if (pVMActivityMonitorWidget)
    231227        {
    232             connect(m_pMachine, &UIMachine::sigAdditionsStateChange,
     228            connect(gpMachine, &UIMachine::sigAdditionsStateChange,
    233229                    pVMActivityMonitorWidget, &UIVMActivityMonitor::sltGuestAdditionsStateChange);
    234230            m_tabs.insert(Tabs_ActivityMonitor, pVMActivityMonitorWidget);
     
    238234        /* Create Guest Process Control tab: */
    239235        UIGuestProcessControlWidget *pGuestProcessControlWidget =
    240             new UIGuestProcessControlWidget(EmbedTo_Dialog, m_pMachine->uisession()->guest(),
     236            new UIGuestProcessControlWidget(EmbedTo_Dialog, gpMachine->uisession()->guest(),
    241237                                            this, m_strMachineName, false /* fShowToolbar */);
    242238        if (pGuestProcessControlWidget)
     
    283279void UIVMInformationDialog::loadDialogGeometry()
    284280{
    285     const QRect geo = gEDataManager->sessionInformationDialogGeometry(this, m_pMachine->activeWindow());
     281    const QRect geo = gEDataManager->sessionInformationDialogGeometry(this, gpMachine->activeWindow());
    286282    LogRel2(("GUI: UIVMInformationDialog: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n",
    287283             geo.x(), geo.y(), geo.width(), geo.height()));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h

    r98707 r98874  
    4444class QITabWidget;
    4545class QIDialogButtonBox;
    46 class UIMachine;
    4746
    4847/* Type definitions: */
     
    6362public:
    6463
    65     /** Constructs information dialog for passed @a pMachine. */
    66     UIVMInformationDialog(UIMachine *pMachine);
     64    /** Constructs information dialog. */
     65    UIVMInformationDialog();
    6766
    6867    /** Returns whether the dialog should be maximized when geometry being restored. */
     
    105104    void saveDialogGeometry();
    106105
    107     /** Holds the machine UI reference. */
    108     UIMachine *m_pMachine;
    109 
    110106    /** @name Widget variables.
    111107     * @{ */
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