Changeset 85090 in vbox
- Timestamp:
- Jul 7, 2020 5:20:27 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 8 edited
-
UIWizardNewVMPageBasic1.cpp (modified) (8 diffs)
-
UIWizardNewVMPageBasic1.h (modified) (3 diffs)
-
UIWizardNewVMPageBasic2.cpp (modified) (11 diffs)
-
UIWizardNewVMPageBasic2.h (modified) (3 diffs)
-
UIWizardNewVMPageBasic3.cpp (modified) (3 diffs)
-
UIWizardNewVMPageBasic3.h (modified) (2 diffs)
-
UIWizardNewVMPageExpert.cpp (modified) (8 diffs)
-
UIWizardNewVMPageExpert.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r85081 r85090 187 187 , m_pStartHeadlessCheckBox(0) 188 188 , m_pNameAndSystemEditor(0) 189 , m_pUnattendedLabel(0) 190 , m_pNameOSTypeLabel(0) 189 191 , m_strGroup(strGroup) 190 192 { … … 281 283 } 282 284 283 void UIWizardNewVMPage1::create Widgets(QGridLayout *pGridLayout)285 void UIWizardNewVMPage1::createNameOSTypeWidgets(QGridLayout *pGridLayout, bool fCreateLabels /* = true */) 284 286 { 285 287 if (pGridLayout) 286 288 { 287 m_pLabel1 = new QIRichTextLabel; 288 if (m_pLabel1) 289 pGridLayout->addWidget(m_pLabel1, 0, 0, 1, 3); 289 if (fCreateLabels) 290 { 291 m_pUnattendedLabel = new QIRichTextLabel; 292 if (m_pUnattendedLabel) 293 pGridLayout->addWidget(m_pUnattendedLabel, 0, 0, 1, 3); 294 } 290 295 291 296 m_pButtonGroup = new QButtonGroup; … … 347 352 } 348 353 349 m_pLabel2 = new QIRichTextLabel; 350 if (m_pLabel2) 351 pGridLayout->addWidget(m_pLabel2, 5, 0, 1, 3); 354 if (fCreateLabels) 355 { 356 m_pNameOSTypeLabel = new QIRichTextLabel; 357 if (m_pNameOSTypeLabel) 358 pGridLayout->addWidget(m_pNameOSTypeLabel, 5, 0, 1, 3); 359 } 352 360 353 361 m_pNameAndSystemEditor = new UINameAndSystemEditor(0, true, true, true); … … 488 496 { 489 497 QGridLayout *pMainLayout = new QGridLayout(this);; 490 create Widgets(pMainLayout);498 createNameOSTypeWidgets(pMainLayout); 491 499 createConnections(); 492 500 /* Register fields: */ … … 521 529 } 522 530 523 void UIWizardNewVMPage Basic1::setTypeByISODetectedOSType(const QString &strDetectedOSType)531 void UIWizardNewVMPage1::setTypeByISODetectedOSType(const QString &strDetectedOSType) 524 532 { 525 533 if (!strDetectedOSType.isEmpty()) … … 570 578 if (m_pStartHeadlessCheckBox) 571 579 m_pStartHeadlessCheckBox->setEnabled(fEnabled); 572 // if (m_pStatusLabel)573 // m_pStatusLabel->setEnabled(fEnabled);574 580 emit completeChanged(); 575 581 } … … 581 587 setTitle(UIWizardNewVM::tr("Virtual machine name and operating system")); 582 588 583 if (m_p Label1)584 m_p Label1->setText(UIWizardNewVM::tr("Please choose whether you want to start an unattended guest os install "589 if (m_pUnattendedLabel) 590 m_pUnattendedLabel->setText(UIWizardNewVM::tr("Please choose whether you want to start an unattended guest os install " 585 591 "in which case you will have to select a valid installation medium. If not " 586 592 "your virtual disk will have an empty virtual hard disk. " … … 609 615 } 610 616 611 if (m_p Label2)612 m_p Label2->setText(UIWizardNewVM::tr("Please choose a descriptive name and destination folder for the new virtual machine "617 if (m_pNameOSTypeLabel) 618 m_pNameOSTypeLabel->setText(UIWizardNewVM::tr("Please choose a descriptive name and destination folder for the new virtual machine " 613 619 "and select the type of operating system you intend to install on it. " 614 620 "The name you choose will be used throughout VirtualBox " -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r85079 r85090 77 77 bool checkISOFile() const; 78 78 /** Creates the page widgets and adds them into the @p pGridLayout. */ 79 void createWidgets(QGridLayout *pGridLayout); 79 void createNameOSTypeWidgets(QGridLayout *pGridLayout, bool fCreateLabels = true); 80 void setTypeByISODetectedOSType(const QString &strDetectedOSType); 80 81 81 82 /** @name Widgets … … 95 96 /** Provides a path selector and a line edit field for path and name entry. */ 96 97 UINameAndSystemEditor *m_pNameAndSystemEditor; 97 QIRichTextLabel *m_p Label1;98 QIRichTextLabel *m_p Label2;98 QIRichTextLabel *m_pUnattendedLabel; 99 QIRichTextLabel *m_pNameOSTypeLabel; 99 100 QButtonGroup *m_pButtonGroup; 100 101 /** @} */ … … 143 144 UIWizardNewVMPageBasic1(const QString &strGroup); 144 145 virtual int nextId() const /* override */; 145 void setTypeByISODetectedOSType(const QString &strDetectedOSType);146 146 virtual bool isComplete() const; /* override */ 147 147 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp
r85071 r85090 34 34 35 35 UIWizardNewVMPage2::UIWizardNewVMPage2() 36 : m_pToolBox(0) 37 , m_pUserNamePasswordEditor(0) 36 : m_pUserNamePasswordEditor(0) 38 37 , m_pHostnameLineEdit(0) 39 38 , m_pHostnameLabel(0) 40 39 , m_pInstallGACheckBox(0) 41 , m_p ISOPathLabel(0)42 , m_p ISOFilePathSelector(0)40 , m_pGAISOPathLabel(0) 41 , m_pGAISOFilePathSelector(0) 43 42 , m_pProductKeyLineEdit(0) 44 43 , m_pProductKeyLabel(0) … … 101 100 QString UIWizardNewVMPage2::guestAdditionsISOPath() const 102 101 { 103 if (!m_p ISOFilePathSelector)102 if (!m_pGAISOFilePathSelector) 104 103 return QString(); 105 return m_p ISOFilePathSelector->path();104 return m_pGAISOFilePathSelector->path(); 106 105 } 107 106 108 107 void UIWizardNewVMPage2::setGuestAdditionsISOPath(const QString &strISOPath) 109 108 { 110 if (m_p ISOFilePathSelector)111 m_p ISOFilePathSelector->setPath(strISOPath);109 if (m_pGAISOFilePathSelector) 110 m_pGAISOFilePathSelector->setPath(strISOPath); 112 111 } 113 112 … … 121 120 QWidget *UIWizardNewVMPage2::createUserNameHostNameWidgets() 122 121 { 123 if (!m_pToolBox)124 return 0;125 122 QWidget *pContainer = new QWidget; 126 123 QGridLayout *pGridLayout = new QGridLayout(pContainer); … … 138 135 QWidget *UIWizardNewVMPage2::createGAInstallWidgets() 139 136 { 140 if (!m_pToolBox)141 return 0;142 137 QWidget *pContainer = new QWidget; 143 138 QGridLayout *pContainerLayout = new QGridLayout(pContainer); … … 145 140 146 141 m_pInstallGACheckBox = new QCheckBox; 147 m_p ISOPathLabel = new QLabel;148 { 149 m_p ISOPathLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);150 m_p ISOPathLabel->setEnabled(false);151 } 152 m_p ISOFilePathSelector = new UIFilePathSelector;153 { 154 m_p ISOFilePathSelector->setResetEnabled(false);155 m_p ISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open);156 m_p ISOFilePathSelector->setFileDialogFilters("*.iso *.ISO");157 m_p ISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);158 m_p ISOFilePathSelector->setEnabled(false);142 m_pGAISOPathLabel = new QLabel; 143 { 144 m_pGAISOPathLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); 145 m_pGAISOPathLabel->setEnabled(false); 146 } 147 m_pGAISOFilePathSelector = new UIFilePathSelector; 148 { 149 m_pGAISOFilePathSelector->setResetEnabled(false); 150 m_pGAISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open); 151 m_pGAISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 152 m_pGAISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); 153 m_pGAISOFilePathSelector->setEnabled(false); 159 154 } 160 155 161 156 pContainerLayout->addWidget(m_pInstallGACheckBox, 0, 0, 1, 5); 162 pContainerLayout->addWidget(m_p ISOPathLabel, 1, 1, 1, 1);163 pContainerLayout->addWidget(m_p ISOFilePathSelector, 1, 2, 1, 4);157 pContainerLayout->addWidget(m_pGAISOPathLabel, 1, 1, 1, 1); 158 pContainerLayout->addWidget(m_pGAISOFilePathSelector, 1, 2, 1, 4); 164 159 return pContainer; 165 160 } … … 167 162 QWidget *UIWizardNewVMPage2::createProductKeyWidgets() 168 163 { 169 if (!m_pToolBox)170 return 0;171 164 QWidget *pContainer = new QWidget; 172 165 QGridLayout *pGridLayout = new QGridLayout(pContainer); … … 185 178 if (m_pInstallGACheckBox && m_pInstallGACheckBox->isChecked()) 186 179 { 187 QString strISOFilePath = m_p ISOFilePathSelector ? m_pISOFilePathSelector->path() : QString();180 QString strISOFilePath = m_pGAISOFilePathSelector ? m_pGAISOFilePathSelector->path() : QString(); 188 181 if (!QFileInfo(strISOFilePath).exists()) 189 182 return false; … … 194 187 UIWizardNewVMPageBasic2::UIWizardNewVMPageBasic2() 195 188 : m_pLabel(0) 189 , m_pToolBox(0) 196 190 { 197 191 prepare(); … … 237 231 connect(m_pInstallGACheckBox, &QCheckBox::toggled, this, 238 232 &UIWizardNewVMPageBasic2::sltInstallGACheckBoxToggle); 239 if (m_p ISOFilePathSelector)240 connect(m_p ISOFilePathSelector, &UIFilePathSelector::pathChanged,233 if (m_pGAISOFilePathSelector) 234 connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged, 241 235 this, &UIWizardNewVMPageBasic2::sltGAISOPathChanged); 242 236 } … … 259 253 if (m_pInstallGACheckBox) 260 254 m_pInstallGACheckBox->setText(UIWizardNewVM::tr("Install guest additions")); 261 if (m_p ISOPathLabel)262 m_p ISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:"));263 if (m_p ISOFilePathSelector)264 m_p ISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)"));255 if (m_pGAISOPathLabel) 256 m_pGAISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:")); 257 if (m_pGAISOFilePathSelector) 258 m_pGAISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)")); 265 259 if (m_pProductKeyLabel) 266 260 m_pProductKeyLabel->setText(UIWizardNewVM::tr("Product Key:")); … … 296 290 } 297 291 298 299 292 void UIWizardNewVMPageBasic2::sltInstallGACheckBoxToggle(bool fEnabled) 300 293 { 301 if (m_p ISOPathLabel)302 m_p ISOPathLabel->setEnabled(fEnabled);303 if (m_p ISOFilePathSelector)304 m_p ISOFilePathSelector->setEnabled(fEnabled);294 if (m_pGAISOPathLabel) 295 m_pGAISOPathLabel->setEnabled(fEnabled); 296 if (m_pGAISOFilePathSelector) 297 m_pGAISOFilePathSelector->setEnabled(fEnabled); 305 298 emit completeChanged(); 306 299 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.h
r85067 r85090 75 75 /** @name Widgets 76 76 * @{ */ 77 QToolBox *m_pToolBox;78 77 UIUserNamePasswordEditor *m_pUserNamePasswordEditor; 79 78 QLineEdit *m_pHostnameLineEdit; … … 81 80 /** Guest additions iso selection widgets. */ 82 81 QCheckBox *m_pInstallGACheckBox; 83 QLabel *m_p ISOPathLabel;84 UIFilePathSelector *m_p ISOFilePathSelector;82 QLabel *m_pGAISOPathLabel; 83 UIFilePathSelector *m_pGAISOFilePathSelector; 85 84 /** Product key stuff. */ 86 85 QLineEdit *m_pProductKeyLineEdit; … … 127 126 128 127 QIRichTextLabel *m_pLabel; 128 QToolBox *m_pToolBox; 129 129 }; 130 130 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp
r85081 r85090 39 39 UIWizardNewVMPage3::UIWizardNewVMPage3() 40 40 : m_fRecommendedNoDisk(false) 41 , m_pToolBox(0)42 41 , m_pDiskSkip(0) 43 42 , m_pDiskCreate(0) … … 201 200 202 201 UIWizardNewVMPageBasic3::UIWizardNewVMPageBasic3() 202 : m_pLabel(0) 203 , m_pToolBox(0) 203 204 { 204 205 prepare(); … … 295 296 retranslateUi(); 296 297 297 /* Prepare initial choice: */298 /* Prepare initial disk choice: */ 298 299 if (field("type").value<CGuestOSType>().GetRecommendedHDD() != 0) 299 300 { 300 m_pDiskCreate->setFocus(); 301 m_pDiskCreate->setChecked(true); 301 if (m_pDiskCreate) 302 { 303 m_pDiskCreate->setFocus(); 304 m_pDiskCreate->setChecked(true); 305 } 302 306 m_fRecommendedNoDisk = false; 303 307 } 304 308 else 305 309 { 306 m_pDiskSkip->setFocus(); 307 m_pDiskSkip->setChecked(true); 310 if (m_pDiskSkip) 311 { 312 m_pDiskSkip->setFocus(); 313 m_pDiskSkip->setChecked(true); 314 } 308 315 m_fRecommendedNoDisk = true; 309 316 } 310 m_pDiskSelector->setCurrentIndex(0); 317 if (m_pDiskSelector) 318 m_pDiskSelector->setCurrentIndex(0); 311 319 } 312 320 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.h
r85067 r85090 96 96 /** @name Widgets 97 97 * @{ */ 98 QToolBox *m_pToolBox;99 98 QRadioButton *m_pDiskSkip; 100 99 QRadioButton *m_pDiskCreate; … … 155 154 /** Widgets. */ 156 155 QIRichTextLabel *m_pLabel; 156 QToolBox *m_pToolBox; 157 157 }; 158 158 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r85081 r85090 17 17 18 18 /* Qt includes: */ 19 #include <QButtonGroup> 20 #include <QCheckBox> 19 21 #include <QGridLayout> 20 #include <QGroupBox>21 22 #include <QHBoxLayout> 22 23 #include <QLabel> 23 #include <QLineEdit>24 24 #include <QRadioButton> 25 25 #include <QSpacerItem> … … 29 29 30 30 /* GUI includes: */ 31 #include "QIRichTextLabel.h" 31 32 #include "QIToolButton.h" 32 33 #include "UIBaseMemorySlider.h" 33 34 #include "UIBaseMemoryEditor.h" 35 #include "UIFilePathSelector.h" 34 36 #include "UIIconPool.h" 35 37 #include "UIMediaComboBox.h" 36 38 #include "UIMedium.h" 37 39 #include "UINameAndSystemEditor.h" 40 #include "UIUserNamePasswordEditor.h" 38 41 #include "UIWizardNewVM.h" 39 42 #include "UIWizardNewVMPageExpert.h" … … 42 45 UIWizardNewVMPageExpert::UIWizardNewVMPageExpert(const QString &strGroup) 43 46 : UIWizardNewVMPage1(strGroup) 44 , m_pNameAndSystemCnt(0) 45 , m_pMemoryCnt(0) 46 , m_pDiskCnt(0) 47 , m_pNameAndSystemContainer(0) 47 48 , m_pToolBox(0) 48 49 { … … 51 52 { 52 53 m_pToolBox = new QToolBox; 53 m_pNameAndSystemCnt = new QWidget(this); 54 { 55 m_pNameAndSystemCnt->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 56 QHBoxLayout *pNameAndSystemCntLayout = new QHBoxLayout(m_pNameAndSystemCnt); 57 { 58 m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt, true, true, true); 59 pNameAndSystemCntLayout->addWidget(m_pNameAndSystemEditor); 60 } 61 } 62 63 pMainLayout->addWidget(m_pToolBox); 64 m_pToolBox->insertItem(ExpertToolboxItems_NameAnsOSType, m_pNameAndSystemCnt, ""); 54 m_pNameAndSystemContainer = new QWidget(this); 55 QGridLayout *pNameContainerLayout = new QGridLayout(m_pNameAndSystemContainer); 56 createNameOSTypeWidgets(pNameContainerLayout, false); 57 m_pToolBox->insertItem(ExpertToolboxItems_NameAndOSType, m_pNameAndSystemContainer, ""); 58 m_pToolBox->insertItem(ExpertToolboxItems_UsernameHostname, createUserNameHostNameWidgets(), ""); 59 m_pToolBox->insertItem(ExpertToolboxItems_GAInstall, createGAInstallWidgets(), ""); 60 m_pToolBox->insertItem(ExpertToolboxItems_ProductKey, createProductKeyWidgets(), ""); 65 61 m_pToolBox->insertItem(ExpertToolboxItems_Disk, createDiskWidgets(), ""); 66 62 m_pToolBox->insertItem(ExpertToolboxItems_Hardware, createHardwareWidgets(), ""); 67 63 pMainLayout->addWidget(m_pToolBox); 68 64 pMainLayout->addStretch(); 69 65 updateVirtualDiskSource(); 70 66 } 71 67 72 /* Setup connections: */ 73 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, 74 this, &UIWizardNewVMPageExpert::sltNameChanged); 75 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, 76 this, &UIWizardNewVMPageExpert::sltPathChanged); 77 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, 78 this, &UIWizardNewVMPageExpert::sltOsTypeChanged); 79 connect(m_pDiskSkip, &QRadioButton::toggled, 80 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 81 connect(m_pDiskCreate, &QRadioButton::toggled, 82 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 83 connect(m_pDiskPresent, &QRadioButton::toggled, 84 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 85 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), 86 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 87 connect(m_pVMMButton, &QIToolButton::clicked, 88 this, &UIWizardNewVMPageExpert::sltGetWithFileOpenDialog); 68 createConnections(); 89 69 90 70 /* Register classes: */ … … 100 80 registerField("virtualDiskId", this, "virtualDiskId"); 101 81 registerField("virtualDiskLocation", this, "virtualDiskLocation"); 82 registerField("guestOSFamiyId", this, "guestOSFamiyId"); 83 registerField("ISOFilePath", this, "ISOFilePath"); 84 registerField("isUnattendedEnabled", this, "isUnattendedEnabled"); 85 registerField("startHeadless", this, "startHeadless"); 86 registerField("detectedOSTypeId", this, "detectedOSTypeId"); 87 registerField("userName", this, "userName"); 88 registerField("password", this, "password"); 89 registerField("hostname", this, "hostname"); 90 registerField("installGuestAdditions", this, "installGuestAdditions"); 91 registerField("guestAdditionsISOPath", this, "guestAdditionsISOPath"); 92 registerField("productKey", this, "productKey"); 93 registerField("VCPUCount", this, "VCPUCount"); 102 94 } 103 95 … … 149 141 } 150 142 143 void UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle() 144 { 145 const bool fEnabled = m_pButtonUnattended->isChecked(); 146 if (m_pISOSelectorLabel) 147 m_pISOSelectorLabel->setEnabled(fEnabled); 148 if (m_pISOFilePathSelector) 149 m_pISOFilePathSelector->setEnabled(fEnabled); 150 if (m_pStartHeadlessLabel) 151 m_pStartHeadlessLabel->setEnabled(fEnabled); 152 if (m_pStartHeadlessCheckBox) 153 m_pStartHeadlessCheckBox->setEnabled(fEnabled); 154 emit completeChanged(); 155 } 156 157 void UIWizardNewVMPageExpert::sltISOPathChanged(const QString &strPath) 158 { 159 determineOSType(strPath); 160 setTypeByISODetectedOSType(m_strDetectedOSTypeId); 161 emit completeChanged(); 162 } 163 164 void UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle(bool fEnabled) 165 { 166 if (m_pGAISOPathLabel) 167 m_pGAISOPathLabel->setEnabled(fEnabled); 168 if (m_pGAISOFilePathSelector) 169 m_pGAISOFilePathSelector->setEnabled(fEnabled); 170 emit completeChanged(); 171 } 172 173 void UIWizardNewVMPageExpert::sltGAISOPathChanged(const QString &strPath) 174 { 175 Q_UNUSED(strPath); 176 emit completeChanged(); 177 } 178 151 179 void UIWizardNewVMPageExpert::retranslateUi() 152 180 { 153 /* Translate widgets: */ 154 155 //m_pMemoryCnt->setTitle(UIWizardNewVM::tr("&Memory size")); 156 //m_pDiskCnt->setTitle(UIWizardNewVM::tr("Hard disk")); 181 if (m_pUnattendedLabel) 182 m_pUnattendedLabel->setText(UIWizardNewVM::tr("Please choose whether you want to start an unattended guest os install " 183 "in which case you will have to select a valid installation medium. If not " 184 "your virtual disk will have an empty virtual hard disk. " 185 "Additionally you can choose to start the unattended install as a headless vm process.")); 186 if (m_pButtonSimple) 187 { 188 m_pButtonSimple->setText(UIWizardNewVM::tr("Leave Disk Empty")); 189 m_pButtonSimple->setToolTip(UIWizardNewVM::tr("When checked, no guest OS will be installed after this wizard is closed")); 190 } 191 if (m_pButtonUnattended) 192 { 193 m_pButtonUnattended->setText(UIWizardNewVM::tr("Unattended Install")); 194 m_pButtonUnattended->setToolTip(UIWizardNewVM::tr("When checked, an unattended guest OS will be initialized after this wizard is closed")); 195 } 196 197 if (m_pISOSelectorLabel) 198 m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Image:")); 199 200 if (m_pStartHeadlessLabel) 201 m_pStartHeadlessLabel->setText(UIWizardNewVM::tr("Options:")); 202 if (m_pStartHeadlessCheckBox) 203 { 204 m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("Start VM Headless")); 205 m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("When checked, the unattended install will start the virtual machine headless")); 206 } 207 208 209 157 210 m_pDiskSkip->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk")); 158 211 m_pDiskCreate->setText(UIWizardNewVM::tr("&Create a virtual hard disk now")); … … 161 214 if (m_pToolBox) 162 215 { 163 m_pToolBox->setItemText(ExpertToolboxItems_NameAnsOSType, UIWizardNewVM::tr("Name and operating system")); 216 m_pToolBox->setItemText(ExpertToolboxItems_NameAndOSType, UIWizardNewVM::tr("Name and operating system")); 217 m_pToolBox->setItemText(ExpertToolboxItems_UsernameHostname, UIWizardNewVM::tr("Username and hostname")); 218 m_pToolBox->setItemText(ExpertToolboxItems_GAInstall, UIWizardNewVM::tr("Guest additions install")); 219 m_pToolBox->setItemText(ExpertToolboxItems_ProductKey, UIWizardNewVM::tr("Product key")); 164 220 m_pToolBox->setItemText(ExpertToolboxItems_Disk, UIWizardNewVM::tr("Hard disk")); 165 221 m_pToolBox->setItemText(ExpertToolboxItems_Hardware, UIWizardNewVM::tr("Hardware")); 166 222 } 223 224 if (m_pHostnameLabel) 225 m_pHostnameLabel->setText(UIWizardNewVM::tr("Hostname:")); 226 if (m_pInstallGACheckBox) 227 m_pInstallGACheckBox->setText(UIWizardNewVM::tr("Install guest additions")); 228 if (m_pGAISOPathLabel) 229 m_pGAISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:")); 230 if (m_pGAISOFilePathSelector) 231 m_pGAISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)")); 232 if (m_pProductKeyLabel) 233 m_pProductKeyLabel->setText(UIWizardNewVM::tr("Product Key:")); 234 235 } 236 237 void UIWizardNewVMPageExpert::createConnections() 238 { 239 /* Connections for Name, OS Type, and unattended install stuff: */ 240 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, 241 this, &UIWizardNewVMPageExpert::sltNameChanged); 242 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, 243 this, &UIWizardNewVMPageExpert::sltPathChanged); 244 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, 245 this, &UIWizardNewVMPageExpert::sltOsTypeChanged); 246 connect(m_pButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), 247 this, &UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle); 248 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, 249 this, &UIWizardNewVMPageExpert::sltISOPathChanged); 250 251 /* Connections for username, password, and hostname: */ 252 connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged, 253 this, &UIWizardNewVMPageExpert::completeChanged); 254 connect(m_pInstallGACheckBox, &QCheckBox::toggled, this, 255 &UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle); 256 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, 257 this, &UIWizardNewVMPageExpert::sltGAISOPathChanged); 258 259 /* Connections for disk and hardware stuff: */ 260 connect(m_pDiskSkip, &QRadioButton::toggled, 261 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 262 connect(m_pDiskCreate, &QRadioButton::toggled, 263 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 264 connect(m_pDiskPresent, &QRadioButton::toggled, 265 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 266 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), 267 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 268 connect(m_pVMMButton, &QIToolButton::clicked, 269 this, &UIWizardNewVMPageExpert::sltGetWithFileOpenDialog); 167 270 } 168 271 … … 176 279 ULONG recommendedRam = type.GetRecommendedRAM(); 177 280 m_pBaseMemoryEditor->setValue(recommendedRam); 281 282 /* Prepare initial disk choice: */ 283 if (field("type").value<CGuestOSType>().GetRecommendedHDD() != 0) 284 { 285 if (m_pDiskCreate) 286 { 287 m_pDiskCreate->setFocus(); 288 m_pDiskCreate->setChecked(true); 289 } 290 m_fRecommendedNoDisk = false; 291 } 292 else 293 { 294 if (m_pDiskSkip) 295 { 296 m_pDiskSkip->setFocus(); 297 m_pDiskSkip->setChecked(true); 298 } 299 m_fRecommendedNoDisk = true; 300 } 301 if (m_pDiskSelector) 302 m_pDiskSelector->setCurrentIndex(0); 178 303 } 179 304 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r85081 r85090 24 24 /* Local includes: */ 25 25 #include "UIWizardNewVMPageBasic1.h" 26 #include "UIWizardNewVMPageBasic2.h" 26 27 #include "UIWizardNewVMPageBasic3.h" 27 28 28 29 /* Forward declarations: */ 29 class QGroupBox;30 30 class QToolBox; 31 31 … … 33 33 class UIWizardNewVMPageExpert : public UIWizardPage, 34 34 public UIWizardNewVMPage1, 35 public UIWizardNewVMPage2, 35 36 public UIWizardNewVMPage3 36 37 { … … 43 44 Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation); 44 45 Q_PROPERTY(int baseMemory READ baseMemory); 46 Q_PROPERTY(QString guestOSFamiyId READ guestOSFamiyId); 47 Q_PROPERTY(QString ISOFilePath READ ISOFilePath); 48 Q_PROPERTY(bool isUnattendedEnabled READ isUnattendedEnabled); 49 Q_PROPERTY(bool startHeadless READ startHeadless); 50 Q_PROPERTY(QString detectedOSTypeId READ detectedOSTypeId); 51 Q_PROPERTY(QString userName READ userName WRITE setUserName); 52 Q_PROPERTY(QString password READ password WRITE setPassword); 53 Q_PROPERTY(QString hostname READ hostname WRITE setHostname); 54 Q_PROPERTY(bool installGuestAdditions READ installGuestAdditions WRITE setInstallGuestAdditions); 55 Q_PROPERTY(QString guestAdditionsISOPath READ guestAdditionsISOPath WRITE setGuestAdditionsISOPath); 56 Q_PROPERTY(QString productKey READ productKey); 57 Q_PROPERTY(int VCPUCount READ VCPUCount); 45 58 46 59 public: … … 66 79 void sltVirtualDiskSourceChanged(); 67 80 void sltGetWithFileOpenDialog(); 81 void sltUnattendedCheckBoxToggle(); 82 void sltISOPathChanged(const QString &strPath); 83 void sltInstallGACheckBoxToggle(bool fChecked); 84 void sltGAISOPathChanged(const QString &strPath); 68 85 69 86 private: 70 87 enum ExpertToolboxItems 71 88 { 72 ExpertToolboxItems_NameAnsOSType, 89 ExpertToolboxItems_NameAndOSType, 90 ExpertToolboxItems_UsernameHostname, 91 ExpertToolboxItems_GAInstall, 92 ExpertToolboxItems_ProductKey, 73 93 ExpertToolboxItems_Disk, 74 94 ExpertToolboxItems_Hardware … … 79 99 80 100 /** Prepare stuff. */ 101 void createConnections(); 81 102 void initializePage(); 82 103 void cleanupPage(); … … 87 108 88 109 /** Widgets. */ 89 QWidget *m_pNameAndSystemCnt; 90 QGroupBox *m_pMemoryCnt; 91 QGroupBox *m_pDiskCnt; 110 QWidget *m_pNameAndSystemContainer; 92 111 QToolBox *m_pToolBox; 93 112 };
Note:
See TracChangeset
for help on using the changeset viewer.

