VirtualBox

Changeset 51002 in vbox


Ignore:
Timestamp:
Apr 8, 2014 3:03:47 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
93188
Message:

FE/Qt: VM Information Dialog rework/cleanup: Re-parent VBoxVMInformationDialog class inheritance from QIMainDialog to QMainWindow.

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

Legend:

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

    r50841 r51002  
    2525#include <QTimer>
    2626#include <QScrollBar>
     27#include <QPushButton>
    2728
    2829/* GUI includes: */
     
    6061    {
    6162        /* Creating new information dialog if there is no one existing */
    62         VBoxVMInformationDlg *id = new VBoxVMInformationDlg(pMachineWindow, Qt::Window);
    63         id->centerAccording (pMachineWindow);
    64         // TODO_NEW_CORE: this seems not necessary, cause we set WA_DeleteOnClose.
     63        VBoxVMInformationDlg *id = new VBoxVMInformationDlg(pMachineWindow);
    6564        id->setAttribute (Qt::WA_DeleteOnClose);
    6665        mSelfArray [machine.GetName()] = id;
     
    7473}
    7574
    76 VBoxVMInformationDlg::VBoxVMInformationDlg (UIMachineWindow *pMachineWindow, Qt::WindowFlags aFlags)
    77 # ifdef Q_WS_MAC
    78     : QIWithRetranslateUI2 <QIMainDialog> (pMachineWindow, aFlags)
    79 # else /* Q_WS_MAC */
    80     : QIWithRetranslateUI2 <QIMainDialog> (0, aFlags)
    81 # endif /* Q_WS_MAC */
     75VBoxVMInformationDlg::VBoxVMInformationDlg (UIMachineWindow *pMachineWindow)
     76    : QIWithRetranslateUI<QMainWindow>(0)
     77    , m_pPseudoParentWidget(pMachineWindow)
    8278    , mSession (pMachineWindow->session())
    8379    , mIsPolished (false)
     
    9692#endif
    9793
    98     /* Enable size grip without using a status bar. */
    99     setSizeGripEnabled (true);
    100 
    10194    /* Setup focus-proxy for pages */
    10295    mPage1->setFocusProxy (mDetailsText);
     
    110103    mDetailsText->setViewportMargins (5, 5, 5, 5);
    111104    mStatisticText->setViewportMargins (5, 5, 5, 5);
     105
     106    /* Configure dialog button-box: */
     107    mButtonBox->button(QDialogButtonBox::Close)->setShortcut(Qt::Key_Escape);
    112108
    113109    /* Setup handlers */
     
    331327bool VBoxVMInformationDlg::event (QEvent *aEvent)
    332328{
    333     bool result = QIMainDialog::event (aEvent);
     329    bool result = QMainWindow::event (aEvent);
    334330    switch (aEvent->type())
    335331    {
     
    350346void VBoxVMInformationDlg::resizeEvent (QResizeEvent *aEvent)
    351347{
    352     QIMainDialog::resizeEvent (aEvent);
     348    QMainWindow::resizeEvent (aEvent);
    353349
    354350    /* Store dialog size for this vm */
     
    369365    if (!mIsPolished)
    370366    {
    371         /* Load window size and state */
     367        /* Load window size, adjust position and load window state finally: */
    372368        resize (mWidth, mHeight);
     369        vboxGlobal().centerWidget(this, m_pPseudoParentWidget, false);
    373370        if (mMax)
    374371            QTimer::singleShot (0, this, SLOT (showMaximized()));
     
    377374    }
    378375
    379     QIMainDialog::showEvent (aEvent);
     376    QMainWindow::showEvent (aEvent);
    380377}
    381378
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.h

    r44528 r51002  
    2020#define __VBoxVMInformationDlg_h__
    2121
    22 /* Local includes: */
     22/* Qt includes: */
     23#include <QMainWindow>
     24
     25/* GUI includes: */
    2326#include "VBoxVMInformationDlg.gen.h"
    24 #include "QIMainDialog.h"
    2527#include "QIWithRetranslateUI.h"
    2628
     
    3234class QTimer;
    3335
    34 class VBoxVMInformationDlg : public QIWithRetranslateUI2 <QIMainDialog>, public Ui::VBoxVMInformationDlg
     36class VBoxVMInformationDlg : public QIWithRetranslateUI<QMainWindow>, public Ui::VBoxVMInformationDlg
    3537{
    3638    Q_OBJECT;
     
    4749protected:
    4850
    49     VBoxVMInformationDlg (UIMachineWindow *pMachineWindow, Qt::WindowFlags aFlags);
     51    VBoxVMInformationDlg(UIMachineWindow *pMachineWindow);
    5052   ~VBoxVMInformationDlg();
    5153
     
    7577    static InfoDlgMap  mSelfArray;
    7678
     79    /** Widget to center UIMediumManager according. */
     80    QWidget           *m_pPseudoParentWidget;
     81
    7782    CSession           mSession;
    7883    bool               mIsPolished;
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