VirtualBox

Ignore:
Timestamp:
Feb 2, 2023 9:55:00 AM (2 years ago)
Author:
vboxsync
Message:

Merging r155559 and r155572 from gui4 branch: FE/Qt: Runtime UI: Keep media related stuff inside UISession; Do not bring it to UIMachine; Move rest of stuff related to graphics and keyboard from UISession to UIMachine; A bit of cleanup as well.

Location:
trunk
Files:
11 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,155488,155509-155513,155526-155527
         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,155509-155513,155526-155527,155559,155572
        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,155488,155509-155513,155526-155527
         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,155509-155513,155526-155527,155559,155572
  • 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,155488,155509-155513,155526-155527
         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,155509-155513,155526-155527,155559,155572
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r98400 r98425  
    19511951bool UIKeyboardHandler::isAutoCaptureDisabled()
    19521952{
    1953     return uisession()->isAutoCaptureDisabled();
     1953    return uimachine()->isAutoCaptureDisabled();
    19541954}
    19551955
    19561956void UIKeyboardHandler::setAutoCaptureDisabled(bool fIsAutoCaptureDisabled)
    19571957{
    1958     uisession()->setAutoCaptureDisabled(fIsAutoCaptureDisabled);
     1958    uimachine()->setAutoCaptureDisabled(fIsAutoCaptureDisabled);
    19591959}
    19601960
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98424 r98425  
    818818    , m_pWatchdogDisplayChange(0)
    819819#endif
     820    , m_fIsGuestResizeIgnored(false)
    820821    , m_fNumLock(false)
    821822    , m_fCapsLock(false)
     
    824825    , m_uCapsLockAdaptionCnt(2)
    825826    , m_fIsHidLedsSyncEnabled(false)
     827    , m_fIsAutoCaptureDisabled(false)
    826828    , m_iKeyboardState(0)
    827829    , m_fIsHidingHostPointer(true)
     
    858860        return false;
    859861    AssertPtrReturn(uisession(), false);
    860 
    861     /* Cache media data early if necessary: */
    862     if (uiCommon().agressiveCaching())
    863         uiCommon().enumerateMedia(uisession()->machineMedia());
    864862
    865863    /* Prepare stuff: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98424 r98425  
    122122    /** @} */
    123123
    124     /** @name Mouse cursor stuff.
     124    /** @name Mouse stuff.
    125125     ** @{ */
    126126        /** Notifies listeners about mouse pointer shape change. */
     
    236236        /** Defines last full-screen @a size for guest-screen with index @a uScreenId. */
    237237        void setLastFullScreenSize(ulong uScreenId, QSize size);
     238
     239        /** Returns whether guest screen resize should be ignored. */
     240        bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; }
     241        /** Defines whether guest screen resize should be @a fIgnored. */
     242        void setGuestResizeIgnored(bool fIgnored) { m_fIsGuestResizeIgnored = fIgnored; }
    238243    /** @} */
    239244
     
    260265        bool isHidLedsSyncEnabled() const { return m_fIsHidLedsSyncEnabled; }
    261266
     267        /** Returns whether auto-capture is disabled. */
     268        bool isAutoCaptureDisabled() const { return m_fIsAutoCaptureDisabled; }
     269        /** Defines whether auto-capture is @a fDisabled. */
     270        void setAutoCaptureDisabled(bool fDisabled) { m_fIsAutoCaptureDisabled = fDisabled; }
     271
    262272        /** Returns the keyboard-state. */
    263273        int keyboardState() const { return m_iKeyboardState; }
    264274    /** @} */
    265275
    266     /** @name Mouse cursor stuff.
     276    /** @name Mouse stuff.
    267277     ** @{ */
    268278        /** Returns whether we should hide host mouse pointer. */
     
    354364    /** @} */
    355365
    356     /** @name Mouse cursor stuff.
     366    /** @name Mouse stuff.
    357367     ** @{ */
    358368        /** Defines @a iMouseState. */
     
    433443    /** @} */
    434444
    435     /** @name Mouse cursor stuff.
     445    /** @name Mouse stuff.
    436446     ** @{ */
    437447        /** Handles signal about mouse pointer shape data change.
     
    527537    /** @} */
    528538
    529     /** @name Mouse cursor stuff.
     539    /** @name Mouse stuff.
    530540     ** @{ */
    531541        /** Updates mouse pointer shape. */
     
    626636        /** Holds the list of guest-screen full-screen sizes. */
    627637        QVector<QSize>  m_monitorLastFullScreenSizeVector;
     638
     639        /** Holds whether guest screen resize should be ignored. */
     640        bool m_fIsGuestResizeIgnored;
    628641    /** @} */
    629642
     
    645658        bool m_fIsHidLedsSyncEnabled;
    646659
     660        /** Holds whether auto-capture is disabled. */
     661        bool m_fIsAutoCaptureDisabled;
     662
    647663        /** Holds the keyboard-state. */
    648664        int  m_iKeyboardState;
    649665    /** @} */
    650666
    651     /** @name Mouse cursor stuff.
     667    /** @name Mouse stuff.
    652668     ** @{ */
    653669        /** Holds whether we should hide host mouse pointer. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r98423 r98425  
    459459        {
    460460            /* Prevent machine-view from resizing: */
    461             uisession()->setGuestResizeIgnored(true);
     461            uimachine()->setGuestResizeIgnored(true);
    462462            /* Get log-folder: */
    463463            QString strLogFolder = machine().GetLogFolder();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r98386 r98425  
    599599    /* Some situations require frame-buffer resize-events to be ignored at all,
    600600     * leaving machine-window, machine-view and frame-buffer sizes preserved: */
    601     if (uisession()->isGuestResizeIgnored())
     601    if (uimachine()->isGuestResizeIgnored())
    602602        return;
    603603
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r98385 r98425  
    11701170                    /* Temporarily disable auto capture that will take place after this dialog is dismissed because
    11711171                     * the capture state is to be defined by the dialog result itself: */
    1172                     uisession()->setAutoCaptureDisabled(true);
     1172                    uimachine()->setAutoCaptureDisabled(true);
    11731173                    bool fIsAutoConfirmed = false;
    11741174                    bool ok = msgCenter().confirmInputCapture(fIsAutoConfirmed);
    11751175                    if (fIsAutoConfirmed)
    1176                         uisession()->setAutoCaptureDisabled(false);
     1176                        uimachine()->setAutoCaptureDisabled(false);
    11771177                    /* Otherwise, the disable flag will be reset in the next console view's focus in event (since
    11781178                     * may happen asynchronously on some platforms, after we return from this code): */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98424 r98425  
    368368    , m_machineStatePrevious(KMachineState_Null)
    369369    , m_machineState(KMachineState_Null)
    370     /* Common flags: */
    371     , m_fIsGuestResizeIgnored(false)
    372     , m_fIsAutoCaptureDisabled(false)
    373370    /* Guest additions flags: */
    374371    , m_ulGuestAdditionsRunLevel(0)
     
    402399    if (!prepareSession())
    403400        return false;
     401
     402    /* Cache media early if requested: */
     403    if (uiCommon().agressiveCaching())
     404        recacheMachineMedia();
    404405
    405406    /* Prepare GUI stuff: */
     
    802803}
    803804
    804 CMediumVector UISession::machineMedia() const
    805 {
     805void UISession::recacheMachineMedia()
     806{
     807    /* Compose a list of machine media: */
    806808    CMediumVector comMedia;
     809
    807810    /* Enumerate all the controllers: */
    808     foreach (const CStorageController &comController, m_machine.GetStorageControllers())
     811    foreach (const CStorageController &comController, machine().GetStorageControllers())
    809812    {
    810813        /* Enumerate all the attachments: */
    811         foreach (const CMediumAttachment &comAttachment, m_machine.GetMediumAttachmentsOfController(comController.GetName()))
     814        foreach (const CMediumAttachment &comAttachment, machine().GetMediumAttachmentsOfController(comController.GetName()))
    812815        {
    813816            /* Skip unrelated device types: */
     
    823826        }
    824827    }
    825     return comMedia;
     828
     829    /* Start media enumeration: */
     830    uiCommon().enumerateMedia(comMedia);
    826831}
    827832
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98424 r98425  
    5353#include "CKeyboard.h"
    5454#include "CMachineDebugger.h"
    55 #include "CMedium.h"
    5655
    5756/* Forward declarations: */
     
    166165    QString machineName() const { return m_strMachineName; }
    167166
     167    /** Returns main machine-widget id. */
     168    WId mainMachineWindowId() const;
     169
    168170    /** Returns previous machine state. */
    169171    KMachineState machineStatePrevious() const { return m_machineStatePrevious; }
    170172    /** Returns machine state. */
    171173    KMachineState machineState() const { return m_machineState; }
    172 
    173     /** Returns main machine-widget id. */
    174     WId mainMachineWindowId() const;
    175174
    176175    bool isSaved() const { return machineState() == KMachineState_Saved ||
     
    189188    bool wasPaused() const { return machineStatePrevious() == KMachineState_Paused ||
    190189                                    machineStatePrevious() == KMachineState_TeleportingPausedVM; }
    191 
    192     bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; }
    193     bool isAutoCaptureDisabled() const { return m_fIsAutoCaptureDisabled; }
     190    /** Returns whether guest-screen is undrawable.
     191     *  @todo: extend this method to all the states when guest-screen is undrawable. */
     192    bool isGuestScreenUnDrawable() const { return machineState() == KMachineState_Stopping ||
     193                                                  machineState() == KMachineState_Saving; }
     194
    194195
    195196    /* Guest additions state getters: */
     
    206207    bool unpause() { return setPause(false); }
    207208    bool setPause(bool fOn);
    208     void setGuestResizeIgnored(bool fIsGuestResizeIgnored) { m_fIsGuestResizeIgnored = fIsGuestResizeIgnored; }
    209     void setAutoCaptureDisabled(bool fIsAutoCaptureDisabled) { m_fIsAutoCaptureDisabled = fIsAutoCaptureDisabled; }
    210209    void forgetPreviousMachineState() { m_machineStatePrevious = m_machineState; }
    211 
    212     /** Returns whether guest-screen is undrawable.
    213      *  @todo: extend this method to all the states when guest-screen is undrawable. */
    214     bool isGuestScreenUnDrawable() const { return machineState() == KMachineState_Stopping ||
    215                                                   machineState() == KMachineState_Saving; }
    216210
    217211    /* Returns existing framebuffer for the given screen-number;
     
    224218    const QVector<UIFrameBuffer*>& frameBuffers() const { return m_frameBufferVector; }
    225219
    226     /** Returns a vector of media attached to the machine. */
    227     CMediumVector machineMedia() const;
    228 
    229220    /** Prepares VM to be saved. */
    230221    bool prepareToBeSaved();
     
    284275    bool preprocessInitialization();
    285276    bool mountAdHocImage(KDeviceType enmDeviceType, UIMediumDeviceType enmMediumType, const QString &strMediumName);
     277
     278    /** Recaches media attached to the machine. */
     279    void recacheMachineMedia();
    286280
    287281    /* Private variables: */
     
    318312    QVector<UIFrameBuffer*> m_frameBufferVector;
    319313
    320     /* Common flags: */
    321     bool m_fIsGuestResizeIgnored : 1;
    322     bool m_fIsAutoCaptureDisabled : 1;
    323 
    324314    /* Guest additions flags: */
    325315    ULONG m_ulGuestAdditionsRunLevel;
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