VirtualBox

Changeset 41107 in vbox for trunk


Ignore:
Timestamp:
May 2, 2012 12:14:21 AM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Reparenting UIMachineWindow interface inheritance to QMainWindow.

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

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r41021 r41107  
    285285        src/runtime/UIMachine.h \
    286286        src/runtime/UIMachineLogic.h \
     287        src/runtime/UIMachineWindow.h \
    287288        src/runtime/UIMachineView.h \
    288289        src/runtime/UIMouseHandler.h \
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp

    r39882 r41107  
    77
    88/*
    9  * Copyright (C) 2006-2009 Oracle Corporation
     9 * Copyright (C) 2006-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4646        /* Creating new information dialog if there is no one existing */
    4747        VBoxVMInformationDlg *id = new VBoxVMInformationDlg(pMachineWindow, Qt::Window);
    48         id->centerAccording (pMachineWindow->machineWindow());
     48        id->centerAccording (pMachineWindow);
    4949        // TODO_NEW_CORE: this seems not necessary, cause we set WA_DeleteOnClose.
    5050        id->setAttribute (Qt::WA_DeleteOnClose);
     
    6161VBoxVMInformationDlg::VBoxVMInformationDlg (UIMachineWindow *pMachineWindow, Qt::WindowFlags aFlags)
    6262# ifdef Q_WS_MAC
    63     : QIWithRetranslateUI2 <QIMainDialog> (pMachineWindow->machineWindow(), aFlags)
     63    : QIWithRetranslateUI2 <QIMainDialog> (pMachineWindow, aFlags)
    6464# else /* Q_WS_MAC */
    6565    : QIWithRetranslateUI2 <QIMainDialog> (0, aFlags)
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r38985 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    120120        m_windows.insert(uIndex, pMachineWindow);
    121121        /* Install event-filter for window: */
    122         m_windows[uIndex]->machineWindow()->installEventFilter(this);
     122        m_windows[uIndex]->installEventFilter(this);
    123123    }
    124124
     
    184184            case UIVisualStateType_Scale:
    185185            {
    186                 XGrabKey(QX11Info::display(), AnyKey, AnyModifier, m_windows[m_iKeyboardCaptureViewIndex]->machineWindow()->winId(), False, GrabModeAsync, GrabModeAsync);
     186                XGrabKey(QX11Info::display(), AnyKey, AnyModifier, m_windows[m_iKeyboardCaptureViewIndex]->winId(), False, GrabModeAsync, GrabModeAsync);
    187187                break;
    188188            }
     
    195195                 * and after we will just ignore that issue: */
    196196                int cTriesLeft = 50;
    197                 while (cTriesLeft && XGrabKeyboard(QX11Info::display(), m_windows[m_iKeyboardCaptureViewIndex]->machineWindow()->winId(), False, GrabModeAsync, GrabModeAsync, CurrentTime)) { --cTriesLeft; }
     197                while (cTriesLeft && XGrabKeyboard(QX11Info::display(), m_windows[m_iKeyboardCaptureViewIndex]->winId(), False, GrabModeAsync, GrabModeAsync, CurrentTime)) { --cTriesLeft; }
    198198                break;
    199199            }
     
    242242            case UIVisualStateType_Scale:
    243243            {
    244                 XUngrabKey(QX11Info::display(), AnyKey, AnyModifier, m_windows[m_iKeyboardCaptureViewIndex]->machineWindow()->winId());
     244                XUngrabKey(QX11Info::display(), AnyKey, AnyModifier, m_windows[m_iKeyboardCaptureViewIndex]->winId());
    245245                break;
    246246            }
     
    16601660    {
    16611661        UIMachineWindow *pIteratedWindow = i.value();
    1662         if (pIteratedWindow->machineWindow() == pWatchedObject)
     1662        if (pIteratedWindow == pWatchedObject)
    16631663        {
    16641664            pResultWindow = pIteratedWindow;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r41064 r41107  
    417417QWidget* UIMachine::mainWindow() const
    418418{
    419     if (machineLogic() &&
    420         machineLogic()->mainMachineWindow() &&
    421         machineLogic()->mainMachineWindow()->machineWindow())
    422         return machineLogic()->mainMachineWindow()->machineWindow();
     419    if (machineLogic() && machineLogic()->mainMachineWindow())
     420        return machineLogic()->mainMachineWindow();
    423421    else
    424422        return 0;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r41064 r41107  
    227227    foreach (UIMachineWindow *pWindowToCheck, machineWindows())
    228228    {
    229         if (pWindowToCheck->machineWindow()->isActiveWindow())
     229        if (pWindowToCheck->isActiveWindow())
    230230        {
    231231            pWindowToPropose = pWindowToCheck;
     
    419419         * what. So, I'll just always show & activate the stupid window to
    420420         * make it get out of the dock when the user wishes to show a VM. */
    421         pMachineWindow->machineWindow()->raise();
    422         pMachineWindow->machineWindow()->activateWindow();
     421        pMachineWindow->raise();
     422        pMachineWindow->activateWindow();
    423423    }
    424424}
     
    846846    {
    847847        /* Exit maximized window state if actual: */
    848         if (pMachineWindow->machineWindow()->isMaximized())
    849             pMachineWindow->machineWindow()->showNormal();
     848        if (pMachineWindow->isMaximized())
     849            pMachineWindow->showNormal();
    850850
    851851        /* Normalize view's geometry: */
     
    907907    CMachine machine = session().GetMachine();
    908908
    909     VBoxTakeSnapshotDlg dlg(defaultMachineWindow()->machineWindow(), machine);
     909    VBoxTakeSnapshotDlg dlg(defaultMachineWindow(), machine);
    910910
    911911    QString strTypeId = machine.GetOSTypeId();
     
    978978    QString strFilename = QIFileDialog::getSaveFileName(strStart,
    979979                                                        filters.join(";;"),
    980                                                         defaultMachineWindow()->machineWindow(),
     980                                                        defaultMachineWindow(),
    981981                                                        tr("Select a filename for the screenshot ..."),
    982982                                                        &strFilter,
     
    10071007    ulong uMonitorCount = session().GetMachine().GetMonitorCount();
    10081008    for (ulong uScreenId = 1; uScreenId < uMonitorCount; ++uScreenId)
    1009         machineWindows().at(uScreenId)->machineWindow()->update();
     1009        machineWindows().at(uScreenId)->update();
    10101010}
    10111011
     
    10471047
    10481048    /* Create and execute current VM settings dialog: */
    1049     UISettingsDialogMachine dlg(defaultMachineWindow()->machineWindow(),
     1049    UISettingsDialogMachine dlg(defaultMachineWindow(),
    10501050                                session().GetMachine().GetId(), strCategory, QString());
    10511051    dlg.execute();
     
    10621062    /* Do not process if additions are not loaded! */
    10631063    if (!uisession()->isGuestAdditionsActive())
    1064         msgCenter().remindAboutGuestAdditionsAreNotActive(defaultMachineWindow()->machineWindow());
     1064        msgCenter().remindAboutGuestAdditionsAreNotActive(defaultMachineWindow());
    10651065
    10661066    /* Open VM settings : Shared folders page: */
     
    13151315        /* Call for file-open window: */
    13161316        QString strMachineFolder(QFileInfo(machine.GetSettingsFilePath()).absolutePath());
    1317         QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(target.type, defaultMachineWindow()->machineWindow(),
     1317        QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(target.type, defaultMachineWindow(),
    13181318                                                                        strMachineFolder);
    13191319        defaultMachineWindow()->machineView()->setFocus();
     
    16401640{
    16411641    /* Show VM Log Viewer: */
    1642     UIVMLogViewer::showLogViewerFor(mainMachineWindow()->machineWindow(), session().GetMachine());
     1642    UIVMLogViewer::showLogViewerFor(mainMachineWindow(), session().GetMachine());
    16431643}
    16441644
     
    17771777                || m_pDbgGuiVT->u32EndVersion == m_pDbgGuiVT->u32Version)
    17781778            {
    1779                 m_pDbgGuiVT->pfnSetParent(m_pDbgGui, defaultMachineWindow()->machineWindow());
     1779                m_pDbgGuiVT->pfnSetParent(m_pDbgGui, defaultMachineWindow());
    17801780                m_pDbgGuiVT->pfnSetMenu(m_pDbgGui, gActionPool->action(UIActionIndexRuntime_Menu_Debug));
    17811781                dbgAdjustRelativePos();
     
    18111811    if (m_pDbgGui)
    18121812    {
    1813         QRect rct = defaultMachineWindow()->machineWindow()->frameGeometry();
     1813        QRect rct = defaultMachineWindow()->frameGeometry();
    18141814        m_pDbgGuiVT->pfnAdjustRelativePos(m_pDbgGui, rct.x(), rct.y(), rct.width(), rct.height());
    18151815    }
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r41049 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    156156    /* Get the current machine: */
    157157    CMachine machine = session().GetMachine();
    158     /* Get machine window: */
    159     QMainWindow *pMachineWindow = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    160                                   qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    161158
    162159    /* If this slot is invoked directly then use the passed size otherwise get
    163160     * the available size for the guest display. We assume here that centralWidget()
    164161     * contains this view only and gives it all available space: */
    165     QSize newSize(toSize.isValid() ? toSize : pMachineWindow ? pMachineWindow->centralWidget()->size() : QSize());
     162    QSize newSize(toSize.isValid() ? toSize : machineWindow()->centralWidget()->size());
    166163    AssertMsg(newSize.isValid(), ("Size should be valid!\n"));
    167164
     
    238235#endif /* VBOX_WITH_VIDEOHWACCEL */
    239236                             )
    240     : QAbstractScrollArea(pMachineWindow->machineWindow())
     237    : QAbstractScrollArea(pMachineWindow)
    241238    , m_pMachineWindow(pMachineWindow)
    242239    , m_uScreenId(uScreenId)
     
    293290                     * this [VBox|UI] duplication
    294291                     * @todo: they are to be removed once VBox stuff is gone */
    295                     pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQImage, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
     292                    pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQImage, UIMachineView, UIResizeEvent>(this, &session(), (uint32_t)screenId());
    296293                }
    297294                else
     
    335332                     * this [VBox|UI] duplication
    336333                     * @todo: they are to be removed once VBox stuff is gone */
    337                     pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
     334                    pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &session(), (uint32_t)screenId());
    338335                }
    339336                else
     
    381378                     * this [VBox|UI] duplication
    382379                     * @todo: they are to be removed once VBox stuff is gone */
    383                     pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQuartz2D, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
     380                    pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQuartz2D, UIMachineView, UIResizeEvent>(this, &session(), (uint32_t)screenId());
    384381                }
    385382                else
     
    483480
    484481    /* We want to be notified on some parent's events: */
    485     machineWindowWrapper()->machineWindow()->installEventFilter(this);
     482    machineWindow()->installEventFilter(this);
    486483}
    487484
     
    563560UIMachineLogic* UIMachineView::machineLogic() const
    564561{
    565     return machineWindowWrapper()->machineLogic();
     562    return machineWindow()->machineLogic();
    566563}
    567564
     
    10221019    }
    10231020#endif /* VBOX_WITH_VIDEOHWACCEL */
    1024     if (pWatched == machineWindowWrapper()->machineWindow())
     1021    if (pWatched == machineWindow())
    10251022    {
    10261023        switch (pEvent->type())
     
    10281025            case QEvent::WindowStateChange:
    10291026            {
    1030                 /* During minimizing and state restoring machineWindowWrapper() gets
     1027                /* During minimizing and state restoring machineWindow() gets
    10311028                 * the focus which belongs to console view window, so returning it properly. */
    10321029                QWindowStateChangeEvent *pWindowEvent = static_cast<QWindowStateChangeEvent*>(pEvent);
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r39451 r41107  
    66
    77/*
    8  * Copyright (C) 2010 Oracle Corporation
     8 * Copyright (C) 2010-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    121121
    122122    /* Protected getters: */
    123     UIMachineWindow* machineWindowWrapper() const { return m_pMachineWindow; }
     123    UIMachineWindow* machineWindow() const { return m_pMachineWindow; }
    124124    UIMachineLogic* machineLogic() const;
    125125    UISession* uisession() const;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r41051 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9090    {
    9191        widget->close();
    92         QTimer::singleShot(0, machineWindow(), SLOT(sltTryClose()));
     92        QTimer::singleShot(0, this, SLOT(sltTryClose()));
    9393    }
    9494    else
    95         machineWindow()->close();
     95        close();
    9696}
    9797
    9898UIMachineWindow::UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId)
    99     : m_pMachineLogic(pMachineLogic)
    100     , m_pMachineWindow(0)
     99    : QIWithRetranslateUI2<QMainWindow>(0, windowFlags(pMachineLogic->visualStateType()))
     100    , m_pMachineLogic(pMachineLogic)
    101101    , m_uScreenId(uScreenId)
    102102    , m_pMachineViewContainer(0)
     
    138138}
    139139
    140 void UIMachineWindow::setMask(const QRegion &region)
    141 {
    142     machineWindow()->setMask(region);
    143 }
    144 
    145140void UIMachineWindow::retranslateUi()
    146141{
     
    206201            }
    207202            /* Prepare close dialog: */
    208             UIVMCloseDialog dlg(machineWindow());
     203            UIVMCloseDialog dlg(this);
    209204
    210205            /* Assign close-dialog pixmap: */
     
    433428     * 1. On Win32, it's built-in to the executable;
    434429     * 2. On Mac OS X the icon referenced in info.plist is used. */
    435     machineWindow()->setWindowIcon(QIcon(":/VirtualBox_48px.png"));
     430    setWindowIcon(QIcon(":/VirtualBox_48px.png"));
    436431#endif
    437432
    438433#ifndef Q_WS_MAC
    439434    /* Set the VM-specific application icon except Mac OS X: */
    440     machineWindow()->setWindowIcon(vboxGlobal().vmGuestOSTypeIcon(session().GetMachine().GetOSTypeId()));
     435    setWindowIcon(vboxGlobal().vmGuestOSTypeIcon(session().GetMachine().GetOSTypeId()));
    441436#endif
    442437}
     
    445440{
    446441    /* Machine state-change updater: */
    447     QObject::connect(uisession(), SIGNAL(sigMachineStateChange()), machineWindow(), SLOT(sltMachineStateChanged()));
     442    connect(uisession(), SIGNAL(sigMachineStateChange()), this, SLOT(sltMachineStateChanged()));
    448443
    449444    /* Guest monitor change updater: */
    450     QObject::connect(uisession(), SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)),
    451                      machineWindow(), SLOT(sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)));
     445    connect(uisession(), SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)),
     446            this, SLOT(sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)));
    452447}
    453448
     
    517512        if (machine.GetMonitorCount() > 1)
    518513            strMachineName += QString(" : %1").arg(m_uScreenId + 1);
    519         machineWindow()->setWindowTitle(strMachineName);
     514        setWindowTitle(strMachineName);
    520515    }
    521516}
     
    546541
    547542    /* Process KGuestMonitorChangedEventType_Enabled change event: */
    548     if (machineWindow()->isHidden() && changeType == KGuestMonitorChangedEventType_Enabled)
     543    if (isHidden() && changeType == KGuestMonitorChangedEventType_Enabled)
    549544        showInNecessaryMode();
    550545    /* Process KGuestMonitorChangedEventType_Disabled change event: */
    551     else if (!machineWindow()->isHidden() && changeType == KGuestMonitorChangedEventType_Disabled)
    552         machineWindow()->hide();
    553 }
    554 
     546    else if (!isHidden() && changeType == KGuestMonitorChangedEventType_Disabled)
     547        hide();
     548}
     549
     550Qt::WindowFlags UIMachineWindow::windowFlags(UIVisualStateType visualStateType)
     551{
     552    switch (visualStateType)
     553    {
     554        case UIVisualStateType_Normal: return Qt::Window;
     555        case UIVisualStateType_Fullscreen: return Qt::FramelessWindowHint;
     556        case UIVisualStateType_Seamless: return Qt::FramelessWindowHint;
     557        case UIVisualStateType_Scale: return Qt::Window;
     558    }
     559    AssertMsgFailed(("Incorrect visual state!"));
     560    return 0;
     561}
     562
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r41051 r41107  
    66
    77/*
    8  * Copyright (C) 2010 Oracle Corporation
     8 * Copyright (C) 2010-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#define __UIMachineWindow_h__
    2121
     22/* Global includes */
     23#include <QMainWindow>
     24
    2225/* Local includes */
     26#include "QIWithRetranslateUI.h"
    2327#include "UIMachineDefs.h"
    2428#include "COMDefs.h"
     
    3640class UIMachineView;
    3741
    38 class UIMachineWindow
     42class UIMachineWindow : public QIWithRetranslateUI2<QMainWindow>
    3943{
     44    Q_OBJECT;
     45
    4046public:
    4147
     
    4450    static void destroy(UIMachineWindow *pWhichWindow);
    4551
    46     /* Abstract slot to close machine window: */
    47     virtual void sltTryClose();
    48 
    4952    /* Public getters: */
    5053    virtual UIMachineLogic* machineLogic() const { return m_pMachineLogic; }
    51     virtual QWidget* machineWindow() const { return m_pMachineWindow; }
    5254    virtual UIMachineView* machineView() const { return m_pMachineView; }
    5355    UISession* uisession() const;
    5456    CSession& session() const;
    5557
    56     /* Public members: */
    57     virtual void reshow() {}
    58     virtual void setMask(const QRegion &region);
     58protected slots:
     59
     60    /* Session event-handlers: */
     61    virtual void sltMachineStateChanged();
     62    virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
     63
     64    /* Slot to safe close machine-window: */
     65    void sltTryClose();
    5966
    6067protected:
     
    96103#endif /* VBOX_WITH_DEBUGGER_GUI */
    97104
    98     /* Protected slots: */
    99     virtual void sltMachineStateChanged();
    100     virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
     105    /* Helpers: */
     106    Qt::WindowFlags windowFlags(UIVisualStateType visualStateType);
    101107
    102108    /* Show routine: */
     
    105111    /* Protected variables: */
    106112    UIMachineLogic *m_pMachineLogic;
    107     QWidget *m_pMachineWindow;
    108113
    109114    /* Virtual screen number: */
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r39452 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9292    {
    9393        /* Register machine-window: */
    94         m_windows.insert(uIndex, pMachineWindow->machineWindow());
     94        m_windows.insert(uIndex, pMachineWindow);
    9595        /* Install event-filter for machine-window: */
    9696        m_windows[uIndex]->installEventFilter(this);
     
    557557                    if (!uisession()->isMouseCaptured() &&
    558558                        QApplication::activeWindow() &&
    559                         QApplication::activeWindow()->inherits("UIMachineWindow") &&
     559                        m_windows.values().contains(QApplication::activeWindow()) &&
     560                        m_windows.values().contains(pWatchedWidget->window()) &&
    560561                        QApplication::activeWindow() != pWatchedWidget->window())
    561562                    {
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r41106 r41107  
    315315QWidget* UISession::mainMachineWindow() const
    316316{
    317     return uimachine()->machineLogic()->mainMachineWindow()->machineWindow();
     317    return uimachine()->machineLogic()->mainMachineWindow();
    318318}
    319319
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIKeyboardHandlerFullscreen.cpp

    r35752 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5959                {
    6060                    /* Post request to show popup-menu: */
    61                     QTimer::singleShot(0, m_windows[uScreenId]->machineWindow(), SLOT(sltPopupMainMenu()));
     61                    QTimer::singleShot(0, m_windows[uScreenId], SLOT(sltPopupMainMenu()));
    6262                    /* Filter-out this event: */
    6363                    return true;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r39081 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    110110bool UIMachineViewFullscreen::eventFilter(QObject *pWatched, QEvent *pEvent)
    111111{
    112     /* Who are we watching? */
    113     QMainWindow *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    114                                qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    115 
    116     if (pWatched != 0 && pWatched == pMainDialog)
     112    if (pWatched != 0 && pWatched == machineWindow())
    117113    {
    118114        switch (pEvent->type())
     
    158154    UIMachineView::prepareFilters();
    159155
    160 #ifdef Q_WS_MAC // TODO: Is it really needed? See UIMachineViewSeamless::eventFilter(...);
     156#ifdef Q_WS_MAC // TODO: Is it really needed? See UIMachineViewFullscreen::eventFilter(...);
    161157    /* Menu bar filter: */
    162     qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
    163 #endif
     158    machineWindow()->menuBar()->installEventFilter(this);
     159#endif /* Q_WS_MAC */
    164160}
    165161
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r41051 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3636
    3737UIMachineWindowFullscreen::UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId)
    38     : QIWithRetranslateUI2<QMainWindow>(0, Qt::FramelessWindowHint)
    39     , UIMachineWindow(pMachineLogic, uScreenId)
     38    : UIMachineWindow(pMachineLogic, uScreenId)
    4039    , m_pMainMenu(0)
    4140    , m_pMiniToolBar(0)
    4241{
    43     /* "This" is machine window: */
    44     m_pMachineWindow = this;
    45 
    4642    /* Set the main window in VBoxGlobal: */
    4743    if (uScreenId == 0)
     
    111107}
    112108
    113 void UIMachineWindowFullscreen::sltMachineStateChanged()
    114 {
    115     UIMachineWindow::sltMachineStateChanged();
    116 }
    117 
    118 void UIMachineWindowFullscreen::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
    119 {
    120     UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
    121 }
    122 
    123109void UIMachineWindowFullscreen::sltPopupMainMenu()
    124110{
     
    126112    if (m_pMainMenu && !m_pMainMenu->isEmpty())
    127113    {
    128         m_pMainMenu->popup(machineWindow()->geometry().center());
     114        m_pMainMenu->popup(geometry().center());
    129115        QTimer::singleShot(0, m_pMainMenu, SLOT(sltSelectFirstAction()));
    130116    }
    131 }
    132 
    133 void UIMachineWindowFullscreen::sltTryClose()
    134 {
    135     UIMachineWindow::sltTryClose();
    136 }
    137 
    138 void UIMachineWindowFullscreen::retranslateUi()
    139 {
    140     /* Translate parent class: */
    141     UIMachineWindow::retranslateUi();
    142 }
    143 
    144 #ifdef Q_WS_X11
    145 bool UIMachineWindowFullscreen::x11Event(XEvent *pEvent)
    146 {
    147     return UIMachineWindow::x11Event(pEvent);
    148 }
    149 #endif
    150 
    151 void UIMachineWindowFullscreen::closeEvent(QCloseEvent *pEvent)
    152 {
    153     return UIMachineWindow::closeEvent(pEvent);
    154117}
    155118
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r41051 r41107  
    66
    77/*
    8  * Copyright (C) 2010 Oracle Corporation
     8 * Copyright (C) 2010-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#define __UIMachineWindowFullscreen_h__
    2121
    22 /* Global includes */
    23 #include <QMainWindow>
    24 
    2522/* Local includes */
    26 #include "QIWithRetranslateUI.h"
    2723#include "UIMachineWindow.h"
    2824
     
    3026class VBoxMiniToolBar;
    3127
    32 class UIMachineWindowFullscreen : public QIWithRetranslateUI2<QMainWindow>, public UIMachineWindow
     28class UIMachineWindowFullscreen : public UIMachineWindow
    3329{
    3430    Q_OBJECT;
     
    4642private slots:
    4743
    48     /* Console callback handlers: */
    49     void sltMachineStateChanged();
    50     void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    51 
    5244    /* Popup main menu: */
    5345    void sltPopupMainMenu();
    5446
    55     /* Close window reimplementation: */
    56     void sltTryClose();
    57 
    5847private:
    59 
    60     /* Translate routine: */
    61     void retranslateUi();
    62 
    63     /* Event handlers: */
    64 #ifdef Q_WS_X11
    65     bool x11Event(XEvent *pEvent);
    66 #endif /* Q_WS_X11 */
    67     void closeEvent(QCloseEvent *pEvent);
    6848
    6949    /* Prepare helpers: */
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIKeyboardHandlerNormal.cpp

    r35752 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6262                {
    6363                    /* Trying to get menu-bar: */
    64                     QMenuBar *pMenuBar = qobject_cast<QMainWindow*>(m_windows[uScreenId]->machineWindow())->menuBar();
     64                    QMenuBar *pMenuBar = qobject_cast<QMainWindow*>(m_windows[uScreenId])->menuBar();
    6565                    /* If menu-bar is present and have actions: */
    6666                    if (pMenuBar && !pMenuBar->actions().isEmpty())
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r41064 r41107  
    104104    /* Order machine window(s): */
    105105    for (ulong uScreenId = uMonitorCount; uScreenId > 0; -- uScreenId)
    106         machineWindows()[uScreenId - 1]->machineWindow()->raise();
     106        machineWindows()[uScreenId - 1]->raise();
    107107
    108108    /* Remember what machine window(s) created: */
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r39094 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    110110bool UIMachineViewNormal::eventFilter(QObject *pWatched, QEvent *pEvent)
    111111{
    112     /* Who are we watching? */
    113     QMainWindow *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    114                                qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    115 #ifdef Q_WS_WIN
    116     QMenuBar *pMenuBar = pMainDialog ? pMainDialog->menuBar() : 0;
    117 #endif /* Q_WS_WIN */
    118 
    119     if (pWatched != 0 && pWatched == pMainDialog)
     112    if (pWatched != 0 && pWatched == machineWindow())
    120113    {
    121114        switch (pEvent->type())
     
    145138
    146139#ifdef Q_WS_WIN
    147     else if (pWatched != 0 && pWatched == pMenuBar)
     140    else if (pWatched != 0 && pWatched == machineWindow()->menuBar())
    148141    {
    149142        /* Due to windows host uses separate 'focus set' to let menubar to
     
    184177
    185178    /* Menu bar filters: */
    186     qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
     179    machineWindow()->menuBar()->installEventFilter(this);
    187180}
    188181
     
    302295    /* The area taken up by the machine window on the desktop,
    303296     * including window frame, title, menu bar and status bar: */
    304     QRect windowGeo = machineWindowWrapper()->machineWindow()->frameGeometry();
     297    QRect windowGeo = machineWindow()->frameGeometry();
    305298    /* The area taken up by the machine central widget, so excluding all decorations: */
    306     QRect centralWidgetGeo = static_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->centralWidget()->geometry();
     299    QRect centralWidgetGeo = machineWindow()->centralWidget()->geometry();
    307300    /* To work out how big we can make the console window while still fitting on the desktop,
    308301     * we calculate workingArea() - (windowGeo - centralWidgetGeo).
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r41051 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5050
    5151UIMachineWindowNormal::UIMachineWindowNormal(UIMachineLogic *pMachineLogic, ulong uScreenId)
    52     : QIWithRetranslateUI2<QMainWindow>(0, Qt::Window)
    53     , UIMachineWindow(pMachineLogic, uScreenId)
     52    : UIMachineWindow(pMachineLogic, uScreenId)
    5453    , m_pIndicatorsPool(new UIIndicatorsPool(pMachineLogic->uisession()->session(), this))
    5554    , m_pIdleTimer(0)
    5655{
    57     /* "This" is machine window: */
    58     m_pMachineWindow = this;
    59 
    6056    /* Set the main window in VBoxGlobal */
    6157    if (uScreenId == 0)
     
    164160    updateAppearanceOf(UIVisualElement_VirtualizationStuff);
    165161}
    166 
    167 void UIMachineWindowNormal::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
    168 {
    169     UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
    170 }
    171 
    172 void UIMachineWindowNormal::sltTryClose()
    173 {
    174     UIMachineWindow::sltTryClose();
    175 }
    176 
    177 #if 0
    178 void UIMachineWindowNormal::sltEmbedDownloader(UIDownloadType downloaderType)
    179 {
    180     switch (downloaderType)
    181     {
    182         case UIDownloadType_Additions:
    183         {
    184             if (UIDownloaderAdditions *pDl = UIDownloaderAdditions::current())
    185                 statusBar()->addWidget(pDl->progressWidget(this), 0);
    186             break;
    187         }
    188         case UIDownloadType_UserManual:
    189         {
    190             if (UIDownloaderUserManual *pDl = UIDownloaderUserManual::current())
    191                 statusBar()->addWidget(pDl->progressWidget(this), 0);
    192             break;
    193         }
    194         case UIDownloadType_ExtensionPack:
    195         {
    196             if (UIDownloaderExtensionPack *pDl = UIDownloaderExtensionPack::current())
    197                 statusBar()->addWidget(pDl->progressWidget(this), 0);
    198             break;
    199         }
    200         default:
    201             break;
    202     }
    203 }
    204 #endif
    205162
    206163void UIMachineWindowNormal::sltUpdateIndicators()
     
    335292}
    336293
    337 #ifdef Q_WS_X11
    338 bool UIMachineWindowNormal::x11Event(XEvent *pEvent)
    339 {
    340     return UIMachineWindow::x11Event(pEvent);
    341 }
    342 #endif
    343 
    344 void UIMachineWindowNormal::closeEvent(QCloseEvent *pEvent)
    345 {
    346     return UIMachineWindow::closeEvent(pEvent);
    347 }
    348 
    349294void UIMachineWindowNormal::prepareConsoleConnections()
    350295{
     
    451396    statusBar()->addPermanentWidget(pIndicatorBox, 0);
    452397
    453 #if 0
    454     /* Add the additions downloader progress bar to the status bar,
    455      * if a download is actually running: */
    456     tryToEmbedDownloaderForAdditions();
    457 
    458     /* Add the user manual progress bar to the status bar,
    459      * if a download is actually running: */
    460     tryToEmbedDownloaderForUserManual();
    461 
    462     /* Add the extension pack progress bar to the status bar,
    463      * if a download is actually running: */
    464     tryToEmbedDownloaderForExtensionPack();
    465 #endif
    466 
    467398    /* Create & start timer to update LEDs: */
    468399    m_pIdleTimer = new QTimer(this);
     
    481412    connect(&vboxGlobal().settings(), SIGNAL(propertyChanged(const char *, const char *)),
    482413            this, SLOT(sltProcessGlobalSettingChange(const char *, const char *)));
    483 #if 0
    484     /* Setup network manager listener: */
    485     connect(gNetworkManager, SIGNAL(sigDownloaderCreated(UIDownloadType)), this, SLOT(sltEmbedDownloader(UIDownloadType)));
    486 #endif
    487414}
    488415
     
    565492
    566493        QRect ar = ok ? QApplication::desktop()->availableGeometry(QPoint(x, y)) :
    567                         QApplication::desktop()->availableGeometry(machineWindow());
     494                        QApplication::desktop()->availableGeometry(this);
    568495
    569496        /* If previous parameters were read correctly: */
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r41051 r41107  
    66
    77/*
    8  * Copyright (C) 2010 Oracle Corporation
     8 * Copyright (C) 2010-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2121
    2222/* Global includes */
    23 #include <QMainWindow>
    2423#include <QLabel>
    2524
    2625/* Local includes */
    27 #include "QIWithRetranslateUI.h"
    2826#include "UIMachineWindow.h"
    29 #include "UINetworkDefs.h"
    3027
    3128/* Local forwards */
     
    3431class QIStateIndicator;
    3532
    36 class UIMachineWindowNormal : public QIWithRetranslateUI2<QMainWindow>, public UIMachineWindow
     33class UIMachineWindowNormal : public UIMachineWindow
    3734{
    3835    Q_OBJECT;
     
    5451    void sltSharedFolderChange();
    5552    void sltCPUExecutionCapChange();
    56     void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    5753
    5854    /* LED connections: */
     
    6056    void sltShowIndicatorsContextMenu(QIStateIndicator *pIndicator, QContextMenuEvent *pEvent);
    6157    void sltProcessGlobalSettingChange(const char *aPublicName, const char *aName);
    62 
    63     /* Close window reimplementation: */
    64     void sltTryClose();
    65 
    66 #if 0
    67     /* Network manager handler: */
    68     void sltEmbedDownloader(UIDownloadType downloaderType);
    69 #endif
    7058
    7159private:
     
    7967    /* Event handlers: */
    8068    bool event(QEvent *pEvent);
    81 #ifdef Q_WS_X11
    82     bool x11Event(XEvent *pEvent);
    83 #endif
    84     void closeEvent(QCloseEvent *pEvent);
    8569
    8670    /* Private getters: */
     
    10892    void updateIndicatorState(QIStateIndicator *pIndicator, KDeviceType deviceType);
    10993
    110 #if 0
    111     /* Network manager helpers: */
    112     void tryToEmbedDownloaderForAdditions() { sltEmbedDownloader(UIDownloadType_Additions); }
    113     void tryToEmbedDownloaderForUserManual() { sltEmbedDownloader(UIDownloadType_UserManual); }
    114     void tryToEmbedDownloaderForExtensionPack() { sltEmbedDownloader(UIDownloadType_ExtensionPack); }
    115 #endif
    116 
    11794    /* Indicators pool: */
    11895    UIIndicatorsPool *m_pIndicatorsPool;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIKeyboardHandlerScale.cpp

    r35752 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6262                {
    6363                    /* Post request to show popup-menu: */
    64                     QTimer::singleShot(0, m_windows[uScreenId]->machineWindow(), SLOT(sltPopupMainMenu()));
     64                    QTimer::singleShot(0, m_windows[uScreenId], SLOT(sltPopupMainMenu()));
    6565                    /* Filter-out this event: */
    6666                    return true;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp

    r41064 r41107  
    8484    /* Order machine window(s): */
    8585    for (ulong uScreenId = uMonitorCount; uScreenId > 0; -- uScreenId)
    86         machineWindows()[uScreenId - 1]->machineWindow()->raise();
     86        machineWindows()[uScreenId - 1]->raise();
    8787
    8888    /* Remember what machine window(s) created: */
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r41049 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    216216bool UIMachineViewScale::eventFilter(QObject *pWatched, QEvent *pEvent)
    217217{
    218     /* Who are we watching? */
    219     QMainWindow *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    220                                qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    221 
    222218    if (pWatched != 0 && pWatched == viewport())
    223219    {
     
    234230        }
    235231    }
    236     else if (pWatched != 0 && pWatched == pMainDialog)
     232    else if (pWatched != 0 && pWatched == machineWindow())
    237233    {
    238234        switch (pEvent->type())
     
    285281    /* The area taken up by the machine window on the desktop,
    286282     * including window frame, title, menu bar and status bar: */
    287     QRect windowGeo = machineWindowWrapper()->machineWindow()->frameGeometry();
     283    QRect windowGeo = machineWindow()->frameGeometry();
    288284    /* The area taken up by the machine central widget, so excluding all decorations: */
    289     QRect centralWidgetGeo = static_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->centralWidget()->geometry();
     285    QRect centralWidgetGeo = machineWindow()->centralWidget()->geometry();
    290286    /* To work out how big we can make the console window while still fitting on the desktop,
    291287     * we calculate workingArea() - (windowGeo - centralWidgetGeo).
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r41051 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3838
    3939UIMachineWindowScale::UIMachineWindowScale(UIMachineLogic *pMachineLogic, ulong uScreenId)
    40     : QIWithRetranslateUI2<QMainWindow>(0, Qt::Window)
    41     , UIMachineWindow(pMachineLogic, uScreenId)
     40    : UIMachineWindow(pMachineLogic, uScreenId)
    4241    , m_pMainMenu(0)
    4342{
    44     /* "This" is machine window: */
    45     m_pMachineWindow = this;
    46 
    4743    /* Set the main window in VBoxGlobal */
    4844    if (uScreenId == 0)
     
    108104}
    109105
    110 void UIMachineWindowScale::sltMachineStateChanged()
    111 {
    112     UIMachineWindow::sltMachineStateChanged();
    113 }
    114 
    115 void UIMachineWindowScale::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
    116 {
    117     UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
    118 }
    119 
    120106void UIMachineWindowScale::sltPopupMainMenu()
    121107{
     
    123109    if (m_pMainMenu && !m_pMainMenu->isEmpty())
    124110    {
    125         m_pMainMenu->popup(machineWindow()->geometry().center());
     111        m_pMainMenu->popup(geometry().center());
    126112        QTimer::singleShot(0, m_pMainMenu, SLOT(sltSelectFirstAction()));
    127113    }
    128 }
    129 
    130 void UIMachineWindowScale::sltTryClose()
    131 {
    132     UIMachineWindow::sltTryClose();
    133 }
    134 
    135 void UIMachineWindowScale::retranslateUi()
    136 {
    137     /* Translate parent class: */
    138     UIMachineWindow::retranslateUi();
    139114}
    140115
     
    219194}
    220195#endif /* Q_WS_WIN */
    221 
    222 #ifdef Q_WS_X11
    223 bool UIMachineWindowScale::x11Event(XEvent *pEvent)
    224 {
    225     return UIMachineWindow::x11Event(pEvent);
    226 }
    227 #endif
    228 
    229 void UIMachineWindowScale::closeEvent(QCloseEvent *pEvent)
    230 {
    231     return UIMachineWindow::closeEvent(pEvent);
    232 }
    233196
    234197void UIMachineWindowScale::prepareMenu()
     
    307270
    308271        QRect ar = ok ? QApplication::desktop()->availableGeometry(QPoint(x, y)) :
    309                         QApplication::desktop()->availableGeometry(machineWindow());
     272                        QApplication::desktop()->availableGeometry(this);
    310273
    311274        /* If previous parameters were read correctly: */
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.h

    r41051 r41107  
    66
    77/*
    8  * Copyright (C) 2010 Oracle Corporation
     8 * Copyright (C) 2010-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#define __UIMachineWindowScale_h__
    2121
    22 /* Global includes */
    23 #include <QMainWindow>
    24 
    2522/* Local includes */
    26 #include "QIWithRetranslateUI.h"
    2723#include "UIMachineWindow.h"
    2824
    29 class UIMachineWindowScale : public QIWithRetranslateUI2<QMainWindow>, public UIMachineWindow
     25class UIMachineWindowScale : public UIMachineWindow
    3026{
    3127    Q_OBJECT;
     
    3935private slots:
    4036
    41     /* Console callback handlers: */
    42     void sltMachineStateChanged();
    43     void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    44 
    4537    /* Popup main menu: */
    4638    void sltPopupMainMenu();
    4739
    48     /* Close window reimplementation: */
    49     void sltTryClose();
    50 
    5140private:
    52 
    53     /* Translate routine: */
    54     void retranslateUi();
    5541
    5642    /* Event handlers: */
     
    5945    bool winEvent(MSG *pMessage, long *pResult);
    6046#endif
    61 #ifdef Q_WS_X11
    62     bool x11Event(XEvent *pEvent);
    63 #endif
    64     void closeEvent(QCloseEvent *pEvent);
    6547
    6648    /* Prepare helpers: */
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIKeyboardHandlerSeamless.cpp

    r35752 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5959                {
    6060                    /* Post request to show popup-menu: */
    61                     QTimer::singleShot(0, m_windows[uScreenId]->machineWindow(), SLOT(sltPopupMainMenu()));
     61                    QTimer::singleShot(0, m_windows[uScreenId], SLOT(sltPopupMainMenu()));
    6262                    /* Filter-out this event: */
    6363                    return true;
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r39081 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    104104            {
    105105                m_lastVisibleRegion = pSetRegionEvent->region();
    106                 machineWindowWrapper()->setMask(m_lastVisibleRegion);
     106                machineWindow()->setMask(m_lastVisibleRegion);
    107107            }
    108108            return true;
     
    122122bool UIMachineViewSeamless::eventFilter(QObject *pWatched, QEvent *pEvent)
    123123{
    124     /* Who are we watching? */
    125     QMainWindow *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?
    126                                qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    127 
    128     if (pWatched != 0 && pWatched == pMainDialog)
     124    if (pWatched != 0 && pWatched == machineWindow())
    129125    {
    130126        switch (pEvent->type())
     
    172168#ifdef Q_WS_MAC // TODO: Is it really needed? See UIMachineViewSeamless::eventFilter(...);
    173169    /* Menu bar filter: */
    174     qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
    175 #endif
     170    machineWindow()->menuBar()->installEventFilter(this);
     171#endif /* Q_WS_MAC */
    176172}
    177173
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r41051 r41107  
    77
    88/*
    9  * Copyright (C) 2010 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4242
    4343UIMachineWindowSeamless::UIMachineWindowSeamless(UIMachineLogic *pMachineLogic, ulong uScreenId)
    44     : QIWithRetranslateUI2<QMainWindow>(0, Qt::FramelessWindowHint)
    45     , UIMachineWindow(pMachineLogic, uScreenId)
     44    : UIMachineWindow(pMachineLogic, uScreenId)
    4645    , m_pMainMenu(0)
    4746#ifndef Q_WS_MAC
     
    4948#endif /* Q_WS_MAC */
    5049{
    51     /* "This" is machine window: */
    52     m_pMachineWindow = this;
    53 
    5450    /* Set the main window in VBoxGlobal: */
    5551    if (uScreenId == 0)
     
    131127}
    132128
    133 void UIMachineWindowSeamless::sltMachineStateChanged()
    134 {
    135     UIMachineWindow::sltMachineStateChanged();
    136 }
    137 
    138 void UIMachineWindowSeamless::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
    139 {
    140     UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
    141 }
    142 
    143129void UIMachineWindowSeamless::sltPopupMainMenu()
    144130{
     
    146132    if (m_pMainMenu && !m_pMainMenu->isEmpty())
    147133    {
    148         m_pMainMenu->popup(machineWindow()->geometry().center());
     134        m_pMainMenu->popup(geometry().center());
    149135        QTimer::singleShot(0, m_pMainMenu, SLOT(sltSelectFirstAction()));
    150136    }
     
    158144}
    159145#endif /* Q_WS_MAC */
    160 
    161 void UIMachineWindowSeamless::sltTryClose()
    162 {
    163     UIMachineWindow::sltTryClose();
    164 }
    165 
    166 void UIMachineWindowSeamless::retranslateUi()
    167 {
    168     /* Translate parent class: */
    169     UIMachineWindow::retranslateUi();
    170 }
    171146
    172147#ifdef Q_WS_MAC
     
    187162}
    188163#endif /* Q_WS_MAC */
    189 
    190 #ifdef Q_WS_X11
    191 bool UIMachineWindowSeamless::x11Event(XEvent *pEvent)
    192 {
    193     return UIMachineWindow::x11Event(pEvent);
    194 }
    195 #endif
    196 
    197 void UIMachineWindowSeamless::closeEvent(QCloseEvent *pEvent)
    198 {
    199     return UIMachineWindow::closeEvent(pEvent);
    200 }
    201164
    202165void UIMachineWindowSeamless::prepareSeamless()
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r41051 r41107  
    66
    77/*
    8  * Copyright (C) 2010 Oracle Corporation
     8 * Copyright (C) 2010-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#define __UIMachineWindowSeamless_h__
    2121
    22 /* Global includes */
    23 #include <QMainWindow>
    24 
    2522/* Local includes */
    26 #include "QIWithRetranslateUI.h"
    2723#include "UIMachineWindow.h"
    2824
     
    3026class VBoxMiniToolBar;
    3127
    32 class UIMachineWindowSeamless : public QIWithRetranslateUI2<QMainWindow>, public UIMachineWindow
     28class UIMachineWindowSeamless : public UIMachineWindow
    3329{
    3430    Q_OBJECT;
     
    4642private slots:
    4743
    48     /* Console callback handlers: */
    49     void sltMachineStateChanged();
    50     void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    51 
    5244    /* Popup main menu: */
    5345    void sltPopupMainMenu();
     
    5850#endif /* RT_OS_DARWIN */
    5951
    60     /* Close window reimplementation: */
    61     void sltTryClose();
    62 
    6352private:
    64 
    65     /* Translate routine: */
    66     void retranslateUi();
    6753
    6854    /* Event handlers: */
     
    7056    bool event(QEvent *pEvent);
    7157#endif /* Q_WS_MAC */
    72 #ifdef Q_WS_X11
    73     bool x11Event(XEvent *pEvent);
    74 #endif /* Q_WS_X11 */
    75     void closeEvent(QCloseEvent *pEvent);
    7658
    7759    /* Prepare helpers: */
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