Changeset 79883 in vbox
- Timestamp:
- Jul 19, 2019 12:05:53 PM (5 years ago)
- 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 44 44 , m_fSupportsHWVirtEx(false) 45 45 , m_fSupportsLongMode(false) 46 , m_pNameLabel(0) 47 , m_pPathLabel(0) 46 48 , m_pLabelFamily(0) 47 49 , m_pLabelType(0) 48 50 , m_pIconType(0) 49 , m_pNameLabel(0)50 , m_pPathLabel(0)51 51 , m_pNameLineEdit(0) 52 52 , m_pPathSelector(0) … … 54 54 , m_pComboType(0) 55 55 { 56 /* Prepare: */57 56 prepare(); 57 } 58 59 void UINameAndSystemEditor::setName(const QString &strName) 60 { 61 if (!m_pNameLineEdit) 62 return; 63 m_pNameLineEdit->setText(strName); 58 64 } 59 65 … … 70 76 return uiCommon().virtualBox().GetSystemProperties().GetDefaultMachineFolder(); 71 77 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);79 78 } 80 79 … … 175 174 } 176 175 177 CGuestOSType UINameAndSystemEditor::type() const178 {179 return uiCommon().vmGuestOSType(typeId(), familyId());180 }181 182 176 void UINameAndSystemEditor::setType(const CGuestOSType &enmType) 183 177 { … … 193 187 } 194 188 189 CGuestOSType UINameAndSystemEditor::type() const 190 { 191 return uiCommon().vmGuestOSType(typeId(), familyId()); 192 } 193 194 void UINameAndSystemEditor::setNameFieldValidator(const QString &strValidator) 195 { 196 if (!m_pNameLineEdit) 197 return; 198 m_pNameLineEdit->setValidator(new QRegExpValidator(QRegExp(strValidator), this)); 199 } 200 195 201 void UINameAndSystemEditor::retranslateUi() 196 202 { … … 284 290 void UINameAndSystemEditor::prepare() 285 291 { 286 /* Prepare this: */287 292 prepareThis(); 288 /* Prepare widgets: */289 293 prepareWidgets(); 290 /* Prepare connections: */291 294 prepareConnections(); 292 /* Apply language settings: */293 295 retranslateUi(); 294 296 } … … 297 299 { 298 300 /* 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); 302 304 } 303 305 … … 480 482 this, &UINameAndSystemEditor::sltTypeChanged); 481 483 } 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 70 70 UINameAndSystemEditor(QWidget *pParent, bool fChooseLocation = false); 71 71 72 /** Defines the VM @a strName. */ 73 void setName(const QString &strName); 72 74 /** Returns the VM name. */ 73 75 QString name() const; 76 74 77 /** Returns path string selected by the user. */ 75 78 QString path() const; 76 77 /** Defines the VM @a strName. */78 void setName(const QString &strName);79 79 80 80 /** Defines the VM OS @a strTypeId and @a strFamilyId if passed. */ … … 85 85 QString familyId() const; 86 86 87 /** Defines the VM OS @a enmType. */ 88 void setType(const CGuestOSType &enmType); 87 89 /** Returns the VM OS type. */ 88 90 CGuestOSType type() const; 89 /** Defines the VM OS @a enmType. */90 void setType(const CGuestOSType &enmType);91 91 92 92 /** Defines the name-field @a strValidator. */ … … 102 102 /** Handles VM OS family @a iIndex change. */ 103 103 void sltFamilyChanged(int iIndex); 104 105 104 /** Handles VM OS type @a iIndex change. */ 106 105 void sltTypeChanged(int iIndex); … … 135 134 /** Holds the currently chosen OS type IDs on per-family basis. */ 136 135 QMap<QString, QString> m_currentIds; 136 137 137 /** Holds whether we should propose to choose a full path. */ 138 bool 138 bool m_fChooseLocation; 139 139 /** Holds whether host supports hardware virtualization. */ 140 bool 140 bool m_fSupportsHWVirtEx; 141 141 /** Holds whether host supports long mode. */ 142 bool 142 bool m_fSupportsLongMode; 143 143 144 /** Holds the VM name label instance. */ 145 QLabel *m_pNameLabel; 146 /** Holds the VM path label instance. */ 147 QLabel *m_pPathLabel; 144 148 /** Holds the VM OS family label instance. */ 145 QLabel 149 QLabel *m_pLabelFamily; 146 150 /** Holds the VM OS type label instance. */ 147 QLabel 151 QLabel *m_pLabelType; 148 152 /** Holds the VM OS type icon instance. */ 149 QLabel 153 QLabel *m_pIconType; 150 154 151 QLabel *m_pNameLabel;152 Q Label *m_pPathLabel;153 QILineEdit *m_pNameLineEdit;154 UIFilePathSelector 155 /** Holds the VM name editor instance. */ 156 QILineEdit *m_pNameLineEdit; 157 /** Holds the VM path editor instance. */ 158 UIFilePathSelector *m_pPathSelector; 155 159 /** Holds the VM OS family combo instance. */ 156 QComboBox 160 QComboBox *m_pComboFamily; 157 161 /** Holds the VM OS type combo instance. */ 158 QComboBox *m_pComboType; 159 QString m_strGroupName; 162 QComboBox *m_pComboType; 160 163 }; 161 164
Note:
See TracChangeset
for help on using the changeset viewer.