VirtualBox

Changeset 87871 in vbox


Ignore:
Timestamp:
Feb 25, 2021 10:17:04 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9950. Adding page 5 for virtual disk stuff

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r87864 r87871  
    664664        src/wizards/newvm/UIWizardNewVMPageBasic8.h \
    665665        src/wizards/newvm/UIWizardNewVMPageBasic4.h \
     666        src/wizards/newvm/UIWizardNewVMPageBasic5.h \
    666667        src/wizards/newvm/UIWizardNewVMPageExpert.h \
    667668        src/wizards/clonevm/UIWizardCloneVM.h \
     
    11551156        src/wizards/newvm/UIWizardNewVMPageBasic8.cpp \
    11561157        src/wizards/newvm/UIWizardNewVMPageBasic4.cpp \
     1158        src/wizards/newvm/UIWizardNewVMPageBasic5.cpp \
    11571159        src/wizards/newvm/UIWizardNewVMPageExpert.cpp \
    11581160        src/wizards/clonevm/UIWizardCloneVM.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic2.cpp

    r87859 r87871  
    2929/* COM includes: */
    3030#include "CMediumFormat.h"
    31 
    3231
    3332UIWizardNewVDPage2::UIWizardNewVDPage2()
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r87865 r87871  
    2525#include "UIWizardNewVMPageBasic1.h"
    2626#include "UIWizardNewVMPageBasic2.h"
     27#include "UIWizardNewVMPageBasic5.h"
    2728#include "UIWizardNewVMPageBasic8.h"
    2829#include "UIWizardNewVMPageBasic4.h"
     
    8182        case WizardMode_Basic:
    8283        {
     84            QString strDefaultDiskName;
     85            QString strDefaultDiskPath;
     86            qulonglong uDefaultSize = 0;
    8387            setPage(Page1, new UIWizardNewVMPageBasic1(m_strGroup));
    8488            setPage(Page2, new UIWizardNewVMPageBasic2);
    8589            setPage(Page4, new UIWizardNewVMPageBasic4);
     90            setPage(Page5, new UIWizardNewVMPageBasic5(strDefaultDiskName, strDefaultDiskPath, uDefaultSize));
    8691            setPage(Page8, new UIWizardNewVMPageBasic8);
    8792
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic5.cpp

    r87864 r87871  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIWizardNewVMPageBasic8 class implementation.
     3 * VBox Qt GUI - UIWizardNewVMPageBasic5 class implementation.
    44 */
    55
     
    2727#include "UIVirtualCPUEditor.h"
    2828#include "UIWizardNewVM.h"
    29 #include "UIWizardNewVMPageBasic8.h"
     29#include "UIWizardNewVMPageBasic5.h"
    3030
    3131/* COM includes: */
    3232#include "CGuestOSType.h"
    3333
    34 UIWizardNewVMPage8::UIWizardNewVMPage8()
    35     : m_pBaseMemoryEditor(0)
    36     , m_pVirtualCPUEditor(0)
    37     , m_pEFICheckBox(0)
     34UIWizardNewVMPageBasic5::UIWizardNewVMPageBasic5(const QString &strDefaultName,
     35                                                 const QString &strDefaultPath,
     36                                                 qulonglong uDefaultSize)
     37    : UIWizardNewVDPage3(strDefaultName, strDefaultPath)
     38    , m_pLabel(0)
    3839{
     40    Q_UNUSED(uDefaultSize);
     41    prepare();
     42    qRegisterMetaType<CMedium>();
     43    // registerField("baseMemory", this, "baseMemory");
     44    // registerField("VCPUCount", this, "VCPUCount");
     45    // registerField("EFIEnabled", this, "EFIEnabled");
    3946}
    4047
    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()
     48void UIWizardNewVMPageBasic5::prepare()
    9949{
    10050    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
     
    10252    m_pLabel = new QIRichTextLabel(this);
    10353    pMainLayout->addWidget(m_pLabel);
    104     pMainLayout->addWidget(createHardwareWidgets());
     54    //pMainLayout->addWidget(createHardwareWidgets());
    10555
    10656    pMainLayout->addStretch();
     
    10858}
    10959
    110 void UIWizardNewVMPageBasic8::createConnections()
     60void UIWizardNewVMPageBasic5::createConnections()
    11161{
    11262}
    11363
    114 void UIWizardNewVMPageBasic8::retranslateUi()
     64void UIWizardNewVMPageBasic5::retranslateUi()
    11565{
    11666    setTitle(UIWizardNewVM::tr("Hardware"));
     
    12070                                            "virtual CPU count.</p>"));
    12171
    122     retranslateWidgets();
     72    //retranslateWidgets();
    12373}
    12474
    125 void UIWizardNewVMPageBasic8::initializePage()
     75void UIWizardNewVMPageBasic5::initializePage()
    12676{
    12777    retranslateUi();
    12878
    129     if (!field("type").canConvert<CGuestOSType>())
    130         return;
     79    // if (!field("type").canConvert<CGuestOSType>())
     80    //     return;
    13181
    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);
    13686
    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);
    14090}
    14191
    142 void UIWizardNewVMPageBasic8::cleanupPage()
     92void UIWizardNewVMPageBasic5::cleanupPage()
    14393{
    14494    UIWizardPage::cleanupPage();
    14595}
    14696
    147 bool UIWizardNewVMPageBasic8::isComplete() const
     97bool UIWizardNewVMPageBasic5::isComplete() const
    14898{
    14999    return true;
    150100}
    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  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIWizardNewVMPageBasic8 class declaration.
     3 * VBox Qt GUI - UIWizardNewVMPageBasic5 class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic8_h
    19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic8_h
     18#ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h
     19#define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    2727/* GUI includes: */
    2828#include "UIWizardPage.h"
     29#include "UIWizardNewVDPageBasic2.h"
     30#include "UIWizardNewVDPageBasic3.h"
    2931
    3032/* COM includes: */
     
    3941class UIVirtualCPUEditor;
    4042
    41 /** 3rd page of the New Virtual Machine wizard (base part). */
    42 class UIWizardNewVMPage8 : public UIWizardPageBase
    43 {
     43class UIWizardNewVMPageBasic5 : public UIWizardPage,
     44                                public UIWizardNewVDPage2,
     45                                public UIWizardNewVDPage3
    4446
    45 protected:
    46 
    47     /** Constructor. */
    48     UIWizardNewVMPage8();
    49 
    50 
    51     /** @name Property getters/setters
    52      * @{ */
    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 Widgets
    64      * @{ */
    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 UIWizardNewVMPage8
    7447{
    7548    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);
    7952
    8053public:
    8154
    8255    /** Constructor. */
    83     UIWizardNewVMPageBasic8();
     56    UIWizardNewVMPageBasic5(const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize);
    8457
    8558protected:
     
    10679
    10780    bool isComplete() const;
    108     virtual bool validatePage() /* override */;
     81
    10982
    11083    /** Widgets. */
     
    11285};
    11386
    114 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic8_h */
     87#endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette