VirtualBox

Changeset 27375 in vbox


Ignore:
Timestamp:
Mar 15, 2010 4:47:50 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: New running VM core: using QMainWindow for running VM window instead QIMainDialog which is superfluous.

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

Legend:

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

    r27364 r27375  
    2525#include <QApplication>
    2626#include <QDesktopWidget>
     27#include <QMainWindow>
    2728#include <QTimer>
    2829#ifdef Q_WS_MAC
     
    4041#include "UIFrameBuffer.h"
    4142#include "UIMachineViewFullscreen.h"
    42 #include "QIMainDialog.h"
    4343
    4444UIMachineViewFullscreen::UIMachineViewFullscreen(  UIMachineWindow *pMachineWindow
     
    9595    {
    9696        /* Get machine window: */
    97         QIMainDialog *pMachineWindow = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    98                                        qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow()) : 0;
     97        QMainWindow *pMachineWindow = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
     98                                      qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    9999
    100100        /* If this slot is invoked directly then use the passed size otherwise get
     
    172172{
    173173    /* Who are we watching? */
    174     QIMainDialog *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    175                                 qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow()) : 0;
     174    QMainWindow *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
     175                               qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    176176
    177177    if (pWatched != 0 && pWatched == pMainDialog)
     
    220220#ifdef Q_WS_MAC // TODO: Is it really needed? See UIMachineViewSeamless::eventFilter(...);
    221221    /* Menu bar filter: */
    222     qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
     222    qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
    223223#endif
    224224}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r27366 r27375  
    4040
    4141UIMachineWindowFullscreen::UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId)
    42     : QIWithRetranslateUI2<QIMainDialog>(0, Qt::FramelessWindowHint)
     42    : QIWithRetranslateUI2<QMainWindow>(0, Qt::FramelessWindowHint)
    4343    , UIMachineWindow(pMachineLogic, uScreenId)
    4444    , m_pMainMenu(0)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r27335 r27375  
    2424#define __UIMachineWindowFullscreen_h__
    2525
     26/* Global includes */
     27#include <QMainWindow>
     28
    2629/* Local includes */
    2730#include "QIWithRetranslateUI.h"
    28 #include "QIMainDialog.h"
    2931#include "UIMachineWindow.h"
    3032#ifdef Q_WS_X11
     
    3537class VBoxMiniToolBar;
    3638
    37 class UIMachineWindowFullscreen : public QIWithRetranslateUI2<QIMainDialog>, public UIMachineWindow
     39class UIMachineWindowFullscreen : public QIWithRetranslateUI2<QMainWindow>, public UIMachineWindow
    3840{
    3941    Q_OBJECT;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r27364 r27375  
    2525#include <QApplication>
    2626#include <QDesktopWidget>
     27#include <QMainWindow>
    2728#include <QMenuBar>
    2829#include <QScrollBar>
     
    3738#include "UIFrameBuffer.h"
    3839#include "UIMachineViewNormal.h"
    39 #include "QIMainDialog.h"
    4040
    4141UIMachineViewNormal::UIMachineViewNormal(  UIMachineWindow *pMachineWindow
     
    9696    {
    9797        /* Get machine window: */
    98         QIMainDialog *pMachineWindow = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    99                                        qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow()) : 0;
     98        QMainWindow *pMachineWindow = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
     99                                      qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    100100
    101101        /* If this slot is invoked directly then use the passed size otherwise get
     
    156156                    /* Trying to get menu-bar: */
    157157                    QMenuBar *pMenuBar = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    158                                          qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow())->menuBar() : 0;
     158                                         qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar() : 0;
    159159
    160160                    /* If menu-bar is present and have actions: */
     
    191191{
    192192    /* Who are we watching? */
    193     QIMainDialog *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    194                                 qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow()) : 0;
     193    QMainWindow *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
     194                               qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    195195
    196196    if (pWatched != 0 && pWatched == pMainDialog)
     
    233233
    234234    /* Menu bar filters: */
    235     qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
     235    qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
    236236}
    237237
     
    333333        QRect windowGeo = machineWindowWrapper()->machineWindow()->frameGeometry();
    334334        /* The area taken up by the machine central widget, so excluding all decorations: */
    335         QRect centralWidgetGeo = static_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow())->centralWidget()->geometry();
     335        QRect centralWidgetGeo = static_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->centralWidget()->geometry();
    336336        /* To work out how big we can make the console window while still fitting on the desktop,
    337337         * we calculate availableGeometry() - (windowGeo - centralWidgetGeo).
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r27374 r27375  
    4444
    4545UIMachineWindowNormal::UIMachineWindowNormal(UIMachineLogic *pMachineLogic, ulong uScreenId)
    46     : QIWithRetranslateUI2<QIMainDialog>(0, Qt::Window)
     46    : QIWithRetranslateUI2<QMainWindow>(0, Qt::Window)
    4747    , UIMachineWindow(pMachineLogic, uScreenId)
    4848    , m_pIndicatorsPool(new UIIndicatorsPool(pMachineLogic->uisession()->session(), this))
     
    292292            break;
    293293    }
    294     return QIWithRetranslateUI2<QIMainDialog>::event(pEvent);
     294    return QIWithRetranslateUI2<QMainWindow>::event(pEvent);
    295295}
    296296
     
    598598void UIMachineWindowNormal::showSimple()
    599599{
    600     /* Diable auto centering: */
    601     setAutoCenteringEnabled(false);
    602 
    603600    /* Just show window: */
    604601    show();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r27374 r27375  
    2525
    2626/* Global includes */
     27#include <QMainWindow>
    2728#include <QLabel>
    2829
     
    3031#include "VBoxDefs.h"
    3132#include "QIWithRetranslateUI.h"
    32 #include "QIMainDialog.h"
    3333#include "UIMachineWindow.h"
    3434#ifdef Q_WS_X11
     
    4141class QIStateIndicator;
    4242
    43 class UIMachineWindowNormal : public QIWithRetranslateUI2<QIMainDialog>, public UIMachineWindow
     43class UIMachineWindowNormal : public QIWithRetranslateUI2<QMainWindow>, public UIMachineWindow
    4444{
    4545    Q_OBJECT;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r27364 r27375  
    2525#include <QApplication>
    2626#include <QDesktopWidget>
     27#include <QMainWindow>
    2728#include <QTimer>
    2829#ifdef Q_WS_MAC
     
    3940#include "UIFrameBuffer.h"
    4041#include "UIMachineViewSeamless.h"
    41 #include "QIMainDialog.h"
    4242
    4343UIMachineViewSeamless::UIMachineViewSeamless(  UIMachineWindow *pMachineWindow
     
    100100    {
    101101        /* Get machine window: */
    102         QIMainDialog *pMachineWindow = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    103                                        qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow()) : 0;
     102        QMainWindow *pMachineWindow = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
     103                                      qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    104104
    105105        /* If this slot is invoked directly then use the passed size otherwise get
     
    186186{
    187187    /* Who are we watching? */
    188     QIMainDialog *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    189                                 qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow()) : 0;
     188    QMainWindow *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
     189                               qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    190190
    191191    if (pWatched != 0 && pWatched == pMainDialog)
     
    234234#ifdef Q_WS_MAC // TODO: Is it really needed? See UIMachineViewSeamless::eventFilter(...);
    235235    /* Menu bar filter: */
    236     qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
     236    qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
    237237#endif
    238238}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r27335 r27375  
    4545
    4646UIMachineWindowSeamless::UIMachineWindowSeamless(UIMachineLogic *pMachineLogic, ulong uScreenId)
    47     : QIWithRetranslateUI2<QIMainDialog>(0, Qt::FramelessWindowHint)
     47    : QIWithRetranslateUI2<QMainWindow>(0, Qt::FramelessWindowHint)
    4848    , UIMachineWindow(pMachineLogic, uScreenId)
    4949    , m_pMainMenu(0)
     
    162162            break;
    163163    }
    164     return QIMainDialog::event(pEvent);
     164    return QMainWindow::event(pEvent);
    165165}
    166166#endif /* Q_WS_MAC */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r27335 r27375  
    2424#define __UIMachineWindowSeamless_h__
    2525
     26/* Global includes */
     27#include <QMainWindow>
     28
    2629/* Local includes */
    2730#include "QIWithRetranslateUI.h"
    28 #include "QIMainDialog.h"
    2931#include "UIMachineWindow.h"
    3032#ifdef Q_WS_X11
     
    3537class VBoxMiniToolBar;
    3638
    37 class UIMachineWindowSeamless : public QIWithRetranslateUI2<QIMainDialog>, public UIMachineWindow
     39class UIMachineWindowSeamless : public QIWithRetranslateUI2<QMainWindow>, public UIMachineWindow
    3840{
    3941    Q_OBJECT;
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