VirtualBox

Changeset 90362 in vbox for trunk/src


Ignore:
Timestamp:
Jul 27, 2021 6:00:18 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145935
Message:

FE/Qt: bugref:9996. Working on new vd wizard. it is still broken

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp

    r90356 r90362  
    2828#include "QILineEdit.h"
    2929#include "QIToolButton.h"
     30#include "QIRichTextLabel.h"
    3031#include "UICommon.h"
    3132#include "UIConverter.h"
     
    4344#include "CSystemProperties.h"
    4445
     46
     47/*********************************************************************************************************************************
     48*   UIDiskEditorGroupBox implementation.                                                                                   *
     49*********************************************************************************************************************************/
     50
     51UIDiskEditorGroupBox::UIDiskEditorGroupBox(bool fExpertMode, QWidget *pParent /* = 0 */)
     52    : QIWithRetranslateUI<QGroupBox>(pParent)
     53    , m_fExpertMode(fExpertMode)
     54{
     55    if (!m_fExpertMode)
     56        setFlat(true);
     57}
     58
    4559/*********************************************************************************************************************************
    4660*   UIDiskFormatsGroupBox implementation.                                                                                   *
     
    4862
    4963UIDiskFormatsGroupBox::UIDiskFormatsGroupBox(bool fExpertMode, QWidget *pParent /* = 0 */)
    50     : QIWithRetranslateUI<QGroupBox>(pParent)
     64    : UIDiskEditorGroupBox(fExpertMode, pParent)
    5165    , m_pFormatButtonGroup(0)
    52     , m_fExpertMode(fExpertMode)
    5366{
    5467    prepare();
     
    7891{
    7992    QVBoxLayout *pContainerLayout = new QVBoxLayout(this);
    80     if (!m_fExpertMode)
    81         setFlat(true);
    8293
    8394    m_pFormatButtonGroup = new QButtonGroup;
     
    212223
    213224UIDiskVariantGroupBox::UIDiskVariantGroupBox(bool fExpertMode, QWidget *pParent /* = 0 */)
    214     : QIWithRetranslateUI<QGroupBox>(pParent)
     225    : UIDiskEditorGroupBox(fExpertMode, pParent)
    215226    , m_pFixedCheckBox(0)
    216227    , m_pSplitBox(0)
    217     , m_fExpertMode(fExpertMode)
    218228{
    219229    prepare();
     
    222232void UIDiskVariantGroupBox::prepare()
    223233{
    224     if (!m_fExpertMode)
    225         setFlat(true);
    226234    QVBoxLayout *pVariantLayout = new QVBoxLayout(this);
    227235    AssertReturnVoid(pVariantLayout);
     
    353361*********************************************************************************************************************************/
    354362
    355 UIMediumSizeAndPathGroupBox::UIMediumSizeAndPathGroupBox(QWidget *pParent /* = 0 */)
    356     : QIWithRetranslateUI<QGroupBox>(pParent)
    357     , m_pLocationLabel(0)
     363UIMediumSizeAndPathGroupBox::UIMediumSizeAndPathGroupBox(bool fExpertMode, QWidget *pParent /* = 0 */)
     364    : UIDiskEditorGroupBox(fExpertMode, pParent)
    358365    , m_pLocationEditor(0)
    359366    , m_pLocationOpenButton(0)
    360     , m_pMediumSizeEditorLabel(0)
    361367    , m_pMediumSizeEditor(0)
     368    , m_pLocationLabel(0)
     369    , m_pSizeLabel(0)
    362370{
    363371    prepare();
     
    366374void UIMediumSizeAndPathGroupBox::prepare()
    367375{
    368     QGridLayout *pDiskContainerLayout = new QGridLayout(this);
    369 
    370     /* Disk location widgets: */
    371     m_pLocationLabel = new QLabel;
    372     m_pLocationLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
     376    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
     377    /* Location widgets: */
     378    if (!m_fExpertMode)
     379        m_pLocationLabel = new QIRichTextLabel;
     380    QHBoxLayout *pLocationLayout = new QHBoxLayout;
    373381    m_pLocationEditor = new QILineEdit;
    374382    m_pLocationOpenButton = new QIToolButton;
     
    378386        m_pLocationOpenButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", "select_file_disabled_16px.png"));
    379387    }
    380     m_pLocationLabel->setBuddy(m_pLocationEditor);
    381 
    382     /* Disk file size widgets: */
    383     m_pMediumSizeEditorLabel = new QLabel;
    384     m_pMediumSizeEditorLabel->setAlignment(Qt::AlignRight);
    385     m_pMediumSizeEditorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
     388    pLocationLayout->addWidget(m_pLocationEditor);
     389    pLocationLayout->addWidget(m_pLocationOpenButton);
     390
     391    /* Size widgets: */
     392    if (!m_fExpertMode)
     393        m_pSizeLabel = new QIRichTextLabel;
    386394    m_pMediumSizeEditor = new UIMediumSizeEditor;
    387     m_pMediumSizeEditorLabel->setBuddy(m_pMediumSizeEditor);
    388 
    389     pDiskContainerLayout->addWidget(m_pLocationLabel, 0, 0, 1, 1);
    390     pDiskContainerLayout->addWidget(m_pLocationEditor, 0, 1, 1, 2);
    391     pDiskContainerLayout->addWidget(m_pLocationOpenButton, 0, 3, 1, 1);
    392 
    393     pDiskContainerLayout->addWidget(m_pMediumSizeEditorLabel, 1, 0, 1, 1, Qt::AlignBottom);
    394     pDiskContainerLayout->addWidget(m_pMediumSizeEditor, 1, 1, 2, 3);
     395
     396    /* Add widgets to main layout: */
     397    if (m_pLocationLabel)
     398        pMainLayout->addWidget(m_pLocationLabel);
     399    pMainLayout->addLayout(pLocationLayout);
     400
     401    if (m_pSizeLabel)
     402        pMainLayout->addWidget(m_pSizeLabel);
     403    pMainLayout->addWidget(m_pMediumSizeEditor);
    395404
    396405    connect(m_pMediumSizeEditor, &UIMediumSizeEditor::sigSizeChanged,
     
    407416void UIMediumSizeAndPathGroupBox::retranslateUi()
    408417{
    409     setTitle(tr("Hard Disk File Location and Size"));
     418    if (m_fExpertMode)
     419        setTitle(tr("Hard Disk File Location and Size"));
    410420    if (m_pLocationOpenButton)
    411421        m_pLocationOpenButton->setToolTip(tr("Choose a location for new virtual hard disk file..."));
     422
     423    if (!m_fExpertMode && m_pLocationLabel)
     424        m_pLocationLabel->setText(tr("Please type the name of the new virtual hard disk file into the box below or "
     425                                                    "click on the folder icon to select a different folder to create the file in."));
     426    if (!m_fExpertMode && m_pSizeLabel)
     427        m_pSizeLabel->setText(tr("Select the size of the virtual hard disk in megabytes. "
     428                                                "This size is the limit on the amount of file data "
     429                                                "that a virtual machine will be able to store on the hard disk."));
    412430}
    413431
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h

    r90356 r90362  
    3737class QLabel;
    3838class QVBoxLayout;
     39class QIRichTextLabel;
    3940class QILineEdit;
    4041class QIToolButton;
     
    4950#include "CMediumFormat.h"
    5051
    51 class SHARED_LIBRARY_STUFF UIDiskFormatsGroupBox : public QIWithRetranslateUI<QGroupBox>
     52class SHARED_LIBRARY_STUFF UIDiskEditorGroupBox : public QIWithRetranslateUI<QGroupBox>
     53{
     54    Q_OBJECT;
     55
     56public:
     57
     58    UIDiskEditorGroupBox(bool fExpertMode, QWidget *pParent = 0);
     59
     60protected:
     61
     62    bool m_fExpertMode;
     63};
     64
     65class SHARED_LIBRARY_STUFF UIDiskFormatsGroupBox : public UIDiskEditorGroupBox
    5266{
    5367    Q_OBJECT;
     
    7892    QStringList m_formatExtensions;
    7993    QButtonGroup *m_pFormatButtonGroup;
    80     bool m_fExpertMode;
    8194};
    8295
    83 class SHARED_LIBRARY_STUFF UIDiskVariantGroupBox : public QIWithRetranslateUI<QGroupBox>
     96class SHARED_LIBRARY_STUFF UIDiskVariantGroupBox : public UIDiskEditorGroupBox
    8497{
    8598    Q_OBJECT;
     
    109122    QCheckBox *m_pFixedCheckBox;
    110123    QCheckBox *m_pSplitBox;
    111     bool m_fExpertMode;
    112124};
    113125
    114126
    115 class SHARED_LIBRARY_STUFF UIMediumSizeAndPathGroupBox : public QIWithRetranslateUI<QGroupBox>
     127class SHARED_LIBRARY_STUFF UIMediumSizeAndPathGroupBox : public UIDiskEditorGroupBox
    116128{
    117129    Q_OBJECT;
     
    125137public:
    126138
    127     UIMediumSizeAndPathGroupBox(QWidget *pParent = 0);
    128 
     139    UIMediumSizeAndPathGroupBox(bool fExpertMode, QWidget *pParent = 0);
    129140    QString mediumPath() const;
    130141    void setMediumPath(const QString &strMediumPath);
     
    132143    qulonglong mediumSize() const;
    133144    void setMediumSize(qulonglong uSize);
    134 
    135145
    136146private:
     
    141151                                        const QStringList &formatExtensions);
    142152
    143 
    144     QLabel *m_pLocationLabel;
    145153    QILineEdit *m_pLocationEditor;
    146154    QIToolButton *m_pLocationOpenButton;
    147     QLabel *m_pMediumSizeEditorLabel;
    148155    UIMediumSizeEditor *m_pMediumSizeEditor;
     156    QIRichTextLabel *m_pLocationLabel;
     157    QIRichTextLabel *m_pSizeLabel;
    149158};
    150159
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp

    r90356 r90362  
    6363            addPage(new UIWizardNewVDPageFileType);
    6464            addPage(new UIWizardNewVDPageVariant);
     65            addPage(new UIWizardNewVDPageSizeLocation(m_strDefaultName, m_strDefaultPath, m_uDefaultSize));
    6566            break;
    6667        }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageSizeLocation.cpp

    r90356 r90362  
    300300    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    301301    AssertReturnVoid(pMainLayout);
     302    m_pMediumSizePathGroup = new UIMediumSizeAndPathGroupBox(false, 0);
    302303//     {
    303304//         m_pLocationLabel = new QIRichTextLabel(this);
     
    319320//         pMainLayout->addLayout(pLocationLayout);
    320321//         pMainLayout->addWidget(m_pSizeLabel);
    321 //         pMainLayout->addWidget(m_pMediumSizeEditor);
    322 //         pMainLayout->addStretch();
     322    pMainLayout->addWidget(m_pMediumSizePathGroup);
     323    pMainLayout->addStretch();
    323324//     }
    324325    retranslateUi();
     
    334335{
    335336    setTitle(UIWizardNewVD::tr("File location and size"));
    336     // if (m_pLocationLabel)
    337     //     m_pLocationLabel->setText(UIWizardNewVD::tr("Please type the name of the new virtual hard disk file into the box below or "
    338     //                                                 "click on the folder icon to select a different folder to create the file in."));
    339     // if (m_pSizeLabel)
    340     //     m_pSizeLabel->setText(UIWizardNewVD::tr("Select the size of the virtual hard disk in megabytes. "
    341     //                                             "This size is the limit on the amount of file data "
    342     //                                             "that a virtual machine will be able to store on the hard disk."));
    343337}
    344338
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageVariant.cpp

    r90356 r90362  
    233233{
    234234    //return mediumVariant() != (qulonglong)KMediumVariant_Max;
    235     return false;
    236 }
     235    return true;
     236}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r90356 r90362  
    464464    QGridLayout *pDiskContainerLayout = new QGridLayout(pNewDiskContainerWidget);
    465465
    466     m_pSizeAndLocationGroup = new UIMediumSizeAndPathGroupBox;
     466    m_pSizeAndLocationGroup = new UIMediumSizeAndPathGroupBox(true, 0);
    467467    pDiskContainerLayout->addWidget(m_pSizeAndLocationGroup, 0, 0, 2, 2);
    468468    m_pFormatButtonGroup = new UIDiskFormatsGroupBox(true, 0);
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