Changeset 49506 in vbox for trunk/src/VBox
- Timestamp:
- Nov 15, 2013 2:38:02 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r49505 r49506 249 249 /* Load extra-data settings: */ 250 250 { 251 /* Machine while saving own settings will save " yes" only for current251 /* Machine while saving own settings will save "on" only for current 252 252 * visual representation mode if its differs from normal mode of course. 253 253 * But user can alter extra data manually in machine xml file and set there … … 278 278 /* We can't enter seamless mode initially, 279 279 * so we should ask ui-session for that: */ 280 uisession()->set SeamlessModeRequested(true);280 uisession()->setRequestedVisualState(UIVisualStateType_Seamless); 281 281 } 282 282 } … … 303 303 /* Save extra-data settings: */ 304 304 { 305 /* Set 'scale' flag: */ 306 machine.SetExtraData(GUI_Scale, m_pVisualState && 307 m_pVisualState->visualStateType() == UIVisualStateType_Scale ? "on" : QString()); 308 309 /* Set 'seamless' flag: */ 310 machine.SetExtraData(GUI_Seamless, m_pVisualState && 311 m_pVisualState->visualStateType() == UIVisualStateType_Seamless ? "on" : QString()); 312 313 /* Set 'fullscreen' flag: */ 314 machine.SetExtraData(GUI_Fullscreen, m_pVisualState && 315 m_pVisualState->visualStateType() == UIVisualStateType_Fullscreen ? "on" : QString()); 305 /* Prepare extra-data values: */ 306 QString strFullscreenRequested; 307 QString strSeamlessRequested; 308 QString strScaleRequested; 309 /* Check if some state was requested: */ 310 if (uisession()->requestedVisualState() != UIVisualStateType_Invalid) 311 { 312 switch (uisession()->requestedVisualState()) 313 { 314 case UIVisualStateType_Fullscreen: strFullscreenRequested = "on"; break; 315 case UIVisualStateType_Seamless: strSeamlessRequested = "on"; break; 316 case UIVisualStateType_Scale: strScaleRequested = "on"; break; 317 default: break; 318 } 319 } 320 /* Check if some state still exists: */ 321 else if (m_pVisualState) 322 { 323 switch (m_pVisualState->visualStateType()) 324 { 325 case UIVisualStateType_Fullscreen: strFullscreenRequested = "on"; break; 326 case UIVisualStateType_Seamless: strSeamlessRequested = "on"; break; 327 case UIVisualStateType_Scale: strScaleRequested = "on"; break; 328 default: break; 329 } 330 } 331 /* Rewrite extra-data values: */ 332 machine.SetExtraData(GUI_Fullscreen, strFullscreenRequested); 333 machine.SetExtraData(GUI_Seamless, strSeamlessRequested); 334 machine.SetExtraData(GUI_Scale, strScaleRequested); 316 335 } 317 336 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r49505 r49506 709 709 { 710 710 /* We should check for entering/exiting requested modes: */ 711 connect(uisession(), SIGNAL(sigMachineStarted()), this, SLOT(sltCheck RequestedModes()));712 connect(uisession(), SIGNAL(sigAdditionsStateChange()), this, SLOT(sltCheck RequestedModes()));711 connect(uisession(), SIGNAL(sigMachineStarted()), this, SLOT(sltCheckForRequestedVisualStateType())); 712 connect(uisession(), SIGNAL(sigAdditionsStateChange()), this, SLOT(sltCheckForRequestedVisualStateType())); 713 713 714 714 /* Machine state-change updater: */ … … 1090 1090 /* Call to base-class: */ 1091 1091 return QIWithRetranslateUI3<QObject>::eventFilter(pWatched, pEvent); 1092 }1093 1094 void UIMachineLogic::sltCheckRequestedModes()1095 {1096 /* Do not try to enter extended mode if machine was not started yet: */1097 if (!uisession()->isRunning() && !uisession()->isPaused())1098 return;1099 1100 /* If seamless mode is requested, supported and we are NOT currently in seamless mode: */1101 if (uisession()->isSeamlessModeRequested() &&1102 uisession()->isGuestSupportsSeamless() &&1103 visualStateType() != UIVisualStateType_Seamless)1104 {1105 uisession()->setSeamlessModeRequested(false);1106 QAction *pSeamlessModeAction = gActionPool->action(UIActionIndexRuntime_Toggle_Seamless);1107 AssertMsg(!pSeamlessModeAction->isChecked(), ("Seamless action should not be triggered before us!\n"));1108 QTimer::singleShot(0, pSeamlessModeAction, SLOT(trigger()));1109 }1110 /* If seamless mode is NOT requested, NOT supported and we are currently in seamless mode: */1111 else if (!uisession()->isSeamlessModeRequested() &&1112 !uisession()->isGuestSupportsSeamless() &&1113 visualStateType() == UIVisualStateType_Seamless)1114 {1115 uisession()->setSeamlessModeRequested(true);1116 QAction *pSeamlessModeAction = gActionPool->action(UIActionIndexRuntime_Toggle_Seamless);1117 AssertMsg(pSeamlessModeAction->isChecked(), ("Seamless action should not be triggered before us!\n"));1118 QTimer::singleShot(0, pSeamlessModeAction, SLOT(trigger()));1119 }1120 1092 } 1121 1093 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r49505 r49506 100 100 protected slots: 101 101 102 /** Checks if some visual-state type was requested. */ 103 virtual void sltCheckForRequestedVisualStateType() {} 104 102 105 /* Console callback handlers: */ 103 106 virtual void sltMachineStateChanged(); … … 172 175 173 176 private slots: 174 175 /* Mode request watch dog: */176 void sltCheckRequestedModes();177 177 178 178 /* "Machine" menu functionality: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r49505 r49506 124 124 , m_machineStatePrevious(KMachineState_Null) 125 125 , m_machineState(session().GetMachine().GetState()) 126 , m_requestedVisualStateType(UIVisualStateType_Invalid) 126 127 #ifdef Q_WS_WIN 127 128 , m_alphaCursor(0) … … 138 139 , m_fIsIgnoreRuntimeMediumsChanging(false) 139 140 , m_fIsGuestResizeIgnored(false) 140 , m_fIsSeamlessModeRequested(false)141 141 , m_fIsAutoCaptureDisabled(false) 142 142 , m_fReconfigurable(false) … … 651 651 { 652 652 /* Reset requests: */ 653 set SeamlessModeRequested(false);653 setRequestedVisualState(UIVisualStateType_Invalid); 654 654 /* Request change: */ 655 655 m_pMachine->asyncChangeVisualState(UIVisualStateType_Normal); … … 659 659 { 660 660 /* Reset requests: */ 661 set SeamlessModeRequested(false);661 setRequestedVisualState(UIVisualStateType_Invalid); 662 662 /* Request change: */ 663 663 m_pMachine->asyncChangeVisualState(UIVisualStateType_Fullscreen); … … 667 667 { 668 668 /* Reset requests: */ 669 set SeamlessModeRequested(false);669 setRequestedVisualState(UIVisualStateType_Invalid); 670 670 /* Request change: */ 671 671 m_pMachine->asyncChangeVisualState(UIVisualStateType_Seamless); … … 675 675 { 676 676 /* Reset requests: */ 677 set SeamlessModeRequested(false);677 setRequestedVisualState(UIVisualStateType_Invalid); 678 678 /* Request change: */ 679 679 m_pMachine->asyncChangeVisualState(UIVisualStateType_Scale); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r49505 r49506 125 125 /** Requests visual-state change. */ 126 126 void changeVisualState(UIVisualStateType visualStateType); 127 /** Requests visual-state to be entered when possible. */ 128 void setRequestedVisualState(UIVisualStateType visualStateType) { m_requestedVisualStateType = visualStateType; } 129 /** Returns requested visual-state to be entered when possible. */ 130 UIVisualStateType requestedVisualState() const { return m_requestedVisualStateType; } 127 131 128 132 bool isSaved() const { return machineState() == KMachineState_Saved; } … … 142 146 bool isIgnoreRuntimeMediumsChanging() const { return m_fIsIgnoreRuntimeMediumsChanging; } 143 147 bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; } 144 bool isSeamlessModeRequested() const { return m_fIsSeamlessModeRequested; }145 148 bool isAutoCaptureDisabled() const { return m_fIsAutoCaptureDisabled; } 146 149 … … 172 175 bool setPause(bool fOn); 173 176 void setGuestResizeIgnored(bool fIsGuestResizeIgnored) { m_fIsGuestResizeIgnored = fIsGuestResizeIgnored; } 174 void setSeamlessModeRequested(bool fIsSeamlessModeRequested) { m_fIsSeamlessModeRequested = fIsSeamlessModeRequested; }175 177 void setAutoCaptureDisabled(bool fIsAutoCaptureDisabled) { m_fIsAutoCaptureDisabled = fIsAutoCaptureDisabled; } 176 178 void forgetPreviousMachineState() { m_machineStatePrevious = m_machineState; } … … 324 326 QCursor m_cursor; 325 327 328 /** @name Visual-state configuration variables. 329 ** @{ */ 330 /** Determines which visual-state should be entered when possible. */ 331 UIVisualStateType m_requestedVisualStateType; 332 /** @} */ 333 326 334 #if defined(Q_WS_WIN) 327 335 HCURSOR m_alphaCursor; … … 358 366 bool m_fIsIgnoreRuntimeMediumsChanging : 1; 359 367 bool m_fIsGuestResizeIgnored : 1; 360 bool m_fIsSeamlessModeRequested : 1;361 368 bool m_fIsAutoCaptureDisabled : 1; 362 369 bool m_fReconfigurable : 1; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r49505 r49506 42 42 /* Normal mode is always available: */ 43 43 return true; 44 } 45 46 void UIMachineLogicNormal::sltCheckForRequestedVisualStateType() 47 { 48 /* Do not try to change visual-state type if machine was not started yet: */ 49 if (!uisession()->isRunning() && !uisession()->isPaused()) 50 return; 51 52 /* Check requested visual-state types: */ 53 switch (uisession()->requestedVisualState()) 54 { 55 /* If 'seamless' visual-state type is requested: */ 56 case UIVisualStateType_Seamless: 57 { 58 /* And supported: */ 59 if (uisession()->isGuestSupportsSeamless()) 60 { 61 LogRel(("UIMachineLogicNormal: Going 'seamless' as requested...\n")); 62 uisession()->setRequestedVisualState(UIVisualStateType_Invalid); 63 uisession()->changeVisualState(UIVisualStateType_Seamless); 64 } 65 break; 66 } 67 default: 68 break; 69 } 44 70 } 45 71 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h
r49505 r49506 36 36 private slots: 37 37 38 /** Checks if some visual-state type was requested. */ 39 void sltCheckForRequestedVisualStateType(); 40 38 41 /* Windowed mode functionality: */ 39 42 void sltPrepareNetworkAdaptersMenu(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r49505 r49506 109 109 } 110 110 111 void UIMachineLogicSeamless::sltCheckForRequestedVisualStateType() 112 { 113 /* Do not try to change visual-state type if machine was not started yet: */ 114 if (!uisession()->isRunning() && !uisession()->isPaused()) 115 return; 116 117 /* If 'seamless' visual-state type is no more supported: */ 118 if (!uisession()->isGuestSupportsSeamless()) 119 { 120 LogRel(("UIMachineLogicSeamless: Leaving 'seamless' as it is no more supported...\n")); 121 uisession()->setRequestedVisualState(UIVisualStateType_Seamless); 122 uisession()->changeVisualState(UIVisualStateType_Normal); 123 } 124 } 125 111 126 void UIMachineLogicSeamless::sltMachineStateChanged() 112 127 { … … 245 260 void UIMachineLogicSeamless::cleanupActionConnections() 246 261 { 247 /* "View" actions connections: */262 /* "View" actions disconnections: */ 248 263 disconnect(gActionPool->action(UIActionIndexRuntime_Toggle_Seamless), SIGNAL(triggered(bool)), 249 264 uisession(), SLOT(sltChangeVisualStateToNormal())); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h
r49505 r49506 48 48 private slots: 49 49 50 /** Checks if some visual-state type was requested. */ 51 void sltCheckForRequestedVisualStateType(); 52 50 53 /* Handler: Console callback stuff: */ 51 54 void sltMachineStateChanged();
Note:
See TracChangeset
for help on using the changeset viewer.