VirtualBox

Ignore:
Timestamp:
Aug 24, 2020 6:48:40 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140055
Message:

FE/Qt: bugref:9812. Removing UISettingsDialog.ui

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro

    r85822 r85881  
    2020TEMPLATE        = app
    2121LANGUAGE        = C++
    22 
    23 FORMS = \
    24     src/settings/UISettingsDialog.ui
    2522
    2623TRANSLATIONS = \
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r85644 r85881  
    2929# include <QRegExp>
    3030#endif
     31# include <QVBoxLayout>
    3132
    3233/* GUI includes: */
     34#include "QIDialogButtonBox.h"
    3335#include "QIFileDialog.h"
    3436#include "UIActionPoolManager.h"
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp

    r82968 r85881  
    1818/* Qt includes: */
    1919#include <QCloseEvent>
     20#include <QGridLayout>
     21#include <QLabel>
    2022#include <QProgressBar>
    2123#include <QPushButton>
     
    2426
    2527/* GUI includes: */
     28#include "QIDialogButtonBox.h"
    2629#include "QIWidgetValidator.h"
    2730#include "UICommon.h"
     
    6164    , m_fSilent(true)
    6265    , m_pWhatsThisTimer(new QTimer(this))
     66    , m_pLabelTitle(0)
     67    , m_pButtonBox(0)
     68    , m_pWidgetStackHandler(0)
    6369{
    6470    /* Prepare: */
     
    151157    setWindowTitle(title());
    152158#else
    153     m_pLbTitle->setText(m_pSelector->itemText(cId));
     159    m_pLabelTitle->setText(m_pSelector->itemText(cId));
    154160#endif
    155161}
     
    241247void UISettingsDialog::retranslateUi()
    242248{
    243     /* Translate generated stuff: */
    244     Ui::UISettingsDialog::retranslateUi(this);
     249    setWhatsThis(tr("<i>Select a settings category from the list on the left-hand side and move the mouse over a settings "
     250                    "item to get more information.</i>"));
     251    m_pLabelTitle->setText(QString());
    245252
    246253    /* Translate warning stuff: */
     
    251258#ifndef VBOX_GUI_WITH_TOOLBAR_SETTINGS
    252259    /* Retranslate current page headline: */
    253     m_pLbTitle->setText(m_pSelector->itemText(m_pSelector->currentId()));
     260    m_pLabelTitle->setText(m_pSelector->itemText(m_pSelector->currentId()));
    254261#endif
    255262
     
    589596void UISettingsDialog::prepare()
    590597{
    591     /* Apply UI decorations: */
    592     Ui::UISettingsDialog::setupUi(this);
     598    prepareWidgets();
    593599
    594600    /* Configure title: */
    595     if (m_pLbTitle)
     601    if (m_pLabelTitle)
    596602    {
    597603        /* Page-title font is bold and larger but derived from the system font: */
     
    599605        pageTitleFont.setBold(true);
    600606        pageTitleFont.setPointSize(pageTitleFont.pointSize() + 2);
    601         m_pLbTitle->setFont(pageTitleFont);
     607        m_pLabelTitle->setFont(pageTitleFont);
    602608    }
    603609
     
    609615
    610616        /* No page-title with tool-bar: */
    611         m_pLbTitle->hide();
     617        m_pLabelTitle->hide();
    612618
    613619        /* Create modern tool-bar selector: */
     
    645651
    646652    /* Prepare stack-handler: */
    647     if (m_pWtStackHandler)
     653    if (m_pWidgetStackHandler)
    648654    {
    649655        /* Create page-stack layout: */
    650         QVBoxLayout *pStackLayout = new QVBoxLayout(m_pWtStackHandler);
     656        QVBoxLayout *pStackLayout = new QVBoxLayout(m_pWidgetStackHandler);
    651657        if (pStackLayout)
    652658        {
     
    722728}
    723729
     730void UISettingsDialog::prepareWidgets()
     731{
     732    if (objectName().isEmpty())
     733        setObjectName(QStringLiteral("UISettingsDialog"));
     734    resize(550, 450);
     735    QWidget *pCentralWidget = new QWidget(this);
     736    pCentralWidget->setObjectName(QStringLiteral("pCentralWidget"));
     737    QGridLayout *pMainLayout = new QGridLayout(pCentralWidget);
     738    pMainLayout->setObjectName(QStringLiteral("pMainLayout"));
     739    m_pLabelTitle = new QLabel(pCentralWidget);
     740    m_pLabelTitle->setObjectName(QStringLiteral("m_pLabelTitle"));
     741    QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
     742    sizePolicy.setHorizontalStretch(0);
     743    sizePolicy.setVerticalStretch(0);
     744    sizePolicy.setHeightForWidth(m_pLabelTitle->sizePolicy().hasHeightForWidth());
     745    m_pLabelTitle->setSizePolicy(sizePolicy);
     746    QPalette palette;
     747    QBrush brush(QColor(255, 255, 255, 255));
     748    brush.setStyle(Qt::SolidPattern);
     749    palette.setBrush(QPalette::Active, QPalette::Window, brush);
     750    palette.setBrush(QPalette::Inactive, QPalette::Window, brush);
     751    palette.setBrush(QPalette::Disabled, QPalette::Window, brush);
     752    m_pLabelTitle->setPalette(palette);
     753    QFont font;
     754    font.setFamily(QStringLiteral("Sans Serif"));
     755    font.setPointSize(11);
     756    font.setBold(true);
     757    font.setWeight(75);
     758    m_pLabelTitle->setFont(font);
     759    m_pLabelTitle->setAutoFillBackground(true);
     760    m_pLabelTitle->setFrameShape(QFrame::Box);
     761    m_pLabelTitle->setFrameShadow(QFrame::Sunken);
     762    m_pLabelTitle->setMargin(7);
     763    pMainLayout->addWidget(m_pLabelTitle, 0, 1, 1, 1);
     764
     765    m_pWidgetStackHandler = new QWidget(pCentralWidget);
     766    m_pWidgetStackHandler->setObjectName(QStringLiteral("m_pWidgetStackHandler"));
     767    QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Expanding);
     768    sizePolicy1.setHorizontalStretch(0);
     769    sizePolicy1.setVerticalStretch(0);
     770    sizePolicy1.setHeightForWidth(m_pWidgetStackHandler->sizePolicy().hasHeightForWidth());
     771    m_pWidgetStackHandler->setSizePolicy(sizePolicy1);
     772    pMainLayout->addWidget(m_pWidgetStackHandler, 1, 1, 1, 1);
     773
     774    m_pButtonBox = new QIDialogButtonBox(pCentralWidget);
     775    m_pButtonBox->setObjectName(QStringLiteral("m_pButtonBox"));
     776    m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
     777    pMainLayout->addWidget(m_pButtonBox, 2, 0, 1, 2);
     778
     779    setCentralWidget(pCentralWidget);
     780
     781    QObject::connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UISettingsDialog::reject);
     782    QObject::connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UISettingsDialog::accept);
     783}
     784
    724785void UISettingsDialog::assignValidator(UISettingsPage *pPage)
    725786{
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h

    r82968 r85881  
    3030#include "QIWithRetranslateUI.h"
    3131#include "UISettingsDefs.h"
    32 #include "UISettingsDialog.gen.h"
    3332
    3433/* Forward declarations: */
    3534class QEvent;
    3635class QObject;
     36class QLabel;
    3737class QProgressBar;
    3838class QShowEvent;
    3939class QStackedWidget;
    4040class QTimer;
     41class QIDialogButtonBox;
    4142class UIPageValidator;
    4243class UISettingsPage;
     
    5051/** QIMainDialog aubclass used as
    5152  * base dialog class for both Global & VM settings which encapsulates most of their common functionality. */
    52 class SHARED_LIBRARY_STUFF UISettingsDialog : public QIWithRetranslateUI<QIMainDialog>, public Ui::UISettingsDialog
     53class SHARED_LIBRARY_STUFF UISettingsDialog : public QIWithRetranslateUI<QIMainDialog>
    5354{
    5455    Q_OBJECT;
     
    164165    /** Prepares all. */
    165166    void prepare();
    166 
     167    /** Prepares widgets. */
     168    void prepareWidgets();
    167169    /** Assigns validater for passed @a pPage. */
    168170    void assignValidator(UISettingsPage *pPage);
     
    209211    QList<QSize>  m_sizeList;
    210212#endif
     213
     214    /** @name Widgets
     215     * @{ */
     216       QLabel *m_pLabelTitle;
     217       QIDialogButtonBox *m_pButtonBox;
     218       QWidget *m_pWidgetStackHandler;
     219    /** @} */
    211220};
    212221
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