VirtualBox

Changeset 98401 in vbox


Ignore:
Timestamp:
Feb 1, 2023 2:53:16 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155645
Message:

Merging r155342 and r155344 from gui4 branch: FE/Qt: Runtime UI: Move Application Close stuff from UISession to UIMachine.

Location:
trunk
Files:
8 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
         21/branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344
        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
         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
  • 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
         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
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98400 r98401  
    711711    , m_fIsMouseIntegrated(true)
    712712    , m_iMouseState(0)
     713    , m_defaultCloseAction(MachineCloseAction_Invalid)
     714    , m_restrictedCloseActions(MachineCloseAction_Invalid)
    713715{
    714716    m_spInstance = this;
     
    737739    prepareBranding();
    738740    prepareKeyboard();
     741    prepareClose();
    739742    prepareMachineLogic();
    740743
     
    10021005}
    10031006
     1007void UIMachine::prepareClose()
     1008{
     1009    /* What is the default close action and the restricted are? */
     1010    const QUuid uMachineID = uiCommon().managedVMUuid();
     1011    m_defaultCloseAction = gEDataManager->defaultMachineCloseAction(uMachineID);
     1012    m_restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(uMachineID);
     1013
     1014    /* Log whether HID LEDs sync is enabled: */
     1015#if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
     1016    LogRel(("GUI: HID LEDs sync is %s\n", isHidLedsSyncEnabled() ? "enabled" : "disabled"));
     1017#else
     1018    LogRel(("GUI: HID LEDs sync is not supported on this platform\n"));
     1019#endif
     1020}
     1021
    10041022void UIMachine::prepareMachineLogic()
    10051023{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98400 r98401  
    296296    /** @} */
    297297
     298    /** @name Close configuration stuff.
     299     * @{ */
     300        /** Returns default close action. */
     301        MachineCloseAction defaultCloseAction() const { return m_defaultCloseAction; }
     302        /** Returns merged restricted close actions. */
     303        MachineCloseAction restrictedCloseActions() const { return m_restrictedCloseActions; }
     304    /** @} */
     305
    298306public slots:
    299307
     
    422430    /** Prepare routine: Keyboard stuff. */
    423431    void prepareKeyboard();
     432    /** Prepare routine: Close stuff. */
     433    void prepareClose();
    424434    /** Prepare routine: Machine-logic stuff. */
    425435    void prepareMachineLogic();
     
    613623        int  m_iMouseState;
    614624    /** @} */
     625
     626    /** @name Close configuration stuff.
     627     * @{ */
     628        /** Default close action. */
     629        MachineCloseAction  m_defaultCloseAction;
     630        /** Merged restricted close actions. */
     631        MachineCloseAction  m_restrictedCloseActions;
     632    /** @} */
    615633};
    616634
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r98385 r98401  
    409409
    410410    /* If default close-action defined and not restricted: */
    411     MachineCloseAction defaultCloseAction = uisession()->defaultCloseAction();
    412     MachineCloseAction restrictedCloseActions = uisession()->restrictedCloseActions();
     411    MachineCloseAction defaultCloseAction = uimachine()->defaultCloseAction();
     412    MachineCloseAction restrictedCloseActions = uimachine()->restrictedCloseActions();
    413413    if ((defaultCloseAction != MachineCloseAction_Invalid) &&
    414414        !(restrictedCloseActions & defaultCloseAction))
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98400 r98401  
    176176    loadVMSettings();
    177177
    178 /* Log whether HID LEDs sync is enabled: */
    179 #if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
    180     LogRel(("GUI: HID LEDs sync is %s\n",
    181             uimachine()->isHidLedsSyncEnabled()
    182             ? "enabled" : "disabled"));
    183 #else /* !VBOX_WS_MAC && !VBOX_WS_WIN */
    184     LogRel(("GUI: HID LEDs sync is not supported on this platform\n"));
    185 #endif /* !VBOX_WS_MAC && !VBOX_WS_WIN */
    186 
    187178#ifdef VBOX_GUI_WITH_PIDFILE
    188179    uiCommon().createPidfile();
     
    549540    , m_machineStatePrevious(KMachineState_Null)
    550541    , m_machineState(KMachineState_Null)
    551     , m_defaultCloseAction(MachineCloseAction_Invalid)
    552     , m_restrictedCloseActions(MachineCloseAction_Invalid)
    553     , m_fAllCloseActionsRestricted(false)
    554542    /* Common flags: */
    555543    , m_fInitialized(false)
     
    586574    prepareConnections();
    587575    prepareSignalHandling();
    588 
    589     /* Load settings: */
    590     loadSessionSettings();
    591576
    592577    /* True by default: */
     
    734719}
    735720
    736 void UISession::loadSessionSettings()
    737 {
    738     /* Load extra-data settings: */
    739     {
    740         /* Get machine ID: */
    741         const QUuid uMachineID = uiCommon().managedVMUuid();
    742 
    743         /* What is the default close action and the restricted are? */
    744         m_defaultCloseAction = gEDataManager->defaultMachineCloseAction(uMachineID);
    745         m_restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(uMachineID);
    746         m_fAllCloseActionsRestricted =  (!uiCommon().isSeparateProcess() || (m_restrictedCloseActions & MachineCloseAction_Detach))
    747                                      && (m_restrictedCloseActions & MachineCloseAction_SaveState)
    748                                      && (m_restrictedCloseActions & MachineCloseAction_Shutdown)
    749                                      && (m_restrictedCloseActions & MachineCloseAction_PowerOff);
    750     }
    751 }
    752 
    753721void UISession::cleanupFramebuffers()
    754722{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98399 r98401  
    176176    /** Returns the machine name. */
    177177    const QString& machineName() const { return m_strMachineName; }
    178 
    179178    KMachineState machineStatePrevious() const { return m_machineStatePrevious; }
    180179    KMachineState machineState() const { return m_machineState; }
     180
    181181    UIMachineLogic* machineLogic() const;
    182182    QWidget* mainMachineWindow() const;
    183183    WId mainMachineWindowId() const;
    184184    UIMachineWindow *activeMachineWindow() const;
    185 
    186     /** @name Application Close configuration stuff.
    187      * @{ */
    188     /** Defines @a defaultCloseAction. */
    189     void setDefaultCloseAction(MachineCloseAction defaultCloseAction) { m_defaultCloseAction = defaultCloseAction; }
    190     /** Returns default close action. */
    191     MachineCloseAction defaultCloseAction() const { return m_defaultCloseAction; }
    192     /** Returns merged restricted close actions. */
    193     MachineCloseAction restrictedCloseActions() const { return m_restrictedCloseActions; }
    194     /** Returns whether all the close actions are restricted. */
    195     bool isAllCloseActionsRestricted() const { return m_fAllCloseActionsRestricted; }
    196     /** @} */
    197185
    198186    /** Returns whether visual @a state is allowed. */
     
    329317    void prepareSignalHandling();
    330318
    331     /* Settings stuff: */
    332     void loadSessionSettings();
    333 
    334319    /* Cleanup helpers: */
    335320    void cleanupFramebuffers();
     
    370355    /** Holds the machine name. */
    371356    QString m_strMachineName;
     357    /** Holds the previous machine state. */
     358    KMachineState m_machineStatePrevious;
     359    /** Holds the actual machine state. */
     360    KMachineState m_machineState;
    372361
    373362    /* Frame-buffers vector: */
    374363    QVector<UIFrameBuffer*> m_frameBufferVector;
    375 
    376     /* Common variables: */
    377     KMachineState m_machineStatePrevious;
    378     KMachineState m_machineState;
    379 
    380     /** @name Application Close configuration variables.
    381      * @{ */
    382     /** Default close action. */
    383     MachineCloseAction m_defaultCloseAction;
    384     /** Merged restricted close actions. */
    385     MachineCloseAction m_restrictedCloseActions;
    386     /** Determines whether all the close actions are restricted. */
    387     bool m_fAllCloseActionsRestricted;
    388     /** @} */
    389364
    390365    /* Common flags: */
Note: See TracChangeset for help on using the changeset viewer.

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