VirtualBox

Ignore:
Timestamp:
Jul 15, 2021 7:22:34 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996. Adding UIDiskSizeAndLocationGroupBox

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

Legend:

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

    r90193 r90206  
    2525/* GUI includes: */
    2626#include "QILineEdit.h"
     27#include "QIToolButton.h"
    2728#include "UICommon.h"
    2829#include "UIConverter.h"
     30#include "UIFilePathSelector.h"
    2931#include "UIHostnameDomainNameEditor.h"
    30 #include "UIFilePathSelector.h"
     32#include "UIIconPool.h"
     33#include "UIMediumSizeEditor.h"
    3134#include "UIUserNamePasswordEditor.h"
     35#include "UIWizardDiskEditors.h"
    3236#include "UIWizardNewVM.h"
    33 #include "UIWizardDiskEditors.h"
    3437
    3538/* Other VBox includes: */
     
    9497void UIDiskFormatsGroupBox::retranslateUi()
    9598{
    96     setTitle(UIDiskFormatsGroupBox::tr("Hard Disk File &Type"));
     99    setTitle(tr("Hard Disk File &Type"));
    97100
    98101    if (m_pFormatButtonGroup)
     
    191194void UIDiskVariantGroupBox::retranslateUi()
    192195{
    193     setTitle(UIDiskVariantGroupBox::tr("Storage on Physical Hard Disk"));
     196    setTitle(tr("Storage on Physical Hard Disk"));
    194197    if (m_pFixedCheckBox)
    195198    {
    196         m_pFixedCheckBox->setText(UIDiskVariantGroupBox::tr("Pre-allocate &Full Size"));
    197         m_pFixedCheckBox->setToolTip(UIDiskVariantGroupBox::tr("<p>When checked, the virtual disk image will be fully allocated at "
     199        m_pFixedCheckBox->setText(tr("Pre-allocate &Full Size"));
     200        m_pFixedCheckBox->setToolTip(tr("<p>When checked, the virtual disk image will be fully allocated at "
    198201                                                       "VM creation time, rather than being allocated dynamically at VM run-time.</p>"));
    199202    }
    200     m_pSplitBox->setText(UIDiskVariantGroupBox::tr("&Split into files of less than 2GB"));
    201 
    202 }
     203    m_pSplitBox->setText(tr("&Split into files of less than 2GB"));
     204
     205}
     206
     207
     208/*********************************************************************************************************************************
     209*   UIDiskSizeAndLocationGroupBox implementation.                                                                                *
     210*********************************************************************************************************************************/
     211
     212UIDiskSizeAndLocationGroupBox::UIDiskSizeAndLocationGroupBox(QWidget *pParent /* = 0 */)
     213    : QIWithRetranslateUI<QGroupBox>(pParent)
     214    , m_pLocationLabel(0)
     215    , m_pLocationEditor(0)
     216    , m_pLocationOpenButton(0)
     217    , m_pMediumSizeEditorLabel(0)
     218    , m_pMediumSizeEditor(0)
     219{
     220    prepare();
     221}
     222
     223void UIDiskSizeAndLocationGroupBox::prepare()
     224{
     225    QGridLayout *pDiskContainerLayout = new QGridLayout(this);
     226
     227    /* Disk location widgets: */
     228    m_pLocationLabel = new QLabel;
     229    m_pLocationLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
     230    m_pLocationEditor = new QILineEdit;
     231    m_pLocationOpenButton = new QIToolButton;
     232    if (m_pLocationOpenButton)
     233    {
     234        m_pLocationOpenButton->setAutoRaise(true);
     235        m_pLocationOpenButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", "select_file_disabled_16px.png"));
     236    }
     237    m_pLocationLabel->setBuddy(m_pLocationEditor);
     238
     239    /* Disk file size widgets: */
     240    m_pMediumSizeEditorLabel = new QLabel;
     241    m_pMediumSizeEditorLabel->setAlignment(Qt::AlignRight);
     242    m_pMediumSizeEditorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
     243    m_pMediumSizeEditor = new UIMediumSizeEditor;
     244    m_pMediumSizeEditorLabel->setBuddy(m_pMediumSizeEditor);
     245
     246
     247    pDiskContainerLayout->addWidget(m_pLocationLabel, 0, 0, 1, 1);
     248    pDiskContainerLayout->addWidget(m_pLocationEditor, 0, 1, 1, 2);
     249    pDiskContainerLayout->addWidget(m_pLocationOpenButton, 0, 3, 1, 1);
     250
     251    pDiskContainerLayout->addWidget(m_pMediumSizeEditorLabel, 1, 0, 1, 1, Qt::AlignBottom);
     252    pDiskContainerLayout->addWidget(m_pMediumSizeEditor, 1, 1, 2, 3);
     253
     254    retranslateUi();
     255}
     256void UIDiskSizeAndLocationGroupBox::retranslateUi()
     257{
     258    setTitle(tr("Hard Disk File Location and Size"));
     259}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h

    r90193 r90206  
    3838class QVBoxLayout;
    3939class QILineEdit;
     40class QIToolButton;
    4041class UIFilePathSelector;
    4142class UIHostnameDomainNameEditor;
    4243class UIPasswordLineEdit;
    4344class UIUserNamePasswordEditor;
     45class UIMediumSizeEditor;
    4446
    4547/* Other VBox includes: */
     
    9496
    9597
     98class UIDiskSizeAndLocationGroupBox : public QIWithRetranslateUI<QGroupBox>
     99{
     100    Q_OBJECT;
     101
     102signals:
     103
     104
     105public:
     106
     107    UIDiskSizeAndLocationGroupBox(QWidget *pParent = 0);
     108
     109private:
     110
     111    void prepare();
     112    virtual void retranslateUi() /* override final */;
     113
     114    QLabel *m_pLocationLabel;
     115    QILineEdit *m_pLocationEditor;
     116    QIToolButton *m_pLocationOpenButton;
     117    QLabel *m_pMediumSizeEditorLabel;
     118    UIMediumSizeEditor *m_pMediumSizeEditor;
     119
     120};
     121
    96122#endif /* !FEQT_INCLUDED_SRC_wizards_editors_UIWizardDiskEditors_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r90193 r90206  
    5353    : m_pToolBox(0)
    5454    , m_pDiskVariantGroupBox(0)
    55     , m_pLocationLabel(0)
    56     , m_pLocationEditor(0)
    57     , m_pLocationOpenButton(0)
    58     , m_pMediumSizeEditorLabel(0)
    59     , m_pMediumSizeEditor(0)
    6055    , m_pFormatButtonGroup(0)
     56    , m_pSizeAndLocationGroup(0)
    6157    , m_pNameAndSystemEditor(0)
    6258    , m_pSkipUnattendedCheckBox(0)
     
    389385    /* Disk location widgets: */
    390386
    391     m_pLocationLabel = new QLabel;
    392     m_pLocationLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
    393     m_pLocationEditor = new QLineEdit;
    394     m_pLocationOpenButton = new QIToolButton;
    395     if (m_pLocationOpenButton)
    396     {
    397         m_pLocationOpenButton->setAutoRaise(true);
    398         m_pLocationOpenButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", "select_file_disabled_16px.png"));
    399     }
    400     m_pLocationLabel->setBuddy(m_pLocationEditor);
    401 
    402     /* Disk file size widgets: */
    403     m_pMediumSizeEditorLabel = new QLabel;
    404     m_pMediumSizeEditorLabel->setAlignment(Qt::AlignRight);
    405     m_pMediumSizeEditorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    406     m_pMediumSizeEditor = new UIMediumSizeEditor;
    407     m_pMediumSizeEditorLabel->setBuddy(m_pMediumSizeEditor);
    408 
    409 
    410     m_pMediumSizeEditor = new UIMediumSizeEditor;
    411 
    412     pDiskContainerLayout->addWidget(m_pLocationLabel, 0, 0, 1, 1);
    413     pDiskContainerLayout->addWidget(m_pLocationEditor, 0, 1, 1, 2);
    414     pDiskContainerLayout->addWidget(m_pLocationOpenButton, 0, 3, 1, 1);
    415 
    416     pDiskContainerLayout->addWidget(m_pMediumSizeEditorLabel, 1, 0, 1, 1, Qt::AlignBottom);
    417     pDiskContainerLayout->addWidget(m_pMediumSizeEditor, 1, 1, 2, 3);
    418 
     387    // m_pLocationLabel = new QLabel;
     388    // m_pLocationLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
     389    // m_pLocationEditor = new QLineEdit;
     390    // m_pLocationOpenButton = new QIToolButton;
     391    // if (m_pLocationOpenButton)
     392    // {
     393    //     m_pLocationOpenButton->setAutoRaise(true);
     394    //     m_pLocationOpenButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", "select_file_disabled_16px.png"));
     395    // }
     396    // m_pLocationLabel->setBuddy(m_pLocationEditor);
     397
     398    // /* Disk file size widgets: */
     399    // m_pMediumSizeEditorLabel = new QLabel;
     400    // m_pMediumSizeEditorLabel->setAlignment(Qt::AlignRight);
     401    // m_pMediumSizeEditorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
     402    // m_pMediumSizeEditor = new UIMediumSizeEditor;
     403    // m_pMediumSizeEditorLabel->setBuddy(m_pMediumSizeEditor);
     404    // m_pMediumSizeEditor = new UIMediumSizeEditor;
     405
     406    // pDiskContainerLayout->addWidget(m_pLocationLabel, 0, 0, 1, 1);
     407    // pDiskContainerLayout->addWidget(m_pLocationEditor, 0, 1, 1, 2);
     408    // pDiskContainerLayout->addWidget(m_pLocationOpenButton, 0, 3, 1, 1);
     409
     410    // pDiskContainerLayout->addWidget(m_pMediumSizeEditorLabel, 1, 0, 1, 1, Qt::AlignBottom);
     411    // pDiskContainerLayout->addWidget(m_pMediumSizeEditor, 1, 1, 2, 3);
     412
     413    m_pSizeAndLocationGroup = new UIDiskSizeAndLocationGroupBox;
     414    pDiskContainerLayout->addWidget(m_pSizeAndLocationGroup, 0, 0, 2, 2);
    419415    m_pFormatButtonGroup = new UIDiskFormatsGroupBox;
    420     pDiskContainerLayout->addWidget(m_pFormatButtonGroup, 3, 0, 6, 2);
     416    pDiskContainerLayout->addWidget(m_pFormatButtonGroup, 2, 0, 4, 1);
    421417    m_pDiskVariantGroupBox  = new UIDiskVariantGroupBox;
    422     pDiskContainerLayout->addWidget(m_pDiskVariantGroupBox, 3, 2, 6, 2);
     418    pDiskContainerLayout->addWidget(m_pDiskVariantGroupBox, 2, 1, 2, 1);
    423419
    424420    return pNewDiskContainerWidget;
     
    591587void UIWizardNewVMPageExpert::sltMediumSizeChanged()
    592588{
    593     if (!m_pMediumSizeEditor)
    594         return;
    595 
    596589    completeChanged();
    597590}
     
    660653void UIWizardNewVMPageExpert::setEnableNewDiskWidgets(bool fEnable)
    661654{
    662     if (m_pMediumSizeEditor)
    663         m_pMediumSizeEditor->setEnabled(fEnable);
    664     if (m_pMediumSizeEditorLabel)
    665         m_pMediumSizeEditorLabel->setEnabled(fEnable);
     655    if (m_pSizeAndLocationGroup)
     656        m_pSizeAndLocationGroup->setEnabled(fEnable);
    666657    if (m_pFormatButtonGroup)
    667658        m_pFormatButtonGroup->setEnabled(fEnable);
    668659    if (m_pDiskVariantGroupBox)
    669660        m_pDiskVariantGroupBox->setEnabled(fEnable);
    670     if (m_pLocationLabel)
    671         m_pLocationLabel->setEnabled(fEnable);
    672     if (m_pLocationEditor)
    673         m_pLocationEditor->setEnabled(fEnable);
    674     if (m_pLocationOpenButton)
    675         m_pLocationOpenButton->setEnabled(fEnable);
    676661}
    677662
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r90193 r90206  
    4040class UIAdditionalUnattendedOptions;
    4141class UIDiskFormatsGroupBox;
     42class UIDiskSizeAndLocationGroupBox;
    4243class UIDiskVariantGroupBox;
    4344class UIFilePathSelector;
     
    129130        UIToolBox  *m_pToolBox;
    130131        UIDiskVariantGroupBox *m_pDiskVariantGroupBox;
    131         QLabel *m_pLocationLabel;
    132         QLineEdit *m_pLocationEditor;
    133         QIToolButton *m_pLocationOpenButton;
    134         QLabel *m_pMediumSizeEditorLabel;
    135         UIMediumSizeEditor *m_pMediumSizeEditor;
    136132        UIDiskFormatsGroupBox *m_pFormatButtonGroup;
     133        UIDiskSizeAndLocationGroupBox *m_pSizeAndLocationGroup;
    137134        UINameAndSystemEditor *m_pNameAndSystemEditor;
    138135        QCheckBox *m_pSkipUnattendedCheckBox;
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