Changeset 90217 in vbox
- Timestamp:
- Jul 15, 2021 6:02:01 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp
r90206 r90217 49 49 { 50 50 prepare(); 51 } 52 53 CMediumFormat UIDiskFormatsGroupBox::mediumFormat() const 54 { 55 return m_pFormatButtonGroup && m_pFormatButtonGroup->checkedButton() ? m_formats[m_pFormatButtonGroup->checkedId()] : CMediumFormat(); 56 } 57 58 void UIDiskFormatsGroupBox::setMediumFormat(const CMediumFormat &mediumFormat) 59 { 60 int iPosition = m_formats.indexOf(mediumFormat); 61 if (iPosition >= 0) 62 { 63 m_pFormatButtonGroup->button(iPosition)->click(); 64 m_pFormatButtonGroup->button(iPosition)->setFocus(); 65 } 51 66 } 52 67 … … 258 273 setTitle(tr("Hard Disk File Location and Size")); 259 274 } 275 276 QString UIDiskSizeAndLocationGroupBox::location() const 277 { 278 if (m_pLocationEditor) 279 return m_pLocationEditor->text(); 280 return QString(); 281 } 282 283 void UIDiskSizeAndLocationGroupBox::setLocation(const QString &strLocation) 284 { 285 if (m_pLocationEditor) 286 m_pLocationEditor->setText(strLocation); 287 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h
r90206 r90217 59 59 60 60 UIDiskFormatsGroupBox(QWidget *pParent = 0); 61 61 CMediumFormat mediumFormat() const; 62 void setMediumFormat(const CMediumFormat &mediumFormat); 62 63 63 64 private: … … 107 108 UIDiskSizeAndLocationGroupBox(QWidget *pParent = 0); 108 109 110 QString location() const; 111 void setLocation(const QString &strLocation); 112 109 113 private: 110 114 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r90210 r90217 46 46 #include "UIWizardNewVMEditors.h" 47 47 #include "UIWizardNewVMPageExpert.h" 48 #include "UIWizardNewVMNameOSTypePageBasic.h" 49 #include "UIWizardNewVMDiskPageBasic.h" 48 50 49 51 /* COM includes: */ … … 116 118 } 117 119 118 void UIWizardNewVMPageExpert::sltNameChanged(const QString &strNewText) 119 { 120 Q_UNUSED(strNewText); 121 // onNameChanged(strNewText); 122 // composeMachineFilePath(); 123 // updateVirtualDiskPathFromMachinePathName(); 124 // emit completeChanged(); 120 void UIWizardNewVMPageExpert::sltNameChanged(const QString &strNewName) 121 { 122 UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, strNewName); 123 UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, qobject_cast<UIWizardNewVM*>(wizard())); 124 updateVirtualDiskPathFromMachinePathName(); 125 emit completeChanged(); 125 126 } 126 127 … … 128 129 { 129 130 Q_UNUSED(strNewPath); 130 // composeMachineFilePath();131 //updateVirtualDiskPathFromMachinePathName();131 UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, qobject_cast<UIWizardNewVM*>(wizard())); 132 updateVirtualDiskPathFromMachinePathName(); 132 133 } 133 134 … … 197 198 m_pDiskSelectionButton->setToolTip(UIWizardNewVM::tr("Choose a Virtual Hard Fisk File...")); 198 199 199 200 201 // if (m_pFormatButtonGroup)202 // {203 // QList<QAbstractButton*> buttons = m_pFormatButtonGroup->buttons();204 // for (int i = 0; i < buttons.size(); ++i)205 // {206 // QAbstractButton *pButton = buttons[i];207 // UIMediumFormat enmFormat = gpConverter->fromInternalString<UIMediumFormat>(m_formatNames[m_pFormatButtonGroup->id(pButton)]);208 // pButton->setText(gpConverter->toString(enmFormat));209 // }210 // }211 // if (m_pLocationLabel)212 // m_pLocationLabel->setText(UIWizardNewVM::tr("Disk &Location:"));213 214 200 if (m_pNameAndSystemLayout && m_pNameAndSystemEditor) 215 201 m_pNameAndSystemLayout->setColumnMinimumWidth(0, m_pNameAndSystemEditor->firstColumnWidth()); … … 226 212 { 227 213 /* Connections for Name, OS Type, and unattended install stuff: */ 228 //if (m_pNameAndSystemEditor)229 //{230 //connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged,231 //this, &UIWizardNewVMPageExpert::sltNameChanged);214 if (m_pNameAndSystemEditor) 215 { 216 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, 217 this, &UIWizardNewVMPageExpert::sltNameChanged); 232 218 // connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, 233 219 // this, &UIWizardNewVMPageExpert::sltPathChanged); … … 238 224 // connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigImageChanged, 239 225 // this, &UIWizardNewVMPageExpert::sltISOPathChanged); 240 //}226 } 241 227 242 228 // /* Connections for username, password, and hostname: */ … … 353 339 void UIWizardNewVMPageExpert::initializePage() 354 340 { 341 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 342 AssertReturnVoid(pWizard); 343 /* Initialize wizard properties: */ 344 if (m_pFormatButtonGroup) 345 newVMWizardPropertySet(MediumFormat, m_pFormatButtonGroup->mediumFormat()); 346 347 355 348 // disableEnableUnattendedRelatedWidgets(isUnattendedEnabled()); 356 349 // setOSTypeDependedValues(); 357 350 // disableEnableUnattendedRelatedWidgets(isUnattendedEnabled()); 358 //updateVirtualDiskPathFromMachinePathName();351 updateVirtualDiskPathFromMachinePathName(); 359 352 // updateWidgetAterMediumFormatChange(); 360 353 // setSkipCheckBoxEnable(); … … 651 644 void UIWizardNewVMPageExpert::updateVirtualDiskPathFromMachinePathName() 652 645 { 653 // QString strDiskFileName = machineBaseName().isEmpty() ? QString("NewVirtualDisk1") : machineBaseName(); 654 // QString strDiskPath = machineFolder(); 655 // if (strDiskPath.isEmpty()) 656 // { 657 // if (m_pNameAndSystemEditor) 658 // strDiskPath = m_pNameAndSystemEditor->path(); 659 // else 660 // strDiskPath = uiCommon().virtualBox().GetSystemProperties().GetDefaultMachineFolder(); 661 // } 662 // QString strExtension = defaultExtension(mediumFormat()); 663 // if (m_pLocationEditor) 664 // m_pLocationEditor->setText(absoluteFilePath(strDiskFileName, strDiskPath, strExtension)); 646 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 647 AssertReturnVoid(pWizard); 648 QString strDiskFileName = pWizard->machineBaseName().isEmpty() ? QString("NewVirtualDisk1") : pWizard->machineBaseName(); 649 QString strDiskPath = pWizard->machineFolder(); 650 if (strDiskPath.isEmpty()) 651 { 652 if (m_pNameAndSystemEditor) 653 strDiskPath = m_pNameAndSystemEditor->path(); 654 else 655 strDiskPath = uiCommon().virtualBox().GetSystemProperties().GetDefaultMachineFolder(); 656 } 657 QString strExtension = UIWizardNewVMDiskPage::defaultExtension(pWizard->mediumFormat()); 658 659 660 if (m_pSizeAndLocationGroup) 661 { 662 QString strMediumPath = 663 UIWizardNewVMDiskPage::absoluteFilePath(UIWizardNewVMDiskPage::toFileName(strDiskFileName, 664 strExtension), strDiskPath); 665 m_pSizeAndLocationGroup->setLocation(strMediumPath); 666 } 665 667 } 666 668 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r90210 r90217 70 70 private slots: 71 71 72 void sltNameChanged(const QString &strNew Text);72 void sltNameChanged(const QString &strNewName); 73 73 void sltPathChanged(const QString &strNewPath); 74 74 void sltOsTypeChanged(); … … 140 140 UIGAInstallationGroupBox *m_pGAInstallationISOContainer; 141 141 UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox; 142 143 144 QButtonGroup *m_pDiskSourceButtonGroup; 145 QRadioButton *m_pDiskEmpty; 146 QRadioButton *m_pDiskNew; 147 QRadioButton *m_pDiskExisting; 148 UIMediaComboBox *m_pDiskSelector; 149 QIToolButton *m_pDiskSelectionButton; 150 151 142 QButtonGroup *m_pDiskSourceButtonGroup; 143 QRadioButton *m_pDiskEmpty; 144 QRadioButton *m_pDiskNew; 145 QRadioButton *m_pDiskExisting; 146 UIMediaComboBox *m_pDiskSelector; 147 QIToolButton *m_pDiskSelectionButton; 148 QSet<QString> m_userModifiedParameters; 152 149 /** @} */ 153 150 };
Note:
See TracChangeset
for help on using the changeset viewer.