VirtualBox

Ignore:
Timestamp:
Jun 10, 2014 11:54:07 AM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 6660: Advanced extra-data management framework: Integrate GUI_AutoresizeGuest.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r51569 r51588  
    821821}
    822822
     823bool UIExtraDataManager::guestScreenAutoResize(const QString &strID) const
     824{
     825    /* 'True' unless feature restricted: */
     826    return !isFeatureRestricted(GUI_AutoresizeGuest, strID);
     827}
     828
     829void UIExtraDataManager::setGuestScreenAutoResize(bool fEnabled, const QString &strID)
     830{
     831    /* 'False' if feature restricted, null-string otherwise: */
     832    setExtraDataString(GUI_AutoresizeGuest, toFeatureRestricted(!fEnabled), strID);
     833}
     834
    823835MachineCloseAction UIExtraDataManager::defaultMachineCloseAction(const QString &strID) const
    824836{
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r51569 r51588  
    240240    void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QString &strID);
    241241
     242    /** Returns whether guest-screen should auto-resize according machine-window size. */
     243    bool guestScreenAutoResize(const QString &strID) const;
     244    /** Defines whether guest-screen auto-resize according machine-window size is @a fEnabled. */
     245    void setGuestScreenAutoResize(bool fEnabled, const QString &strID);
     246
    242247    /** Returns default machine close action. */
    243248    MachineCloseAction defaultMachineCloseAction(const QString &strID) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r51565 r51588  
    11411141
    11421142        /* Should guest autoresize? */
    1143         strSettings = machine.GetExtraData(GUI_AutoresizeGuest);
    11441143        QAction *pGuestAutoresizeSwitch = gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize);
    1145         pGuestAutoresizeSwitch->setChecked(strSettings != "off");
     1144        pGuestAutoresizeSwitch->setChecked(gEDataManager->guestScreenAutoResize(vboxGlobal().managedVMUuid()));
    11461145
    11471146        /* Should we allow reconfiguration? */
     
    11741173void UISession::saveSessionSettings()
    11751174{
    1176     /* Get uisession machine: */
    1177     CMachine machine = session().GetConsole().GetMachine();
    1178 
    11791175    /* Save extra-data settings: */
    11801176    {
     
    11831179
    11841180        /* Remember if guest should autoresize: */
    1185         machine.SetExtraData(GUI_AutoresizeGuest,
    1186                              gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)->isChecked() ?
    1187                              QString() : "off");
     1181        gEDataManager->setGuestScreenAutoResize(gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)->isChecked(), vboxGlobal().managedVMUuid());
    11881182
    11891183#if 0 /* Disabled for now! */
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