VirtualBox

Changeset 66588 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 17, 2017 1:02:42 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114615
Message:

FE/Qt: Get rid of VBoxGlobalSettings: Moving maximum guest-screen resolution policy/size handling into extra-data manager.

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

Legend:

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

    r66587 r66588  
    5151{
    5252    /* default settings */
    53     maxGuestRes = QString::null;
    5453    remapScancodes = QString::null;
    5554    proxySettings = QString::null;
     
    5958VBoxGlobalSettingsData::VBoxGlobalSettingsData (const VBoxGlobalSettingsData &that)
    6059{
    61     maxGuestRes = that.maxGuestRes;
    6260    remapScancodes = that.remapScancodes;
    6361    proxySettings = that.proxySettings;
     
    7270{
    7371    return this == &that ||
    74         (maxGuestRes == that.maxGuestRes &&
    75          remapScancodes == that.remapScancodes &&
     72        (remapScancodes == that.remapScancodes &&
    7673         proxySettings == that.proxySettings &&
    7774         hostScreenSaverDisabled == that.hostScreenSaverDisabled
     
    9491gPropertyMap[] =
    9592{
    96     { "GUI/MaxGuestResolution",                    "maxGuestRes",             "\\d*[1-9]\\d*,\\d*[1-9]\\d*|any|auto", true },
    9793    { "GUI/RemapScancodes",                        "remapScancodes",          "(\\d+=\\d+,)*\\d+=\\d+", true },
    9894    { "GUI/ProxySettings",                         "proxySettings",           "[\\s\\S]*", true },
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.h

    r66587 r66588  
    3737private:
    3838
    39     QString maxGuestRes;
    4039    QString remapScancodes;
    4140    QString proxySettings;
     
    5049{
    5150    Q_OBJECT
    52     Q_PROPERTY (QString maxGuestRes READ maxGuestRes WRITE setMaxGuestRes)
    5351    Q_PROPERTY (QString remapScancodes READ remapScancodes WRITE setRemapScancodes)
    5452    Q_PROPERTY (QString proxySettings READ proxySettings WRITE setProxySettings)
     
    6765
    6866    // Properties
    69 
    70     QString maxGuestRes() const { return data()->maxGuestRes; }
    71     void setMaxGuestRes (const QString &aMaxGuestRes)
    72     {
    73         mData()->maxGuestRes = aMaxGuestRes;
    74     }
    7567
    7668    QString remapScancodes() const { return data()->remapScancodes; }
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h

    r66579 r66588  
    8787template<> bool canConvert<UIVisualStateType>();
    8888template<> bool canConvert<DetailsElementType>();
    89 template<> bool canConvert<InformationElementType>();
    9089template<> bool canConvert<PreviewUpdateIntervalType>();
    9190template<> bool canConvert<EventHandlingType>();
     
    103102template<> bool canConvert<MiniToolbarAlignment>();
    104103#endif /* !VBOX_WS_MAC */
     104template<> bool canConvert<InformationElementType>();
     105template<> bool canConvert<MaxGuestResolutionPolicy>();
    105106
    106107/* Declare COM canConvert specializations: */
     
    201202template<> InformationElementType fromInternalString<InformationElementType>(const QString &strInformationElementType);
    202203template<> QIcon toIcon(const InformationElementType &informationElementType);
     204template<> QString toInternalString(const MaxGuestResolutionPolicy &enmMaxGuestResolutionPolicy);
     205template<> MaxGuestResolutionPolicy fromInternalString<MaxGuestResolutionPolicy>(const QString &strMaxGuestResolutionPolicy);
    203206
    204207/* Declare COM conversion specializations: */
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r66579 r66588  
    2323# include <QApplication>
    2424# include <QHash>
     25# include <QRegularExpression>
    2526
    2627/* GUI includes: */
     
    5455template<> bool canConvert<UIVisualStateType>() { return true; }
    5556template<> bool canConvert<DetailsElementType>() { return true; }
    56 template<> bool canConvert<InformationElementType>() { return true; }
    5757template<> bool canConvert<PreviewUpdateIntervalType>() { return true; }
    5858template<> bool canConvert<EventHandlingType>() { return true; }
     
    7070template<> bool canConvert<MiniToolbarAlignment>() { return true; }
    7171#endif /* !VBOX_WS_MAC */
     72template<> bool canConvert<InformationElementType>() { return true; }
     73template<> bool canConvert<MaxGuestResolutionPolicy>() { return true; }
    7274
    7375/* QString <= SizeSuffix: */
     
    18041806}
    18051807
     1808/* QString <= MaxGuestResolutionPolicy: */
     1809template<> QString toInternalString(const MaxGuestResolutionPolicy &enmMaxGuestResolutionPolicy)
     1810{
     1811    QString strResult;
     1812    switch (enmMaxGuestResolutionPolicy)
     1813    {
     1814        case MaxGuestResolutionPolicy_Automatic: strResult = ""; break;
     1815        case MaxGuestResolutionPolicy_Any:       strResult = "any"; break;
     1816        default:
     1817        {
     1818            AssertMsgFailed(("No text for max guest resolution policy=%d", enmMaxGuestResolutionPolicy));
     1819            break;
     1820        }
     1821    }
     1822    return strResult;
     1823}
     1824
     1825/* MaxGuestResolutionPolicy <= QString: */
     1826template<> MaxGuestResolutionPolicy fromInternalString<MaxGuestResolutionPolicy>(const QString &strMaxGuestResolutionPolicy)
     1827{
     1828    /* Here we have some fancy stuff allowing us
     1829     * to search through the keys using 'case-insensitive' rule: */
     1830    QStringList keys; QList<MaxGuestResolutionPolicy> values;
     1831    keys << "auto";   values << MaxGuestResolutionPolicy_Automatic;
     1832    /* Auto type for empty value: */
     1833    if (strMaxGuestResolutionPolicy.isEmpty())
     1834        return MaxGuestResolutionPolicy_Automatic;
     1835    /* Fixed type for value which can be parsed: */
     1836    if (QRegularExpression("[1-9]\\d*,[1-9]\\d*").match(strMaxGuestResolutionPolicy).hasMatch())
     1837        return MaxGuestResolutionPolicy_Fixed;
     1838    /* Any type for unknown words: */
     1839    if (!keys.contains(strMaxGuestResolutionPolicy, Qt::CaseInsensitive))
     1840        return MaxGuestResolutionPolicy_Any;
     1841    /* Corresponding type for known words: */
     1842    return values.at(keys.indexOf(QRegExp(strMaxGuestResolutionPolicy, Qt::CaseInsensitive)));
     1843}
     1844
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp

    r66587 r66588  
    5252
    5353/* Settings: Display: */
     54const char* UIExtraDataDefs::GUI_MaxGuestResolution = "GUI/MaxGuestResolution";
    5455const char* UIExtraDataDefs::GUI_ActivateHoveredMachineWindow = "GUI/ActivateHoveredMachineWindow";
    5556
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r66587 r66588  
    7878    /** @name Settings: Display
    7979      * @{ */
     80        /** Holds maximum guest-screen resolution policy/value. */
     81        extern const char* GUI_MaxGuestResolution;
    8082        /** Holds whether hovered machine-window should be activated. */
    8183        extern const char* GUI_ActivateHoveredMachineWindow;
     
    721723Q_DECLARE_METATYPE(InformationElementType);
    722724
     725/** Runtime UI: Maximum guest-screen resolution policy types.
     726  * @note This policy determines which guest-screen resolutions we wish to
     727  *       handle. We also accept anything smaller than the current resolution. */
     728enum MaxGuestResolutionPolicy
     729{
     730    /** Anything at all. */
     731    MaxGuestResolutionPolicy_Any,
     732    /** Anything up to a fixed size. */
     733    MaxGuestResolutionPolicy_Fixed,
     734    /** Anything up to host-screen available space. */
     735    MaxGuestResolutionPolicy_Automatic
     736};
     737
    723738#endif /* !___UIExtraDataDefs_h___ */
    724739
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r66587 r66588  
    23492349}
    23502350
     2351MaxGuestResolutionPolicy UIExtraDataManager::maxGuestResolutionPolicy()
     2352{
     2353    /* Return maximum guest-screen resolution policy: */
     2354    return gpConverter->fromInternalString<MaxGuestResolutionPolicy>(extraDataString(GUI_MaxGuestResolution));
     2355}
     2356
     2357void UIExtraDataManager::setMaxGuestScreenResolution(MaxGuestResolutionPolicy enmPolicy, const QSize resolution /* = QSize() */)
     2358{
     2359    /* If policy is 'Fixed' => call the wrapper: */
     2360    if (enmPolicy == MaxGuestResolutionPolicy_Fixed)
     2361        setMaxGuestResolutionForPolicyFixed(resolution);
     2362    /* Otherwise => just store the value: */
     2363    else
     2364        setExtraDataString(GUI_MaxGuestResolution, gpConverter->toInternalString(enmPolicy));
     2365}
     2366
     2367QSize UIExtraDataManager::maxGuestResolutionForPolicyFixed()
     2368{
     2369    /* Acquire maximum guest-screen resolution policy: */
     2370    const QString strPolicy = extraDataString(GUI_MaxGuestResolution);
     2371    const MaxGuestResolutionPolicy enmPolicy = gpConverter->fromInternalString<MaxGuestResolutionPolicy>(strPolicy);
     2372
     2373    /* Make sure maximum guest-screen resolution policy is really Fixed: */
     2374    if (enmPolicy != MaxGuestResolutionPolicy_Fixed)
     2375        return QSize();
     2376
     2377    /* Parse maximum guest-screen resolution: */
     2378    const QStringList values = strPolicy.split(',');
     2379    int iWidth = values.at(0).toInt();
     2380    int iHeight = values.at(1).toInt();
     2381    if (iWidth <= 0)
     2382        iWidth = 640;
     2383    if (iHeight <= 0)
     2384        iHeight = 480;
     2385
     2386    /* Return maximum guest-screen resolution: */
     2387    return QSize(iWidth, iHeight);
     2388}
     2389
     2390void UIExtraDataManager::setMaxGuestResolutionForPolicyFixed(const QSize &resolution)
     2391{
     2392    /* If resolution is 'empty' => call the wrapper: */
     2393    if (resolution.isEmpty())
     2394        setMaxGuestScreenResolution(MaxGuestResolutionPolicy_Automatic);
     2395    /* Otherwise => just store the value: */
     2396    else
     2397        setExtraDataString(GUI_MaxGuestResolution, QString("%1,%2").arg(resolution.width()).arg(resolution.height()));
     2398}
     2399
    23512400bool UIExtraDataManager::activateHoveredMachineWindow()
    23522401{
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r66587 r66588  
    2525# include <QPointer>
    2626#endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
     27#include <QSize>
    2728
    2829/* GUI includes: */
     
    198199    /** @name Settings: Display
    199200      * @{ */
     201        /** Returns maximum guest-screen resolution policy. */
     202        MaxGuestResolutionPolicy maxGuestResolutionPolicy();
     203        /** Defines maximum guest-screen resolution @a enmPolicy or @a resolution itself for Fixed policy. */
     204        void setMaxGuestScreenResolution(MaxGuestResolutionPolicy enmPolicy, const QSize resolution = QSize());
     205        /** Returns maximum guest-screen resolution for fixed policy. */
     206        QSize maxGuestResolutionForPolicyFixed();
     207        /** Defines maximum guest-screen @a resolution for fixed policy. */
     208        void setMaxGuestResolutionForPolicyFixed(const QSize &resolution);
     209
    200210        /** Returns whether hovered machine-window should be activated. */
    201211        bool activateHoveredMachineWindow();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r66256 r66588  
    649649    , m_iHostScreenNumber(0)
    650650#endif /* VBOX_WS_MAC */
    651     , m_maxGuestSizePolicy(MaxGuestSizePolicy_Invalid)
     651    , m_maxGuestSizePolicy(MaxGuestResolutionPolicy_Automatic)
    652652    , m_u64MaxGuestSize(0)
    653653#ifdef VBOX_WITH_VIDEOHWACCEL
     
    667667    /* Global settings: */
    668668    {
    669         /* Remember the maximum guest size policy for telling the guest about
    670          * video modes we like: */
    671         QString maxGuestSize = vboxGlobal().settings().publicProperty("GUI/MaxGuestResolution");
    672         if ((maxGuestSize == QString::null) || (maxGuestSize == "auto"))
    673             m_maxGuestSizePolicy = MaxGuestSizePolicy_Automatic;
    674         else if (maxGuestSize == "any")
    675             m_maxGuestSizePolicy = MaxGuestSizePolicy_Any;
    676         else  /** @todo Mea culpa, but what about error checking? */
    677         {
    678             int width  = maxGuestSize.section(',', 0, 0).toInt();
    679             int height = maxGuestSize.section(',', 1, 1).toInt();
    680             m_maxGuestSizePolicy = MaxGuestSizePolicy_Fixed;
    681             m_fixedMaxGuestSize = QSize(width, height);
    682         }
     669        /* Remember the maximum guest size policy for
     670         * telling the guest about video modes we like: */
     671        m_maxGuestSizePolicy = gEDataManager->maxGuestResolutionPolicy();
     672        if (m_maxGuestSizePolicy == MaxGuestResolutionPolicy_Fixed)
     673            m_fixedMaxGuestSize = gEDataManager->maxGuestResolutionForPolicyFixed();
    683674    }
    684675}
     
    10141005    switch (m_maxGuestSizePolicy)
    10151006    {
    1016         case MaxGuestSizePolicy_Fixed:
     1007        case MaxGuestResolutionPolicy_Fixed:
    10171008            maxSize = m_fixedMaxGuestSize;
    10181009            break;
    1019         case MaxGuestSizePolicy_Automatic:
     1010        case MaxGuestResolutionPolicy_Automatic:
    10201011            maxSize = calculateMaxGuestSize().expandedTo(minimumSizeHint);
    10211012            break;
    1022         case MaxGuestSizePolicy_Any:
    1023         default:
    1024             AssertMsg(m_maxGuestSizePolicy == MaxGuestSizePolicy_Any,
    1025                       ("Invalid maximum guest size policy %d!\n",
    1026                        m_maxGuestSizePolicy));
     1013        case MaxGuestResolutionPolicy_Any:
    10271014            /* (0, 0) means any of course. */
    10281015            maxSize = QSize(0, 0);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r66256 r66588  
    8080
    8181public:
    82 
    83     /** Policy for determining which guest resolutions we wish to
    84      * handle.  We also accept anything smaller than the current
    85      * resolution. */
    86     enum MaxGuestSizePolicy
    87     {
    88         /** Policy not set correctly. */
    89         MaxGuestSizePolicy_Invalid = 0,
    90         /** Anything up to a fixed size. */
    91         MaxGuestSizePolicy_Fixed,
    92         /** Anything up to available space on the host desktop. */
    93         MaxGuestSizePolicy_Automatic,
    94         /** We accept anything. */
    95         MaxGuestSizePolicy_Any
    96     };
    9782
    9883    /* Factory function to create machine-view: */
     
    406391    /** The policy for calculating the maximum guest resolution which we wish
    407392     * to handle. */
    408     MaxGuestSizePolicy m_maxGuestSizePolicy;
     393    MaxGuestResolutionPolicy m_maxGuestSizePolicy;
    409394    /** The maximum guest size for fixed size policy. */
    410395    QSize m_fixedMaxGuestSize;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.cpp

    r66568 r66588  
    3232    /** Constructs data. */
    3333    UIDataSettingsGlobalDisplay()
    34         : m_strMaxGuestResolution(QString())
     34        : m_enmMaxGuestResolution(MaxGuestResolutionPolicy_Automatic)
     35        , m_maxGuestResolution(QSize())
    3536        , m_fActivateHoveredMachineWindow(false)
    3637    {}
     
    4041    {
    4142        return true
    42                && (m_strMaxGuestResolution == other.m_strMaxGuestResolution)
     43               && (m_enmMaxGuestResolution == other.m_enmMaxGuestResolution)
     44               && (m_maxGuestResolution == other.m_maxGuestResolution)
    4345               && (m_fActivateHoveredMachineWindow == other.m_fActivateHoveredMachineWindow)
    4446               ;
     
    5052    bool operator!=(const UIDataSettingsGlobalDisplay &other) const { return !equal(other); }
    5153
    52     /** Holds the maximum guest resolution or preset name. */
    53     QString m_strMaxGuestResolution;
     54    /** Holds the maximum guest-screen resolution policy. */
     55    MaxGuestResolutionPolicy m_enmMaxGuestResolution;
     56    /** Holds the maximum guest-screen resolution. */
     57    QSize m_maxGuestResolution;
    5458    /** Holds whether we should automatically activate machine window under the mouse cursor. */
    5559    bool m_fActivateHoveredMachineWindow;
     
    8286
    8387    /* Gather old display data: */
    84     oldDisplayData.m_strMaxGuestResolution = m_settings.maxGuestRes();
     88    oldDisplayData.m_enmMaxGuestResolution = gEDataManager->maxGuestResolutionPolicy();
     89    if (oldDisplayData.m_enmMaxGuestResolution == MaxGuestResolutionPolicy_Fixed)
     90        oldDisplayData.m_maxGuestResolution = gEDataManager->maxGuestResolutionForPolicyFixed();
    8591    oldDisplayData.m_fActivateHoveredMachineWindow = gEDataManager->activateHoveredMachineWindow();
    8692
     
    98104
    99105    /* Load old display data from the cache: */
    100     if (   (oldDisplayData.m_strMaxGuestResolution.isEmpty())
    101         || (oldDisplayData.m_strMaxGuestResolution == "auto"))
    102     {
    103         /* Switch combo-box item: */
    104         m_pMaxResolutionCombo->setCurrentIndex(m_pMaxResolutionCombo->findData("auto"));
    105     }
    106     else if (oldDisplayData.m_strMaxGuestResolution == "any")
    107     {
    108         /* Switch combo-box item: */
    109         m_pMaxResolutionCombo->setCurrentIndex(m_pMaxResolutionCombo->findData("any"));
    110     }
    111     else
    112     {
    113         /* Switch combo-box item: */
    114         m_pMaxResolutionCombo->setCurrentIndex(m_pMaxResolutionCombo->findData("fixed"));
    115         /* Trying to parse text into 2 sections by ',' symbol: */
    116         const int iWidth  = oldDisplayData.m_strMaxGuestResolution.section(',', 0, 0).toInt();
    117         const int iHeight = oldDisplayData.m_strMaxGuestResolution.section(',', 1, 1).toInt();
    118         /* And set values if they are present: */
    119         m_pResolutionWidthSpin->setValue(iWidth);
    120         m_pResolutionHeightSpin->setValue(iHeight);
     106    m_pMaxResolutionCombo->setCurrentIndex(m_pMaxResolutionCombo->findData((int)oldDisplayData.m_enmMaxGuestResolution));
     107    if (oldDisplayData.m_enmMaxGuestResolution == MaxGuestResolutionPolicy_Fixed)
     108    {
     109        m_pResolutionWidthSpin->setValue(oldDisplayData.m_maxGuestResolution.width());
     110        m_pResolutionHeightSpin->setValue(oldDisplayData.m_maxGuestResolution.height());
    121111    }
    122112    m_pCheckBoxActivateOnMouseHover->setChecked(oldDisplayData.m_fActivateHoveredMachineWindow);
     
    129119
    130120    /* Gather new display data: */
    131     if (m_pMaxResolutionCombo->itemData(m_pMaxResolutionCombo->currentIndex()).toString() == "auto")
    132     {
    133         /* If resolution current combo item is "auto" => resolution set to "auto": */
    134         newDisplayData.m_strMaxGuestResolution = QString();
    135     }
    136     else if (   m_pMaxResolutionCombo->itemData(m_pMaxResolutionCombo->currentIndex()).toString() == "any"
    137              || m_pResolutionWidthSpin->value() == 0 || m_pResolutionHeightSpin->value() == 0)
    138     {
    139         /* Else if resolution current combo item is "any"
    140          * or any of the resolution field attributes is zero => resolution set to "any": */
    141         newDisplayData.m_strMaxGuestResolution = "any";
    142     }
    143     else if (m_pResolutionWidthSpin->value() != 0 && m_pResolutionHeightSpin->value() != 0)
    144     {
    145         /* Else if both field attributes are non-zeroes => resolution set to "fixed": */
    146         newDisplayData.m_strMaxGuestResolution = QString("%1,%2").arg(m_pResolutionWidthSpin->value()).arg(m_pResolutionHeightSpin->value());
    147     }
     121    newDisplayData.m_enmMaxGuestResolution = (MaxGuestResolutionPolicy)m_pMaxResolutionCombo->itemData(m_pMaxResolutionCombo->currentIndex()).toInt();
     122    if (newDisplayData.m_enmMaxGuestResolution == MaxGuestResolutionPolicy_Fixed)
     123        newDisplayData.m_maxGuestResolution = QSize(m_pResolutionWidthSpin->value(), m_pResolutionHeightSpin->value());
    148124    newDisplayData.m_fActivateHoveredMachineWindow = m_pCheckBoxActivateOnMouseHover->isChecked();
    149125
     
    161137    {
    162138        /* Save new display data from the cache: */
    163         if (m_pCache->data().m_strMaxGuestResolution != m_pCache->base().m_strMaxGuestResolution)
    164             m_settings.setMaxGuestRes(m_pCache->data().m_strMaxGuestResolution);
     139        if (   m_pCache->data().m_enmMaxGuestResolution != m_pCache->base().m_enmMaxGuestResolution
     140            || m_pCache->data().m_maxGuestResolution != m_pCache->base().m_maxGuestResolution)
     141            gEDataManager->setMaxGuestScreenResolution(m_pCache->data().m_enmMaxGuestResolution, m_pCache->data().m_maxGuestResolution);
    165142        if (m_pCache->data().m_fActivateHoveredMachineWindow != m_pCache->base().m_fActivateHoveredMachineWindow)
    166143            gEDataManager->setActivateHoveredMachineWindow(m_pCache->data().m_fActivateHoveredMachineWindow);
     
    187164
    188165    /* Get current resolution-combo item data: */
    189     const QString strCurrentComboItemData = m_pMaxResolutionCombo->itemData(m_pMaxResolutionCombo->currentIndex()).toString();
    190     /* Is our combo in state for 'fixed' resolution? */
    191     const bool fCurrentResolutionStateFixed = strCurrentComboItemData == "fixed";
     166    const MaxGuestResolutionPolicy enmPolicy = (MaxGuestResolutionPolicy)m_pMaxResolutionCombo->itemData(m_pMaxResolutionCombo->currentIndex()).toInt();
    192167    /* Should be combo-level widgets enabled? */
    193     const bool fComboLevelWidgetsEnabled = fCurrentResolutionStateFixed;
     168    const bool fComboLevelWidgetsEnabled = enmPolicy == MaxGuestResolutionPolicy_Fixed;
    194169    /* Enable/disable combo-level widgets: */
    195170    m_pResolutionWidthLabel->setEnabled(fComboLevelWidgetsEnabled);
     
    247222
    248223    /* Create corresponding items: */
    249     m_pMaxResolutionCombo->addItem(tr("Automatic", "Maximum Guest Screen Size"), "auto");
     224    m_pMaxResolutionCombo->addItem(tr("Automatic", "Maximum Guest Screen Size"),
     225                                   QVariant((int)MaxGuestResolutionPolicy_Automatic));
    250226    m_pMaxResolutionCombo->setItemData(m_pMaxResolutionCombo->count() - 1,
    251227                                       tr("Suggest a reasonable maximum screen size to the guest. "
    252228                                          "The guest will only see this suggestion when guest additions are installed."),
    253229                                       Qt::ToolTipRole);
    254     m_pMaxResolutionCombo->addItem(tr("None", "Maximum Guest Screen Size"), "any");
     230    m_pMaxResolutionCombo->addItem(tr("None", "Maximum Guest Screen Size"),
     231                                   QVariant((int)MaxGuestResolutionPolicy_Any));
    255232    m_pMaxResolutionCombo->setItemData(m_pMaxResolutionCombo->count() - 1,
    256233                                       tr("Do not attempt to limit the size of the guest screen."),
    257234                                       Qt::ToolTipRole);
    258     m_pMaxResolutionCombo->addItem(tr("Hint", "Maximum Guest Screen Size"), "fixed");
     235    m_pMaxResolutionCombo->addItem(tr("Hint", "Maximum Guest Screen Size"),
     236                                   QVariant((int)MaxGuestResolutionPolicy_Fixed));
    259237    m_pMaxResolutionCombo->setItemData(m_pMaxResolutionCombo->count() - 1,
    260238                                       tr("Suggest a maximum screen size to the guest. "
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