VirtualBox

Ignore:
Timestamp:
Aug 3, 2017 11:50:39 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8900: UIDesktopPane: A possibility to assign welcome icon (picture).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIDesktopPane.cpp

    r68246 r68281  
    3636# include "QIWithRetranslateUI.h"
    3737# include "UIDesktopPane.h"
    38 # include "UIIconPool.h"
    3938# include "VBoxUtils.h"
    4039
     
    141140    /** Defines a tools pane welcome @a strText. */
    142141    void setToolsPaneText(const QString &strText);
     142    /** Defines a tools pane welcome @a icon. */
     143    void setToolsPaneIcon(const QIcon &icon);
    143144    /** Add a tool element.
    144145      * @param  pAction         Brings tool action reference.
     
    183184    /** Holds the tools pane text label instance. */
    184185    QILabel     *m_pLabelToolsPaneText;
     186    /** Holds the tools pane icon label instance. */
     187    QLabel      *m_pLabelToolsPaneIcon;
    185188};
    186189
     
    467470    , m_pErrBox(0), m_pErrLabel(0), m_pErrText(0)
    468471    , m_pRefreshButton(0), m_pRefreshAction(pRefreshAction)
    469     , m_pToolsPane(0), m_pLayoutWidget(0), m_pLabelToolsPaneText(0)
     472    , m_pToolsPane(0), m_pLayoutWidget(0), m_pLabelToolsPaneText(0), m_pLabelToolsPaneIcon(0)
    470473{
    471474    /* Translate finally: */
     
    504507    /* Assign corresponding text: */
    505508    m_pLabelToolsPaneText->setText(strText);
     509
     510    /* Raise corresponding widget: */
     511    setCurrentWidget(m_pToolsPane);
     512}
     513
     514void UIDesktopPanePrivate::setToolsPaneIcon(const QIcon &icon)
     515{
     516    /* Prepare tools pane if necessary: */
     517    prepareToolsPane();
     518
     519    /* Assign corresponding icon: */
     520    m_pLabelToolsPaneIcon->setPixmap(icon.pixmap(QSize(200, 200)));
    506521
    507522    /* Raise corresponding widget: */
     
    675690                }
    676691
    677                 /* Create picture label: */
    678                 QLabel *pLabelPicture = new QLabel;
    679                 AssertPtrReturnVoid(pLabelPicture);
     692                /* Create welcome picture label: */
     693                m_pLabelToolsPaneIcon = new QLabel;
     694                AssertPtrReturnVoid(m_pLabelToolsPaneIcon);
    680695                {
    681696                    /* Configure label: */
    682                     const QIcon icon = UIIconPool::iconSet(":/tools_200px.png");
    683                     pLabelPicture->setPixmap(icon.pixmap(QSize(200, 200)));
    684                     pLabelPicture->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
     697                    m_pLabelToolsPaneIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    685698
    686699                    /* Add into layout: */
    687                     pLayoutWelcome->addWidget(pLabelPicture);
    688                     pLayoutWelcome->setAlignment(pLabelPicture, Qt::AlignHCenter | Qt::AlignTop);
     700                    pLayoutWelcome->addWidget(m_pLabelToolsPaneIcon);
     701                    pLayoutWelcome->setAlignment(m_pLabelToolsPaneIcon, Qt::AlignHCenter | Qt::AlignTop);
    689702                }
    690703
     
    744757}
    745758
     759void UIDesktopPane::setToolsPaneIcon(const QIcon &icon)
     760{
     761    m_pDesktopPrivate->setToolsPaneIcon(icon);
     762}
     763
    746764void UIDesktopPane::addToolDescription(QAction *pAction, const QString &strDescription)
    747765{
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIDesktopPane.h

    r68235 r68281  
    2424/* Forward declarations: */
    2525class QAction;
     26class QIcon;
     27class QString;
    2628class UIDesktopPanePrivate;
    2729
     
    4850    /** Defines a tools pane welcome @a strText. */
    4951    void setToolsPaneText(const QString &strText);
     52    /** Defines a tools pane welcome @a icon. */
     53    void setToolsPaneIcon(const QIcon &icon);
    5054    /** Add a tool element.
    5155      * @param  pAction         Brings tool action reference.
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneGlobal.cpp

    r68235 r68281  
    2727# include "UIActionPoolSelector.h"
    2828# include "UIDesktopPane.h"
     29# include "UIHostNetworkManager.h"
     30# include "UIIconPool.h"
    2931# include "UIMediumManager.h"
    30 # include "UIHostNetworkManager.h"
    3132# include "UIToolsPaneGlobal.h"
    3233
     
    183184{
    184185    /* Translate Global Tools welcome screen: */
    185     setDetailsText(
     186    m_pPaneDesktop->setToolsPaneIcon(UIIconPool::iconSet(":/tools_200px.png"));
     187    m_pPaneDesktop->setToolsPaneText(
    186188        tr("<h3>Welcome to VirtualBox!</h3>"
    187189           "<p>This window represents a set of global tools "
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.cpp

    r68235 r68281  
    2828# include "UIDesktopPane.h"
    2929# include "UIGDetails.h"
     30# include "UIIconPool.h"
    3031# include "UISnapshotPane.h"
    3132# include "UIToolsPaneMachine.h"
     
    201202{
    202203    /* Translate Machine Tools welcome screen: */
    203     setDetailsText(
     204    m_pPaneDesktop->setToolsPaneIcon(UIIconPool::iconSet(":/tools_200px.png"));
     205    m_pPaneDesktop->setToolsPaneText(
    204206        tr("<h3>Welcome to VirtualBox!</h3>"
    205207           "<p>The left part of this window is a list of all virtual "
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