Changeset 51002 in vbox
- Timestamp:
- Apr 8, 2014 3:03:47 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93188
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp
r50841 r51002 25 25 #include <QTimer> 26 26 #include <QScrollBar> 27 #include <QPushButton> 27 28 28 29 /* GUI includes: */ … … 60 61 { 61 62 /* 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); 65 64 id->setAttribute (Qt::WA_DeleteOnClose); 66 65 mSelfArray [machine.GetName()] = id; … … 74 73 } 75 74 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 */ 75 VBoxVMInformationDlg::VBoxVMInformationDlg (UIMachineWindow *pMachineWindow) 76 : QIWithRetranslateUI<QMainWindow>(0) 77 , m_pPseudoParentWidget(pMachineWindow) 82 78 , mSession (pMachineWindow->session()) 83 79 , mIsPolished (false) … … 96 92 #endif 97 93 98 /* Enable size grip without using a status bar. */99 setSizeGripEnabled (true);100 101 94 /* Setup focus-proxy for pages */ 102 95 mPage1->setFocusProxy (mDetailsText); … … 110 103 mDetailsText->setViewportMargins (5, 5, 5, 5); 111 104 mStatisticText->setViewportMargins (5, 5, 5, 5); 105 106 /* Configure dialog button-box: */ 107 mButtonBox->button(QDialogButtonBox::Close)->setShortcut(Qt::Key_Escape); 112 108 113 109 /* Setup handlers */ … … 331 327 bool VBoxVMInformationDlg::event (QEvent *aEvent) 332 328 { 333 bool result = Q IMainDialog::event (aEvent);329 bool result = QMainWindow::event (aEvent); 334 330 switch (aEvent->type()) 335 331 { … … 350 346 void VBoxVMInformationDlg::resizeEvent (QResizeEvent *aEvent) 351 347 { 352 Q IMainDialog::resizeEvent (aEvent);348 QMainWindow::resizeEvent (aEvent); 353 349 354 350 /* Store dialog size for this vm */ … … 369 365 if (!mIsPolished) 370 366 { 371 /* Load window size and state*/367 /* Load window size, adjust position and load window state finally: */ 372 368 resize (mWidth, mHeight); 369 vboxGlobal().centerWidget(this, m_pPseudoParentWidget, false); 373 370 if (mMax) 374 371 QTimer::singleShot (0, this, SLOT (showMaximized())); … … 377 374 } 378 375 379 Q IMainDialog::showEvent (aEvent);376 QMainWindow::showEvent (aEvent); 380 377 } 381 378 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.h
r44528 r51002 20 20 #define __VBoxVMInformationDlg_h__ 21 21 22 /* Local includes: */ 22 /* Qt includes: */ 23 #include <QMainWindow> 24 25 /* GUI includes: */ 23 26 #include "VBoxVMInformationDlg.gen.h" 24 #include "QIMainDialog.h"25 27 #include "QIWithRetranslateUI.h" 26 28 … … 32 34 class QTimer; 33 35 34 class VBoxVMInformationDlg : public QIWithRetranslateUI 2 <QIMainDialog>, public Ui::VBoxVMInformationDlg36 class VBoxVMInformationDlg : public QIWithRetranslateUI<QMainWindow>, public Ui::VBoxVMInformationDlg 35 37 { 36 38 Q_OBJECT; … … 47 49 protected: 48 50 49 VBoxVMInformationDlg (UIMachineWindow *pMachineWindow, Qt::WindowFlags aFlags);51 VBoxVMInformationDlg(UIMachineWindow *pMachineWindow); 50 52 ~VBoxVMInformationDlg(); 51 53 … … 75 77 static InfoDlgMap mSelfArray; 76 78 79 /** Widget to center UIMediumManager according. */ 80 QWidget *m_pPseudoParentWidget; 81 77 82 CSession mSession; 78 83 bool mIsPolished;
Note:
See TracChangeset
for help on using the changeset viewer.