VirtualBox

Changeset 87430 in vbox


Ignore:
Timestamp:
Jan 26, 2021 11:44:45 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515. Working on the guided mode. part 4

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

Legend:

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

    r87418 r87430  
    657657        src/wizards/newvm/UIWizardNewVMPageBasic3.h \
    658658        src/wizards/newvm/UIWizardNewVMPageBasic4.h \
     659        src/wizards/newvm/UIWizardNewVMPageBasic5.h \
    659660        src/wizards/newvm/UIWizardNewVMPageExpert.h \
    660661        src/wizards/clonevm/UIWizardCloneVM.h \
     
    11391140        src/wizards/newvm/UIWizardNewVMPageBasic3.cpp \
    11401141        src/wizards/newvm/UIWizardNewVMPageBasic4.cpp \
     1142        src/wizards/newvm/UIWizardNewVMPageBasic5.cpp \
    11411143        src/wizards/newvm/UIWizardNewVMPageExpert.cpp \
    11421144        src/wizards/clonevm/UIWizardCloneVM.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r87414 r87430  
    2727#include "UIWizardNewVMPageBasic3.h"
    2828#include "UIWizardNewVMPageBasic4.h"
     29#include "UIWizardNewVMPageBasic5.h"
    2930#include "UIWizardNewVMPageExpert.h"
    3031#include "UIMessageCenter.h"
     
    8485            setPage(Page3, new UIWizardNewVMPageBasic3);
    8586            setPage(Page4, new UIWizardNewVMPageBasic4);
     87            setPage(Page5, new UIWizardNewVMPageBasic5);
    8688            setStartId(Page1);
    8789            break;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r87414 r87430  
    6464        Page3,
    6565        Page4,
     66        Page5,
    6667        PageMax
    6768    };
     
    99100
    100101    /* Who will be able to create virtual-machine: */
    101     friend class UIWizardNewVMPageBasic4;
     102    friend class UIWizardNewVMPageBasic5;
    102103    friend class UIWizardNewVMPageExpert;
    103104
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.cpp

    r87423 r87430  
    3737
    3838UIWizardNewVMPage4::UIWizardNewVMPage4()
    39     : m_fRecommendedNoDisk(false)
    40     , m_pDiskSkip(0)
    41     , m_pDiskCreate(0)
    42     , m_pDiskPresent(0)
    43     , m_pDiskSelector(0)
    44     , m_pVMMButton(0)
    45     , m_pBaseMemoryEditor(0)
     39    : m_pBaseMemoryEditor(0)
    4640    , m_pVirtualCPUEditor(0)
    4741{
    48 }
    49 
    50 void UIWizardNewVMPage4::updateVirtualDiskSource()
    51 {
    52     if (!m_pDiskSelector || !m_pVMMButton)
    53         return;
    54 
    55     /* Enable/disable controls: */
    56     m_pDiskSelector->setEnabled(m_pDiskPresent->isChecked());
    57     m_pVMMButton->setEnabled(m_pDiskPresent->isChecked());
    58 
    59     /* Fetch filed values: */
    60     if (m_pDiskSkip->isChecked())
    61     {
    62         m_uVirtualDiskId = QUuid();
    63         m_strVirtualDiskName = QString();
    64         m_strVirtualDiskLocation = QString();
    65     }
    66     else if (m_pDiskPresent->isChecked())
    67     {
    68         m_uVirtualDiskId = m_pDiskSelector->id();
    69         m_strVirtualDiskName = m_pDiskSelector->currentText();
    70         m_strVirtualDiskLocation = m_pDiskSelector->location();
    71     }
    72 }
    73 
    74 void UIWizardNewVMPage4::getWithFileOpenDialog()
    75 {
    76     /* Get opened medium id: */
    77     QUuid uMediumId;
    78 
    79     int returnCode = uiCommon().openMediumSelectorDialog(thisImp(), UIMediumDeviceType_HardDisk,
    80                                                            uMediumId,
    81                                                            fieldImp("machineFolder").toString(),
    82                                                            fieldImp("machineBaseName").toString(),
    83                                                            fieldImp("type").value<CGuestOSType>().GetId(),
    84                                                            false /* don't show/enable the create action: */);
    85 
    86     if (returnCode == static_cast<int>(UIMediumSelector::ReturnCode_Accepted) && !uMediumId.isNull())
    87     {
    88         /* Update medium-combo if necessary: */
    89         m_pDiskSelector->setCurrentItem(uMediumId);
    90         /* Update hard disk source: */
    91         updateVirtualDiskSource();
    92         /* Focus on hard disk combo: */
    93         m_pDiskSelector->setFocus();
    94     }
    95 }
    96 
    97 bool UIWizardNewVMPage4::getWithNewVirtualDiskWizard()
    98 {
    99     /* Create New Virtual Hard Drive wizard: */
    100     UISafePointerWizardNewVD pWizard = new UIWizardNewVD(thisImp(),
    101                                                          fieldImp("machineBaseName").toString(),
    102                                                          fieldImp("machineFolder").toString(),
    103                                                          fieldImp("type").value<CGuestOSType>().GetRecommendedHDD(),
    104                                                          wizardImp()->mode());
    105     pWizard->prepare();
    106     bool fResult = false;
    107     if (pWizard->exec() == QDialog::Accepted)
    108     {
    109         fResult = true;
    110         m_virtualDisk = pWizard->virtualDisk();
    111         m_pDiskSelector->setCurrentItem(m_virtualDisk.GetId());
    112         m_pDiskPresent->click();
    113     }
    114     if (pWizard)
    115         delete pWizard;
    116     return fResult;
    11742}
    11843
     
    13156}
    13257
    133 void UIWizardNewVMPage4::ensureNewVirtualDiskDeleted()
    134 {
    135     /* Make sure virtual-disk valid: */
    136     if (m_virtualDisk.isNull())
    137         return;
    138 
    139     /* Remember virtual-disk attributes: */
    140     QString strLocation = m_virtualDisk.GetLocation();
    141     /* Prepare delete storage progress: */
    142     CProgress progress = m_virtualDisk.DeleteStorage();
    143     if (m_virtualDisk.isOk())
    144     {
    145         /* Show delete storage progress: */
    146         msgCenter().showModalProgressDialog(progress, thisImp()->windowTitle(), ":/progress_media_delete_90px.png", thisImp());
    147         if (!progress.isOk() || progress.GetResultCode() != 0)
    148             msgCenter().cannotDeleteHardDiskStorage(progress, strLocation, thisImp());
    149     }
    150     else
    151         msgCenter().cannotDeleteHardDiskStorage(m_virtualDisk, strLocation, thisImp());
    152 
    153     /* Detach virtual-disk anyway: */
    154     m_virtualDisk.detach();
    155 }
    156 
    15758void UIWizardNewVMPage4::retranslateWidgets()
    15859{
    159     if (m_pDiskSkip)
    160         m_pDiskSkip->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk"));
    161     if (m_pDiskCreate)
    162         m_pDiskCreate->setText(UIWizardNewVM::tr("&Create a virtual hard disk now"));
    163     if (m_pDiskPresent)
    164         m_pDiskPresent->setText(UIWizardNewVM::tr("&Use an existing virtual hard disk file"));
    165     if (m_pVMMButton)
    166         m_pVMMButton->setToolTip(UIWizardNewVM::tr("Choose a virtual hard disk file..."));
    167 }
    168 
    169 QWidget *UIWizardNewVMPage4::createDiskWidgets()
    170 {
    171     QWidget *pDiskContainer = new QWidget;
    172     QGridLayout *pDiskLayout = new QGridLayout(pDiskContainer);
    173 
    174     m_pDiskSkip = new QRadioButton;
    175     m_pDiskCreate = new QRadioButton;
    176     m_pDiskPresent = new QRadioButton;
    177     QStyleOptionButton options;
    178     options.initFrom(m_pDiskPresent);
    179     int iWidth = m_pDiskPresent->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, &options, m_pDiskPresent);
    180     pDiskLayout->setColumnMinimumWidth(0, iWidth);
    181     m_pDiskSelector = new UIMediaComboBox;
    182     {
    183         m_pDiskSelector->setType(UIMediumDeviceType_HardDisk);
    184         m_pDiskSelector->repopulate();
    185     }
    186     m_pVMMButton = new QIToolButton;
    187     {
    188         m_pVMMButton->setAutoRaise(true);
    189         m_pVMMButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", ":/select_file_disabled_16px.png"));
    190     }
    191     pDiskLayout->addWidget(m_pDiskSkip, 0, 0, 1, 3);
    192     pDiskLayout->addWidget(m_pDiskCreate, 1, 0, 1, 3);
    193     pDiskLayout->addWidget(m_pDiskPresent, 2, 0, 1, 3);
    194     pDiskLayout->addWidget(m_pDiskSelector, 3, 1);
    195     pDiskLayout->addWidget(m_pVMMButton, 3, 2);
    196     return pDiskContainer;
    19760}
    19861
     
    21477    prepare();
    21578    qRegisterMetaType<CMedium>();
    216     registerField("virtualDisk", this, "virtualDisk");
    217     registerField("virtualDiskId", this, "virtualDiskId");
    218     registerField("virtualDiskName", this, "virtualDiskName");
    219     registerField("virtualDiskLocation", this, "virtualDiskLocation");
    22079    registerField("baseMemory", this, "baseMemory");
    22180    registerField("VCPUCount", this, "VCPUCount");
     
    22887    m_pLabel = new QIRichTextLabel(this);
    22988    pMainLayout->addWidget(m_pLabel);
    230     pMainLayout->addWidget(createDiskWidgets());
     89    pMainLayout->addWidget(createHardwareWidgets());
    23190
    23291    pMainLayout->addStretch();
    233     updateVirtualDiskSource();
    23492    createConnections();
    23593}
     
    23795void UIWizardNewVMPageBasic4::createConnections()
    23896{
    239     connect(m_pDiskSkip, &QRadioButton::toggled,
    240             this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged);
    241     connect(m_pDiskCreate, &QRadioButton::toggled,
    242             this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged);
    243     connect(m_pDiskPresent, &QRadioButton::toggled,
    244             this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged);
    245     connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged),
    246             this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged);
    247     connect(m_pVMMButton, &QIToolButton::clicked,
    248             this, &UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog);
     97
    24998}
    25099
    251 void UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged()
    252 {
    253     /* Call to base-class: */
    254     updateVirtualDiskSource();
    255 
    256     /* Broadcast complete-change: */
    257     emit completeChanged();
    258 }
    259 
    260 void UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog()
    261 {
    262     /* Call to base-class: */
    263     getWithFileOpenDialog();
    264 }
    265100
    266101void UIWizardNewVMPageBasic4::retranslateUi()
    267102{
    268     /* Translate page: */
    269     setTitle(UIWizardNewVM::tr("Hard disk and Hardware"));
     103    setTitle(UIWizardNewVM::tr("Hardware"));
    270104
    271     /* Translate widgets: */
    272     QString strRecommendedHDD = field("type").value<CGuestOSType>().isNull() ? QString() :
    273                                 UICommon::formatSize(field("type").value<CGuestOSType>().GetRecommendedHDD());
    274105    if (m_pLabel)
    275         m_pLabel->setText(UIWizardNewVM::tr("<p>If you wish you can add a virtual hard disk to the new machine. "
    276                                             "You can either create a new hard disk file or select one from the list "
    277                                             "or from another location using the folder icon. "
    278                                             "If you need a more complex storage set-up you can skip this step "
    279                                             "and make the changes to the machine settings once the machine is created. "
    280                                             "The recommended size of the hard disk is <b>%1</b>.")
    281                           .arg(strRecommendedHDD));
     106        m_pLabel->setText(UIWizardNewVM::tr("<p>You can modify virtual machine's hardware by changing amount of RAM and "
     107                                            "virtual CPU count.</p>"));
     108
    282109    retranslateWidgets();
    283110}
     
    285112void UIWizardNewVMPageBasic4::initializePage()
    286113{
    287     /* Translate page: */
    288114    retranslateUi();
    289115
     
    296122        m_pBaseMemoryEditor->setValue(recommendedRam);
    297123
    298 
    299     /* Prepare initial disk choice: */
    300     if (type.GetRecommendedHDD() != 0)
    301     {
    302         if (m_pDiskCreate)
    303         {
    304             m_pDiskCreate->setFocus();
    305             m_pDiskCreate->setChecked(true);
    306         }
    307         m_fRecommendedNoDisk = false;
    308     }
    309     else
    310     {
    311         if (m_pDiskSkip)
    312         {
    313             m_pDiskSkip->setFocus();
    314             m_pDiskSkip->setChecked(true);
    315         }
    316         m_fRecommendedNoDisk = true;
    317     }
    318     if (m_pDiskSelector)
    319         m_pDiskSelector->setCurrentIndex(0);
    320124}
    321125
    322126void UIWizardNewVMPageBasic4::cleanupPage()
    323127{
    324     /* Call to base-class: */
    325     ensureNewVirtualDiskDeleted();
    326128    UIWizardPage::cleanupPage();
    327129}
     
    329131bool UIWizardNewVMPageBasic4::isComplete() const
    330132{
    331     /* Make sure 'virtualDisk' field feats the rules: */
    332     if (!m_pDiskSkip)
    333         return false;
    334     return m_pDiskSkip->isChecked() ||
    335         !m_pDiskPresent->isChecked() ||
    336         !uiCommon().medium(m_pDiskSelector->id()).isNull();
     133    return true;
    337134}
    338 
    339 bool UIWizardNewVMPageBasic4::validatePage()
    340 {
    341     /* Initial result: */
    342     bool fResult = true;
    343 
    344     /* Ensure unused virtual-disk is deleted: */
    345     if (m_pDiskSkip->isChecked() || m_pDiskCreate->isChecked() || (!m_virtualDisk.isNull() && m_uVirtualDiskId != m_virtualDisk.GetId()))
    346         ensureNewVirtualDiskDeleted();
    347 
    348     if (m_pDiskSkip->isChecked())
    349     {
    350         /* Ask user about disk-less machine unless that's the recommendation: */
    351         if (!m_fRecommendedNoDisk)
    352             fResult = msgCenter().confirmHardDisklessMachine(thisImp());
    353     }
    354     else if (m_pDiskCreate->isChecked())
    355     {
    356         /* Show the New Virtual Hard Drive wizard: */
    357         fResult = getWithNewVirtualDiskWizard();
    358     }
    359 
    360     if (fResult)
    361     {
    362         /* Lock finish button: */
    363         startProcessing();
    364 
    365         /* Try to create VM: */
    366         fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM();
    367 
    368         /* Unlock finish button: */
    369         endProcessing();
    370     }
    371 
    372     /* Return result: */
    373     return fResult;
    374 }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.h

    r87423 r87430  
    4949    UIWizardNewVMPage4();
    5050
    51     /** Handlers. */
    52     void updateVirtualDiskSource();
    53     void getWithFileOpenDialog();
    54     bool getWithNewVirtualDiskWizard();
    55 
    5651
    5752    /** @name Property getters/setters
    5853     * @{ */
    59        CMedium virtualDisk() const { return m_virtualDisk; }
    60        void setVirtualDisk(const CMedium &virtualDisk) { m_virtualDisk = virtualDisk; }
    61        QUuid virtualDiskId() const { return m_uVirtualDiskId; }
    62        void setVirtualDiskId(const QUuid &uVirtualDiskId) { m_uVirtualDiskId = uVirtualDiskId; }
    63        QString virtualDiskName() const { return m_strVirtualDiskName; }
    64        void setVirtualDiskName(const QString &strVirtualDiskName) { m_strVirtualDiskName = strVirtualDiskName; }
    65        QString virtualDiskLocation() const { return m_strVirtualDiskLocation; }
    66        void setVirtualDiskLocation(const QString &strVirtualDiskLocation) { m_strVirtualDiskLocation = strVirtualDiskLocation; }
    6754       int baseMemory() const;
    6855       int VCPUCount() const;
    6956    /** @} */
    7057
    71     QWidget *createDiskWidgets();
    7258    QWidget *createHardwareWidgets();
    73 
    74     /** Helpers. */
    75     void ensureNewVirtualDiskDeleted();
    7659    void retranslateWidgets();
    7760
    78     /** Input. */
    79     bool m_fRecommendedNoDisk;
    8061
    81     /** @name Variables
    82      * @{ */
    83        CMedium m_virtualDisk;
    84        QUuid   m_uVirtualDiskId;
    85        QString m_strVirtualDiskName;
    86        QString m_strVirtualDiskLocation;
    87     /** @} */
    8862
    8963    /** @name Widgets
    9064     * @{ */
    91        QRadioButton *m_pDiskSkip;
    92        QRadioButton *m_pDiskCreate;
    93        QRadioButton *m_pDiskPresent;
    94        UIMediaComboBox *m_pDiskSelector;
    95        QIToolButton *m_pVMMButton;
    9665       UIBaseMemoryEditor *m_pBaseMemoryEditor;
    9766       UIVirtualCPUEditor *m_pVirtualCPUEditor;
     
    10473{
    10574    Q_OBJECT;
    106     Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk);
    107     Q_PROPERTY(QUuid virtualDiskId READ virtualDiskId WRITE setVirtualDiskId);
    108     Q_PROPERTY(QString virtualDiskName READ virtualDiskName WRITE setVirtualDiskName);
    109     Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation);
    11075    Q_PROPERTY(int baseMemory READ baseMemory);
    11176    Q_PROPERTY(int VCPUCount READ VCPUCount);
     
    12792private slots:
    12893
    129     /** Handlers. */
    130     void sltVirtualDiskSourceChanged();
    131     void sltGetWithFileOpenDialog();
    13294
    13395private:
     
    141103    void cleanupPage();
    142104
    143     /** Validation stuff. */
    144105    bool isComplete() const;
    145     bool validatePage();
    146106
    147107    /** Widgets. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic5.cpp

    r87423 r87430  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIWizardNewVMPageBasic4 class implementation.
     3 * VBox Qt GUI - UIWizardNewVMPageBasic5 class implementation.
    44 */
    55
     
    2525#include "QIRichTextLabel.h"
    2626#include "QIToolButton.h"
    27 #include "UIBaseMemoryEditor.h"
    2827#include "UIIconPool.h"
    2928#include "UIMediaComboBox.h"
     
    3130#include "UIMediumSelector.h"
    3231#include "UIMessageCenter.h"
    33 #include "UIVirtualCPUEditor.h"
    3432#include "UIWizardNewVD.h"
    3533#include "UIWizardNewVM.h"
    36 #include "UIWizardNewVMPageBasic4.h"
    37 
    38 UIWizardNewVMPage4::UIWizardNewVMPage4()
     34#include "UIWizardNewVMPageBasic5.h"
     35
     36UIWizardNewVMPage5::UIWizardNewVMPage5()
    3937    : m_fRecommendedNoDisk(false)
    4038    , m_pDiskSkip(0)
     
    4341    , m_pDiskSelector(0)
    4442    , m_pVMMButton(0)
    45     , m_pBaseMemoryEditor(0)
    46     , m_pVirtualCPUEditor(0)
    47 {
    48 }
    49 
    50 void UIWizardNewVMPage4::updateVirtualDiskSource()
     43{
     44}
     45
     46void UIWizardNewVMPage5::updateVirtualDiskSource()
    5147{
    5248    if (!m_pDiskSelector || !m_pVMMButton)
     
    7268}
    7369
    74 void UIWizardNewVMPage4::getWithFileOpenDialog()
     70void UIWizardNewVMPage5::getWithFileOpenDialog()
    7571{
    7672    /* Get opened medium id: */
     
    9591}
    9692
    97 bool UIWizardNewVMPage4::getWithNewVirtualDiskWizard()
     93bool UIWizardNewVMPage5::getWithNewVirtualDiskWizard()
    9894{
    9995    /* Create New Virtual Hard Drive wizard: */
     
    117113}
    118114
    119 int UIWizardNewVMPage4::baseMemory() const
    120 {
    121     if (!m_pBaseMemoryEditor)
    122         return 0;
    123     return m_pBaseMemoryEditor->value();
    124 }
    125 
    126 int UIWizardNewVMPage4::VCPUCount() const
    127 {
    128     if (!m_pVirtualCPUEditor)
    129         return 1;
    130     return m_pVirtualCPUEditor->value();
    131 }
    132 
    133 void UIWizardNewVMPage4::ensureNewVirtualDiskDeleted()
     115void UIWizardNewVMPage5::ensureNewVirtualDiskDeleted()
    134116{
    135117    /* Make sure virtual-disk valid: */
     
    155137}
    156138
    157 void UIWizardNewVMPage4::retranslateWidgets()
     139void UIWizardNewVMPage5::retranslateWidgets()
    158140{
    159141    if (m_pDiskSkip)
     
    167149}
    168150
    169 QWidget *UIWizardNewVMPage4::createDiskWidgets()
     151QWidget *UIWizardNewVMPage5::createDiskWidgets()
    170152{
    171153    QWidget *pDiskContainer = new QWidget;
     
    197179}
    198180
    199 QWidget *UIWizardNewVMPage4::createHardwareWidgets()
    200 {
    201     QWidget *pHardwareContainer = new QWidget;
    202     QGridLayout *pHardwareLayout = new QGridLayout(pHardwareContainer);
    203 
    204     m_pBaseMemoryEditor = new UIBaseMemoryEditor(0, true);
    205     m_pVirtualCPUEditor = new UIVirtualCPUEditor(0, true);
    206     pHardwareLayout->addWidget(m_pBaseMemoryEditor, 0, 0, 1, 4);
    207     pHardwareLayout->addWidget(m_pVirtualCPUEditor, 1, 0, 1, 4);
    208     return pHardwareContainer;
    209 }
    210 
    211 UIWizardNewVMPageBasic4::UIWizardNewVMPageBasic4()
     181UIWizardNewVMPageBasic5::UIWizardNewVMPageBasic5()
    212182    : m_pLabel(0)
    213183{
     
    218188    registerField("virtualDiskName", this, "virtualDiskName");
    219189    registerField("virtualDiskLocation", this, "virtualDiskLocation");
    220     registerField("baseMemory", this, "baseMemory");
    221     registerField("VCPUCount", this, "VCPUCount");
    222 }
    223 
    224 void UIWizardNewVMPageBasic4::prepare()
     190}
     191
     192void UIWizardNewVMPageBasic5::prepare()
    225193{
    226194    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
     
    235203}
    236204
    237 void UIWizardNewVMPageBasic4::createConnections()
     205void UIWizardNewVMPageBasic5::createConnections()
    238206{
    239207    connect(m_pDiskSkip, &QRadioButton::toggled,
    240             this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged);
     208            this, &UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged);
    241209    connect(m_pDiskCreate, &QRadioButton::toggled,
    242             this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged);
     210            this, &UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged);
    243211    connect(m_pDiskPresent, &QRadioButton::toggled,
    244             this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged);
     212            this, &UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged);
    245213    connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged),
    246             this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged);
     214            this, &UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged);
    247215    connect(m_pVMMButton, &QIToolButton::clicked,
    248             this, &UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog);
    249 }
    250 
    251 void UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged()
     216            this, &UIWizardNewVMPageBasic5::sltGetWithFileOpenDialog);
     217}
     218
     219void UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged()
    252220{
    253221    /* Call to base-class: */
     
    258226}
    259227
    260 void UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog()
     228void UIWizardNewVMPageBasic5::sltGetWithFileOpenDialog()
    261229{
    262230    /* Call to base-class: */
     
    264232}
    265233
    266 void UIWizardNewVMPageBasic4::retranslateUi()
    267 {
    268     /* Translate page: */
     234void UIWizardNewVMPageBasic5::retranslateUi()
     235{
    269236    setTitle(UIWizardNewVM::tr("Hard disk and Hardware"));
    270237
    271     /* Translate widgets: */
    272238    QString strRecommendedHDD = field("type").value<CGuestOSType>().isNull() ? QString() :
    273239                                UICommon::formatSize(field("type").value<CGuestOSType>().GetRecommendedHDD());
     
    278244                                            "If you need a more complex storage set-up you can skip this step "
    279245                                            "and make the changes to the machine settings once the machine is created. "
    280                                             "The recommended size of the hard disk is <b>%1</b>.")
     246                                            "The recommended size of the hard disk is <b>%1</b>.</p>")
    281247                          .arg(strRecommendedHDD));
     248
    282249    retranslateWidgets();
    283250}
    284251
    285 void UIWizardNewVMPageBasic4::initializePage()
    286 {
    287     /* Translate page: */
     252void UIWizardNewVMPageBasic5::initializePage()
     253{
    288254    retranslateUi();
    289255
     
    292258
    293259    CGuestOSType type = field("type").value<CGuestOSType>();
    294     ULONG recommendedRam = type.GetRecommendedRAM();
    295     if (m_pBaseMemoryEditor)
    296         m_pBaseMemoryEditor->setValue(recommendedRam);
    297 
    298 
    299     /* Prepare initial disk choice: */
     260
    300261    if (type.GetRecommendedHDD() != 0)
    301262    {
     
    320281}
    321282
    322 void UIWizardNewVMPageBasic4::cleanupPage()
     283void UIWizardNewVMPageBasic5::cleanupPage()
    323284{
    324285    /* Call to base-class: */
     
    327288}
    328289
    329 bool UIWizardNewVMPageBasic4::isComplete() const
    330 {
    331     /* Make sure 'virtualDisk' field feats the rules: */
     290bool UIWizardNewVMPageBasic5::isComplete() const
     291{
    332292    if (!m_pDiskSkip)
    333293        return false;
     
    337297}
    338298
    339 bool UIWizardNewVMPageBasic4::validatePage()
     299bool UIWizardNewVMPageBasic5::validatePage()
    340300{
    341301    /* Initial result: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic5.h

    r87423 r87430  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIWizardNewVMPageBasic4 class declaration.
     3 * VBox Qt GUI - UIWizardNewVMPageBasic5 class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic4_h
    19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic4_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
     
    3636class QIRichTextLabel;
    3737class QIToolButton;
    38 class UIBaseMemoryEditor;
    3938class UIMediaComboBox;
    40 class UIVirtualCPUEditor;
    4139
    4240/** 3rd page of the New Virtual Machine wizard (base part). */
    43 class UIWizardNewVMPage4 : public UIWizardPageBase
     41class UIWizardNewVMPage5 : public UIWizardPageBase
    4442{
    4543
     
    4745
    4846    /** Constructor. */
    49     UIWizardNewVMPage4();
     47    UIWizardNewVMPage5();
    5048
    5149    /** Handlers. */
     
    6563       QString virtualDiskLocation() const { return m_strVirtualDiskLocation; }
    6664       void setVirtualDiskLocation(const QString &strVirtualDiskLocation) { m_strVirtualDiskLocation = strVirtualDiskLocation; }
    67        int baseMemory() const;
    68        int VCPUCount() const;
    6965    /** @} */
    7066
    7167    QWidget *createDiskWidgets();
    72     QWidget *createHardwareWidgets();
    7368
    7469    /** Helpers. */
     
    9489       UIMediaComboBox *m_pDiskSelector;
    9590       QIToolButton *m_pVMMButton;
    96        UIBaseMemoryEditor *m_pBaseMemoryEditor;
    97        UIVirtualCPUEditor *m_pVirtualCPUEditor;
    9891    /** @} */
    9992
     
    10194
    10295/** 3rd page of the New Virtual Machine wizard (basic extension). */
    103 class UIWizardNewVMPageBasic4 : public UIWizardPage, public UIWizardNewVMPage4
     96class UIWizardNewVMPageBasic5 : public UIWizardPage, public UIWizardNewVMPage5
    10497{
    10598    Q_OBJECT;
     
    108101    Q_PROPERTY(QString virtualDiskName READ virtualDiskName WRITE setVirtualDiskName);
    109102    Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation);
    110     Q_PROPERTY(int baseMemory READ baseMemory);
    111     Q_PROPERTY(int VCPUCount READ VCPUCount);
    112103
    113104public:
    114105
    115106    /** Constructor. */
    116     UIWizardNewVMPageBasic4();
     107    UIWizardNewVMPageBasic5();
    117108
    118109protected:
     
    149140};
    150141
    151 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic4_h */
     142#endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r87422 r87430  
    2727#include "UIWizardNewVMPageBasic3.h"
    2828#include "UIWizardNewVMPageBasic4.h"
     29#include "UIWizardNewVMPageBasic5.h"
    2930
    3031/* Forward declarations: */
     
    3738                                public UIWizardNewVMPage2,
    3839                                public UIWizardNewVMPage3,
    39                                 public UIWizardNewVMPage4
     40                                public UIWizardNewVMPage4,
     41                                public UIWizardNewVMPage5
    4042{
    4143
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