VirtualBox

Ignore:
Timestamp:
Jan 18, 2016 5:04:54 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105073
Message:

FE/Qt: Qt5 migration (part 63): Runtime UI: Another bit of machine-view rework for further improvements.

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

Legend:

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

    r59379 r59380  
    171171    }
    172172
     173    /* Load machine-view settings: */
     174    pMachineView->loadMachineViewSettings();
     175
     176    /* Prepare viewport: */
     177    pMachineView->prepareViewport();
     178
     179    /* Prepare frame-buffer: */
     180    pMachineView->prepareFrameBuffer();
     181
    173182    /* Prepare common things: */
    174183    pMachineView->prepareCommon();
     
    205214    if (!pMachineView)
    206215        return;
     216
     217    /* Cleanup frame-buffer: */
     218    pMachineView->cleanupFrameBuffer();
    207219
    208220#ifdef VBOX_WITH_DRAG_AND_DROP
     
    611623#endif
    612624{
    613     /* Load machine view settings: */
    614     loadMachineViewSettings();
    615 
    616     /* Prepare viewport: */
    617     prepareViewport();
    618 
    619     /* Prepare frame buffer: */
    620     prepareFrameBuffer();
    621 }
    622 
    623 UIMachineView::~UIMachineView()
    624 {
     625}
     626
     627void UIMachineView::loadMachineViewSettings()
     628{
     629    /* Global settings: */
     630    {
     631        /* Remember the maximum guest size policy for telling the guest about
     632         * video modes we like: */
     633        QString maxGuestSize = vboxGlobal().settings().publicProperty("GUI/MaxGuestResolution");
     634        if ((maxGuestSize == QString::null) || (maxGuestSize == "auto"))
     635            m_maxGuestSizePolicy = MaxGuestSizePolicy_Automatic;
     636        else if (maxGuestSize == "any")
     637            m_maxGuestSizePolicy = MaxGuestSizePolicy_Any;
     638        else  /** @todo Mea culpa, but what about error checking? */
     639        {
     640            int width  = maxGuestSize.section(',', 0, 0).toInt();
     641            int height = maxGuestSize.section(',', 1, 1).toInt();
     642            m_maxGuestSizePolicy = MaxGuestSizePolicy_Fixed;
     643            m_fixedMaxGuestSize = QSize(width, height);
     644        }
     645    }
    625646}
    626647
     
    802823    /* Machine state-change updater: */
    803824    connect(uisession(), SIGNAL(sigMachineStateChange()), this, SLOT(sltMachineStateChanged()));
    804 }
    805 
    806 void UIMachineView::loadMachineViewSettings()
    807 {
    808     /* Global settings: */
    809     {
    810         /* Remember the maximum guest size policy for telling the guest about
    811          * video modes we like: */
    812         QString maxGuestSize = vboxGlobal().settings().publicProperty("GUI/MaxGuestResolution");
    813         if ((maxGuestSize == QString::null) || (maxGuestSize == "auto"))
    814             m_maxGuestSizePolicy = MaxGuestSizePolicy_Automatic;
    815         else if (maxGuestSize == "any")
    816             m_maxGuestSizePolicy = MaxGuestSizePolicy_Any;
    817         else  /** @todo Mea culpa, but what about error checking? */
    818         {
    819             int width  = maxGuestSize.section(',', 0, 0).toInt();
    820             int height = maxGuestSize.section(',', 1, 1).toInt();
    821             m_maxGuestSizePolicy = MaxGuestSizePolicy_Fixed;
    822             m_fixedMaxGuestSize = QSize(width, height);
    823         }
    824     }
    825825}
    826826
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r59361 r59380  
    170170    );
    171171    /* Machine-view destructor: */
    172     virtual ~UIMachineView();
     172    virtual ~UIMachineView() {}
    173173
    174174    /* Prepare routines: */
    175     void prepareViewport();
    176     void prepareFrameBuffer();
     175    virtual void loadMachineViewSettings();
     176    virtual void prepareViewport();
     177    virtual void prepareFrameBuffer();
    177178    virtual void prepareCommon();
    178179    virtual void prepareFilters();
    179180    virtual void prepareConnections();
    180181    virtual void prepareConsoleConnections();
    181     void loadMachineViewSettings();
    182182
    183183    /* Cleanup routines: */
    184     //virtual void saveMachineViewSettings() {}
    185184    //virtual void cleanupConsoleConnections() {}
     185    //virtual void cleanupConnections() {}
    186186    //virtual void cleanupFilters() {}
    187187    //virtual void cleanupCommon() {}
    188188    virtual void cleanupFrameBuffer();
    189189    //virtual void cleanupViewport();
     190    //virtual void saveMachineViewSettings() {}
    190191
    191192    /** Returns the session UI reference. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r58013 r59380  
    6161}
    6262
    63 UIMachineViewFullscreen::~UIMachineViewFullscreen()
    64 {
    65     /* Cleanup frame buffer: */
    66     cleanupFrameBuffer();
    67 }
    68 
    6963void UIMachineViewFullscreen::sltAdditionsStateChanged()
    7064{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h

    r55401 r59380  
    3636    );
    3737    /* Fullscreen machine-view destructor: */
    38     virtual ~UIMachineViewFullscreen();
     38    virtual ~UIMachineViewFullscreen() {}
    3939
    4040private slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r59379 r59380  
    5454    , m_bIsGuestAutoresizeEnabled(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize)->isChecked())
    5555{
    56 }
    57 
    58 UIMachineViewNormal::~UIMachineViewNormal()
    59 {
    60     /* Cleanup frame buffer: */
    61     cleanupFrameBuffer();
    6256}
    6357
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h

    r55939 r59380  
    3636    );
    3737    /* Normal machine-view destructor: */
    38     virtual ~UIMachineViewNormal();
     38    virtual ~UIMachineViewNormal() {}
    3939
    4040private slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r59379 r59380  
    5656                    )
    5757{
    58 }
    59 
    60 UIMachineViewScale::~UIMachineViewScale()
    61 {
    62     /* Cleanup frame buffer: */
    63     cleanupFrameBuffer();
    6458}
    6559
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h

    r55939 r59380  
    3636    );
    3737    /* Scale machine-view destructor: */
    38     virtual ~UIMachineViewScale();
     38    virtual ~UIMachineViewScale() {}
    3939
    4040private slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r58013 r59380  
    6767}
    6868
    69 UIMachineViewSeamless::~UIMachineViewSeamless()
    70 {
    71     /* Cleanup seamless mode: */
    72     cleanupSeamless();
    73 
    74     /* Cleanup frame buffer: */
    75     cleanupFrameBuffer();
    76 }
    77 
    7869void UIMachineViewSeamless::sltAdditionsStateChanged()
    7970{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h

    r55401 r59380  
    3636    );
    3737    /* Seamless machine-view destructor: */
    38     virtual ~UIMachineViewSeamless();
     38    virtual ~UIMachineViewSeamless() { cleanupSeamless(); }
    3939
    4040private slots:
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