VirtualBox

Changeset 55697 in vbox


Ignore:
Timestamp:
May 6, 2015 4:50:27 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Extend manual-override mode to prevent unwanted visual-representation mode switches.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r55436 r55697  
    378378void UIMachineLogic::saveState()
    379379{
    380     /* Prevent auto-closure: */
    381     setPreventAutoClose(true);
     380    /* Enable 'manual-override',
     381     * preventing automatic Runtime UI closing: */
     382    setManualOverrideMode(true);
    382383
    383384    /* Was the step successful? */
     
    391392        fSuccess = uisession()->saveState();
    392393
    393     /* Allow auto-closure: */
    394     setPreventAutoClose(false);
     394    /* Disable 'manual-override' finally: */
     395    setManualOverrideMode(false);
    395396
    396397    /* Manually close Runtime UI: */
     
    411412void UIMachineLogic::powerOff(bool fDiscardingState)
    412413{
    413     /* Prevent auto-closure: */
    414     setPreventAutoClose(true);
     414    /* Enable 'manual-override',
     415     * preventing automatic Runtime UI closing: */
     416    setManualOverrideMode(true);
    415417
    416418    /* Was the step successful? */
     
    420422    fSuccess = uisession()->powerOff(fDiscardingState, fServerCrashed) || fServerCrashed;
    421423
    422     /* Allow auto-closure: */
    423     setPreventAutoClose(false);
     424    /* Disable 'manual-override' finally: */
     425    setManualOverrideMode(false);
    424426
    425427    /* Manually close Runtime UI: */
     
    555557        case KMachineState_Aborted:
    556558        {
    557             /* Is it allowed to close Runtime UI? */
    558             if (!isPreventAutoClose())
     559            /* If not in 'manual-override' mode: */
     560            if (!isManualOverrideMode())
    559561            {
    560562                /* VM has been powered off, saved, teleported or aborted.
     
    753755    , m_pDragAndDropActions(0)
    754756    , m_fIsWindowsCreated(false)
    755     , m_fIsPreventAutoClose(false)
     757    , m_fIsManualOverride(false)
    756758#ifdef VBOX_WITH_DEBUGGER_GUI
    757759    , m_pDbgGui(0)
     
    15061508        return;
    15071509
    1508     /* Do not try to close machine-window if restricted: */
    1509     if (isPreventAutoClose())
     1510    /* Do not close machine-window in 'manual-override' mode: */
     1511    if (isManualOverrideMode())
    15101512        return;
    15111513
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r55401 r55697  
    118118    UIMachineWindow* activeMachineWindow() const;
    119119
    120     /* Maintenance getters/setters: */
    121     bool isPreventAutoClose() const { return m_fIsPreventAutoClose; }
    122     void setPreventAutoClose(bool fIsPreventAutoClose) { m_fIsPreventAutoClose = fIsPreventAutoClose; }
     120    /** Returns whether VM is in 'manual-override' mode.
     121      * @note S.a. #m_fIsManualOverride description for more information. */
     122    bool isManualOverrideMode() const { return m_fIsManualOverride; }
     123    /** Defines whether VM is in 'manual-override' mode.
     124      * @note S.a. #m_fIsManualOverride description for more information. */
     125    void setManualOverrideMode(bool fIsManualOverride) { m_fIsManualOverride = fIsManualOverride; }
    123126
    124127    /** Adjusts machine-window(s) geometry if necessary. */
     
    361364
    362365    bool m_fIsWindowsCreated : 1;
    363     bool m_fIsPreventAutoClose : 1;
     366
     367    /** Holds whether VM is in 'manual-override' mode
     368      * which means there will be no automatic UI shutdowns,
     369      * visual representation mode changes and other similar routines. */
     370    bool m_fIsManualOverride : 1;
    364371
    365372#ifdef VBOX_WITH_DEBUGGER_GUI
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r55687 r55697  
    273273    }
    274274
    275     /* Guard progressbar warnings from auto-closing: */
    276     if (uimachine()->machineLogic())
    277         uimachine()->machineLogic()->setPreventAutoClose(true);
     275    /* Enable 'manual-override',
     276     * preventing automatic Runtime UI closing
     277     * and visual representation mode changes: */
     278    if (machineLogic())
     279        machineLogic()->setManualOverrideMode(true);
    278280
    279281    /* Show "Starting/Restoring" progress dialog: */
     
    295297    }
    296298
    297     /* Allow further auto-closing: */
    298     if (uimachine()->machineLogic())
    299         uimachine()->machineLogic()->setPreventAutoClose(false);
     299    /* Disable 'manual-override' finally: */
     300    if (machineLogic())
     301        machineLogic()->setManualOverrideMode(false);
    300302
    301303    /* True by default: */
     
    19231925        if (fShouldWeClose)
    19241926        {
    1925             /* Prevent auto-closure during power off sequence: */
    1926             machineLogic()->setPreventAutoClose(true);
     1927            /* Enable 'manual-override',
     1928             * preventing automatic Runtime UI closing: */
     1929            if (machineLogic())
     1930                machineLogic()->setManualOverrideMode(true);
    19271931            /* Power off VM: */
    19281932            bool fServerCrashed = false;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r55436 r55697  
    340340    /* Do not try to change visual-state type if machine was not started yet: */
    341341    if (!uisession()->isRunning() && !uisession()->isPaused())
     342        return;
     343
     344    /* Do not try to change visual-state type in 'manual override' mode: */
     345    if (isManualOverrideMode())
    342346        return;
    343347
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r55436 r55697  
    7070    /* Do not try to change visual-state type if machine was not started yet: */
    7171    if (!uisession()->isRunning() && !uisession()->isPaused())
     72        return;
     73
     74    /* Do not try to change visual-state type in 'manual override' mode: */
     75    if (isManualOverrideMode())
    7276        return;
    7377
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r55436 r55697  
    132132        return;
    133133
     134    /* Do not try to change visual-state type in 'manual override' mode: */
     135    if (isManualOverrideMode())
     136        return;
     137
    134138    /* If 'seamless' visual-state type is no more supported: */
    135139    if (!uisession()->isGuestSupportsSeamless())
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