VirtualBox

Ignore:
Timestamp:
Oct 1, 2008 11:48:04 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37282
Message:

Debugger: parenting, menu, destroy on close

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/VBoxDbgGui.cpp

    r12878 r12884  
    4343VBoxDbgGui::VBoxDbgGui() :
    4444    m_pDbgStats(NULL), m_pDbgConsole(NULL), m_pSession(NULL), m_pConsole(NULL),
    45     m_pMachineDebugger(NULL), m_pMachine(NULL), m_pVM(NULL), m_x(0), m_y(0), m_cx(0), m_cy(0),
    46     m_xDesktop(0), m_yDesktop(0), m_cxDesktop(0), m_cyDesktop(0)
     45    m_pMachineDebugger(NULL), m_pMachine(NULL), m_pVM(NULL),
     46    m_pParent(NULL), m_pMenu(NULL),
     47    m_x(0), m_y(0), m_cx(0), m_cy(0), m_xDesktop(0), m_yDesktop(0), m_cxDesktop(0), m_cyDesktop(0)
    4748{
    4849
     
    107108VBoxDbgGui::~VBoxDbgGui()
    108109{
    109 
    110 #ifndef VBOXDBG_USE_QT4
    111110    if (m_pDbgStats)
    112111    {
     
    114113        m_pDbgStats = NULL;
    115114    }
    116 #endif
    117115
    118116    if (m_pDbgConsole)
     
    149147}
    150148
     149void
     150VBoxDbgGui::setParent(QWidget *pParent)
     151{
     152    m_pParent = pParent;
     153}
     154
     155
     156void
     157#ifdef VBOXDBG_USE_QT4
     158VBoxDbgGui::setMenu(QMenu *pMenu)
     159#else
     160VBoxDbgGui::setMenu(QPopupMenu *pMenu)
     161#endif
     162{
     163    m_pMenu = pMenu;
     164}
     165
    151166
    152167int
     
    155170    if (!m_pDbgStats)
    156171    {
    157         m_pDbgStats = new VBoxDbgStats(m_pVM, "*");
     172        m_pDbgStats = new VBoxDbgStats(m_pVM, "*", 0, m_pParent);
    158173        connect(m_pDbgStats, SIGNAL(destroyed(QObject *)), this, SLOT(notifyChildDestroyed(QObject *)));
    159174        repositionStatistics();
    160175    }
     176
    161177    m_pDbgStats->show();
     178#ifdef VBOXDBG_USE_QT4 /** @todo this isn't working right. */
     179    m_pDbgStats->setWindowState(m_pDbgStats->windowState() & ~Qt::WindowMinimized);
     180    //m_pDbgStats->activateWindow();
     181    //m_pDbgStats->setFocus();
     182#endif
     183
    162184    return VINF_SUCCESS;
    163185}
     
    183205    if (!m_pDbgConsole)
    184206    {
    185         m_pDbgConsole = new VBoxDbgConsole(m_pVM);
     207        m_pDbgConsole = new VBoxDbgConsole(m_pVM, m_pParent);
    186208        connect(m_pDbgConsole, SIGNAL(destroyed(QObject *)), this, SLOT(notifyChildDestroyed(QObject *)));
    187209        repositionConsole();
    188210    }
     211
    189212    m_pDbgConsole->show();
     213#ifdef VBOXDBG_USE_QT4 /** @todo this ain't working right. */
     214    m_pDbgConsole->setWindowState(m_pDbgConsole->windowState() & ~Qt::WindowMinimized);
     215    //m_pDbgConsole->activateWindow();
     216    //m_pDbgConsole->setFocus();
     217#endif
     218
    190219    return VINF_SUCCESS;
    191220}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette