Changeset 88101 in vbox
- Timestamp:
- Mar 12, 2021 1:26:56 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r87736 r88101 42 42 bool fChooseName /* = true */, 43 43 bool fChoosePath /* = false */, 44 bool fChooseType /* = true */) 44 bool fChooseType /* = true */, 45 bool fChooseISOFile /* = false */) 45 46 : QIWithRetranslateUI<QWidget>(pParent) 46 47 , m_fChooseName(fChooseName) 47 48 , m_fChoosePath(fChoosePath) 49 , m_fChooseISOFile(fChooseISOFile) 48 50 , m_fChooseType(fChooseType) 49 51 , m_fSupportsHWVirtEx(false) … … 52 54 , m_pNameLabel(0) 53 55 , m_pPathLabel(0) 56 , m_pISOFileSelectorLabel(0) 54 57 , m_pLabelFamily(0) 55 58 , m_pLabelType(0) … … 57 60 , m_pNameLineEdit(0) 58 61 , m_pPathSelector(0) 62 , m_pISOFileSelector(0) 59 63 , m_pComboFamily(0) 60 64 , m_pComboType(0) … … 99 103 } 100 104 105 void UINameAndSystemEditor::setFileSelectorDialogFilters(const QString &strFilters) 106 { 107 if (m_pISOFileSelector) 108 m_pISOFileSelector->setFileDialogFilters(strFilters); 109 } 110 101 111 void UINameAndSystemEditor::setName(const QString &strName) 102 112 { … … 266 276 if (m_pPathLabel) 267 277 m_pPathLabel->setText(tr("Folder:")); 278 if (m_pISOFileSelectorLabel) 279 m_pISOFileSelectorLabel->setText(tr("Installation ISO:")); 268 280 if (m_pLabelFamily) 269 281 m_pLabelFamily->setText(tr("&Type:")); … … 452 464 } 453 465 466 if (m_fChooseISOFile) 467 { 468 m_pISOFileSelectorLabel = new QLabel(this); 469 m_pMainLayout->addWidget(m_pISOFileSelectorLabel, iRow, 0); 470 471 m_pISOFileSelector = new UIFilePathSelector(this); 472 if (m_pISOFileSelector) 473 { 474 m_pISOFileSelector->setResetEnabled(false); 475 m_pISOFileSelector->setMode(UIFilePathSelector::Mode_File_Open); 476 m_pISOFileSelector->setFileDialogFilters("*.iso *.ISO"); 477 m_pISOFileSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 478 m_pISOFileSelector->setInitialPath(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD)); 479 m_pISOFileSelectorLabel->setBuddy(m_pISOFileSelector); 480 m_pMainLayout->addWidget(m_pISOFileSelector, iRow, 1, 1, 2); 481 } 482 ++iRow; 483 } 484 454 485 if (m_fChooseType) 455 486 { … … 460 491 m_pLabelFamily->setAlignment(Qt::AlignRight); 461 492 m_pLabelFamily->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 462 463 493 /* Add into layout: */ 464 494 m_pMainLayout->addWidget(m_pLabelFamily, iRow, 0); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.h
r86089 r88101 70 70 71 71 /** Constructs VM parameters editor passing @a pParent to the base-class. 72 * @param fChooseName Controls whether we should propose to choose name. 73 * @param fChoosePath Controls whether we should propose to choose path. 74 * @param fChooseType Controls whether we should propose to choose type. */ 72 * @param fChooseName Controls whether we should propose to choose name. 73 * @param fChoosePath Controls whether we should propose to choose path. 74 * @param fChooseType Controls whether we should propose to choose type. 75 * @param fChooseISOFile Controls whether we should have a ISO file selector. */ 75 76 UINameAndSystemEditor(QWidget *pParent, 76 77 bool fChooseName = true, 77 78 bool fChoosePath = false, 78 bool fChooseType = true); 79 bool fChooseType = true, 80 bool fChooseISOFile = false); 79 81 80 82 /** Defines minimum layout @a iIndent. */ … … 87 89 /** Defines whether VM OS type stuff is @a fEnabled. */ 88 90 void setOSTypeStuffEnabled(bool fEnabled); 91 92 void setFileSelectorDialogFilters(const QString &strFilters); 89 93 90 94 /** Defines the VM @a strName. */ … … 162 166 /** Holds whether we should propose to choose a path. */ 163 167 bool m_fChoosePath; 168 /** Holds whether we should propose a file selector. */ 169 bool m_fChooseISOFile; 164 170 /** Holds whether we should propose to choose a type. */ 165 171 bool m_fChooseType; … … 176 182 /** Holds the VM path label instance. */ 177 183 QLabel *m_pPathLabel; 184 QLabel *m_pISOFileSelectorLabel; 178 185 /** Holds the VM OS family label instance. */ 179 186 QLabel *m_pLabelFamily; … … 187 194 /** Holds the VM path editor instance. */ 188 195 UIFilePathSelector *m_pPathSelector; 196 /** Holds the ISO file selector instance. */ 197 UIFilePathSelector *m_pISOFileSelector; 189 198 /** Holds the VM OS family combo instance. */ 190 199 QComboBox *m_pComboFamily; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r88068 r88101 239 239 true /* fChooseName? */, 240 240 true /* fChoosePath? */, 241 true /* fChooseType? */); 241 true /* fChooseType? */, 242 true /* fChooseISOFile? */); 242 243 return m_pNameAndSystemEditor; 243 244 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r88065 r88101 81 81 QString ISOFilePath() const; 82 82 bool determineOSType(const QString &strISOPath); 83 bool isISOFileSelectorComplete() const;84 83 void setTypeByISODetectedOSType(const QString &strDetectedOSType); 85 84 /** Return false if ISO path is not empty but points to an missing or unreadable file. */ 86 85 bool checkISOFile() const; 87 88 86 89 87 /** @name Widgets
Note:
See TracChangeset
for help on using the changeset viewer.