- Timestamp:
- May 2, 2012 12:14:21 AM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk ¶
r41021 r41107 285 285 src/runtime/UIMachine.h \ 286 286 src/runtime/UIMachineLogic.h \ 287 src/runtime/UIMachineWindow.h \ 287 288 src/runtime/UIMachineView.h \ 288 289 src/runtime/UIMouseHandler.h \ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp ¶
r39882 r41107 7 7 8 8 /* 9 * Copyright (C) 2006-20 09Oracle Corporation9 * Copyright (C) 2006-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 46 46 /* Creating new information dialog if there is no one existing */ 47 47 VBoxVMInformationDlg *id = new VBoxVMInformationDlg(pMachineWindow, Qt::Window); 48 id->centerAccording (pMachineWindow ->machineWindow());48 id->centerAccording (pMachineWindow); 49 49 // TODO_NEW_CORE: this seems not necessary, cause we set WA_DeleteOnClose. 50 50 id->setAttribute (Qt::WA_DeleteOnClose); … … 61 61 VBoxVMInformationDlg::VBoxVMInformationDlg (UIMachineWindow *pMachineWindow, Qt::WindowFlags aFlags) 62 62 # ifdef Q_WS_MAC 63 : QIWithRetranslateUI2 <QIMainDialog> (pMachineWindow ->machineWindow(), aFlags)63 : QIWithRetranslateUI2 <QIMainDialog> (pMachineWindow, aFlags) 64 64 # else /* Q_WS_MAC */ 65 65 : QIWithRetranslateUI2 <QIMainDialog> (0, aFlags) -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp ¶
r38985 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 120 120 m_windows.insert(uIndex, pMachineWindow); 121 121 /* Install event-filter for window: */ 122 m_windows[uIndex]-> machineWindow()->installEventFilter(this);122 m_windows[uIndex]->installEventFilter(this); 123 123 } 124 124 … … 184 184 case UIVisualStateType_Scale: 185 185 { 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); 187 187 break; 188 188 } … … 195 195 * and after we will just ignore that issue: */ 196 196 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; } 198 198 break; 199 199 } … … 242 242 case UIVisualStateType_Scale: 243 243 { 244 XUngrabKey(QX11Info::display(), AnyKey, AnyModifier, m_windows[m_iKeyboardCaptureViewIndex]-> machineWindow()->winId());244 XUngrabKey(QX11Info::display(), AnyKey, AnyModifier, m_windows[m_iKeyboardCaptureViewIndex]->winId()); 245 245 break; 246 246 } … … 1660 1660 { 1661 1661 UIMachineWindow *pIteratedWindow = i.value(); 1662 if (pIteratedWindow ->machineWindow()== pWatchedObject)1662 if (pIteratedWindow == pWatchedObject) 1663 1663 { 1664 1664 pResultWindow = pIteratedWindow; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp ¶
r41064 r41107 417 417 QWidget* UIMachine::mainWindow() const 418 418 { 419 if (machineLogic() && 420 machineLogic()->mainMachineWindow() && 421 machineLogic()->mainMachineWindow()->machineWindow()) 422 return machineLogic()->mainMachineWindow()->machineWindow(); 419 if (machineLogic() && machineLogic()->mainMachineWindow()) 420 return machineLogic()->mainMachineWindow(); 423 421 else 424 422 return 0; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp ¶
r41064 r41107 227 227 foreach (UIMachineWindow *pWindowToCheck, machineWindows()) 228 228 { 229 if (pWindowToCheck-> machineWindow()->isActiveWindow())229 if (pWindowToCheck->isActiveWindow()) 230 230 { 231 231 pWindowToPropose = pWindowToCheck; … … 419 419 * what. So, I'll just always show & activate the stupid window to 420 420 * 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(); 423 423 } 424 424 } … … 846 846 { 847 847 /* Exit maximized window state if actual: */ 848 if (pMachineWindow-> machineWindow()->isMaximized())849 pMachineWindow-> machineWindow()->showNormal();848 if (pMachineWindow->isMaximized()) 849 pMachineWindow->showNormal(); 850 850 851 851 /* Normalize view's geometry: */ … … 907 907 CMachine machine = session().GetMachine(); 908 908 909 VBoxTakeSnapshotDlg dlg(defaultMachineWindow() ->machineWindow(), machine);909 VBoxTakeSnapshotDlg dlg(defaultMachineWindow(), machine); 910 910 911 911 QString strTypeId = machine.GetOSTypeId(); … … 978 978 QString strFilename = QIFileDialog::getSaveFileName(strStart, 979 979 filters.join(";;"), 980 defaultMachineWindow() ->machineWindow(),980 defaultMachineWindow(), 981 981 tr("Select a filename for the screenshot ..."), 982 982 &strFilter, … … 1007 1007 ulong uMonitorCount = session().GetMachine().GetMonitorCount(); 1008 1008 for (ulong uScreenId = 1; uScreenId < uMonitorCount; ++uScreenId) 1009 machineWindows().at(uScreenId)-> machineWindow()->update();1009 machineWindows().at(uScreenId)->update(); 1010 1010 } 1011 1011 … … 1047 1047 1048 1048 /* Create and execute current VM settings dialog: */ 1049 UISettingsDialogMachine dlg(defaultMachineWindow() ->machineWindow(),1049 UISettingsDialogMachine dlg(defaultMachineWindow(), 1050 1050 session().GetMachine().GetId(), strCategory, QString()); 1051 1051 dlg.execute(); … … 1062 1062 /* Do not process if additions are not loaded! */ 1063 1063 if (!uisession()->isGuestAdditionsActive()) 1064 msgCenter().remindAboutGuestAdditionsAreNotActive(defaultMachineWindow() ->machineWindow());1064 msgCenter().remindAboutGuestAdditionsAreNotActive(defaultMachineWindow()); 1065 1065 1066 1066 /* Open VM settings : Shared folders page: */ … … 1315 1315 /* Call for file-open window: */ 1316 1316 QString strMachineFolder(QFileInfo(machine.GetSettingsFilePath()).absolutePath()); 1317 QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(target.type, defaultMachineWindow() ->machineWindow(),1317 QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(target.type, defaultMachineWindow(), 1318 1318 strMachineFolder); 1319 1319 defaultMachineWindow()->machineView()->setFocus(); … … 1640 1640 { 1641 1641 /* Show VM Log Viewer: */ 1642 UIVMLogViewer::showLogViewerFor(mainMachineWindow() ->machineWindow(), session().GetMachine());1642 UIVMLogViewer::showLogViewerFor(mainMachineWindow(), session().GetMachine()); 1643 1643 } 1644 1644 … … 1777 1777 || m_pDbgGuiVT->u32EndVersion == m_pDbgGuiVT->u32Version) 1778 1778 { 1779 m_pDbgGuiVT->pfnSetParent(m_pDbgGui, defaultMachineWindow() ->machineWindow());1779 m_pDbgGuiVT->pfnSetParent(m_pDbgGui, defaultMachineWindow()); 1780 1780 m_pDbgGuiVT->pfnSetMenu(m_pDbgGui, gActionPool->action(UIActionIndexRuntime_Menu_Debug)); 1781 1781 dbgAdjustRelativePos(); … … 1811 1811 if (m_pDbgGui) 1812 1812 { 1813 QRect rct = defaultMachineWindow()-> machineWindow()->frameGeometry();1813 QRect rct = defaultMachineWindow()->frameGeometry(); 1814 1814 m_pDbgGuiVT->pfnAdjustRelativePos(m_pDbgGui, rct.x(), rct.y(), rct.width(), rct.height()); 1815 1815 } -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp ¶
r41049 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 156 156 /* Get the current machine: */ 157 157 CMachine machine = session().GetMachine(); 158 /* Get machine window: */159 QMainWindow *pMachineWindow = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?160 qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;161 158 162 159 /* If this slot is invoked directly then use the passed size otherwise get 163 160 * the available size for the guest display. We assume here that centralWidget() 164 161 * 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()); 166 163 AssertMsg(newSize.isValid(), ("Size should be valid!\n")); 167 164 … … 238 235 #endif /* VBOX_WITH_VIDEOHWACCEL */ 239 236 ) 240 : QAbstractScrollArea(pMachineWindow ->machineWindow())237 : QAbstractScrollArea(pMachineWindow) 241 238 , m_pMachineWindow(pMachineWindow) 242 239 , m_uScreenId(uScreenId) … … 293 290 * this [VBox|UI] duplication 294 291 * @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()); 296 293 } 297 294 else … … 335 332 * this [VBox|UI] duplication 336 333 * @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()); 338 335 } 339 336 else … … 381 378 * this [VBox|UI] duplication 382 379 * @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()); 384 381 } 385 382 else … … 483 480 484 481 /* We want to be notified on some parent's events: */ 485 machineWindow Wrapper()->machineWindow()->installEventFilter(this);482 machineWindow()->installEventFilter(this); 486 483 } 487 484 … … 563 560 UIMachineLogic* UIMachineView::machineLogic() const 564 561 { 565 return machineWindow Wrapper()->machineLogic();562 return machineWindow()->machineLogic(); 566 563 } 567 564 … … 1022 1019 } 1023 1020 #endif /* VBOX_WITH_VIDEOHWACCEL */ 1024 if (pWatched == machineWindow Wrapper()->machineWindow())1021 if (pWatched == machineWindow()) 1025 1022 { 1026 1023 switch (pEvent->type()) … … 1028 1025 case QEvent::WindowStateChange: 1029 1026 { 1030 /* During minimizing and state restoring machineWindow Wrapper() gets1027 /* During minimizing and state restoring machineWindow() gets 1031 1028 * the focus which belongs to console view window, so returning it properly. */ 1032 1029 QWindowStateChangeEvent *pWindowEvent = static_cast<QWindowStateChangeEvent*>(pEvent); -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h ¶
r39451 r41107 6 6 7 7 /* 8 * Copyright (C) 2010 Oracle Corporation8 * Copyright (C) 2010-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 121 121 122 122 /* Protected getters: */ 123 UIMachineWindow* machineWindow Wrapper() const { return m_pMachineWindow; }123 UIMachineWindow* machineWindow() const { return m_pMachineWindow; } 124 124 UIMachineLogic* machineLogic() const; 125 125 UISession* uisession() const; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp ¶
r41051 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 90 90 { 91 91 widget->close(); 92 QTimer::singleShot(0, machineWindow(), SLOT(sltTryClose()));92 QTimer::singleShot(0, this, SLOT(sltTryClose())); 93 93 } 94 94 else 95 machineWindow()->close();95 close(); 96 96 } 97 97 98 98 UIMachineWindow::UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId) 99 : m_pMachineLogic(pMachineLogic)100 , m_pMachine Window(0)99 : QIWithRetranslateUI2<QMainWindow>(0, windowFlags(pMachineLogic->visualStateType())) 100 , m_pMachineLogic(pMachineLogic) 101 101 , m_uScreenId(uScreenId) 102 102 , m_pMachineViewContainer(0) … … 138 138 } 139 139 140 void UIMachineWindow::setMask(const QRegion ®ion)141 {142 machineWindow()->setMask(region);143 }144 145 140 void UIMachineWindow::retranslateUi() 146 141 { … … 206 201 } 207 202 /* Prepare close dialog: */ 208 UIVMCloseDialog dlg( machineWindow());203 UIVMCloseDialog dlg(this); 209 204 210 205 /* Assign close-dialog pixmap: */ … … 433 428 * 1. On Win32, it's built-in to the executable; 434 429 * 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")); 436 431 #endif 437 432 438 433 #ifndef Q_WS_MAC 439 434 /* 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())); 441 436 #endif 442 437 } … … 445 440 { 446 441 /* Machine state-change updater: */ 447 QObject::connect(uisession(), SIGNAL(sigMachineStateChange()), machineWindow(), SLOT(sltMachineStateChanged()));442 connect(uisession(), SIGNAL(sigMachineStateChange()), this, SLOT(sltMachineStateChanged())); 448 443 449 444 /* 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))); 452 447 } 453 448 … … 517 512 if (machine.GetMonitorCount() > 1) 518 513 strMachineName += QString(" : %1").arg(m_uScreenId + 1); 519 machineWindow()->setWindowTitle(strMachineName);514 setWindowTitle(strMachineName); 520 515 } 521 516 } … … 546 541 547 542 /* Process KGuestMonitorChangedEventType_Enabled change event: */ 548 if ( machineWindow()->isHidden() && changeType == KGuestMonitorChangedEventType_Enabled)543 if (isHidden() && changeType == KGuestMonitorChangedEventType_Enabled) 549 544 showInNecessaryMode(); 550 545 /* 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 550 Qt::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 6 6 7 7 /* 8 * Copyright (C) 2010 Oracle Corporation8 * Copyright (C) 2010-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #define __UIMachineWindow_h__ 21 21 22 /* Global includes */ 23 #include <QMainWindow> 24 22 25 /* Local includes */ 26 #include "QIWithRetranslateUI.h" 23 27 #include "UIMachineDefs.h" 24 28 #include "COMDefs.h" … … 36 40 class UIMachineView; 37 41 38 class UIMachineWindow 42 class UIMachineWindow : public QIWithRetranslateUI2<QMainWindow> 39 43 { 44 Q_OBJECT; 45 40 46 public: 41 47 … … 44 50 static void destroy(UIMachineWindow *pWhichWindow); 45 51 46 /* Abstract slot to close machine window: */47 virtual void sltTryClose();48 49 52 /* Public getters: */ 50 53 virtual UIMachineLogic* machineLogic() const { return m_pMachineLogic; } 51 virtual QWidget* machineWindow() const { return m_pMachineWindow; }52 54 virtual UIMachineView* machineView() const { return m_pMachineView; } 53 55 UISession* uisession() const; 54 56 CSession& session() const; 55 57 56 /* Public members: */ 57 virtual void reshow() {} 58 virtual void setMask(const QRegion ®ion); 58 protected 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(); 59 66 60 67 protected: … … 96 103 #endif /* VBOX_WITH_DEBUGGER_GUI */ 97 104 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); 101 107 102 108 /* Show routine: */ … … 105 111 /* Protected variables: */ 106 112 UIMachineLogic *m_pMachineLogic; 107 QWidget *m_pMachineWindow;108 113 109 114 /* Virtual screen number: */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp ¶
r39452 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 92 92 { 93 93 /* Register machine-window: */ 94 m_windows.insert(uIndex, pMachineWindow ->machineWindow());94 m_windows.insert(uIndex, pMachineWindow); 95 95 /* Install event-filter for machine-window: */ 96 96 m_windows[uIndex]->installEventFilter(this); … … 557 557 if (!uisession()->isMouseCaptured() && 558 558 QApplication::activeWindow() && 559 QApplication::activeWindow()->inherits("UIMachineWindow") && 559 m_windows.values().contains(QApplication::activeWindow()) && 560 m_windows.values().contains(pWatchedWidget->window()) && 560 561 QApplication::activeWindow() != pWatchedWidget->window()) 561 562 { -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp ¶
r41106 r41107 315 315 QWidget* UISession::mainMachineWindow() const 316 316 { 317 return uimachine()->machineLogic()->mainMachineWindow() ->machineWindow();317 return uimachine()->machineLogic()->mainMachineWindow(); 318 318 } 319 319 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIKeyboardHandlerFullscreen.cpp ¶
r35752 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 59 59 { 60 60 /* 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())); 62 62 /* Filter-out this event: */ 63 63 return true; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp ¶
r39081 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 110 110 bool UIMachineViewFullscreen::eventFilter(QObject *pWatched, QEvent *pEvent) 111 111 { 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()) 117 113 { 118 114 switch (pEvent->type()) … … 158 154 UIMachineView::prepareFilters(); 159 155 160 #ifdef Q_WS_MAC // TODO: Is it really needed? See UIMachineView Seamless::eventFilter(...);156 #ifdef Q_WS_MAC // TODO: Is it really needed? See UIMachineViewFullscreen::eventFilter(...); 161 157 /* Menu bar filter: */ 162 qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);163 #endif 158 machineWindow()->menuBar()->installEventFilter(this); 159 #endif /* Q_WS_MAC */ 164 160 } 165 161 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp ¶
r41051 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 36 36 37 37 UIMachineWindowFullscreen::UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId) 38 : QIWithRetranslateUI2<QMainWindow>(0, Qt::FramelessWindowHint) 39 , UIMachineWindow(pMachineLogic, uScreenId) 38 : UIMachineWindow(pMachineLogic, uScreenId) 40 39 , m_pMainMenu(0) 41 40 , m_pMiniToolBar(0) 42 41 { 43 /* "This" is machine window: */44 m_pMachineWindow = this;45 46 42 /* Set the main window in VBoxGlobal: */ 47 43 if (uScreenId == 0) … … 111 107 } 112 108 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 123 109 void UIMachineWindowFullscreen::sltPopupMainMenu() 124 110 { … … 126 112 if (m_pMainMenu && !m_pMainMenu->isEmpty()) 127 113 { 128 m_pMainMenu->popup( machineWindow()->geometry().center());114 m_pMainMenu->popup(geometry().center()); 129 115 QTimer::singleShot(0, m_pMainMenu, SLOT(sltSelectFirstAction())); 130 116 } 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_X11145 bool UIMachineWindowFullscreen::x11Event(XEvent *pEvent)146 {147 return UIMachineWindow::x11Event(pEvent);148 }149 #endif150 151 void UIMachineWindowFullscreen::closeEvent(QCloseEvent *pEvent)152 {153 return UIMachineWindow::closeEvent(pEvent);154 117 } 155 118 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h ¶
r41051 r41107 6 6 7 7 /* 8 * Copyright (C) 2010 Oracle Corporation8 * Copyright (C) 2010-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #define __UIMachineWindowFullscreen_h__ 21 21 22 /* Global includes */23 #include <QMainWindow>24 25 22 /* Local includes */ 26 #include "QIWithRetranslateUI.h"27 23 #include "UIMachineWindow.h" 28 24 … … 30 26 class VBoxMiniToolBar; 31 27 32 class UIMachineWindowFullscreen : public QIWithRetranslateUI2<QMainWindow>, publicUIMachineWindow28 class UIMachineWindowFullscreen : public UIMachineWindow 33 29 { 34 30 Q_OBJECT; … … 46 42 private slots: 47 43 48 /* Console callback handlers: */49 void sltMachineStateChanged();50 void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);51 52 44 /* Popup main menu: */ 53 45 void sltPopupMainMenu(); 54 46 55 /* Close window reimplementation: */56 void sltTryClose();57 58 47 private: 59 60 /* Translate routine: */61 void retranslateUi();62 63 /* Event handlers: */64 #ifdef Q_WS_X1165 bool x11Event(XEvent *pEvent);66 #endif /* Q_WS_X11 */67 void closeEvent(QCloseEvent *pEvent);68 48 69 49 /* Prepare helpers: */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIKeyboardHandlerNormal.cpp ¶
r35752 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 62 62 { 63 63 /* 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(); 65 65 /* If menu-bar is present and have actions: */ 66 66 if (pMenuBar && !pMenuBar->actions().isEmpty()) -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp ¶
r41064 r41107 104 104 /* Order machine window(s): */ 105 105 for (ulong uScreenId = uMonitorCount; uScreenId > 0; -- uScreenId) 106 machineWindows()[uScreenId - 1]-> machineWindow()->raise();106 machineWindows()[uScreenId - 1]->raise(); 107 107 108 108 /* Remember what machine window(s) created: */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp ¶
r39094 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 110 110 bool UIMachineViewNormal::eventFilter(QObject *pWatched, QEvent *pEvent) 111 111 { 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()) 120 113 { 121 114 switch (pEvent->type()) … … 145 138 146 139 #ifdef Q_WS_WIN 147 else if (pWatched != 0 && pWatched == pMenuBar)140 else if (pWatched != 0 && pWatched == machineWindow()->menuBar()) 148 141 { 149 142 /* Due to windows host uses separate 'focus set' to let menubar to … … 184 177 185 178 /* Menu bar filters: */ 186 qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);179 machineWindow()->menuBar()->installEventFilter(this); 187 180 } 188 181 … … 302 295 /* The area taken up by the machine window on the desktop, 303 296 * including window frame, title, menu bar and status bar: */ 304 QRect windowGeo = machineWindow Wrapper()->machineWindow()->frameGeometry();297 QRect windowGeo = machineWindow()->frameGeometry(); 305 298 /* 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(); 307 300 /* To work out how big we can make the console window while still fitting on the desktop, 308 301 * we calculate workingArea() - (windowGeo - centralWidgetGeo). -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp ¶
r41051 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 50 50 51 51 UIMachineWindowNormal::UIMachineWindowNormal(UIMachineLogic *pMachineLogic, ulong uScreenId) 52 : QIWithRetranslateUI2<QMainWindow>(0, Qt::Window) 53 , UIMachineWindow(pMachineLogic, uScreenId) 52 : UIMachineWindow(pMachineLogic, uScreenId) 54 53 , m_pIndicatorsPool(new UIIndicatorsPool(pMachineLogic->uisession()->session(), this)) 55 54 , m_pIdleTimer(0) 56 55 { 57 /* "This" is machine window: */58 m_pMachineWindow = this;59 60 56 /* Set the main window in VBoxGlobal */ 61 57 if (uScreenId == 0) … … 164 160 updateAppearanceOf(UIVisualElement_VirtualizationStuff); 165 161 } 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 0178 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 #endif205 162 206 163 void UIMachineWindowNormal::sltUpdateIndicators() … … 335 292 } 336 293 337 #ifdef Q_WS_X11338 bool UIMachineWindowNormal::x11Event(XEvent *pEvent)339 {340 return UIMachineWindow::x11Event(pEvent);341 }342 #endif343 344 void UIMachineWindowNormal::closeEvent(QCloseEvent *pEvent)345 {346 return UIMachineWindow::closeEvent(pEvent);347 }348 349 294 void UIMachineWindowNormal::prepareConsoleConnections() 350 295 { … … 451 396 statusBar()->addPermanentWidget(pIndicatorBox, 0); 452 397 453 #if 0454 /* 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 #endif466 467 398 /* Create & start timer to update LEDs: */ 468 399 m_pIdleTimer = new QTimer(this); … … 481 412 connect(&vboxGlobal().settings(), SIGNAL(propertyChanged(const char *, const char *)), 482 413 this, SLOT(sltProcessGlobalSettingChange(const char *, const char *))); 483 #if 0484 /* Setup network manager listener: */485 connect(gNetworkManager, SIGNAL(sigDownloaderCreated(UIDownloadType)), this, SLOT(sltEmbedDownloader(UIDownloadType)));486 #endif487 414 } 488 415 … … 565 492 566 493 QRect ar = ok ? QApplication::desktop()->availableGeometry(QPoint(x, y)) : 567 QApplication::desktop()->availableGeometry( machineWindow());494 QApplication::desktop()->availableGeometry(this); 568 495 569 496 /* If previous parameters were read correctly: */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h ¶
r41051 r41107 6 6 7 7 /* 8 * Copyright (C) 2010 Oracle Corporation8 * Copyright (C) 2010-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 22 22 /* Global includes */ 23 #include <QMainWindow>24 23 #include <QLabel> 25 24 26 25 /* Local includes */ 27 #include "QIWithRetranslateUI.h"28 26 #include "UIMachineWindow.h" 29 #include "UINetworkDefs.h"30 27 31 28 /* Local forwards */ … … 34 31 class QIStateIndicator; 35 32 36 class UIMachineWindowNormal : public QIWithRetranslateUI2<QMainWindow>, publicUIMachineWindow33 class UIMachineWindowNormal : public UIMachineWindow 37 34 { 38 35 Q_OBJECT; … … 54 51 void sltSharedFolderChange(); 55 52 void sltCPUExecutionCapChange(); 56 void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);57 53 58 54 /* LED connections: */ … … 60 56 void sltShowIndicatorsContextMenu(QIStateIndicator *pIndicator, QContextMenuEvent *pEvent); 61 57 void sltProcessGlobalSettingChange(const char *aPublicName, const char *aName); 62 63 /* Close window reimplementation: */64 void sltTryClose();65 66 #if 067 /* Network manager handler: */68 void sltEmbedDownloader(UIDownloadType downloaderType);69 #endif70 58 71 59 private: … … 79 67 /* Event handlers: */ 80 68 bool event(QEvent *pEvent); 81 #ifdef Q_WS_X1182 bool x11Event(XEvent *pEvent);83 #endif84 void closeEvent(QCloseEvent *pEvent);85 69 86 70 /* Private getters: */ … … 108 92 void updateIndicatorState(QIStateIndicator *pIndicator, KDeviceType deviceType); 109 93 110 #if 0111 /* Network manager helpers: */112 void tryToEmbedDownloaderForAdditions() { sltEmbedDownloader(UIDownloadType_Additions); }113 void tryToEmbedDownloaderForUserManual() { sltEmbedDownloader(UIDownloadType_UserManual); }114 void tryToEmbedDownloaderForExtensionPack() { sltEmbedDownloader(UIDownloadType_ExtensionPack); }115 #endif116 117 94 /* Indicators pool: */ 118 95 UIIndicatorsPool *m_pIndicatorsPool; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIKeyboardHandlerScale.cpp ¶
r35752 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 62 62 { 63 63 /* 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())); 65 65 /* Filter-out this event: */ 66 66 return true; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp ¶
r41064 r41107 84 84 /* Order machine window(s): */ 85 85 for (ulong uScreenId = uMonitorCount; uScreenId > 0; -- uScreenId) 86 machineWindows()[uScreenId - 1]-> machineWindow()->raise();86 machineWindows()[uScreenId - 1]->raise(); 87 87 88 88 /* Remember what machine window(s) created: */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp ¶
r41049 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 216 216 bool UIMachineViewScale::eventFilter(QObject *pWatched, QEvent *pEvent) 217 217 { 218 /* Who are we watching? */219 QMainWindow *pMainDialog = machineWindowWrapper() && machineWindowWrapper()->machineWindow() ?220 qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;221 222 218 if (pWatched != 0 && pWatched == viewport()) 223 219 { … … 234 230 } 235 231 } 236 else if (pWatched != 0 && pWatched == pMainDialog)232 else if (pWatched != 0 && pWatched == machineWindow()) 237 233 { 238 234 switch (pEvent->type()) … … 285 281 /* The area taken up by the machine window on the desktop, 286 282 * including window frame, title, menu bar and status bar: */ 287 QRect windowGeo = machineWindow Wrapper()->machineWindow()->frameGeometry();283 QRect windowGeo = machineWindow()->frameGeometry(); 288 284 /* 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(); 290 286 /* To work out how big we can make the console window while still fitting on the desktop, 291 287 * we calculate workingArea() - (windowGeo - centralWidgetGeo). -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp ¶
r41051 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 38 38 39 39 UIMachineWindowScale::UIMachineWindowScale(UIMachineLogic *pMachineLogic, ulong uScreenId) 40 : QIWithRetranslateUI2<QMainWindow>(0, Qt::Window) 41 , UIMachineWindow(pMachineLogic, uScreenId) 40 : UIMachineWindow(pMachineLogic, uScreenId) 42 41 , m_pMainMenu(0) 43 42 { 44 /* "This" is machine window: */45 m_pMachineWindow = this;46 47 43 /* Set the main window in VBoxGlobal */ 48 44 if (uScreenId == 0) … … 108 104 } 109 105 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 120 106 void UIMachineWindowScale::sltPopupMainMenu() 121 107 { … … 123 109 if (m_pMainMenu && !m_pMainMenu->isEmpty()) 124 110 { 125 m_pMainMenu->popup( machineWindow()->geometry().center());111 m_pMainMenu->popup(geometry().center()); 126 112 QTimer::singleShot(0, m_pMainMenu, SLOT(sltSelectFirstAction())); 127 113 } 128 }129 130 void UIMachineWindowScale::sltTryClose()131 {132 UIMachineWindow::sltTryClose();133 }134 135 void UIMachineWindowScale::retranslateUi()136 {137 /* Translate parent class: */138 UIMachineWindow::retranslateUi();139 114 } 140 115 … … 219 194 } 220 195 #endif /* Q_WS_WIN */ 221 222 #ifdef Q_WS_X11223 bool UIMachineWindowScale::x11Event(XEvent *pEvent)224 {225 return UIMachineWindow::x11Event(pEvent);226 }227 #endif228 229 void UIMachineWindowScale::closeEvent(QCloseEvent *pEvent)230 {231 return UIMachineWindow::closeEvent(pEvent);232 }233 196 234 197 void UIMachineWindowScale::prepareMenu() … … 307 270 308 271 QRect ar = ok ? QApplication::desktop()->availableGeometry(QPoint(x, y)) : 309 QApplication::desktop()->availableGeometry( machineWindow());272 QApplication::desktop()->availableGeometry(this); 310 273 311 274 /* If previous parameters were read correctly: */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.h ¶
r41051 r41107 6 6 7 7 /* 8 * Copyright (C) 2010 Oracle Corporation8 * Copyright (C) 2010-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #define __UIMachineWindowScale_h__ 21 21 22 /* Global includes */23 #include <QMainWindow>24 25 22 /* Local includes */ 26 #include "QIWithRetranslateUI.h"27 23 #include "UIMachineWindow.h" 28 24 29 class UIMachineWindowScale : public QIWithRetranslateUI2<QMainWindow>, publicUIMachineWindow25 class UIMachineWindowScale : public UIMachineWindow 30 26 { 31 27 Q_OBJECT; … … 39 35 private slots: 40 36 41 /* Console callback handlers: */42 void sltMachineStateChanged();43 void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);44 45 37 /* Popup main menu: */ 46 38 void sltPopupMainMenu(); 47 39 48 /* Close window reimplementation: */49 void sltTryClose();50 51 40 private: 52 53 /* Translate routine: */54 void retranslateUi();55 41 56 42 /* Event handlers: */ … … 59 45 bool winEvent(MSG *pMessage, long *pResult); 60 46 #endif 61 #ifdef Q_WS_X1162 bool x11Event(XEvent *pEvent);63 #endif64 void closeEvent(QCloseEvent *pEvent);65 47 66 48 /* Prepare helpers: */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIKeyboardHandlerSeamless.cpp ¶
r35752 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 59 59 { 60 60 /* 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())); 62 62 /* Filter-out this event: */ 63 63 return true; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp ¶
r39081 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 104 104 { 105 105 m_lastVisibleRegion = pSetRegionEvent->region(); 106 machineWindow Wrapper()->setMask(m_lastVisibleRegion);106 machineWindow()->setMask(m_lastVisibleRegion); 107 107 } 108 108 return true; … … 122 122 bool UIMachineViewSeamless::eventFilter(QObject *pWatched, QEvent *pEvent) 123 123 { 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()) 129 125 { 130 126 switch (pEvent->type()) … … 172 168 #ifdef Q_WS_MAC // TODO: Is it really needed? See UIMachineViewSeamless::eventFilter(...); 173 169 /* Menu bar filter: */ 174 qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);175 #endif 170 machineWindow()->menuBar()->installEventFilter(this); 171 #endif /* Q_WS_MAC */ 176 172 } 177 173 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp ¶
r41051 r41107 7 7 8 8 /* 9 * Copyright (C) 2010 Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 42 42 43 43 UIMachineWindowSeamless::UIMachineWindowSeamless(UIMachineLogic *pMachineLogic, ulong uScreenId) 44 : QIWithRetranslateUI2<QMainWindow>(0, Qt::FramelessWindowHint) 45 , UIMachineWindow(pMachineLogic, uScreenId) 44 : UIMachineWindow(pMachineLogic, uScreenId) 46 45 , m_pMainMenu(0) 47 46 #ifndef Q_WS_MAC … … 49 48 #endif /* Q_WS_MAC */ 50 49 { 51 /* "This" is machine window: */52 m_pMachineWindow = this;53 54 50 /* Set the main window in VBoxGlobal: */ 55 51 if (uScreenId == 0) … … 131 127 } 132 128 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 143 129 void UIMachineWindowSeamless::sltPopupMainMenu() 144 130 { … … 146 132 if (m_pMainMenu && !m_pMainMenu->isEmpty()) 147 133 { 148 m_pMainMenu->popup( machineWindow()->geometry().center());134 m_pMainMenu->popup(geometry().center()); 149 135 QTimer::singleShot(0, m_pMainMenu, SLOT(sltSelectFirstAction())); 150 136 } … … 158 144 } 159 145 #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 }171 146 172 147 #ifdef Q_WS_MAC … … 187 162 } 188 163 #endif /* Q_WS_MAC */ 189 190 #ifdef Q_WS_X11191 bool UIMachineWindowSeamless::x11Event(XEvent *pEvent)192 {193 return UIMachineWindow::x11Event(pEvent);194 }195 #endif196 197 void UIMachineWindowSeamless::closeEvent(QCloseEvent *pEvent)198 {199 return UIMachineWindow::closeEvent(pEvent);200 }201 164 202 165 void UIMachineWindowSeamless::prepareSeamless() -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h ¶
r41051 r41107 6 6 7 7 /* 8 * Copyright (C) 2010 Oracle Corporation8 * Copyright (C) 2010-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #define __UIMachineWindowSeamless_h__ 21 21 22 /* Global includes */23 #include <QMainWindow>24 25 22 /* Local includes */ 26 #include "QIWithRetranslateUI.h"27 23 #include "UIMachineWindow.h" 28 24 … … 30 26 class VBoxMiniToolBar; 31 27 32 class UIMachineWindowSeamless : public QIWithRetranslateUI2<QMainWindow>, publicUIMachineWindow28 class UIMachineWindowSeamless : public UIMachineWindow 33 29 { 34 30 Q_OBJECT; … … 46 42 private slots: 47 43 48 /* Console callback handlers: */49 void sltMachineStateChanged();50 void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);51 52 44 /* Popup main menu: */ 53 45 void sltPopupMainMenu(); … … 58 50 #endif /* RT_OS_DARWIN */ 59 51 60 /* Close window reimplementation: */61 void sltTryClose();62 63 52 private: 64 65 /* Translate routine: */66 void retranslateUi();67 53 68 54 /* Event handlers: */ … … 70 56 bool event(QEvent *pEvent); 71 57 #endif /* Q_WS_MAC */ 72 #ifdef Q_WS_X1173 bool x11Event(XEvent *pEvent);74 #endif /* Q_WS_X11 */75 void closeEvent(QCloseEvent *pEvent);76 58 77 59 /* Prepare helpers: */
Note:
See TracChangeset
for help on using the changeset viewer.