VirtualBox

Changeset 98419 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 2, 2023 9:13:56 AM (23 months ago)
Author:
vboxsync
Message:

Merging r155448 from gui4 branch: FE/Qt: Runtime UI: Using UIMachine to switch states directly instead of UISession; Cleanup corresponding stuff from UISession.

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3:79645-79692
        21 /branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443
         21/branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443,155488
        2222/trunk/src:92342,154921
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2/src/VBox:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3/src/VBox:79645-79692
        21 /branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443
         21/branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443,155488
  • trunk/src/VBox/Frontends

    • Property svn:mergeinfo
      •  

        old new  
        1616/branches/dsen/gui2/src/VBox/Frontends:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        1717/branches/dsen/gui3/src/VBox/Frontends:79645-79692
        18 /branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443
         18/branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443,155488
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r98404 r98419  
    422422void UIMachineLogic::sltChangeVisualStateToNormal()
    423423{
    424     uisession()->setRequestedVisualState(UIVisualStateType_Invalid);
    425     uisession()->changeVisualState(UIVisualStateType_Normal);
     424    uimachine()->setRequestedVisualState(UIVisualStateType_Invalid);
     425    uimachine()->asyncChangeVisualState(UIVisualStateType_Normal);
    426426}
    427427
    428428void UIMachineLogic::sltChangeVisualStateToFullscreen()
    429429{
    430     uisession()->setRequestedVisualState(UIVisualStateType_Invalid);
    431     uisession()->changeVisualState(UIVisualStateType_Fullscreen);
     430    uimachine()->setRequestedVisualState(UIVisualStateType_Invalid);
     431    uimachine()->asyncChangeVisualState(UIVisualStateType_Fullscreen);
    432432}
    433433
    434434void UIMachineLogic::sltChangeVisualStateToSeamless()
    435435{
    436     uisession()->setRequestedVisualState(UIVisualStateType_Invalid);
    437     uisession()->changeVisualState(UIVisualStateType_Seamless);
     436    uimachine()->setRequestedVisualState(UIVisualStateType_Invalid);
     437    uimachine()->asyncChangeVisualState(UIVisualStateType_Seamless);
    438438}
    439439
    440440void UIMachineLogic::sltChangeVisualStateToScale()
    441441{
    442     uisession()->setRequestedVisualState(UIVisualStateType_Invalid);
    443     uisession()->changeVisualState(UIVisualStateType_Scale);
     442    uimachine()->setRequestedVisualState(UIVisualStateType_Invalid);
     443    uimachine()->asyncChangeVisualState(UIVisualStateType_Scale);
    444444}
    445445
     
    585585    /* Update action states: */
    586586    LogRel3(("GUI: UIMachineLogic::sltAdditionsStateChanged: Adjusting actions availability according to GA state.\n"));
    587     actionPool()->action(UIActionIndexRT_M_View_T_Seamless)->setEnabled(uisession()->isVisualStateAllowed(UIVisualStateType_Seamless) &&
     587    actionPool()->action(UIActionIndexRT_M_View_T_Seamless)->setEnabled(uimachine()->isVisualStateAllowed(UIVisualStateType_Seamless) &&
    588588                                                                        uisession()->isGuestSupportsSeamless());
    589589}
     
    27062706     * but is not entered because we're waiting for a guest addition permission. */
    27072707    if (   visualStateType() != enmRequestedState
    2708         && uisession()->requestedVisualState() != enmRequestedState)
     2708        && uimachine()->requestedVisualState() != enmRequestedState)
    27092709    {
    27102710        switch (enmRequestedState)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r98404 r98419  
    687687                {
    688688                    /* Enter 'full-screen' mode: */
    689                     uisession()->setRequestedVisualState(UIVisualStateType_Invalid);
    690                     uisession()->changeVisualState(UIVisualStateType_Fullscreen);
     689                    uimachine()->setRequestedVisualState(UIVisualStateType_Invalid);
     690                    uimachine()->asyncChangeVisualState(UIVisualStateType_Fullscreen);
    691691                }
    692692            }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98404 r98419  
    265265{
    266266    return machineLogic() ? machineLogic()->activeMachineWindow() : 0;
    267 }
    268 
    269 bool UISession::isVisualStateAllowed(UIVisualStateType state) const
    270 {
    271     return uimachine()->isVisualStateAllowed(state);
    272 }
    273 
    274 void UISession::changeVisualState(UIVisualStateType visualStateType)
    275 {
    276     uimachine()->asyncChangeVisualState(visualStateType);
    277 }
    278 
    279 void UISession::setRequestedVisualState(UIVisualStateType visualStateType)
    280 {
    281     uimachine()->setRequestedVisualState(visualStateType);
    282 }
    283 
    284 UIVisualStateType UISession::requestedVisualState() const
    285 {
    286     return uimachine()->requestedVisualState();
    287267}
    288268
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98404 r98419  
    176176    UIMachineWindow *activeMachineWindow() const;
    177177
    178     /** Returns whether visual @a state is allowed. */
    179     bool isVisualStateAllowed(UIVisualStateType state) const;
    180     /** Requests visual-state change. */
    181     void changeVisualState(UIVisualStateType visualStateType);
    182     /** Requests visual-state to be entered when possible. */
    183     void setRequestedVisualState(UIVisualStateType visualStateType);
    184     /** Returns requested visual-state to be entered when possible. */
    185     UIVisualStateType requestedVisualState() const;
    186 
    187178    bool isSaved() const { return machineState() == KMachineState_Saved ||
    188179                                  machineState() == KMachineState_AbortedSaved; }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r98404 r98419  
    246246
    247247            /* Change visual-state to requested: */
    248             UIVisualStateType type = uisession()->requestedVisualState();
     248            UIVisualStateType type = uimachine()->requestedVisualState();
    249249            if (type == UIVisualStateType_Invalid)
    250250                type = UIVisualStateType_Normal;
    251             uisession()->setRequestedVisualState(UIVisualStateType_Invalid);
    252             uisession()->changeVisualState(type);
     251            uimachine()->setRequestedVisualState(UIVisualStateType_Invalid);
     252            uimachine()->asyncChangeVisualState(type);
    253253        }
    254254    }
     
    286286
    287287        /* Ask session to change 'fullscreen' mode to 'normal': */
    288         uisession()->setRequestedVisualState(UIVisualStateType_Normal);
     288        uimachine()->setRequestedVisualState(UIVisualStateType_Normal);
    289289
    290290        /* If session already initialized => push mode-change directly: */
     
    303303    {
    304304        /* Request 'normal' (window) visual-state: */
    305         uisession()->setRequestedVisualState(UIVisualStateType_Normal);
     305        uimachine()->setRequestedVisualState(UIVisualStateType_Normal);
    306306        /* Ask window(s) to exit 'fullscreen' mode: */
    307307        emit sigNotifyAboutNativeFullscreenShouldBeExited();
     
    318318    {
    319319        /* Request 'seamless' visual-state: */
    320         uisession()->setRequestedVisualState(UIVisualStateType_Seamless);
     320        uimachine()->setRequestedVisualState(UIVisualStateType_Seamless);
    321321        /* Ask window(s) to exit 'fullscreen' mode: */
    322322        emit sigNotifyAboutNativeFullscreenShouldBeExited();
     
    333333    {
    334334        /* Request 'scale' visual-state: */
    335         uisession()->setRequestedVisualState(UIVisualStateType_Scale);
     335        uimachine()->setRequestedVisualState(UIVisualStateType_Scale);
    336336        /* Ask window(s) to exit 'fullscreen' mode: */
    337337        emit sigNotifyAboutNativeFullscreenShouldBeExited();
     
    342342{
    343343    LogRel(("GUI: UIMachineLogicFullscreen::sltCheckForRequestedVisualStateType: Requested-state=%d, Machine-state=%d\n",
    344             uisession()->requestedVisualState(), uisession()->machineState()));
     344            uimachine()->requestedVisualState(), uisession()->machineState()));
    345345
    346346    /* Do not try to change visual-state type if machine was not started yet: */
     
    353353
    354354    /* Check requested visual-state types: */
    355     switch (uisession()->requestedVisualState())
     355    switch (uimachine()->requestedVisualState())
    356356    {
    357357        /* If 'normal' visual-state type is requested: */
     
    360360            LogRel(("GUI: UIMachineLogicFullscreen::sltCheckForRequestedVisualStateType: "
    361361                    "Going 'normal' as requested...\n"));
    362             uisession()->setRequestedVisualState(UIVisualStateType_Invalid);
    363             uisession()->changeVisualState(UIVisualStateType_Normal);
     362            uimachine()->setRequestedVisualState(UIVisualStateType_Invalid);
     363            uimachine()->asyncChangeVisualState(UIVisualStateType_Normal);
    364364            break;
    365365        }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r98404 r98419  
    7373{
    7474    LogRel(("GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: Requested-state=%d, Machine-state=%d\n",
    75             uisession()->requestedVisualState(), uisession()->machineState()));
     75            uimachine()->requestedVisualState(), uisession()->machineState()));
    7676
    7777    /* Do not try to change visual-state type if machine was not started yet: */
     
    8484
    8585    /* Check requested visual-state types: */
    86     switch (uisession()->requestedVisualState())
     86    switch (uimachine()->requestedVisualState())
    8787    {
    8888        /* If 'seamless' visual-state type is requested: */
     
    9494                LogRel(("GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: "
    9595                        "Going 'seamless' as requested...\n"));
    96                 uisession()->setRequestedVisualState(UIVisualStateType_Invalid);
    97                 uisession()->changeVisualState(UIVisualStateType_Seamless);
     96                uimachine()->setRequestedVisualState(UIVisualStateType_Invalid);
     97                uimachine()->asyncChangeVisualState(UIVisualStateType_Seamless);
    9898            }
    9999            else
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r98386 r98419  
    150150{
    151151    /* Skip if another visual representation mode requested: */
    152     if (uisession()->requestedVisualState() == UIVisualStateType_Seamless) // Seamless only for now.
     152    if (uimachine()->requestedVisualState() == UIVisualStateType_Seamless) // Seamless only for now.
    153153        return;
    154154
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp

    r98404 r98419  
    3939#include "UIMachineWindow.h"
    4040#include "UIMessageCenter.h"
    41 #include "UISession.h"
    4241#include "UIShortcutPool.h"
    4342#ifndef VBOX_WS_MAC
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r98386 r98419  
    3939#include "UIMachineViewScale.h"
    4040#include "UIMachineWindow.h"
    41 #include "UISession.h"
    4241
    4342/* COM includes: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r98386 r98419  
    4444#include "UIMachineView.h"
    4545#include "UINotificationCenter.h"
    46 #include "UISession.h"
    4746#ifdef VBOX_WS_MAC
    4847# include "VBoxUtils.h"
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r98404 r98419  
    118118{
    119119    LogRel(("GUI: UIMachineLogicSeamless::sltCheckForRequestedVisualStateType: Requested-state=%d, Machine-state=%d\n",
    120             uisession()->requestedVisualState(), uisession()->machineState()));
     120            uimachine()->requestedVisualState(), uisession()->machineState()));
    121121
    122122    /* Do not try to change visual-state type if machine was not started yet: */
     
    133133        LogRel(("GUI: UIMachineLogicSeamless::sltCheckForRequestedVisualStateType: "
    134134                "Leaving 'seamless' as it is no more supported...\n"));
    135         uisession()->setRequestedVisualState(UIVisualStateType_Seamless);
    136         uisession()->changeVisualState(UIVisualStateType_Normal);
     135        uimachine()->setRequestedVisualState(UIVisualStateType_Seamless);
     136        uimachine()->asyncChangeVisualState(UIVisualStateType_Normal);
    137137    }
    138138}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r98386 r98419  
    4040#include "UIMachineView.h"
    4141#include "UIMachineWindowSeamless.h"
    42 #include "UISession.h"
    4342#if   defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
    4443# include "UIMachineDefs.h"
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