VirtualBox

Changeset 75158 in vbox for trunk


Ignore:
Timestamp:
Oct 29, 2018 4:37:53 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Mental note. Two dialog almost always needs two variables.

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

Legend:

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

    r75091 r75158  
    857857    , m_fIsHidLedsSyncEnabled(false)
    858858    , m_pLogViewerDialog(0)
    859     , m_pGuestControlDialog(0)
     859    , m_pFileManagerDialog(0)
     860    , m_pProcessControlDialog(0)
    860861{
    861862}
     
    17861787
    17871788    /* Create a logviewer only if we don't have one already */
    1788     if (m_pGuestControlDialog)
    1789         return;
    1790 
    1791     QIManagerDialog *pGuestControlDialog;
     1789    if (m_pFileManagerDialog)
     1790        return;
     1791
     1792    QIManagerDialog *pFileManagerDialog;
    17921793    UIGuestControlFileManagerDialogFactory dialogFactory(actionPool(), console().GetGuest(), machine().GetName());
    1793     dialogFactory.prepare(pGuestControlDialog, activeMachineWindow());
    1794     if (pGuestControlDialog)
    1795     {
    1796         m_pGuestControlDialog = pGuestControlDialog;
     1794    dialogFactory.prepare(pFileManagerDialog, activeMachineWindow());
     1795    if (pFileManagerDialog)
     1796    {
     1797        m_pFileManagerDialog = pFileManagerDialog;
    17971798
    17981799        /* Show instance: */
    1799         pGuestControlDialog->show();
    1800         pGuestControlDialog->setWindowState(pGuestControlDialog->windowState() & ~Qt::WindowMinimized);
    1801         pGuestControlDialog->activateWindow();
    1802         connect(pGuestControlDialog, &QIManagerDialog::sigClose,
     1800        pFileManagerDialog->show();
     1801        pFileManagerDialog->setWindowState(pFileManagerDialog->windowState() & ~Qt::WindowMinimized);
     1802        pFileManagerDialog->activateWindow();
     1803        connect(pFileManagerDialog, &QIManagerDialog::sigClose,
    18031804                this, &UIMachineLogic::sltCloseGuestControlFileManagerDialog);
    18041805    }
     
    18081809{
    18091810    QIManagerDialog* pDialog = qobject_cast<QIManagerDialog*>(sender());
    1810     if (m_pGuestControlDialog != pDialog || !pDialog)
     1811    if (m_pFileManagerDialog != pDialog || !pDialog)
    18111812        return;
    18121813
    18131814    /* Set the m_pLogViewerDialog to NULL before closing the dialog. or we will have redundant deletes*/
    1814     m_pGuestControlDialog = 0;
     1815    m_pFileManagerDialog = 0;
    18151816    pDialog->close();
    18161817    UIGuestControlFileManagerDialogFactory().cleanup(pDialog);
     
    18231824
    18241825    /* Create a logviewer only if we don't have one already */
    1825     if (m_pGuestControlDialog)
    1826         return;
    1827 
    1828     QIManagerDialog *pGuestControlDialog;
     1826    if (m_pProcessControlDialog)
     1827        return;
     1828
     1829    QIManagerDialog *pProcessControlDialog;
    18291830    UIGuestProcessControlDialogFactory dialogFactory(actionPool(), console().GetGuest(), machine().GetName());
    1830     dialogFactory.prepare(pGuestControlDialog, activeMachineWindow());
    1831     if (pGuestControlDialog)
    1832     {
    1833         m_pGuestControlDialog = pGuestControlDialog;
     1831    dialogFactory.prepare(pProcessControlDialog, activeMachineWindow());
     1832    if (pProcessControlDialog)
     1833    {
     1834        m_pProcessControlDialog = pProcessControlDialog;
    18341835
    18351836        /* Show instance: */
    1836         pGuestControlDialog->show();
    1837         pGuestControlDialog->setWindowState(pGuestControlDialog->windowState() & ~Qt::WindowMinimized);
    1838         pGuestControlDialog->activateWindow();
    1839         connect(pGuestControlDialog, &QIManagerDialog::sigClose,
     1837        pProcessControlDialog->show();
     1838        pProcessControlDialog->setWindowState(pProcessControlDialog->windowState() & ~Qt::WindowMinimized);
     1839        pProcessControlDialog->activateWindow();
     1840        connect(pProcessControlDialog, &QIManagerDialog::sigClose,
    18401841                this, &UIMachineLogic::sltCloseGuestProcessControlDialog);
    18411842    }
     
    18451846{
    18461847    QIManagerDialog* pDialog = qobject_cast<QIManagerDialog*>(sender());
    1847     if (m_pGuestControlDialog != pDialog || !pDialog)
     1848    if (m_pProcessControlDialog != pDialog || !pDialog)
    18481849        return;
    18491850
    18501851    /* Set the m_pLogViewerDialog to NULL before closing the dialog. or we will have redundant deletes*/
    1851     m_pGuestControlDialog = 0;
     1852    m_pProcessControlDialog = 0;
    18521853    pDialog->close();
    18531854    UIGuestProcessControlDialogFactory().cleanup(pDialog);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r75087 r75158  
    431431    /** Holds the log viewer dialog instance. */
    432432    QIManagerDialog *m_pLogViewerDialog;
    433     QIManagerDialog *m_pGuestControlDialog;
     433    QIManagerDialog *m_pFileManagerDialog;
     434    QIManagerDialog *m_pProcessControlDialog;
    434435
    435436    /* Friend classes: */
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