VirtualBox

Changeset 27300 in vbox for trunk/src


Ignore:
Timestamp:
Mar 11, 2010 7:20:32 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: New running VM core: support for pre-loading extended modes, seamless pre-loading support.

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  
    390390    /* Load extra-data settings: */
    391391    {
    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        }
    396424    }
    397425}
     
    404432    /* Save extra-data settings: */
    405433    {
    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: */
    407439        machine.SetExtraData(VBoxDefs::GUI_Fullscreen, m_pVisualState &&
    408440                             m_pVisualState->visualStateType() == UIVisualStateType_Fullscreen ? "yes" : QString());
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r27294 r27300  
    424424    , m_pRunningOrPausedActions(0)
    425425    , m_fIsWindowsCreated(false)
     426    , m_fIsMachineStarted(false)
    426427    , m_fIsPreventAutoStart(false)
    427428    , m_fIsPreventAutoClose(false)
     
    476477{
    477478    /* If we are started already => just return: */
    478     if (uisession()->isRunning() || uisession()->isPaused())
     479    if (m_fIsMachineStarted || uisession()->isRunning() || uisession()->isPaused())
    479480        return;
    480481
     
    556557    vboxGlobal().showUpdateDialog(false /* force request? */);
    557558#endif
     559
     560    /* Remember what machine was started already: */
     561    m_fIsMachineStarted = true;
    558562
    559563    /* Warn listeners about machine was started: */
     
    582586}
    583587#endif /* Q_WS_MAC */
     588
     589void UIMachineLogic::prepareConnections()
     590{
     591    /* Connect common handlers: */
     592    connect(this, SIGNAL(sigMachineStarted()), this, SLOT(sltCheckRequestedModes()));
     593}
    584594
    585595void UIMachineLogic::prepareConsoleConnections()
     
    951961    actionsPool()->action(UIActionIndex_Toggle_Seamless)->setEnabled(fIsSupportsSeamless);
    952962
     963    /* Check if we should enter some extended mode: */
     964    sltCheckRequestedModes();
     965
    953966    /* Check the GA version only in case of additions are active: */
    954967    if (!fIsAdditionsActive)
     
    10051018{
    10061019    vboxProblem().showRuntimeError(session().GetConsole(), fIsFatal, strErrorId, strMessage);
     1020}
     1021
     1022void 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    }
    10071048}
    10081049
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r27263 r27300  
    114114
    115115    /* Prepare helpers: */
     116    virtual void prepareConnections();
    116117    virtual void prepareConsoleConnections();
    117118    virtual void prepareActionGroups();
     
    132133    //virtual void cleanupActionGroups() {}
    133134    //virtual void cleanupConsoleConnections() {}
     135    //virtual void cleanupConnections() {}
    134136
    135137protected slots:
     
    141143    virtual void sltUSBDeviceStateChange(const CUSBDevice &device, bool fIsAttached, const CVirtualBoxErrorInfo &error);
    142144    virtual void sltRuntimeError(bool fIsFatal, const QString &strErrorId, const QString &strMessage);
     145
     146    /* Mode request watch dog: */
     147    void sltCheckRequestedModes();
    143148
    144149private slots:
     
    200205
    201206    bool m_fIsWindowsCreated : 1;
     207    bool m_fIsMachineStarted : 1;
    202208    bool m_fIsPreventAutoStart : 1;
    203209    bool m_fIsPreventAutoClose : 1;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r27296 r27300  
    538538    , m_fIsIgnoreRutimeMediumsChanging(false)
    539539    , m_fIsGuestResizeIgnored(false)
     540    , m_fIsSeamlessModeRequested(false)
    540541    /* Guest additions flags: */
    541542    , m_fIsGuestAdditionsActive(false)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r27296 r27300  
    9797    bool isIgnoreRuntimeMediumsChanging() const { return m_fIsIgnoreRutimeMediumsChanging; }
    9898    bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; }
     99    bool isSeamlessModeRequested() const { return m_fIsSeamlessModeRequested; }
    99100
    100101    /* Guest additions state getters: */
     
    124125    bool setPause(bool fOn);
    125126    void setGuestResizeIgnored(bool fIsGuestResizeIgnored) { m_fIsGuestResizeIgnored = fIsGuestResizeIgnored; }
     127    void setSeamlessModeRequested(bool fIsSeamlessModeRequested) { m_fIsSeamlessModeRequested = fIsSeamlessModeRequested; }
    126128
    127129    /* Keyboard setters: */
     
    201203    bool m_fIsIgnoreRutimeMediumsChanging : 1;
    202204    bool m_fIsGuestResizeIgnored : 1;
     205    bool m_fIsSeamlessModeRequested : 1;
    203206
    204207    /* Guest additions flags: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r27263 r27300  
    132132    if (!isPreventAutoStart())
    133133    {
     134        /* Prepare common connections: */
     135        prepareConnections();
     136
    134137        /* Prepare console connections: */
    135138        prepareConsoleConnections();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r27263 r27300  
    5757    if (!isPreventAutoStart())
    5858    {
     59        /* Prepare common connections: */
     60        prepareConnections();
     61
    5962        /* Prepare console connections: */
    6063        prepareConsoleConnections();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r27263 r27300  
    125125    if (!isPreventAutoStart())
    126126    {
     127        /* Prepare common connections: */
     128        prepareConnections();
     129
    127130        /* Prepare console connections: */
    128131        prepareConsoleConnections();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette