VirtualBox

Changeset 85081 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 7, 2020 12:03:00 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138986
Message:

FE/Qt: bugref:9515. First go at the expert mode page.

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

Legend:

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

    r85078 r85081  
    489489    QGridLayout *pMainLayout = new QGridLayout(this);;
    490490    createWidgets(pMainLayout);
    491     void createConnections();
     491    createConnections();
    492492    /* Register fields: */
    493493    registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &)));
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp

    r85071 r85081  
    5252void UIWizardNewVMPage3::updateVirtualDiskSource()
    5353{
     54    if (!m_pDiskSelector || !m_pVMMButton)
     55        return;
     56
    5457    /* Enable/disable controls: */
    5558    m_pDiskSelector->setEnabled(m_pDiskPresent->isChecked());
     
    260263{
    261264    /* Translate page: */
    262     setTitle(UIWizardNewVM::tr("Hard disk"));
     265    setTitle(UIWizardNewVM::tr("Hard disk and Hardware"));
    263266
    264267    /* Translate widgets: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r85055 r85081  
    2525#include <QSpacerItem>
    2626#include <QSpinBox>
     27#include <QToolBox>
    2728#include <QVBoxLayout>
    2829
     
    4142UIWizardNewVMPageExpert::UIWizardNewVMPageExpert(const QString &strGroup)
    4243    : UIWizardNewVMPage1(strGroup)
     44    , m_pNameAndSystemCnt(0)
     45    , m_pMemoryCnt(0)
     46    , m_pDiskCnt(0)
     47    , m_pToolBox(0)
    4348{
    4449    /* Create widgets: */
    4550    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    4651    {
    47         m_pNameAndSystemCnt = new QGroupBox(this);
     52        m_pToolBox = new QToolBox;
     53        m_pNameAndSystemCnt = new QWidget(this);
    4854        {
    4955            m_pNameAndSystemCnt->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
     
    5460            }
    5561        }
    56         m_pMemoryCnt = new QGroupBox(this);
    57         {
    58             m_pMemoryCnt->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    59             QGridLayout *pMemoryCntLayout = new QGridLayout(m_pMemoryCnt);
    60             {
    61                 m_pBaseMemoryEditor = new UIBaseMemoryEditor;
    62                 pMemoryCntLayout->addWidget(m_pBaseMemoryEditor, 0, 0, 1, 4);
    63             }
    64         }
    65         m_pDiskCnt = new QGroupBox(this);
    66         {
    67             m_pDiskCnt->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    68             QGridLayout *pDiskCntLayout = new QGridLayout(m_pDiskCnt);
    69             {
    70                 m_pDiskSkip = new QRadioButton(m_pDiskCnt);
    71                 m_pDiskCreate = new QRadioButton(m_pDiskCnt);
    72                 {
    73                     m_pDiskCreate->setChecked(true);
    74                 }
    75                 m_pDiskPresent = new QRadioButton(m_pDiskCnt);
    76                 QStyleOptionButton options;
    77                 options.initFrom(m_pDiskPresent);
    78                 int iWidth = m_pDiskPresent->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, &options, m_pDiskPresent);
    79                 pDiskCntLayout->setColumnMinimumWidth(0, iWidth);
    80                 m_pDiskSelector = new UIMediaComboBox(m_pDiskCnt);
    81                 {
    82                     m_pDiskSelector->setType(UIMediumDeviceType_HardDisk);
    83                     m_pDiskSelector->repopulate();
    84                 }
    85                 m_pVMMButton = new QIToolButton(m_pDiskCnt);
    86                 {
    87                     m_pVMMButton->setAutoRaise(true);
    88                     m_pVMMButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", ":/select_file_disabled_16px.png"));
    89                 }
    90                 pDiskCntLayout->addWidget(m_pDiskSkip, 0, 0, 1, 3);
    91                 pDiskCntLayout->addWidget(m_pDiskCreate, 1, 0, 1, 3);
    92                 pDiskCntLayout->addWidget(m_pDiskPresent, 2, 0, 1, 3);
    93                 pDiskCntLayout->addWidget(m_pDiskSelector, 3, 1);
    94                 pDiskCntLayout->addWidget(m_pVMMButton, 3, 2);
    95             }
    96         }
    97         pMainLayout->addWidget(m_pNameAndSystemCnt);
    98         pMainLayout->addWidget(m_pMemoryCnt);
    99         pMainLayout->addWidget(m_pDiskCnt);
     62
     63        pMainLayout->addWidget(m_pToolBox);
     64        m_pToolBox->insertItem(ExpertToolboxItems_NameAnsOSType, m_pNameAndSystemCnt, "");
     65        m_pToolBox->insertItem(ExpertToolboxItems_Disk, createDiskWidgets(), "");
     66        m_pToolBox->insertItem(ExpertToolboxItems_Hardware, createHardwareWidgets(), "");
     67
    10068        pMainLayout->addStretch();
    10169        updateVirtualDiskSource();
     
    184152{
    185153    /* Translate widgets: */
    186     m_pNameAndSystemCnt->setTitle(UIWizardNewVM::tr("Name and operating system"));
    187     m_pMemoryCnt->setTitle(UIWizardNewVM::tr("&Memory size"));
    188     m_pDiskCnt->setTitle(UIWizardNewVM::tr("Hard disk"));
     154
     155    //m_pMemoryCnt->setTitle(UIWizardNewVM::tr("&Memory size"));
     156    //m_pDiskCnt->setTitle(UIWizardNewVM::tr("Hard disk"));
    189157    m_pDiskSkip->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk"));
    190158    m_pDiskCreate->setText(UIWizardNewVM::tr("&Create a virtual hard disk now"));
    191159    m_pDiskPresent->setText(UIWizardNewVM::tr("&Use an existing virtual hard disk file"));
    192160    m_pVMMButton->setToolTip(UIWizardNewVM::tr("Choose a virtual hard disk file..."));
     161    if (m_pToolBox)
     162    {
     163        m_pToolBox->setItemText(ExpertToolboxItems_NameAnsOSType, UIWizardNewVM::tr("Name and operating system"));
     164        m_pToolBox->setItemText(ExpertToolboxItems_Disk, UIWizardNewVM::tr("Hard disk"));
     165        m_pToolBox->setItemText(ExpertToolboxItems_Hardware, UIWizardNewVM::tr("Hardware"));
     166    }
    193167}
    194168
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r85064 r85081  
    2828/* Forward declarations: */
    2929class QGroupBox;
     30class QToolBox;
    3031
    31 /* Expert page of the New Virtual Machine wizard: */
     32/** Expert page of the New Virtual Machine wizard. */
    3233class UIWizardNewVMPageExpert : public UIWizardPage,
    3334                                public UIWizardNewVMPage1,
     
    4546public:
    4647
    47     /* Constructor: */
     48    /** Constructor. */
    4849    UIWizardNewVMPageExpert(const QString &strGroup);
    4950
    5051protected:
    5152
    52     /* Wrapper to access 'wizard' from base part: */
     53    /** Wrapper to access 'wizard' from base part. */
    5354    UIWizard *wizardImp() const { return wizard(); }
    54     /* Wrapper to access 'this' from base part: */
     55    /** Wrapper to access 'this' from base part. */
    5556    UIWizardPage* thisImp() { return this; }
    56     /* Wrapper to access 'wizard-field' from base part: */
     57    /** Wrapper to access 'wizard-field' from base part. */
    5758    QVariant fieldImp(const QString &strFieldName) const { return UIWizardPage::field(strFieldName); }
    5859
    5960private slots:
    6061
    61     /* Handlers: */
     62    /** Handlers. */
    6263    void sltNameChanged(const QString &strNewText);
    6364    void sltPathChanged(const QString &strNewPath);
     
    6768
    6869private:
     70    enum ExpertToolboxItems
     71    {
     72        ExpertToolboxItems_NameAnsOSType,
     73        ExpertToolboxItems_Disk,
     74        ExpertToolboxItems_Hardware
    6975
    70     /* Translation stuff: */
     76    };
     77    /** Translation stuff. */
    7178    void retranslateUi();
    7279
    73     /* Prepare stuff: */
     80    /** Prepare stuff. */
    7481    void initializePage();
    7582    void cleanupPage();
    7683
    77     /* Validation stuff: */
     84    /** Validation stuff. */
    7885    bool isComplete() const;
    7986    bool validatePage();
    8087
    81     /* Widgets: */
    82     QGroupBox *m_pNameAndSystemCnt;
     88    /** Widgets. */
     89    QWidget *m_pNameAndSystemCnt;
    8390    QGroupBox *m_pMemoryCnt;
    8491    QGroupBox *m_pDiskCnt;
     92    QToolBox  *m_pToolBox;
    8593};
    8694
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