Changeset 87871 in vbox
- Timestamp:
- Feb 25, 2021 10:17:04 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r87864 r87871 664 664 src/wizards/newvm/UIWizardNewVMPageBasic8.h \ 665 665 src/wizards/newvm/UIWizardNewVMPageBasic4.h \ 666 src/wizards/newvm/UIWizardNewVMPageBasic5.h \ 666 667 src/wizards/newvm/UIWizardNewVMPageExpert.h \ 667 668 src/wizards/clonevm/UIWizardCloneVM.h \ … … 1155 1156 src/wizards/newvm/UIWizardNewVMPageBasic8.cpp \ 1156 1157 src/wizards/newvm/UIWizardNewVMPageBasic4.cpp \ 1158 src/wizards/newvm/UIWizardNewVMPageBasic5.cpp \ 1157 1159 src/wizards/newvm/UIWizardNewVMPageExpert.cpp \ 1158 1160 src/wizards/clonevm/UIWizardCloneVM.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic2.cpp
r87859 r87871 29 29 /* COM includes: */ 30 30 #include "CMediumFormat.h" 31 32 31 33 32 UIWizardNewVDPage2::UIWizardNewVDPage2() -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r87865 r87871 25 25 #include "UIWizardNewVMPageBasic1.h" 26 26 #include "UIWizardNewVMPageBasic2.h" 27 #include "UIWizardNewVMPageBasic5.h" 27 28 #include "UIWizardNewVMPageBasic8.h" 28 29 #include "UIWizardNewVMPageBasic4.h" … … 81 82 case WizardMode_Basic: 82 83 { 84 QString strDefaultDiskName; 85 QString strDefaultDiskPath; 86 qulonglong uDefaultSize = 0; 83 87 setPage(Page1, new UIWizardNewVMPageBasic1(m_strGroup)); 84 88 setPage(Page2, new UIWizardNewVMPageBasic2); 85 89 setPage(Page4, new UIWizardNewVMPageBasic4); 90 setPage(Page5, new UIWizardNewVMPageBasic5(strDefaultDiskName, strDefaultDiskPath, uDefaultSize)); 86 91 setPage(Page8, new UIWizardNewVMPageBasic8); 87 92 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic5.cpp
r87864 r87871 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic 8class implementation.3 * VBox Qt GUI - UIWizardNewVMPageBasic5 class implementation. 4 4 */ 5 5 … … 27 27 #include "UIVirtualCPUEditor.h" 28 28 #include "UIWizardNewVM.h" 29 #include "UIWizardNewVMPageBasic 8.h"29 #include "UIWizardNewVMPageBasic5.h" 30 30 31 31 /* COM includes: */ 32 32 #include "CGuestOSType.h" 33 33 34 UIWizardNewVMPage8::UIWizardNewVMPage8() 35 : m_pBaseMemoryEditor(0) 36 , m_pVirtualCPUEditor(0) 37 , m_pEFICheckBox(0) 34 UIWizardNewVMPageBasic5::UIWizardNewVMPageBasic5(const QString &strDefaultName, 35 const QString &strDefaultPath, 36 qulonglong uDefaultSize) 37 : UIWizardNewVDPage3(strDefaultName, strDefaultPath) 38 , m_pLabel(0) 38 39 { 40 Q_UNUSED(uDefaultSize); 41 prepare(); 42 qRegisterMetaType<CMedium>(); 43 // registerField("baseMemory", this, "baseMemory"); 44 // registerField("VCPUCount", this, "VCPUCount"); 45 // registerField("EFIEnabled", this, "EFIEnabled"); 39 46 } 40 47 41 int UIWizardNewVMPage8::baseMemory() const 42 { 43 if (!m_pBaseMemoryEditor) 44 return 0; 45 return m_pBaseMemoryEditor->value(); 46 } 47 48 int UIWizardNewVMPage8::VCPUCount() const 49 { 50 if (!m_pVirtualCPUEditor) 51 return 1; 52 return m_pVirtualCPUEditor->value(); 53 } 54 55 bool UIWizardNewVMPage8::EFIEnabled() const 56 { 57 if (!m_pEFICheckBox) 58 return false; 59 return m_pEFICheckBox->isChecked(); 60 } 61 62 void UIWizardNewVMPage8::retranslateWidgets() 63 { 64 if (m_pEFICheckBox) 65 { 66 m_pEFICheckBox->setText(UIWizardNewVM::tr("Enable EFI (special OSes only)")); 67 m_pEFICheckBox->setToolTip(UIWizardNewVM::tr("<p>When checked, the guest will support the " 68 "Extended Firmware Interface (EFI), which is required to boot certain " 69 "guest OSes. Non-EFI aware OSes will not be able to boot if this option is activated.</p>")); 70 } 71 } 72 73 QWidget *UIWizardNewVMPage8::createHardwareWidgets() 74 { 75 QWidget *pHardwareContainer = new QWidget; 76 QGridLayout *pHardwareLayout = new QGridLayout(pHardwareContainer); 77 78 m_pBaseMemoryEditor = new UIBaseMemoryEditor(0, true); 79 m_pVirtualCPUEditor = new UIVirtualCPUEditor(0, true); 80 m_pEFICheckBox = new QCheckBox; 81 pHardwareLayout->addWidget(m_pBaseMemoryEditor, 0, 0, 1, 4); 82 pHardwareLayout->addWidget(m_pVirtualCPUEditor, 1, 0, 1, 4); 83 pHardwareLayout->addWidget(m_pEFICheckBox, 2, 0, 1, 1); 84 85 return pHardwareContainer; 86 } 87 88 UIWizardNewVMPageBasic8::UIWizardNewVMPageBasic8() 89 : m_pLabel(0) 90 { 91 prepare(); 92 qRegisterMetaType<CMedium>(); 93 registerField("baseMemory", this, "baseMemory"); 94 registerField("VCPUCount", this, "VCPUCount"); 95 registerField("EFIEnabled", this, "EFIEnabled"); 96 } 97 98 void UIWizardNewVMPageBasic8::prepare() 48 void UIWizardNewVMPageBasic5::prepare() 99 49 { 100 50 QVBoxLayout *pMainLayout = new QVBoxLayout(this); … … 102 52 m_pLabel = new QIRichTextLabel(this); 103 53 pMainLayout->addWidget(m_pLabel); 104 pMainLayout->addWidget(createHardwareWidgets());54 //pMainLayout->addWidget(createHardwareWidgets()); 105 55 106 56 pMainLayout->addStretch(); … … 108 58 } 109 59 110 void UIWizardNewVMPageBasic 8::createConnections()60 void UIWizardNewVMPageBasic5::createConnections() 111 61 { 112 62 } 113 63 114 void UIWizardNewVMPageBasic 8::retranslateUi()64 void UIWizardNewVMPageBasic5::retranslateUi() 115 65 { 116 66 setTitle(UIWizardNewVM::tr("Hardware")); … … 120 70 "virtual CPU count.</p>")); 121 71 122 retranslateWidgets();72 //retranslateWidgets(); 123 73 } 124 74 125 void UIWizardNewVMPageBasic 8::initializePage()75 void UIWizardNewVMPageBasic5::initializePage() 126 76 { 127 77 retranslateUi(); 128 78 129 if (!field("type").canConvert<CGuestOSType>())130 return;79 // if (!field("type").canConvert<CGuestOSType>()) 80 // return; 131 81 132 CGuestOSType type = field("type").value<CGuestOSType>();133 ULONG recommendedRam = type.GetRecommendedRAM();134 if (m_pBaseMemoryEditor)135 m_pBaseMemoryEditor->setValue(recommendedRam);82 // CGuestOSType type = field("type").value<CGuestOSType>(); 83 // ULONG recommendedRam = type.GetRecommendedRAM(); 84 // if (m_pBaseMemoryEditor) 85 // m_pBaseMemoryEditor->setValue(recommendedRam); 136 86 137 KFirmwareType fwType = type.GetRecommendedFirmware();138 if (m_pEFICheckBox)139 m_pEFICheckBox->setChecked(fwType != KFirmwareType_BIOS);87 // KFirmwareType fwType = type.GetRecommendedFirmware(); 88 // if (m_pEFICheckBox) 89 // m_pEFICheckBox->setChecked(fwType != KFirmwareType_BIOS); 140 90 } 141 91 142 void UIWizardNewVMPageBasic 8::cleanupPage()92 void UIWizardNewVMPageBasic5::cleanupPage() 143 93 { 144 94 UIWizardPage::cleanupPage(); 145 95 } 146 96 147 bool UIWizardNewVMPageBasic 8::isComplete() const97 bool UIWizardNewVMPageBasic5::isComplete() const 148 98 { 149 99 return true; 150 100 } 151 152 bool UIWizardNewVMPageBasic8::validatePage()153 {154 /* Lock finish button: */155 startProcessing();156 157 /* Try to create VM: */158 bool fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM();159 160 /* Unlock finish button: */161 endProcessing();162 163 return fResult;164 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic5.h
r87864 r87871 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic 8class declaration.3 * VBox Qt GUI - UIWizardNewVMPageBasic5 class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic 8_h19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic 8_h18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h 19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 27 27 /* GUI includes: */ 28 28 #include "UIWizardPage.h" 29 #include "UIWizardNewVDPageBasic2.h" 30 #include "UIWizardNewVDPageBasic3.h" 29 31 30 32 /* COM includes: */ … … 39 41 class UIVirtualCPUEditor; 40 42 41 /** 3rd page of the New Virtual Machine wizard (base part). */ 42 class UIWizardNewVMPage8 : public UIWizardPageBase 43 { 43 class UIWizardNewVMPageBasic5 : public UIWizardPage, 44 public UIWizardNewVDPage2, 45 public UIWizardNewVDPage3 44 46 45 protected:46 47 /** Constructor. */48 UIWizardNewVMPage8();49 50 51 /** @name Property getters/setters52 * @{ */53 int baseMemory() const;54 int VCPUCount() const;55 bool EFIEnabled() const;56 /** @} */57 58 QWidget *createHardwareWidgets();59 void retranslateWidgets();60 61 62 63 /** @name Widgets64 * @{ */65 UIBaseMemoryEditor *m_pBaseMemoryEditor;66 UIVirtualCPUEditor *m_pVirtualCPUEditor;67 QCheckBox *m_pEFICheckBox;68 /** @} */69 70 };71 72 /** 3rd page of the New Virtual Machine wizard (basic extension). */73 class UIWizardNewVMPageBasic8 : public UIWizardPage, public UIWizardNewVMPage874 47 { 75 48 Q_OBJECT; 76 Q_PROPERTY(int baseMemory READ baseMemory);77 Q_PROPERTY(int VCPUCount READ VCPUCount);78 Q_PROPERTY(bool EFIEnabled READ EFIEnabled);49 // Q_PROPERTY(int baseMemory READ baseMemory); 50 // Q_PROPERTY(int VCPUCount READ VCPUCount); 51 // Q_PROPERTY(bool EFIEnabled READ EFIEnabled); 79 52 80 53 public: 81 54 82 55 /** Constructor. */ 83 UIWizardNewVMPageBasic 8();56 UIWizardNewVMPageBasic5(const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize); 84 57 85 58 protected: … … 106 79 107 80 bool isComplete() const; 108 virtual bool validatePage() /* override */; 81 109 82 110 83 /** Widgets. */ … … 112 85 }; 113 86 114 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic 8_h */87 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h */
Note:
See TracChangeset
for help on using the changeset viewer.