VirtualBox

Changeset 100177 in vbox for trunk


Ignore:
Timestamp:
Jun 15, 2023 10:54:10 AM (18 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. More work on settings widget's design.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r100169 r100177  
    9393    void prepareConnections();
    9494
     95    QTabWidget   *m_pTabWidget;
    9596    QILabel      *m_pVisoNameLabel;
    9697    QILabel      *m_pCustomOptionsLabel;
     
    109110UIVisoSettingWidget::UIVisoSettingWidget(QWidget *pParent)
    110111    :QIWithRetranslateUI<QGroupBox>(pParent)
     112    , m_pTabWidget(0)
    111113    , m_pVisoNameLabel(0)
    112114    , m_pCustomOptionsLabel(0)
     
    124126{
    125127    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    126     QGridLayout *pGridLayout = new QGridLayout;
    127 
    128     //pGridLayout->setSpacing(0);
    129     //pGridLayout->setContentsMargins(0, 0, 0, 0);
    130     if (!pGridLayout)
    131         return;
     128    AssertReturnVoid(pMainLayout);
     129    m_pTabWidget = new QTabWidget;
     130    AssertReturnVoid(m_pTabWidget);
     131    pMainLayout->addWidget(m_pTabWidget);
     132
     133    QWidget *pVisoOptionsContainerWidget = new QWidget;
     134    AssertReturnVoid(pVisoOptionsContainerWidget);
     135    QGridLayout *pVisoOptionsGridLayout = new QGridLayout(pVisoOptionsContainerWidget);
     136    AssertReturnVoid(pVisoOptionsGridLayout);
     137    //pVisoOptionsGridLayout->setSpacing(0);
     138    //pVisoOptionsGridLayout->setContentsMargins(0, 0, 0, 0);
     139
     140    m_pTabWidget->addTab(pVisoOptionsContainerWidget, QApplication::translate("UIVisoCreatorWidget", "VISO options"));
    132141
    133142    /* Name edit and and label: */
     
    138147    {
    139148        m_pVisoNameLabel->setBuddy(m_pVisoNameLineEdit);
    140         pGridLayout->addWidget(m_pVisoNameLabel,    iRow, 0, 1, 1, Qt::AlignTop);
    141         pGridLayout->addWidget(m_pVisoNameLineEdit, iRow, 1, 1, 1, Qt::AlignTop);
    142     }
    143 
    144     /* Cutom Viso options stuff: */
     149        pVisoOptionsGridLayout->addWidget(m_pVisoNameLabel,    iRow, 0, 1, 1, Qt::AlignTop);
     150        pVisoOptionsGridLayout->addWidget(m_pVisoNameLineEdit, iRow, 1, 1, 1, Qt::AlignTop);
     151    }
     152
     153    /* Custom Viso options stuff: */
    145154    m_pCustomOptionsLabel = new QILabel(QApplication::translate("UIVisoCreatorWidget", "Custom VISO options:"));
    146155    m_pCustomOptionsLineEdit = new QILineEdit;
    147156    ++iRow;
    148     if (m_pCustomOptionsLabel && m_pCustomOptionsLineEdit)
    149     {
    150         m_pCustomOptionsLabel->setBuddy(m_pCustomOptionsLineEdit);
    151         pGridLayout->addWidget(m_pCustomOptionsLabel,    iRow, 0, 1, 1, Qt::AlignTop);
    152         pGridLayout->addWidget(m_pCustomOptionsLineEdit, iRow, 1, 1, 1, Qt::AlignTop);
    153     }
     157    AssertReturnVoid(m_pCustomOptionsLabel);
     158    AssertReturnVoid(m_pCustomOptionsLineEdit);
     159    m_pCustomOptionsLabel->setBuddy(m_pCustomOptionsLineEdit);
     160    pVisoOptionsGridLayout->addWidget(m_pCustomOptionsLabel,    iRow, 0, 1, 1, Qt::AlignTop);
     161    pVisoOptionsGridLayout->addWidget(m_pCustomOptionsLineEdit, iRow, 1, 1, 1, Qt::AlignTop);
     162
    154163
    155164    ++iRow;
     165    pVisoOptionsGridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), iRow, 0, 1, 2);
     166
     167    QWidget *pDialogSettingsContainerWidget = new QWidget;
     168    AssertReturnVoid(pDialogSettingsContainerWidget);
     169    QGridLayout *pDialogSettingsContainerLayout = new QGridLayout(pDialogSettingsContainerWidget);
     170    AssertReturnVoid(pDialogSettingsContainerLayout);
     171
     172    m_pTabWidget->addTab(pDialogSettingsContainerWidget, QApplication::translate("UIVisoCreatorWidget", "Dialog Settings"));
     173
     174    iRow = 0;
    156175    m_pShowHiddenObjectsCheckBox = new QCheckBox;
    157176    m_pShowHiddenObjectsLabel = new QILabel(QApplication::translate("UIVisoCreatorWidget", "Show Hidden Objects"));
    158177    m_pShowHiddenObjectsLabel->setBuddy(m_pShowHiddenObjectsCheckBox);
    159     pGridLayout->addWidget(m_pShowHiddenObjectsLabel,    iRow, 0, 1, 1, Qt::AlignTop);
    160     pGridLayout->addWidget(m_pShowHiddenObjectsCheckBox, iRow, 1, 1, 1, Qt::AlignTop);
     178    pDialogSettingsContainerLayout->addWidget(m_pShowHiddenObjectsLabel,    iRow, 0, 1, 1, Qt::AlignTop);
     179    pDialogSettingsContainerLayout ->addWidget(m_pShowHiddenObjectsCheckBox, iRow, 1, 1, 1, Qt::AlignTop);
     180
    161181    ++iRow;
    162     QSpacerItem *pSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
    163     pGridLayout->addItem(pSpacer, iRow, 0, 1, 2);
    164 
    165     pMainLayout->addLayout(pGridLayout);
     182    pDialogSettingsContainerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), iRow, 0, 1, 2);
    166183
    167184    m_pButtonBox = new QIDialogButtonBox;
    168     if (m_pButtonBox)
    169     {
    170         m_pButtonBox->setDoNotPickDefaultButton(true);
    171         m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
    172         pMainLayout->addWidget(m_pButtonBox);
    173 
    174     }
     185    AssertReturnVoid(m_pButtonBox);
     186    m_pButtonBox->setDoNotPickDefaultButton(true);
     187    m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
     188    pMainLayout->addWidget(m_pButtonBox);
     189
    175190    retranslateUi();
    176191}
     
    416431{
    417432    QString strFileName =  QIFileDialog::getOpenFileName(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD),
    418                                                          "Viso files (*.viso)", this, UIVisoCreatorWidget::tr("Select a viso file to load"));
     433                                                         "VISO files (*.viso)", this, UIVisoCreatorWidget::tr("Select a VISO file to load"));
    419434    if (!strFileName.isEmpty() && m_pVISOContentBrowser)
    420435        m_pVISOContentBrowser->parseVisoFileContent(strFileName);
     
    914929{
    915930    if (m_pStatusLabel)
    916         m_pStatusLabel->setText(QString("%1: %2").arg(UIVisoCreatorWidget::tr("Viso file")).arg(visoFileFullPath()));
     931        m_pStatusLabel->setText(QString("%1: %2").arg(UIVisoCreatorWidget::tr("VISO file")).arg(visoFileFullPath()));
    917932}
    918933
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