VirtualBox

Changeset 87423 in vbox


Ignore:
Timestamp:
Jan 25, 2021 6:48:16 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142417
Message:

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

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.cpp

    r87414 r87423  
    2020#include <QMetaType>
    2121#include <QRadioButton>
    22 #include <QToolBox>
    2322#include <QVBoxLayout>
    2423
     
    158157void UIWizardNewVMPage4::retranslateWidgets()
    159158{
    160     m_pDiskSkip->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk"));
    161     m_pDiskCreate->setText(UIWizardNewVM::tr("&Create a virtual hard disk now"));
    162     m_pDiskPresent->setText(UIWizardNewVM::tr("&Use an existing virtual hard disk file"));
    163     m_pVMMButton->setToolTip(UIWizardNewVM::tr("Choose a virtual hard disk file..."));
     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..."));
    164167}
    165168
     
    208211UIWizardNewVMPageBasic4::UIWizardNewVMPageBasic4()
    209212    : m_pLabel(0)
    210     , m_pToolBox(0)
    211213{
    212214    prepare();
     
    223225{
    224226    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    225     m_pToolBox = new QToolBox;
    226227
    227228    m_pLabel = new QIRichTextLabel(this);
    228229    pMainLayout->addWidget(m_pLabel);
    229     pMainLayout->addWidget(m_pToolBox);
    230 
    231     m_pToolBox->insertItem(ToolBoxItems_Disk, createDiskWidgets(), QString());
    232     m_pToolBox->insertItem(ToolBoxItems_Hardware, createHardwareWidgets(), QString());
    233     m_pToolBox->setStyleSheet("QToolBox::tab:selected { font: bold; }");
     230    pMainLayout->addWidget(createDiskWidgets());
    234231
    235232    pMainLayout->addStretch();
     
    275272    QString strRecommendedHDD = field("type").value<CGuestOSType>().isNull() ? QString() :
    276273                                UICommon::formatSize(field("type").value<CGuestOSType>().GetRecommendedHDD());
    277     m_pLabel->setText(UIWizardNewVM::tr("<p>If you wish you can add a virtual hard disk to the new machine. "
    278                                         "You can either create a new hard disk file or select one from the list "
    279                                         "or from another location using the folder icon. "
    280                                         "If you need a more complex storage set-up you can skip this step "
    281                                         "and make the changes to the machine settings once the machine is created. "
    282                                         "The recommended size of the hard disk is <b>%1</b>."
    283                                         "<p>You can also modify the virtual machine's hardware by modifying the amount of memory "
    284                                         "and virtual processors.</p>")
    285                                         .arg(strRecommendedHDD));
     274    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));
    286282    retranslateWidgets();
    287     if (m_pToolBox)
    288     {
    289         m_pToolBox->setItemText(ToolBoxItems_Disk, UIWizardNewVM::tr("Hard Disk"));
    290         m_pToolBox->setItemText(ToolBoxItems_Hardware, UIWizardNewVM::tr("Hardware"));
    291     }
    292283}
    293284
     
    302293    CGuestOSType type = field("type").value<CGuestOSType>();
    303294    ULONG recommendedRam = type.GetRecommendedRAM();
    304     m_pBaseMemoryEditor->setValue(recommendedRam);
     295    if (m_pBaseMemoryEditor)
     296        m_pBaseMemoryEditor->setValue(recommendedRam);
    305297
    306298
     
    338330{
    339331    /* Make sure 'virtualDisk' field feats the rules: */
     332    if (!m_pDiskSkip)
     333        return false;
    340334    return m_pDiskSkip->isChecked() ||
    341            !m_pDiskPresent->isChecked() ||
    342            !uiCommon().medium(m_pDiskSelector->id()).isNull();
     335        !m_pDiskPresent->isChecked() ||
     336        !uiCommon().medium(m_pDiskSelector->id()).isNull();
    343337}
    344338
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.h

    r87414 r87423  
    3434/* Forward declarations: */
    3535class QRadioButton;
    36 class QToolBox;
    3736class QIRichTextLabel;
    3837class QIToolButton;
     
    4645
    4746protected:
    48 
    49     enum
    50     {
    51         ToolBoxItems_Disk,
    52         ToolBoxItems_Hardware
    53     };
    54 
    5547
    5648    /** Constructor. */
     
    155147    /** Widgets. */
    156148    QIRichTextLabel *m_pLabel;
    157     QToolBox     *m_pToolBox;
    158149};
    159150
Note: See TracChangeset for help on using the changeset viewer.

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