Changeset 52344 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 11, 2014 3:29:06 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95469
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r52343 r52344 1390 1390 /* Call to corresponding handler: */ 1391 1391 updateMenuViewMultiscreen(pMenu); 1392 } 1393 1394 void UIActionPoolRuntime::sltHandleActionTriggerViewScreenToggle() 1395 { 1396 /* Make sure sender is valid: */ 1397 QAction *pAction = qobject_cast<QAction*>(sender()); 1398 AssertPtrReturnVoid(pAction); 1399 1400 /* Send request to enable/disable guest-screen: */ 1401 const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt(); 1402 const bool fScreenEnabled = pAction->isChecked(); 1403 emit sigNotifyAboutTriggeringViewScreenToggle(iGuestScreenIndex, fScreenEnabled); 1392 1404 } 1393 1405 … … 2110 2122 const UIFrameBuffer* pFrameBuffer = session()->frameBuffer(iGuestScreenIndex); 2111 2123 const QSize screenSize = QSize(pFrameBuffer->width(), pFrameBuffer->height()); 2124 const bool fScreenEnabled = session()->isScreenVisible(iGuestScreenIndex); 2125 2126 /* For non-primary screens: */ 2127 if (iGuestScreenIndex > 0) 2128 { 2129 /* Create 'toggle' action: */ 2130 QAction *pToggleAction = pMenu->addAction(UIActionPoolRuntime::tr("Enable", "Virtual Screen"), 2131 this, SLOT(sltHandleActionTriggerViewScreenToggle())); 2132 AssertPtrReturnVoid(pToggleAction); 2133 { 2134 /* Configure 'toggle' action: */ 2135 pToggleAction->setEnabled(session()->isGuestSupportsGraphics()); 2136 pToggleAction->setProperty("Guest Screen Index", iGuestScreenIndex); 2137 pToggleAction->setCheckable(true); 2138 pToggleAction->setChecked(fScreenEnabled); 2139 /* Add separator: */ 2140 pMenu->addSeparator(); 2141 } 2142 } 2112 2143 2113 2144 /* Create exclusive 'resize' action-group: */ … … 2126 2157 { 2127 2158 /* Configure exclusive 'resize' action: */ 2128 pAction->setEnabled(session()->isGuestSupportsGraphics() );2159 pAction->setEnabled(session()->isGuestSupportsGraphics() && fScreenEnabled); 2129 2160 pAction->setProperty("Guest Screen Index", iGuestScreenIndex); 2130 2161 pAction->setProperty("Requested Size", size); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r52343 r52344 121 121 signals: 122 122 123 /** Notifies about 'View' : 'Virtual Screen #' menu : 'Toggle' action trigger. */ 124 void sigNotifyAboutTriggeringViewScreenToggle(int iGuestScreenIndex, bool fEnabled); 123 125 /** Notifies about 'View' : 'Virtual Screen #' menu : 'Resize' action trigger. */ 124 126 void sigNotifyAboutTriggeringViewScreenResize(int iGuestScreenIndex, const QSize &size); … … 174 176 void sltPrepareMenuViewMultiscreen(); 175 177 178 /** Handles 'View' : 'Virtual Screen #' menu : 'Toggle' action trigger. */ 179 void sltHandleActionTriggerViewScreenToggle(); 176 180 /** Handles 'View' : 'Virtual Screen #' menu : 'Resize' @a pAction trigger. */ 177 181 void sltHandleActionTriggerViewScreenResize(QAction *pAction); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r52343 r52344 124 124 } 125 125 126 void UIMachineLogicNormal::sltHandleActionTriggerViewScreenToggle(int iIndex, bool fEnabled) 127 { 128 /* Enable/disable guest keeping current size: */ 129 ULONG uWidth, uHeight, uBitsPerPixel; 130 LONG uOriginX, uOriginY; 131 CDisplay display = session().GetConsole().GetDisplay(); 132 display.GetScreenResolution(iIndex, uWidth, uHeight, uBitsPerPixel, uOriginX, uOriginY); 133 if (!fEnabled) 134 display.SetVideoModeHint(iIndex, false, false, 0, 0, 0, 0, 0); 135 else 136 { 137 /* Defaults: */ 138 if (!uWidth) 139 uWidth = 800; 140 if (!uHeight) 141 uHeight = 600; 142 display.SetVideoModeHint(iIndex, true, false, 0, 0, uWidth, uHeight, 32); 143 } 144 } 145 126 146 void UIMachineLogicNormal::sltHandleActionTriggerViewScreenResize(int iIndex, const QSize &size) 127 147 { … … 148 168 connect(actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility), SIGNAL(triggered(bool)), 149 169 this, SLOT(sltToggleStatusBar())); 170 connect(actionPool(), SIGNAL(sigNotifyAboutTriggeringViewScreenToggle(int, bool)), 171 this, SLOT(sltHandleActionTriggerViewScreenToggle(int, bool))); 150 172 connect(actionPool(), SIGNAL(sigNotifyAboutTriggeringViewScreenResize(int, const QSize&)), 151 173 this, SLOT(sltHandleActionTriggerViewScreenResize(int, const QSize&))); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h
r52343 r52344 46 46 void sltStatusBarSettingsClosed(); 47 47 void sltToggleStatusBar(); 48 void sltHandleActionTriggerViewScreenToggle(int iIndex, bool fEnabled); 48 49 void sltHandleActionTriggerViewScreenResize(int iIndex, const QSize &size); 49 50
Note:
See TracChangeset
for help on using the changeset viewer.