- Timestamp:
- Jun 22, 2020 7:33:39 AM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r84886 r84889 681 681 src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.h \ 682 682 src/wizards/newvm/UIWizardNewVM.h \ 683 src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.h \ 683 684 src/wizards/newvm/UIWizardNewVMPageBasicUnattended.h \ 684 685 src/wizards/newvm/UIWizardNewVMPageBasicNameType.h \ … … 1141 1142 src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp \ 1142 1143 src/wizards/newvm/UIWizardNewVM.cpp \ 1144 src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.cpp \ 1143 1145 src/wizards/newvm/UIWizardNewVMPageBasicUnattended.cpp \ 1144 1146 src/wizards/newvm/UIWizardNewVMPageBasicNameType.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r84887 r84889 24 24 #include "UIWizardNewVMPageBasicDisk.h" 25 25 #include "UIWizardNewVMPageExpert.h" 26 #include "UIWizardNewVMPageBasicInstallSetup.h" 26 27 #include "UIMessageCenter.h" 27 28 #include "UIMedium.h" … … 73 74 setPage(PageHardware, new UIWizardNewVMPageBasicHardware); 74 75 setPage(PageDisk, new UIWizardNewVMPageBasicDisk); 76 setPage(PageInstallSetup, new UIWizardNewVMPageBasicInstallSetup); 75 77 break; 76 78 } … … 381 383 break; 382 384 case PageNameType: 383 return PageHardware; 385 if (!isUnattendedInstallEnabled()) 386 return PageHardware; 387 else 388 return PageInstallSetup; 384 389 break; 385 390 case PageHardware: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r84887 r84889 43 43 PageHardware, 44 44 PageDisk, 45 PageInstallSetup, 45 46 PageMax 46 47 }; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicHardware.h
r84886 r84889 26 26 27 27 /* Forward declarations: */ 28 class UIBaseMemorySlider;29 28 class UIBaseMemoryEditor; 30 29 class UIVirtualCPUEditor; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.cpp
r84886 r84889 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic Hardwareclass implementation.3 * VBox Qt GUI - UIWizardNewVMPageBasicInstallSetup class implementation. 4 4 */ 5 5 … … 22 22 #include <QSpacerItem> 23 23 #include <QLabel> 24 #include <QLineEdit> 24 25 #include <QSpinBox> 25 26 … … 30 31 #include "UICommon.h" 31 32 #include "UIVirtualCPUEditor.h" 32 #include "UIWizardNewVMPageBasic Hardware.h"33 #include "UIWizardNewVMPageBasicInstallSetup.h" 33 34 #include "UIWizardNewVM.h" 34 35 35 36 36 UIWizardNewVMPageHardware::UIWizardNewVMPageHardware() 37 : m_pBaseMemoryEditor(0) 38 , m_pVirtualCPUEditor(0) 37 UIUserNamePasswordEditor::UIUserNamePasswordEditor(QWidget *pParent /* = 0 */) 38 : QIWithRetranslateUI<QWidget>(pParent) 39 , m_pUserNameField(0) 40 , m_pPasswordField(0) 41 , m_pPasswordRepeatField(0) 42 , m_pUserNameFieldLabel(0) 43 , m_pPasswordFieldLabel(0) 44 , m_pPasswordRepeatFieldLabel(0) 45 { 46 prepare(); 47 } 48 49 void UIUserNamePasswordEditor::retranslateUi() 50 { 51 if (m_pUserNameFieldLabel) 52 { 53 m_pUserNameFieldLabel->setText(UIWizardNewVM::tr("User Name:")); 54 m_pUserNameFieldLabel->setToolTip(UIWizardNewVM::tr("Type the user name which will be used in attended install:")); 55 56 } 57 if (m_pPasswordFieldLabel) 58 { 59 m_pPasswordFieldLabel->setText(UIWizardNewVM::tr("Password:")); 60 m_pPasswordFieldLabel->setToolTip(UIWizardNewVM::tr("Type the password for the user name")); 61 62 } 63 if (m_pPasswordRepeatFieldLabel) 64 { 65 m_pPasswordRepeatFieldLabel->setText(UIWizardNewVM::tr("Repeat Password:")); 66 m_pPasswordRepeatFieldLabel->setToolTip(UIWizardNewVM::tr("Retype the password:")); 67 } 68 } 69 70 void UIUserNamePasswordEditor::addField(QLabel *&pLabel, QLineEdit *&pLineEdit, QGridLayout *pLayout, bool fIsPasswordField /* = false */) 71 { 72 static int iRow = 0; 73 if (!pLayout || pLabel || pLineEdit) 74 return; 75 pLabel = new QLabel; 76 if (!pLabel) 77 return; 78 pLayout->addWidget(pLabel, iRow, 0, 1, 1, Qt::AlignRight); 79 80 pLineEdit = new QLineEdit; 81 if (!pLineEdit) 82 return; 83 pLayout->addWidget(pLineEdit, iRow, 1, 1, 1); 84 85 pLabel->setBuddy(pLineEdit); 86 if (fIsPasswordField) 87 pLineEdit->setEchoMode(QLineEdit::Password); 88 ++iRow; 89 return; 90 } 91 92 void UIUserNamePasswordEditor::prepare() 93 { 94 QGridLayout *pMainLayout = new QGridLayout; 95 if (!pMainLayout) 96 return; 97 setLayout(pMainLayout); 98 99 addField(m_pUserNameFieldLabel, m_pUserNameField, pMainLayout); 100 addField(m_pPasswordFieldLabel, m_pPasswordField, pMainLayout, true); 101 addField(m_pPasswordRepeatFieldLabel, m_pPasswordRepeatField, pMainLayout, true); 102 retranslateUi(); 103 } 104 105 UIWizardNewVMPageInstallSetup::UIWizardNewVMPageInstallSetup() 106 : m_pUserNamePasswordEditor(0) 39 107 { 40 108 } 41 109 42 int UIWizardNewVMPageHardware::baseMemory() const 43 { 44 if (!m_pBaseMemoryEditor) 45 return 0; 46 return m_pBaseMemoryEditor->value(); 47 } 48 49 int UIWizardNewVMPageHardware::VCPUCount() const 50 { 51 if (!m_pVirtualCPUEditor) 52 return 1; 53 return m_pVirtualCPUEditor->value(); 54 } 55 56 UIWizardNewVMPageBasicHardware::UIWizardNewVMPageBasicHardware() 110 UIWizardNewVMPageBasicInstallSetup::UIWizardNewVMPageBasicInstallSetup() 57 111 : m_pLabel(0) 58 112 { … … 63 117 QGridLayout *pMemoryLayout = new QGridLayout; 64 118 { 65 m_pBaseMemoryEditor = new UIBaseMemoryEditor(this, true); 66 m_pVirtualCPUEditor = new UIVirtualCPUEditor(this, true); 67 pMemoryLayout->addWidget(m_pBaseMemoryEditor, 0, 0, 1, 4); 68 pMemoryLayout->addWidget(m_pVirtualCPUEditor, 1, 0, 1, 4); 119 m_pUserNamePasswordEditor = new UIUserNamePasswordEditor; 120 pMemoryLayout->addWidget(m_pUserNamePasswordEditor, 0, 0); 69 121 } 70 122 if (m_pLabel) … … 80 132 } 81 133 82 void UIWizardNewVMPageBasic Hardware::retranslateUi()134 void UIWizardNewVMPageBasicInstallSetup::retranslateUi() 83 135 { 84 136 /* Translate page: */ 85 setTitle(UIWizardNewVM::tr(" Virtual Machine Settings"));137 setTitle(UIWizardNewVM::tr("User Name/Password and Time Zone Selection")); 86 138 87 139 /* Translate widgets: */ 88 140 if (m_pLabel) 89 m_pLabel->setText(UIWizardNewVM::tr("<p>You can modify the virtual machine's hardware.</p>")); 141 m_pLabel->setText(UIWizardNewVM::tr("<p>Here you can specify the user name/password and time zone. " 142 "The values you enter here will be used during the unattended install.</p>")); 143 90 144 } 91 145 92 void UIWizardNewVMPageBasic Hardware::initializePage()146 void UIWizardNewVMPageBasicInstallSetup::initializePage() 93 147 { 94 148 /* Translate page: */ … … 96 150 97 151 /* Get recommended 'ram' field value: */ 98 CGuestOSType type = field("type").value<CGuestOSType>();99 m_pBaseMemoryEditor->setValue(type.GetRecommendedRAM());100 m_pVirtualCPUEditor->setValue(1);152 // CGuestOSType type = field("type").value<CGuestOSType>(); 153 // m_pBaseMemoryEditor->setValue(type.GetRecommendedRAM()); 154 // m_pVirtualCPUEditor->setValue(1); 101 155 102 / * 'Ram' field should have focus initially: */103 m_pBaseMemoryEditor->setFocus();156 // /* 'Ram' field should have focus initially: */ 157 // m_pBaseMemoryEditor->setFocus(); 104 158 } 105 159 106 bool UIWizardNewVMPageBasic Hardware::isComplete() const160 bool UIWizardNewVMPageBasicInstallSetup::isComplete() const 107 161 { 108 162 return UIWizardPage::isComplete(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.h
r84886 r84889 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic Hardwareclass declaration.3 * VBox Qt GUI - UIWizardNewVMPageBasicInstallSetup class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic Hardware_h19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic Hardware_h18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicInstallSetup_h 19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicInstallSetup_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once 22 22 #endif 23 23 24 /* Qt includes: */ 25 #include <QWidget> 26 24 27 /* Local includes: */ 28 #include "QIWithRetranslateUI.h" 25 29 #include "UIWizardPage.h" 26 30 27 31 /* Forward declarations: */ 28 class UIBaseMemorySlider;29 class UIBaseMemoryEditor;30 class UIVirtualCPUEditor;32 class QGridLayout; 33 class QLabel; 34 class QLineEdit; 31 35 class QSpinBox; 32 class QLabel;33 36 class QIRichTextLabel; 34 37 38 class UIUserNamePasswordEditor : public QIWithRetranslateUI<QWidget> 39 { 40 41 Q_OBJECT; 42 43 public: 44 45 UIUserNamePasswordEditor(QWidget *pParent = 0); 46 47 protected: 48 49 void retranslateUi(); 50 51 private: 52 53 void prepare(); 54 void addField(QLabel *&pLabel, QLineEdit *&pLineEdit, QGridLayout *pLayout, bool fIsPasswordField = false); 55 56 QLineEdit *m_pUserNameField; 57 QLineEdit *m_pPasswordField; 58 QLineEdit *m_pPasswordRepeatField; 59 60 QLabel *m_pUserNameFieldLabel; 61 QLabel *m_pPasswordFieldLabel; 62 QLabel *m_pPasswordRepeatFieldLabel; 63 64 }; 65 35 66 /* 2nd page of the New Virtual Machine wizard (base part): */ 36 class UIWizardNewVMPage Hardware: public UIWizardPageBase67 class UIWizardNewVMPageInstallSetup : public UIWizardPageBase 37 68 { 38 69 protected: 39 70 40 71 /* Constructor: */ 41 UIWizardNewVMPage Hardware();72 UIWizardNewVMPageInstallSetup(); 42 73 43 int baseMemory() const;44 int VCPUCount() const;45 74 46 75 /* Widgets: */ 47 UIBaseMemoryEditor *m_pBaseMemoryEditor; 48 UIVirtualCPUEditor *m_pVirtualCPUEditor; 76 UIUserNamePasswordEditor *m_pUserNamePasswordEditor; 49 77 }; 50 78 51 79 /* 2nd page of the New Virtual Machine wizard (basic extension): */ 52 class UIWizardNewVMPageBasic Hardware : public UIWizardPage, public UIWizardNewVMPageHardware80 class UIWizardNewVMPageBasicInstallSetup : public UIWizardPage, public UIWizardNewVMPageInstallSetup 53 81 { 54 82 Q_OBJECT; 55 Q_PROPERTY(int baseMemory READ baseMemory);56 Q_PROPERTY(int VCPUCount READ VCPUCount);57 83 58 84 public: 59 85 60 86 /* Constructor: */ 61 UIWizardNewVMPageBasic Hardware();87 UIWizardNewVMPageBasicInstallSetup(); 62 88 63 89 private slots: … … 78 104 }; 79 105 80 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic Hardware_h */106 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicInstallSetup_h */
Note:
See TracChangeset
for help on using the changeset viewer.