Changeset 85881 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 24, 2020 6:48:40 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 140055
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r85822 r85881 20 20 TEMPLATE = app 21 21 LANGUAGE = C++ 22 23 FORMS = \24 src/settings/UISettingsDialog.ui25 22 26 23 TRANSLATIONS = \ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r85644 r85881 29 29 # include <QRegExp> 30 30 #endif 31 # include <QVBoxLayout> 31 32 32 33 /* GUI includes: */ 34 #include "QIDialogButtonBox.h" 33 35 #include "QIFileDialog.h" 34 36 #include "UIActionPoolManager.h" -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r82968 r85881 18 18 /* Qt includes: */ 19 19 #include <QCloseEvent> 20 #include <QGridLayout> 21 #include <QLabel> 20 22 #include <QProgressBar> 21 23 #include <QPushButton> … … 24 26 25 27 /* GUI includes: */ 28 #include "QIDialogButtonBox.h" 26 29 #include "QIWidgetValidator.h" 27 30 #include "UICommon.h" … … 61 64 , m_fSilent(true) 62 65 , m_pWhatsThisTimer(new QTimer(this)) 66 , m_pLabelTitle(0) 67 , m_pButtonBox(0) 68 , m_pWidgetStackHandler(0) 63 69 { 64 70 /* Prepare: */ … … 151 157 setWindowTitle(title()); 152 158 #else 153 m_pL bTitle->setText(m_pSelector->itemText(cId));159 m_pLabelTitle->setText(m_pSelector->itemText(cId)); 154 160 #endif 155 161 } … … 241 247 void UISettingsDialog::retranslateUi() 242 248 { 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()); 245 252 246 253 /* Translate warning stuff: */ … … 251 258 #ifndef VBOX_GUI_WITH_TOOLBAR_SETTINGS 252 259 /* Retranslate current page headline: */ 253 m_pL bTitle->setText(m_pSelector->itemText(m_pSelector->currentId()));260 m_pLabelTitle->setText(m_pSelector->itemText(m_pSelector->currentId())); 254 261 #endif 255 262 … … 589 596 void UISettingsDialog::prepare() 590 597 { 591 /* Apply UI decorations: */ 592 Ui::UISettingsDialog::setupUi(this); 598 prepareWidgets(); 593 599 594 600 /* Configure title: */ 595 if (m_pL bTitle)601 if (m_pLabelTitle) 596 602 { 597 603 /* Page-title font is bold and larger but derived from the system font: */ … … 599 605 pageTitleFont.setBold(true); 600 606 pageTitleFont.setPointSize(pageTitleFont.pointSize() + 2); 601 m_pL bTitle->setFont(pageTitleFont);607 m_pLabelTitle->setFont(pageTitleFont); 602 608 } 603 609 … … 609 615 610 616 /* No page-title with tool-bar: */ 611 m_pL bTitle->hide();617 m_pLabelTitle->hide(); 612 618 613 619 /* Create modern tool-bar selector: */ … … 645 651 646 652 /* Prepare stack-handler: */ 647 if (m_pW tStackHandler)653 if (m_pWidgetStackHandler) 648 654 { 649 655 /* Create page-stack layout: */ 650 QVBoxLayout *pStackLayout = new QVBoxLayout(m_pW tStackHandler);656 QVBoxLayout *pStackLayout = new QVBoxLayout(m_pWidgetStackHandler); 651 657 if (pStackLayout) 652 658 { … … 722 728 } 723 729 730 void 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 724 785 void UISettingsDialog::assignValidator(UISettingsPage *pPage) 725 786 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r82968 r85881 30 30 #include "QIWithRetranslateUI.h" 31 31 #include "UISettingsDefs.h" 32 #include "UISettingsDialog.gen.h"33 32 34 33 /* Forward declarations: */ 35 34 class QEvent; 36 35 class QObject; 36 class QLabel; 37 37 class QProgressBar; 38 38 class QShowEvent; 39 39 class QStackedWidget; 40 40 class QTimer; 41 class QIDialogButtonBox; 41 42 class UIPageValidator; 42 43 class UISettingsPage; … … 50 51 /** QIMainDialog aubclass used as 51 52 * 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::UISettingsDialog53 class SHARED_LIBRARY_STUFF UISettingsDialog : public QIWithRetranslateUI<QIMainDialog> 53 54 { 54 55 Q_OBJECT; … … 164 165 /** Prepares all. */ 165 166 void prepare(); 166 167 /** Prepares widgets. */ 168 void prepareWidgets(); 167 169 /** Assigns validater for passed @a pPage. */ 168 170 void assignValidator(UISettingsPage *pPage); … … 209 211 QList<QSize> m_sizeList; 210 212 #endif 213 214 /** @name Widgets 215 * @{ */ 216 QLabel *m_pLabelTitle; 217 QIDialogButtonBox *m_pButtonBox; 218 QWidget *m_pWidgetStackHandler; 219 /** @} */ 211 220 }; 212 221
Note:
See TracChangeset
for help on using the changeset viewer.