VirtualBox

Changeset 75886 in vbox for trunk


Ignore:
Timestamp:
Dec 3, 2018 6:41:46 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
127090
Message:

FE/Qt: bugref:9314: A bit of fixes for r127016: Proper enum/widget orders, moving combo-box handing code to corresponding place.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h

    r75813 r75886  
    130130template<> SHARED_LIBRARY_STUFF bool canConvert<KDnDMode>();
    131131template<> SHARED_LIBRARY_STUFF bool canConvert<KPointingHIDType>();
     132template<> SHARED_LIBRARY_STUFF bool canConvert<KGraphicsControllerType>();
    132133template<> SHARED_LIBRARY_STUFF bool canConvert<KMediumType>();
    133134template<> SHARED_LIBRARY_STUFF bool canConvert<KMediumVariant>();
     
    142143template<> SHARED_LIBRARY_STUFF bool canConvert<KAudioControllerType>();
    143144template<> SHARED_LIBRARY_STUFF bool canConvert<KAuthType>();
    144 template<> SHARED_LIBRARY_STUFF bool canConvert<KGraphicsControllerType>();
    145145template<> SHARED_LIBRARY_STUFF bool canConvert<KStorageBus>();
    146146template<> SHARED_LIBRARY_STUFF bool canConvert<KStorageControllerType>();
     
    271271template<> SHARED_LIBRARY_STUFF QString toString(const KDnDMode &mode);
    272272template<> SHARED_LIBRARY_STUFF QString toString(const KPointingHIDType &type);
     273template<> SHARED_LIBRARY_STUFF QString toString(const KGraphicsControllerType &type);
     274template<> SHARED_LIBRARY_STUFF KGraphicsControllerType fromString<KGraphicsControllerType>(const QString &strType);
    273275template<> SHARED_LIBRARY_STUFF QString toString(const KMediumType &type);
    274276template<> SHARED_LIBRARY_STUFF QString toString(const KMediumVariant &variant);
     
    288290template<> SHARED_LIBRARY_STUFF QString toString(const KAuthType &type);
    289291template<> SHARED_LIBRARY_STUFF KAuthType fromString<KAuthType>(const QString &strType);
    290 template<> SHARED_LIBRARY_STUFF QString toString(const KGraphicsControllerType &type);
    291 template<> SHARED_LIBRARY_STUFF KGraphicsControllerType fromString<KGraphicsControllerType>(const QString &strType);
    292292template<> SHARED_LIBRARY_STUFF QString toString(const KStorageBus &bus);
    293293template<> SHARED_LIBRARY_STUFF QString toString(const KStorageControllerType &type);
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp

    r75813 r75886  
    4343template<> bool canConvert<KDnDMode>() { return true; }
    4444template<> bool canConvert<KPointingHIDType>() { return true; }
     45template<> bool canConvert<KGraphicsControllerType>() { return true; }
    4546template<> bool canConvert<KMediumType>() { return true; }
    4647template<> bool canConvert<KMediumVariant>() { return true; }
     
    5556template<> bool canConvert<KAudioControllerType>() { return true; }
    5657template<> bool canConvert<KAuthType>() { return true; }
    57 template<> bool canConvert<KGraphicsControllerType>() { return true; }
    5858template<> bool canConvert<KStorageBus>() { return true; }
    5959template<> bool canConvert<KStorageControllerType>() { return true; }
     
    263263}
    264264
     265/* QString <= KGraphicsControllerType: */
     266template<> QString toString(const KGraphicsControllerType &type)
     267{
     268    switch (type)
     269    {
     270        case KGraphicsControllerType_Null:     return QApplication::translate("VBoxGlobal", "Null",     "GraphicsControllerType");
     271        case KGraphicsControllerType_VBoxVGA:  return QApplication::translate("VBoxGlobal", "VBoxVGA",  "GraphicsControllerType");
     272        case KGraphicsControllerType_VMSVGA:   return QApplication::translate("VBoxGlobal", "VMSVGA",   "GraphicsControllerType");
     273        case KGraphicsControllerType_VBoxSVGA: return QApplication::translate("VBoxGlobal", "VBoxSVGA", "GraphicsControllerType");
     274        default: AssertMsgFailed(("No text for %d", type)); break;
     275    }
     276    return QString();
     277}
     278
     279/* KGraphicsControllerType <= QString: */
     280template<> KGraphicsControllerType fromString<KGraphicsControllerType>(const QString &strType)
     281{
     282    QHash<QString, KGraphicsControllerType> list;
     283    list.insert(QApplication::translate("VBoxGlobal", "Null",     "GraphicsControllerType"), KGraphicsControllerType_Null);
     284    list.insert(QApplication::translate("VBoxGlobal", "VBoxVGA",  "GraphicsControllerType"), KGraphicsControllerType_VBoxVGA);
     285    list.insert(QApplication::translate("VBoxGlobal", "VMSVGA",   "GraphicsControllerType"), KGraphicsControllerType_VMSVGA);
     286    list.insert(QApplication::translate("VBoxGlobal", "VBoxSVGA", "GraphicsControllerType"), KGraphicsControllerType_VBoxSVGA);
     287    if (!list.contains(strType))
     288    {
     289        AssertMsgFailed(("No value for '%s'", strType.toUtf8().constData()));
     290    }
     291    return list.value(strType, KGraphicsControllerType_Null);
     292}
     293
    265294/* QString <= KMediumType: */
    266295template<> QString toString(const KMediumType &type)
     
    543572}
    544573
    545 /* QString <= KGraphicsControllerType: */
    546 template<> QString toString(const KGraphicsControllerType &type)
    547 {
    548     switch (type)
    549     {
    550         case KGraphicsControllerType_Null:     return QApplication::translate("VBoxGlobal", "Null",     "GraphicsControllerType");
    551         case KGraphicsControllerType_VBoxVGA:  return QApplication::translate("VBoxGlobal", "VBoxVGA",  "GraphicsControllerType");
    552         case KGraphicsControllerType_VMSVGA:   return QApplication::translate("VBoxGlobal", "VMSVGA",   "GraphicsControllerType");
    553         case KGraphicsControllerType_VBoxSVGA: return QApplication::translate("VBoxGlobal", "VBoxSVGA", "GraphicsControllerType");
    554         default: AssertMsgFailed(("No text for %d", type)); break;
    555     }
    556     return QString();
    557 }
    558 
    559 /* KGraphicsControllerType <= QString: */
    560 template<> KGraphicsControllerType fromString<KGraphicsControllerType>(const QString &strType)
    561 {
    562     QHash<QString, KGraphicsControllerType> list;
    563     list.insert(QApplication::translate("VBoxGlobal", "Null",     "GraphicsControllerType"), KGraphicsControllerType_Null);
    564     list.insert(QApplication::translate("VBoxGlobal", "VBoxVGA",  "GraphicsControllerType"), KGraphicsControllerType_VBoxVGA);
    565     list.insert(QApplication::translate("VBoxGlobal", "VMSVGA",  "GraphicsControllerType"), KGraphicsControllerType_VMSVGA);
    566     list.insert(QApplication::translate("VBoxGlobal", "VBoxSVGA", "GraphicsControllerType"), KGraphicsControllerType_VBoxSVGA);
    567     if (!list.contains(strType))
    568     {
    569         AssertMsgFailed(("No value for '%s'", strType.toUtf8().constData()));
    570     }
    571     return list.value(strType, KGraphicsControllerType_Null);
    572 }
    573 
    574574/* QString <= KStorageBus: */
    575575template<> QString toString(const KStorageBus &bus)
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r75813 r75886  
    243243
    244244    /** Holds the video RAM amount. */
    245     int     m_iCurrentVRAM;
     245    int                      m_iCurrentVRAM;
    246246    /** Holds the guest screen count. */
    247     int     m_cGuestScreenCount;
     247    int                      m_cGuestScreenCount;
    248248    /** Holds the guest screen scale-factor. */
    249     QList<double> m_scaleFactors;
     249    QList<double>            m_scaleFactors;
    250250    /** Holds whether the 3D acceleration is enabled. */
    251     bool    m_f3dAccelerationEnabled;
     251    bool                     m_f3dAccelerationEnabled;
    252252#ifdef VBOX_WITH_VIDEOHWACCEL
    253253    /** Holds whether the 2D video acceleration is enabled. */
    254     bool    m_f2dAccelerationEnabled;
     254    bool                     m_f2dAccelerationEnabled;
    255255#endif /* VBOX_WITH_VIDEOHWACCEL */
    256     /** Holds the graphics controller type of the virtual machine. */
    257     KGraphicsControllerType m_graphicsControllerType;
     256    /** Holds the graphics controller type. */
     257    KGraphicsControllerType  m_graphicsControllerType;
    258258    /** Holds whether the remote display server is supported. */
    259     bool       m_fRemoteDisplayServerSupported;
     259    bool                     m_fRemoteDisplayServerSupported;
    260260    /** Holds whether the remote display server is enabled. */
    261     bool       m_fRemoteDisplayServerEnabled;
     261    bool                     m_fRemoteDisplayServerEnabled;
    262262    /** Holds the remote display server port. */
    263     QString    m_strRemoteDisplayPort;
     263    QString                  m_strRemoteDisplayPort;
    264264    /** Holds the remote display server auth type. */
    265     KAuthType  m_remoteDisplayAuthType;
     265    KAuthType                m_remoteDisplayAuthType;
    266266    /** Holds the remote display server timeout. */
    267     ulong      m_uRemoteDisplayTimeout;
     267    ulong                    m_uRemoteDisplayTimeout;
    268268    /** Holds whether the remote display server allows multiple connections. */
    269     bool       m_fRemoteDisplayMultiConnAllowed;
     269    bool                     m_fRemoteDisplayMultiConnAllowed;
    270270
    271271    /** Holds whether recording is enabled. */
     
    435435    m_pCheckbox2DVideo->setChecked(oldDisplayData.m_f2dAccelerationEnabled);
    436436#endif
    437     m_pComboGraphicsControllerType->setCurrentIndex((int)oldDisplayData.m_graphicsControllerType);
     437    m_pComboGraphicsControllerType->setCurrentIndex(m_pComboGraphicsControllerType->findText(gpConverter->toString(oldDisplayData.m_graphicsControllerType)));
    438438    // Should be the last one for this tab:
    439439    m_pEditorVideoMemorySize->setValue(oldDisplayData.m_iCurrentVRAM);
     
    494494    newDisplayData.m_f2dAccelerationEnabled = m_pCheckbox2DVideo->isChecked();
    495495#endif
    496     newDisplayData.m_graphicsControllerType = (KGraphicsControllerType) m_pComboGraphicsControllerType->currentIndex();
     496    newDisplayData.m_graphicsControllerType = gpConverter->fromString<KGraphicsControllerType>(m_pComboGraphicsControllerType->currentText());
    497497    /* If remote display server is supported: */
    498498    newDisplayData.m_fRemoteDisplayServerSupported = m_pCache->base().m_fRemoteDisplayServerSupported;
     
    720720    m_pLabelVideoScreenCountMin->setText(QString::number(1));
    721721    m_pLabelVideoScreenCountMax->setText(QString::number(qMin(sys.GetMaxGuestMonitors(), (ULONG)8)));
     722    m_pComboGraphicsControllerType->setItemText(0, gpConverter->toString(KGraphicsControllerType_Null));
     723    m_pComboGraphicsControllerType->setItemText(1, gpConverter->toString(KGraphicsControllerType_VBoxVGA));
     724    m_pComboGraphicsControllerType->setItemText(2, gpConverter->toString(KGraphicsControllerType_VMSVGA));
     725    m_pComboGraphicsControllerType->setItemText(3, gpConverter->toString(KGraphicsControllerType_VBoxSVGA));
    722726
    723727    /* Remote Display stuff: */
     
    10211025            m_pScaleFactorEditor->setSpinBoxWidthHint(m_pEditorVideoMemorySize->minimumWidth());
    10221026        }
     1027
     1028        /* Graphics controller combo-box created in the .ui file. */
     1029        AssertPtrReturnVoid(m_pComboGraphicsControllerType);
     1030        {
     1031            /* Configure combo-box: */
     1032            m_pComboGraphicsControllerType->insertItem(0, ""); /* KGraphicsControllerType_Null */
     1033            m_pComboGraphicsControllerType->insertItem(1, ""); /* KGraphicsControllerType_VBoxVGA */
     1034            m_pComboGraphicsControllerType->insertItem(2, ""); /* KGraphicsControllerType_VMSVGA */
     1035            m_pComboGraphicsControllerType->insertItem(3, ""); /* KGraphicsControllerType_VBoxSVGA */
     1036        }
    10231037    }
    10241038}
     
    10501064            m_pComboRemoteDisplayAuthMethod->insertItem(1, ""); /* KAuthType_External */
    10511065            m_pComboRemoteDisplayAuthMethod->insertItem(2, ""); /* KAuthType_Guest */
    1052         }
    1053         AssertPtrReturnVoid(m_pComboGraphicsControllerType);
    1054         {
    1055             m_pComboGraphicsControllerType->insertItem((int)KGraphicsControllerType_Null, gpConverter->toString(KGraphicsControllerType_Null));
    1056             m_pComboGraphicsControllerType->insertItem((int)KGraphicsControllerType_VBoxVGA, gpConverter->toString(KGraphicsControllerType_VBoxVGA));
    1057             m_pComboGraphicsControllerType->insertItem((int)KGraphicsControllerType_VMSVGA, gpConverter->toString(KGraphicsControllerType_VMSVGA));
    1058             m_pComboGraphicsControllerType->insertItem((int)KGraphicsControllerType_VBoxSVGA, gpConverter->toString(KGraphicsControllerType_VBoxSVGA));
    10591066        }
    10601067    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui

    r75813 r75886  
    171171          </item>
    172172          <item row="6" column="0">
    173            <widget class="QLabel" name="m_pLabelVideoOptions">
    174             <property name="text">
    175              <string>Acceleration:</string>
    176             </property>
    177             <property name="alignment">
    178              <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    179             </property>
    180            </widget>
    181           </item>
    182           <item row="6" column="1">
    183            <widget class="QCheckBox" name="m_pCheckbox3D">
    184             <property name="sizePolicy">
    185              <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
    186               <horstretch>0</horstretch>
    187               <verstretch>0</verstretch>
    188              </sizepolicy>
    189             </property>
    190             <property name="whatsThis">
    191              <string>When checked, the virtual machine will be given access to the 3D graphics capabilities available on the host.</string>
    192             </property>
    193             <property name="text">
    194              <string>Enable &amp;3D Acceleration</string>
    195             </property>
    196            </widget>
    197           </item>
    198           <item row="7" column="1">
    199            <widget class="QCheckBox" name="m_pCheckbox2DVideo">
    200             <property name="sizePolicy">
    201              <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
    202               <horstretch>0</horstretch>
    203               <verstretch>0</verstretch>
    204              </sizepolicy>
    205             </property>
    206             <property name="whatsThis">
    207              <string>When checked, the virtual machine will be given access to the Video Acceleration capabilities available on the host.</string>
    208             </property>
    209             <property name="text">
    210              <string>Enable &amp;2D Video Acceleration</string>
    211             </property>
    212            </widget>
    213           </item>
    214           <item row="8" column="0">
    215173           <widget class="QLabel" name="m_pLabelGraphicsControllerType">
    216174            <property name="text">
     
    225183           </widget>
    226184          </item>
    227           <item row="8" column="1" colspan="3">
     185          <item row="6" column="1" colspan="2">
    228186           <layout class="QHBoxLayout">
    229187            <item>
     
    254212            </item>
    255213           </layout>
     214          </item>
     215          <item row="7" column="0">
     216           <widget class="QLabel" name="m_pLabelVideoOptions">
     217            <property name="text">
     218             <string>Acceleration:</string>
     219            </property>
     220            <property name="alignment">
     221             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     222            </property>
     223           </widget>
     224          </item>
     225          <item row="7" column="1">
     226           <widget class="QCheckBox" name="m_pCheckbox3D">
     227            <property name="sizePolicy">
     228             <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     229              <horstretch>0</horstretch>
     230              <verstretch>0</verstretch>
     231             </sizepolicy>
     232            </property>
     233            <property name="whatsThis">
     234             <string>When checked, the virtual machine will be given access to the 3D graphics capabilities available on the host.</string>
     235            </property>
     236            <property name="text">
     237             <string>Enable &amp;3D Acceleration</string>
     238            </property>
     239           </widget>
     240          </item>
     241          <item row="8" column="1">
     242           <widget class="QCheckBox" name="m_pCheckbox2DVideo">
     243            <property name="sizePolicy">
     244             <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     245              <horstretch>0</horstretch>
     246              <verstretch>0</verstretch>
     247             </sizepolicy>
     248            </property>
     249            <property name="whatsThis">
     250             <string>When checked, the virtual machine will be given access to the Video Acceleration capabilities available on the host.</string>
     251            </property>
     252            <property name="text">
     253             <string>Enable &amp;2D Video Acceleration</string>
     254            </property>
     255           </widget>
    256256          </item>
    257257         </layout>
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