VirtualBox

Changeset 47616 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 8, 2013 4:23:33 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Settings dialog: Warning pane cleanup/rework.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r47461 r47616  
    387387        src/widgets/VBoxOSTypeSelectorButton.h \
    388388        src/widgets/UINameAndSystemEditor.h \
    389         src/widgets/VBoxWarningPane.h \
     389    src/widgets/UIWarningPane.h \
    390390        src/widgets/UIFilmContainer.h \
    391391        src/widgets/graphics/UIGraphicsButton.h \
     
    637637        src/widgets/VBoxOSTypeSelectorButton.cpp \
    638638        src/widgets/UINameAndSystemEditor.cpp \
    639         src/widgets/VBoxWarningPane.cpp \
     639    src/widgets/UIWarningPane.cpp \
    640640        src/widgets/UIFilmContainer.cpp \
    641641        src/widgets/graphics/UIGraphicsButton.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp

    r47595 r47616  
    2727/* Local includes */
    2828#include "UISettingsDialog.h"
    29 #include "VBoxWarningPane.h"
     29#include "UIWarningPane.h"
    3030#include "VBoxGlobal.h"
    3131#include "UIMessageCenter.h"
     
    6363    , m_fValid(true)
    6464    , m_fSilent(true)
    65     , m_pWarningPane(new VBoxWarningPane(this))
     65    , m_pWarningPane(new UIWarningPane(this))
    6666    /* Whats-this stuff: */
    6767    , m_pWhatsThisTimer(new QTimer(this))
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h

    r47595 r47616  
    3131class QStackedWidget;
    3232class QTimer;
    33 class VBoxWarningPane;
     33class UIWarningPane;
    3434class VBoxSettingsSelector;
    3535class UISettingsPage;
     
    143143    QString m_strErrorString;
    144144    QString m_strWarningString;
    145     VBoxWarningPane *m_pWarningPane;
     145    UIWarningPane *m_pWarningPane;
    146146
    147147    /* Whats-This stuff: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIWarningPane.cpp

    r47605 r47616  
    33 *
    44 * VBox frontends: Qt4 GUI ("VirtualBox"):
    5  * VBoxWarningPane class implementation
     5 * UIWarningPane class implementation
    66 */
    77
    88/*
    9  * Copyright (C) 2009-2011 Oracle Corporation
     9 * Copyright (C) 2009-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1818 */
    1919
    20 /* Global includes */
     20/* Qt includes: */
    2121#include <QHBoxLayout>
     22#include <QLabel>
    2223
    23 /* Local includes */
    24 #include "VBoxWarningPane.h"
     24/* GUI includes: */
     25#include "UIWarningPane.h"
    2526
    26 VBoxWarningPane::VBoxWarningPane(QWidget *pParent)
     27UIWarningPane::UIWarningPane(QWidget *pParent)
    2728    : QWidget(pParent)
     29    , m_pLabelIcon(0)
     30    , m_pLabelText(0)
    2831{
    29     QHBoxLayout *pLayout = new QHBoxLayout(this);
    30     pLayout->setContentsMargins(0, 0, 0, 0);
    31     pLayout->addWidget(&m_icon);
    32     pLayout->addWidget(&m_label);
     32    /* Prepare: */
     33    prepare();
    3334}
    3435
    35 void VBoxWarningPane::setWarningPixmap(const QPixmap &imgPixmap)
     36void UIWarningPane::setWarningPixmap(const QPixmap &pixmap)
    3637{
    37     m_icon.setPixmap(imgPixmap);
     38    m_pLabelIcon->setPixmap(pixmap);
    3839}
    3940
    40 void VBoxWarningPane::setWarningText(const QString &strText)
     41void UIWarningPane::setWarningText(const QString &strText)
    4142{
    42     m_label.setText(strText);
     43    m_pLabelText->setText(strText);
    4344}
    4445
     46void UIWarningPane::prepare()
     47{
     48    /* Prepare content: */
     49    prepareContent();
     50}
     51
     52void UIWarningPane::prepareContent()
     53{
     54    /* Create layout: */
     55    QHBoxLayout *pLayout = new QHBoxLayout(this);
     56    {
     57        /* Configure layout: */
     58        pLayout->setContentsMargins(0, 0, 0, 0);
     59        /* Create icon label: */
     60        m_pLabelIcon = new QLabel;
     61        /* Create text label: */
     62        m_pLabelText = new QLabel;
     63        /* Add widgets into layout: */
     64        pLayout->addWidget(m_pLabelIcon);
     65        pLayout->addWidget(m_pLabelText);
     66    }
     67}
     68
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIWarningPane.h

    r47605 r47616  
    22 *
    33 * VBox frontends: Qt4 GUI ("VirtualBox"):
    4  * VBoxWarningPane class declaration
     4 * UIWarningPane class declaration
    55 */
    66
    77/*
    8  * Copyright (C) 2009-2010 Oracle Corporation
     8 * Copyright (C) 2009-2013 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1717 */
    1818
    19 #ifndef __VBoxWarningPane_h__
    20 #define __VBoxWarningPane_h__
     19#ifndef __UIWarningPane_h__
     20#define __UIWarningPane_h__
    2121
    2222/* Global includes */
    2323#include <QWidget>
    24 #include <QLabel>
    2524
    26 class VBoxWarningPane: public QWidget
     25/* Forward declarations: */
     26class QLabel;
     27
     28/* Warning-pane prototype: */
     29class UIWarningPane: public QWidget
    2730{
    2831    Q_OBJECT;
     
    3033public:
    3134
    32     VBoxWarningPane(QWidget *pParent = 0);
     35    /* Constructor: */
     36    UIWarningPane(QWidget *pParent = 0);
    3337
    34     void setWarningPixmap(const QPixmap &imgPixmap);
     38    /* API: Warning stuff: */
     39    void setWarningPixmap(const QPixmap &pixmap);
    3540    void setWarningText(const QString &strText);
    3641
    3742private:
    3843
    39     QLabel m_icon;
    40     QLabel m_label;
     44    /* Helpers: Prepare stuff: */
     45    void prepare();
     46    void prepareContent();
     47
     48    /* Variables: Widgets: */
     49    QLabel *m_pLabelIcon;
     50    QLabel *m_pLabelText;
    4151};
    4252
    43 #endif // __VBoxWarningPane_h__
    44 
     53#endif /* __UIWarningPane_h__ */
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