- Timestamp:
- Mar 11, 2010 7:20:32 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r27243 r27300 390 390 /* Load extra-data settings: */ 391 391 { 392 /* Get 'fullscreen' attributes: */ 393 QString strFullscreenSettings = machine.GetExtraData(VBoxDefs::GUI_Fullscreen); 394 if (strFullscreenSettings == "yes") 395 initialStateType = UIVisualStateType_Fullscreen; 392 /* Machine while saving own settings will save "yes" only for current 393 * visual representation mode if its differs from normal mode of course. 394 * But user can alter extra data manually in machine xml file and set there 395 * more than one visual representation mode flags. Shame on such user! 396 * There is no reason to enter in more than one visual representation mode 397 * at machine start, so we are chosing first of requested modes: */ 398 bool fIsSomeExtendedModeChosen = false; 399 400 if (!fIsSomeExtendedModeChosen) 401 { 402 /* Test 'seamless' flag: */ 403 QString strSeamlessSettings = machine.GetExtraData(VBoxDefs::GUI_Seamless); 404 if (strSeamlessSettings == "yes") 405 { 406 fIsSomeExtendedModeChosen = true; 407 /* We can't enter seamless mode initially, 408 * so we should ask ui-session for that: */ 409 uisession()->setSeamlessModeRequested(true); 410 } 411 } 412 413 if (!fIsSomeExtendedModeChosen) 414 { 415 /* Test 'fullscreen' flag: */ 416 QString strFullscreenSettings = machine.GetExtraData(VBoxDefs::GUI_Fullscreen); 417 if (strFullscreenSettings == "yes") 418 { 419 fIsSomeExtendedModeChosen = true; 420 /* We can enter fullscreen mode initially: */ 421 initialStateType = UIVisualStateType_Fullscreen; 422 } 423 } 396 424 } 397 425 } … … 404 432 /* Save extra-data settings: */ 405 433 { 406 /* Set 'fullscreen' attributes: */ 434 /* Set 'seamless' flag: */ 435 machine.SetExtraData(VBoxDefs::GUI_Seamless, m_pVisualState && 436 m_pVisualState->visualStateType() == UIVisualStateType_Seamless ? "yes" : QString()); 437 438 /* Set 'fullscreen' flag: */ 407 439 machine.SetExtraData(VBoxDefs::GUI_Fullscreen, m_pVisualState && 408 440 m_pVisualState->visualStateType() == UIVisualStateType_Fullscreen ? "yes" : QString()); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r27294 r27300 424 424 , m_pRunningOrPausedActions(0) 425 425 , m_fIsWindowsCreated(false) 426 , m_fIsMachineStarted(false) 426 427 , m_fIsPreventAutoStart(false) 427 428 , m_fIsPreventAutoClose(false) … … 476 477 { 477 478 /* If we are started already => just return: */ 478 if ( uisession()->isRunning() || uisession()->isPaused())479 if (m_fIsMachineStarted || uisession()->isRunning() || uisession()->isPaused()) 479 480 return; 480 481 … … 556 557 vboxGlobal().showUpdateDialog(false /* force request? */); 557 558 #endif 559 560 /* Remember what machine was started already: */ 561 m_fIsMachineStarted = true; 558 562 559 563 /* Warn listeners about machine was started: */ … … 582 586 } 583 587 #endif /* Q_WS_MAC */ 588 589 void UIMachineLogic::prepareConnections() 590 { 591 /* Connect common handlers: */ 592 connect(this, SIGNAL(sigMachineStarted()), this, SLOT(sltCheckRequestedModes())); 593 } 584 594 585 595 void UIMachineLogic::prepareConsoleConnections() … … 951 961 actionsPool()->action(UIActionIndex_Toggle_Seamless)->setEnabled(fIsSupportsSeamless); 952 962 963 /* Check if we should enter some extended mode: */ 964 sltCheckRequestedModes(); 965 953 966 /* Check the GA version only in case of additions are active: */ 954 967 if (!fIsAdditionsActive) … … 1005 1018 { 1006 1019 vboxProblem().showRuntimeError(session().GetConsole(), fIsFatal, strErrorId, strMessage); 1020 } 1021 1022 void UIMachineLogic::sltCheckRequestedModes() 1023 { 1024 /* Do not try to enter extended mode if machine was not started yet: */ 1025 if (!m_fIsMachineStarted) 1026 return; 1027 1028 /* If seamless mode is requested, supported and we are NOT currently in seamless mode: */ 1029 if (uisession()->isSeamlessModeRequested() && 1030 uisession()->isGuestSupportsSeamless() && 1031 visualStateType() != UIVisualStateType_Seamless) 1032 { 1033 uisession()->setSeamlessModeRequested(false); 1034 QAction *pSeamlessModeAction = actionsPool()->action(UIActionIndex_Toggle_Seamless); 1035 AssertMsg(!pSeamlessModeAction->isChecked(), ("Seamless action should not be triggered before us!\n")); 1036 QTimer::singleShot(0, pSeamlessModeAction, SLOT(trigger())); 1037 } 1038 /* If seamless mode is NOT requested, NOT supported and we are currently in seamless mode: */ 1039 else if (!uisession()->isSeamlessModeRequested() && 1040 !uisession()->isGuestSupportsSeamless() && 1041 visualStateType() == UIVisualStateType_Seamless) 1042 { 1043 uisession()->setSeamlessModeRequested(true); 1044 QAction *pSeamlessModeAction = actionsPool()->action(UIActionIndex_Toggle_Seamless); 1045 AssertMsg(pSeamlessModeAction->isChecked(), ("Seamless action should not be triggered before us!\n")); 1046 QTimer::singleShot(0, pSeamlessModeAction, SLOT(trigger())); 1047 } 1007 1048 } 1008 1049 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r27263 r27300 114 114 115 115 /* Prepare helpers: */ 116 virtual void prepareConnections(); 116 117 virtual void prepareConsoleConnections(); 117 118 virtual void prepareActionGroups(); … … 132 133 //virtual void cleanupActionGroups() {} 133 134 //virtual void cleanupConsoleConnections() {} 135 //virtual void cleanupConnections() {} 134 136 135 137 protected slots: … … 141 143 virtual void sltUSBDeviceStateChange(const CUSBDevice &device, bool fIsAttached, const CVirtualBoxErrorInfo &error); 142 144 virtual void sltRuntimeError(bool fIsFatal, const QString &strErrorId, const QString &strMessage); 145 146 /* Mode request watch dog: */ 147 void sltCheckRequestedModes(); 143 148 144 149 private slots: … … 200 205 201 206 bool m_fIsWindowsCreated : 1; 207 bool m_fIsMachineStarted : 1; 202 208 bool m_fIsPreventAutoStart : 1; 203 209 bool m_fIsPreventAutoClose : 1; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r27296 r27300 538 538 , m_fIsIgnoreRutimeMediumsChanging(false) 539 539 , m_fIsGuestResizeIgnored(false) 540 , m_fIsSeamlessModeRequested(false) 540 541 /* Guest additions flags: */ 541 542 , m_fIsGuestAdditionsActive(false) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r27296 r27300 97 97 bool isIgnoreRuntimeMediumsChanging() const { return m_fIsIgnoreRutimeMediumsChanging; } 98 98 bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; } 99 bool isSeamlessModeRequested() const { return m_fIsSeamlessModeRequested; } 99 100 100 101 /* Guest additions state getters: */ … … 124 125 bool setPause(bool fOn); 125 126 void setGuestResizeIgnored(bool fIsGuestResizeIgnored) { m_fIsGuestResizeIgnored = fIsGuestResizeIgnored; } 127 void setSeamlessModeRequested(bool fIsSeamlessModeRequested) { m_fIsSeamlessModeRequested = fIsSeamlessModeRequested; } 126 128 127 129 /* Keyboard setters: */ … … 201 203 bool m_fIsIgnoreRutimeMediumsChanging : 1; 202 204 bool m_fIsGuestResizeIgnored : 1; 205 bool m_fIsSeamlessModeRequested : 1; 203 206 204 207 /* Guest additions flags: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r27263 r27300 132 132 if (!isPreventAutoStart()) 133 133 { 134 /* Prepare common connections: */ 135 prepareConnections(); 136 134 137 /* Prepare console connections: */ 135 138 prepareConsoleConnections(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r27263 r27300 57 57 if (!isPreventAutoStart()) 58 58 { 59 /* Prepare common connections: */ 60 prepareConnections(); 61 59 62 /* Prepare console connections: */ 60 63 prepareConsoleConnections(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r27263 r27300 125 125 if (!isPreventAutoStart()) 126 126 { 127 /* Prepare common connections: */ 128 prepareConnections(); 129 127 130 /* Prepare console connections: */ 128 131 prepareConsoleConnections();
Note:
See TracChangeset
for help on using the changeset viewer.