Changeset 72314 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 24, 2018 9:16:58 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp
r72313 r72314 121 121 m_pLabelType->setText(tr("&Version:")); 122 122 m_pNameLabel->setText(tr("Name:")); 123 m_pPathLabel->setText(tr("Path:")); 123 if (m_pPathLabel) 124 m_pPathLabel->setText(tr("Path:")); 124 125 125 126 m_pComboFamily->setWhatsThis(tr("Selects the operating system family that " … … 232 233 233 234 m_pNameLabel = new QLabel; 235 int iRow = 0; 234 236 if (m_pNameLabel) 235 237 { 236 238 m_pNameLabel->setAlignment(Qt::AlignRight); 237 239 m_pNameLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 238 pMainLayout->addWidget(m_pNameLabel, 0, 0, 1, 1);240 pMainLayout->addWidget(m_pNameLabel, iRow, 0, 1, 1); 239 241 } 240 242 m_pNameLineEdit = new QILineEdit; 241 243 if (m_pNameLineEdit) 242 244 { 243 pMainLayout->addWidget(m_pNameLineEdit, 0, 1, 1, 2); 244 } 245 246 m_pPathLabel = new QLabel; 247 if (m_pPathLabel) 248 { 249 m_pPathLabel->setAlignment(Qt::AlignRight); 250 m_pPathLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 251 pMainLayout->addWidget(m_pPathLabel, 1, 0, 1, 1); 252 } 253 254 m_pPathSelector = new UIFilePathSelector; 255 if (m_pPathSelector) 256 { 257 pMainLayout->addWidget(m_pPathSelector, 1, 1, 1, 2); 258 QString strDefaultMachineFolder = vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder(); 259 m_pPathSelector->setPath(strDefaultMachineFolder); 260 m_pPathSelector->setDefaultPath(strDefaultMachineFolder); 245 pMainLayout->addWidget(m_pNameLineEdit, iRow++, 1, 1, 2); 246 } 247 248 if (m_fChooseLocation) 249 { 250 m_pPathLabel = new QLabel; 251 if (m_pPathLabel) 252 { 253 m_pPathLabel->setAlignment(Qt::AlignRight); 254 m_pPathLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 255 pMainLayout->addWidget(m_pPathLabel, iRow, 0, 1, 1); 256 } 257 258 m_pPathSelector = new UIFilePathSelector; 259 if (m_pPathSelector) 260 { 261 pMainLayout->addWidget(m_pPathSelector, iRow++, 1, 1, 2); 262 QString strDefaultMachineFolder = vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder(); 263 m_pPathSelector->setPath(strDefaultMachineFolder); 264 m_pPathSelector->setDefaultPath(strDefaultMachineFolder); 265 } 261 266 } 262 267 … … 269 274 m_pLabelFamily->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 270 275 /* Add VM OS family label into main-layout: */ 271 pMainLayout->addWidget(m_pLabelFamily, 2, 0);272 } 273 276 pMainLayout->addWidget(m_pLabelFamily, iRow, 0); 277 } 278 int iIconRow = iRow; 274 279 /* Create VM OS family combo: */ 275 280 m_pComboFamily = new QComboBox; … … 280 285 m_pLabelFamily->setBuddy(m_pComboFamily); 281 286 /* Add VM OS family combo into main-layout: */ 282 pMainLayout->addWidget(m_pComboFamily, 2, 1);287 pMainLayout->addWidget(m_pComboFamily, iRow++, 1); 283 288 } 284 289 … … 291 296 m_pLabelType->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 292 297 /* Add VM OS type label into main-layout: */ 293 pMainLayout->addWidget(m_pLabelType, 3, 0);298 pMainLayout->addWidget(m_pLabelType, iRow, 0); 294 299 } 295 300 … … 302 307 m_pLabelType->setBuddy(m_pComboType); 303 308 /* Add VM OS type combo into main-layout: */ 304 pMainLayout->addWidget(m_pComboType, 3, 1);309 pMainLayout->addWidget(m_pComboType, iRow++, 1); 305 310 } 306 311 … … 321 326 pLayoutIcon->addStretch(); 322 327 /* Add sub-layout into main-layout: */ 323 pMainLayout->addLayout(pLayoutIcon, 2, 2, 2, 1);328 pMainLayout->addLayout(pLayoutIcon, iIconRow, 2, 2, 1); 324 329 } 325 330 } … … 352 357 connect(m_pNameLineEdit, &QILineEdit::textChanged, 353 358 this, &UINameAndSystemEditor::sigNameChanged); 354 connect(m_pPathSelector, &UIFilePathSelector::pathChanged, 355 this, &UINameAndSystemEditor::sigPathChanged); 359 if (m_pPathSelector) 360 connect(m_pPathSelector, &UIFilePathSelector::pathChanged, 361 this, &UINameAndSystemEditor::sigPathChanged); 356 362 connect(m_pComboFamily, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 357 363 this, &UINameAndSystemEditor::sltFamilyChanged); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r72279 r72314 328 328 { 329 329 m_pLabel = new QIRichTextLabel(this); 330 m_pNameAndSystemEditor = new UINameAndSystemEditor(this );330 m_pNameAndSystemEditor = new UINameAndSystemEditor(this, true); 331 331 pMainLayout->addWidget(m_pLabel); 332 332 pMainLayout->addWidget(m_pNameAndSystemEditor); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r72191 r72314 55 55 QHBoxLayout *pNameAndSystemCntLayout = new QHBoxLayout(m_pNameAndSystemCnt); 56 56 { 57 m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt );57 m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt, true); 58 58 pNameAndSystemCntLayout->addWidget(m_pNameAndSystemEditor); 59 59 }
Note:
See TracChangeset
for help on using the changeset viewer.