Changeset 3762 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 22, 2007 12:14:05 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
r3728 r3762 71 71 void refreshView(); 72 72 73 bool isTrueFullscreen() const { return mIs InFullscreenMode; }74 75 bool isTrueSeamless() const { return mIs InSeamlessMode; }76 77 void setMouseIntegrationLocked (bool );78 79 void popup SeamlessMenu();73 bool isTrueFullscreen() const { return mIsFullscreen; } 74 75 bool isTrueSeamless() const { return mIsSeamless; } 76 77 void setMouseIntegrationLocked (bool aDisabled); 78 79 void popupMainMenu (bool aCenter); 80 80 81 81 public slots: … … 180 180 private: 181 181 182 QPopupMenu *mSeamlessPopupMenu; 182 /** Popup version of the main menu */ 183 QPopupMenu *mMainMenu; 183 184 184 185 QActionGroup *runningActions; 185 186 186 // VMactions187 // Machine actions 187 188 QAction *vmFullscreenAction; 188 189 QAction *vmSeamlessAction; … … 199 200 QAction *vmTakeSnapshotAction; 200 201 QAction *vmDisableMouseIntegrAction; 201 202 // VM popup menus203 VBoxSwitchMenu *vmAutoresizeMenu;204 VBoxSwitchMenu *vmDisMouseIntegrMenu;205 202 206 203 // Devices actions … … 223 220 QAction *helpAboutAction; 224 221 QAction *helpResetMessagesAction; 222 223 // Machine popup menus 224 VBoxSwitchMenu *vmAutoresizeMenu; 225 VBoxSwitchMenu *vmDisMouseIntegrMenu; 225 226 226 227 // Devices popup menus … … 288 289 289 290 // variables for dealing with true fullscreen 290 bool mIs InFullscreenMode: 1;291 bool mIs InSeamlessMode: 1;292 bool mIsSeamless ModeSupported : 1;291 bool mIsFullscreen : 1; 292 bool mIsSeamless : 1; 293 bool mIsSeamlessSupported : 1; 293 294 int normal_wflags; 294 295 bool was_max : 1; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r3740 r3762 1132 1132 else if (ke->key() == Key_Home) 1133 1133 { 1134 if (mainwnd->isTrueSeamless()) 1135 mainwnd->popupSeamlessMenu(); 1134 /* activate the main menu */ 1135 if (mainwnd->isTrueSeamless() || mainwnd->isTrueFullscreen()) 1136 mainwnd->popupMainMenu (mouse_captured); 1136 1137 else 1137 1138 mainwnd->menuBar()->setFocus(); … … 1139 1140 else 1140 1141 { 1141 /* 1142 * process hot keys not processed in keyEvent() 1143 * (as in case of non-alphanumeric keys) 1144 */ 1142 /* process hot keys not processed in keyEvent() 1143 * (as in case of non-alphanumeric keys) */ 1145 1144 processHotKey (QKeySequence (ke->key()), 1146 1145 mainwnd->menuBar()); … … 1151 1150 if (isPaused()) 1152 1151 { 1153 /* 1154 * if the reminder is disabled we pass the event to 1155 * Qt to enable normal keyboard functionality 1156 * (for example, menu access with Alt+Letter) 1157 */ 1152 /* if the reminder is disabled we pass the event to 1153 * Qt to enable normal keyboard functionality 1154 * (for example, menu access with Alt+Letter) */ 1158 1155 if (!vboxProblem().remindAboutPausedVMInput()) 1159 1156 break; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r3728 r3762 215 215 WFlags aFlags) 216 216 : QMainWindow (aParent, aName, aFlags) 217 , m SeamlessPopupMenu (0)217 , mMainMenu (0) 218 218 #ifdef VBOX_WITH_DEBUGGER_GUI 219 219 , dbgStatisticsAction (NULL) … … 226 226 , machine_state (CEnums::InvalidMachineState) 227 227 , no_auto_close (false) 228 , mIs InFullscreenMode(false)229 , mIs InSeamlessMode(false)230 , mIsSeamless ModeSupported (false)228 , mIsFullscreen (false) 229 , mIsSeamless (false) 230 , mIsSeamlessSupported (false) 231 231 , normal_wflags (getWFlags()) 232 232 , was_max (false) … … 377 377 ///// Menubar /////////////////////////////////////////////////////////// 378 378 379 m SeamlessPopupMenu = new QPopupMenu (this, "mSeamlessPopupMenu");380 381 /* VM popupmenu */379 mMainMenu = new QPopupMenu (this, "mMainMenu"); 380 381 /* Machine submenu */ 382 382 383 383 QPopupMenu *vmMenu = new QPopupMenu (this, "vmMenu"); 384 385 /* dynamic & status line popup menus */ 386 vmAutoresizeMenu = new VBoxSwitchMenu (vmMenu, vmAutoresizeGuestAction); 387 vmDisMouseIntegrMenu = new VBoxSwitchMenu (vmMenu, vmDisableMouseIntegrAction, 388 true /* inverted toggle state */); 389 384 390 vmFullscreenAction->addTo (vmMenu); 385 391 vmSeamlessAction->addTo (vmMenu); … … 401 407 vmMenu->insertSeparator(); 402 408 vmCloseAction->addTo (vmMenu); 409 403 410 menuBar()->insertItem (QString::null, vmMenu, vmMenuId); 404 vmAutoresizeMenu = new VBoxSwitchMenu (vmMenu, vmAutoresizeGuestAction); 405 vmDisMouseIntegrMenu = new VBoxSwitchMenu (vmMenu, vmDisableMouseIntegrAction, 406 true /* inverted toggle state */); 407 mSeamlessPopupMenu->insertItem (QString::null, vmMenu, vmMenuId); 408 409 /* Devices popup menu */ 411 mMainMenu->insertItem (QString::null, vmMenu, vmMenuId); 412 413 /* Devices submenu */ 410 414 411 415 devicesMenu = new QPopupMenu (this, "devicesMenu"); 412 416 413 /* two dynamic submenus */417 /* dynamic & statusline popup menus */ 414 418 devicesMountFloppyMenu = new QPopupMenu (devicesMenu, "devicesMountFloppyMenu"); 415 419 devicesMountDVDMenu = new QPopupMenu (devicesMenu, "devicesMountDVDMenu"); 416 417 420 devicesSharedFolders = new QPopupMenu (devicesMenu, "devicesSharedFolders"); 418 421 devicesNetworkMenu = new QPopupMenu (devicesMenu, "devicesNetworkMenu"); … … 439 442 devicesVRDPMenuSeparatorId = devicesMenu->insertSeparator(); 440 443 devicesInstallGuestToolsAction->addTo (devicesMenu); 444 441 445 menuBar()->insertItem (QString::null, devicesMenu, devicesMenuId); 446 mMainMenu->insertItem (QString::null, devicesMenu, devicesMenuId); 442 447 443 448 /* reset the "context menu" flag */ … … 445 450 devicesMenu->setItemParameter (devicesMountDVDMenuId, 0); 446 451 devicesMenu->setItemParameter (devicesUSBMenuId, 0); 447 mSeamlessPopupMenu->insertItem (QString::null, devicesMenu, devicesMenuId);448 452 449 453 #ifdef VBOX_WITH_DEBUGGER_GUI … … 455 459 dbgCommandLineAction->addTo (dbgMenu); 456 460 menuBar()->insertItem (QString::null, dbgMenu, dbgMenuId); 457 m SeamlessPopupMenu->insertItem (QString::null, dbgMenu, dbgMenuId);461 mMainMenu->insertItem (QString::null, dbgMenu, dbgMenuId); 458 462 } 459 463 else … … 461 465 #endif 462 466 463 /* Help popupmenu */467 /* Help submenu */ 464 468 465 469 QPopupMenu *helpMenu = new QPopupMenu( this, "helpMenu" ); 470 466 471 helpWebAction->addTo( helpMenu ); 467 472 helpMenu->insertSeparator(); … … 469 474 helpMenu->insertSeparator(); 470 475 helpResetMessagesAction->addTo (helpMenu); 476 471 477 menuBar()->insertItem( QString::null, helpMenu, helpMenuId ); 472 m SeamlessPopupMenu->insertItem (QString::null, helpMenu, helpMenuId);478 mMainMenu->insertItem (QString::null, helpMenu, helpMenuId); 473 479 474 480 ///// Status bar //////////////////////////////////////////////////////// … … 786 792 normal_pos = QPoint (x, y); 787 793 normal_size = QSize (w, h); 788 if (!mIs InFullscreenMode&& !vmSeamlessAction->isOn())794 if (!mIsFullscreen && !vmSeamlessAction->isOn()) 789 795 { 790 796 move (normal_pos); … … 803 809 normal_pos = QPoint(); 804 810 normal_size = QSize(); 805 if (!mIs InFullscreenMode&& !vmSeamlessAction->isOn())811 if (!mIsFullscreen && !vmSeamlessAction->isOn()) 806 812 { 807 813 console->normalizeGeometry (true /* adjustPosition */); … … 1039 1045 .arg (normal_size.width()) 1040 1046 .arg (normal_size.height()); 1041 if (isMaximized() || (mIs InFullscreenMode&& was_max)1042 || (mIs InSeamlessMode&& was_max))1047 if (isMaximized() || (mIsFullscreen && was_max) 1048 || (mIsSeamless && was_max)) 1043 1049 winPos += QString (",%1").arg (GUI_LastWindowPosition_Max); 1044 1050 … … 1082 1088 } 1083 1089 1084 void VBoxConsoleWnd::popupSeamlessMenu() 1085 { 1086 mSeamlessPopupMenu->popup (QCursor::pos()); 1090 /** 1091 * Shows up and activates the popup version of the main menu. 1092 * 1093 * @param aCenter If @a true, center the popup menu on the screen, otherwise 1094 * show it at the current mouse pointer location. 1095 */ 1096 void VBoxConsoleWnd::popupMainMenu (bool aCenter) 1097 { 1098 QPoint pos = QCursor::pos(); 1099 if (aCenter) 1100 { 1101 QRect deskGeo = QApplication::desktop()->screenGeometry (this); 1102 QRect popGeo = mMainMenu->frameGeometry(); 1103 popGeo.moveCenter (QPoint (deskGeo.width() / 2, deskGeo.height() / 2)); 1104 pos = popGeo.topLeft(); 1105 } 1106 else 1107 { 1108 /* put the menu's bottom right corner to the pointer's hotspot point */ 1109 pos.setX (pos.x() - mMainMenu->frameGeometry().width()); 1110 pos.setY (pos.y() - mMainMenu->frameGeometry().height()); 1111 } 1112 1113 mMainMenu->popup (pos); 1114 mMainMenu->setActiveWindow(); 1115 mMainMenu->setActiveItem (0); 1087 1116 } 1088 1117 … … 1102 1131 { 1103 1132 QResizeEvent *re = (QResizeEvent *) e; 1104 if (!mIs InFullscreenMode && !mIsInSeamlessMode&&1133 if (!mIsFullscreen && !mIsSeamless && 1105 1134 (windowState() & (WindowMaximized | WindowMinimized | 1106 1135 WindowFullScreen)) == 0) … … 1115 1144 case QEvent::Move: 1116 1145 { 1117 if (!mIs InFullscreenMode && !mIsInSeamlessMode&&1146 if (!mIsFullscreen && !mIsSeamless && 1118 1147 (windowState() & (WindowMaximized | WindowMinimized | 1119 1148 WindowFullScreen)) == 0) … … 1495 1524 1496 1525 menuBar()->changeItem (vmMenuId, tr ("&Machine")); 1497 m SeamlessPopupMenu->changeItem (vmMenuId,1498 VBoxGlobal::iconSet (" ico16x01.png"), tr ("&Machine"));1526 mMainMenu->changeItem (vmMenuId, 1527 VBoxGlobal::iconSet ("machine_16px.png"), tr ("&Machine")); 1499 1528 menuBar()->changeItem (devicesMenuId, tr ("&Devices")); 1500 m SeamlessPopupMenu->changeItem (devicesMenuId,1501 VBoxGlobal::iconSet (" diskim_16px.png"), tr ("&Devices"));1529 mMainMenu->changeItem (devicesMenuId, 1530 VBoxGlobal::iconSet ("settings_16px.png"), tr ("&Devices")); 1502 1531 #ifdef VBOX_WITH_DEBUGGER_GUI 1503 1532 if (vboxGlobal().isDebuggerEnabled()) 1504 1533 { 1505 1534 menuBar()->changeItem (dbgMenuId, tr ("De&bug")); 1506 mSeamlessPopupMenu->changeItem (dbgMenuId, 1507 VBoxGlobal::iconSet ("global_settings_16px.png"), tr ("De&bug")); 1535 mMainMenu->changeItem (dbgMenuId, tr ("De&bug")); 1508 1536 } 1509 1537 #endif 1510 1538 menuBar()->changeItem (helpMenuId, tr ("&Help")); 1511 m SeamlessPopupMenu->changeItem (helpMenuId,1539 mMainMenu->changeItem (helpMenuId, 1512 1540 VBoxGlobal::iconSet ("help_16px.png"), tr ("&Help")); 1513 1541 … … 1789 1817 { 1790 1818 if (aSeamless && 1791 (aOn && !mIsSeamless ModeSupported ||1792 aOn && mIs InFullscreenMode||1793 !aOn && !mIs InSeamlessMode))1819 (aOn && !mIsSeamlessSupported || 1820 aOn && mIsFullscreen || 1821 !aOn && !mIsSeamless)) 1794 1822 return; 1795 1823 … … 1797 1825 AssertReturnVoid ((hidden_children.isEmpty() == aOn)); 1798 1826 if (aSeamless) 1799 AssertReturnVoid (mIs InSeamlessMode!= aOn);1827 AssertReturnVoid (mIsSeamless != aOn); 1800 1828 else 1801 AssertReturnVoid (mIs InFullscreenMode!= aOn);1829 AssertReturnVoid (mIsFullscreen != aOn); 1802 1830 1803 1831 if (aOn) … … 1833 1861 else 1834 1862 { 1835 mIs InFullscreenMode= aOn;1863 mIsFullscreen = aOn; 1836 1864 vmAdjustWindowAction->setEnabled (!aOn); 1837 1865 vmSeamlessAction->setEnabled (!aOn); … … 1843 1871 { 1844 1872 if (aSeamless) 1845 mIs InSeamlessMode= true;1873 mIsSeamless = true; 1846 1874 1847 1875 /* Save the previous scroll-view minimum size before entering … … 1982 2010 1983 2011 if (aSeamless) 1984 mIs InSeamlessMode= false;2012 mIsSeamless = false; 1985 2013 } 1986 2014 … … 2759 2787 vmAutoresizeGuestAction->setEnabled (aActive); 2760 2788 vmSeamlessAction->setEnabled (aSeamless); 2761 mIsSeamless ModeSupported = aSeamless;2789 mIsSeamlessSupported = aSeamless; 2762 2790 if (aSeamless && vmSeamlessAction->isOn()) 2763 2791 vmSeamless (true); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r3483 r3762 2232 2232 delete list; 2233 2233 2234 /// @todo (r=dmik) not sure ,we really need this2234 /// @todo (r=dmik) not sure if we really need this 2235 2235 #if 0 2236 2236 /* sanity check for decoration frames. With embedding, we
Note:
See TracChangeset
for help on using the changeset viewer.