VirtualBox

Changeset 79883 in vbox


Ignore:
Timestamp:
Jul 19, 2019 12:05:53 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7720: A bit of cleanup for UINameAndSystemEditor.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
2 edited

Legend:

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

    r79365 r79883  
    4444    , m_fSupportsHWVirtEx(false)
    4545    , m_fSupportsLongMode(false)
     46    , m_pNameLabel(0)
     47    , m_pPathLabel(0)
    4648    , m_pLabelFamily(0)
    4749    , m_pLabelType(0)
    4850    , m_pIconType(0)
    49     , m_pNameLabel(0)
    50     , m_pPathLabel(0)
    5151    , m_pNameLineEdit(0)
    5252    , m_pPathSelector(0)
     
    5454    , m_pComboType(0)
    5555{
    56     /* Prepare: */
    5756    prepare();
     57}
     58
     59void UINameAndSystemEditor::setName(const QString &strName)
     60{
     61    if (!m_pNameLineEdit)
     62        return;
     63    m_pNameLineEdit->setText(strName);
    5864}
    5965
     
    7076        return uiCommon().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
    7177    return m_pPathSelector->path();
    72 }
    73 
    74 void UINameAndSystemEditor::setName(const QString &strName)
    75 {
    76     if (!m_pNameLineEdit)
    77         return;
    78     m_pNameLineEdit->setText(strName);
    7978}
    8079
     
    175174}
    176175
    177 CGuestOSType UINameAndSystemEditor::type() const
    178 {
    179     return uiCommon().vmGuestOSType(typeId(), familyId());
    180 }
    181 
    182176void UINameAndSystemEditor::setType(const CGuestOSType &enmType)
    183177{
     
    193187}
    194188
     189CGuestOSType UINameAndSystemEditor::type() const
     190{
     191    return uiCommon().vmGuestOSType(typeId(), familyId());
     192}
     193
     194void UINameAndSystemEditor::setNameFieldValidator(const QString &strValidator)
     195{
     196    if (!m_pNameLineEdit)
     197        return;
     198    m_pNameLineEdit->setValidator(new QRegExpValidator(QRegExp(strValidator), this));
     199}
     200
    195201void UINameAndSystemEditor::retranslateUi()
    196202{
     
    284290void UINameAndSystemEditor::prepare()
    285291{
    286     /* Prepare this: */
    287292    prepareThis();
    288     /* Prepare widgets: */
    289293    prepareWidgets();
    290     /* Prepare connections: */
    291294    prepareConnections();
    292     /* Apply language settings: */
    293295    retranslateUi();
    294296}
     
    297299{
    298300    /* Check if host supports (AMD-V or VT-x) and long mode: */
    299     CHost host = uiCommon().host();
    300     m_fSupportsHWVirtEx = host.GetProcessorFeature(KProcessorFeature_HWVirtEx);
    301     m_fSupportsLongMode = host.GetProcessorFeature(KProcessorFeature_LongMode);
     301    CHost comHost = uiCommon().host();
     302    m_fSupportsHWVirtEx = comHost.GetProcessorFeature(KProcessorFeature_HWVirtEx);
     303    m_fSupportsLongMode = comHost.GetProcessorFeature(KProcessorFeature_LongMode);
    302304}
    303305
     
    480482            this, &UINameAndSystemEditor::sltTypeChanged);
    481483}
    482 
    483 void UINameAndSystemEditor::setNameFieldValidator(const QString &strValidator)
    484 {
    485     if (!m_pNameLineEdit)
    486         return;
    487     m_pNameLineEdit->setValidator(new QRegExpValidator(QRegExp(strValidator), this));
    488 }
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h

    r76581 r79883  
    7070    UINameAndSystemEditor(QWidget *pParent, bool fChooseLocation = false);
    7171
     72    /** Defines the VM @a strName. */
     73    void setName(const QString &strName);
    7274    /** Returns the VM name. */
    7375    QString name() const;
     76
    7477    /** Returns path string selected by the user. */
    7578    QString path() const;
    76 
    77     /** Defines the VM @a strName. */
    78     void setName(const QString &strName);
    7979
    8080    /** Defines the VM OS @a strTypeId and @a strFamilyId if passed. */
     
    8585    QString familyId() const;
    8686
     87    /** Defines the VM OS @a enmType. */
     88    void setType(const CGuestOSType &enmType);
    8789    /** Returns the VM OS type. */
    8890    CGuestOSType type() const;
    89     /** Defines the VM OS @a enmType. */
    90     void setType(const CGuestOSType &enmType);
    9191
    9292    /** Defines the name-field @a strValidator. */
     
    102102    /** Handles VM OS family @a iIndex change. */
    103103    void sltFamilyChanged(int iIndex);
    104 
    105104    /** Handles VM OS type @a iIndex change. */
    106105    void sltTypeChanged(int iIndex);
     
    135134    /** Holds the currently chosen OS type IDs on per-family basis. */
    136135    QMap<QString, QString>  m_currentIds;
     136
    137137    /** Holds whether we should propose to choose a full path. */
    138     bool                    m_fChooseLocation;
     138    bool  m_fChooseLocation;
    139139    /** Holds whether host supports hardware virtualization. */
    140     bool                    m_fSupportsHWVirtEx;
     140    bool  m_fSupportsHWVirtEx;
    141141    /** Holds whether host supports long mode. */
    142     bool                    m_fSupportsLongMode;
     142    bool  m_fSupportsLongMode;
    143143
     144    /** Holds the VM name label instance. */
     145    QLabel *m_pNameLabel;
     146    /** Holds the VM path label instance. */
     147    QLabel *m_pPathLabel;
    144148    /** Holds the VM OS family label instance. */
    145     QLabel                 *m_pLabelFamily;
     149    QLabel *m_pLabelFamily;
    146150    /** Holds the VM OS type label instance. */
    147     QLabel                 *m_pLabelType;
     151    QLabel *m_pLabelType;
    148152    /** Holds the VM OS type icon instance. */
    149     QLabel                 *m_pIconType;
     153    QLabel *m_pIconType;
    150154
    151     QLabel                 *m_pNameLabel;
    152     QLabel                 *m_pPathLabel;
    153     QILineEdit             *m_pNameLineEdit;
    154     UIFilePathSelector     *m_pPathSelector;
     155    /** Holds the VM name editor instance. */
     156    QILineEdit         *m_pNameLineEdit;
     157    /** Holds the VM path editor instance. */
     158    UIFilePathSelector *m_pPathSelector;
    155159    /** Holds the VM OS family combo instance. */
    156     QComboBox              *m_pComboFamily;
     160    QComboBox          *m_pComboFamily;
    157161    /** Holds the VM OS type combo instance. */
    158     QComboBox              *m_pComboType;
    159     QString                 m_strGroupName;
     162    QComboBox          *m_pComboType;
    160163};
    161164
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