VirtualBox

Changeset 57608 in vbox


Ignore:
Timestamp:
Sep 3, 2015 11:44:27 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
102475
Message:

FE/Qt: About-VirtualBox Dialog: Rework/Cleanup and review comments implementation.

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

Legend:

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

    r57551 r57608  
    4242    : QIWithRetranslateUI2<QIDialog>(pParent)
    4343    , m_strVersion(strVersion)
     44    , m_pLabel(0)
    4445{
    4546    /* Prepare: */
     
    4950bool VBoxAboutDlg::event(QEvent *pEvent)
    5051{
     52    /* Set fixed-size for dialog: */
    5153    if (pEvent->type() == QEvent::Polish)
    5254        setFixedSize(m_size);
     55    /* Call to base-class: */
    5356    return QIDialog::event(pEvent);
    5457}
     
    5760{
    5861    QPainter painter(this);
     62    /* Draw About-VirtualBox background image: */
    5963    painter.drawPixmap(0, 0, m_pixmap);
    6064}
     
    6367{
    6468    setWindowTitle(tr("VirtualBox - About"));
    65     QString strAboutText = tr("VirtualBox Graphical User Interface");
     69    const QString strAboutText = tr("VirtualBox Graphical User Interface");
    6670#ifdef VBOX_BLEEDING_EDGE
    67     QString strVersionText = "EXPERIMENTAL build %1 - " + QString(VBOX_BLEEDING_EDGE);
    68 #else
    69     QString strVersionText = tr("Version %1");
    70 #endif
     71    const QString strVersionText = "EXPERIMENTAL build %1 - " + QString(VBOX_BLEEDING_EDGE);
     72#else /* !VBOX_BLEEDING_EDGE */
     73    const QString strVersionText = tr("Version %1");
     74#endif /* !VBOX_BLEEDING_EDGE */
    7175#if VBOX_OSE
    7276    m_strAboutText = strAboutText + " " + strVersionText.arg(m_strVersion) + "\n" +
    7377                     QString("%1 2004-" VBOX_C_YEAR " " VBOX_VENDOR).arg(QChar(0xa9));
    74 #else /* VBOX_OSE */
     78#else /* !VBOX_OSE */
    7579    m_strAboutText = strAboutText + "\n" + strVersionText.arg(m_strVersion);
    76 #endif /* VBOX_OSE */
     80#endif /* !VBOX_OSE */
    7781    m_strAboutText = m_strAboutText + "\n" + QString("Copyright %1 2015 Oracle and/or its affiliates. All rights reserved.").arg(QChar(0xa9));
     82    AssertPtrReturnVoid(m_pLabel);
    7883    m_pLabel->setText(m_strAboutText);
    7984}
     
    8893
    8994    /* Branding: Use a custom about splash picture if set: */
    90     QString strSplash = vboxGlobal().brandingGetKey("UI/AboutSplash");
     95    const QString strSplash = vboxGlobal().brandingGetKey("UI/AboutSplash");
    9196    if (vboxGlobal().brandingIsActive() && !strSplash.isEmpty())
    9297    {
     
    99104
    100105    /* Load image: */
    101     QIcon icon = UIIconPool::iconSet(strPath);
     106    const QIcon icon = UIIconPool::iconSet(strPath);
    102107    m_size = icon.availableSizes().first();
    103108    m_pixmap = icon.pixmap(m_size);
    104109
    105     /* Prepare main-layout: */
     110    /* Prepares main-layout: */
    106111    prepareMainLayout();
    107112
     
    121126        {
    122127            /* Prepare label for version text: */
    123 
    124128            QPalette palette;
    125129            /* Branding: Set a different text color (because splash also could be white),
    126130             * otherwise use white as default color: */
    127             QString strColor = vboxGlobal().brandingGetKey("UI/AboutTextColor");
     131            const QString strColor = vboxGlobal().brandingGetKey("UI/AboutTextColor");
    128132            if (!strColor.isEmpty())
    129133                palette.setColor(QPalette::WindowText, QColor(strColor).name());
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxAboutDlg.h

    r57551 r57608  
    4040    /** Constructs dialog passing @a pParent to the QWidget base-class constructor.
    4141      * @param strVersion is used to specify the version number of VirtualBox. */
    42     VBoxAboutDlg(QWidget* pParent, const QString &strVersion);
     42    VBoxAboutDlg(QWidget *pParent, const QString &strVersion);
    4343
    4444protected:
    4545
    46     /** Handles Qt polish event. */
     46    /** Handles any Qt @a pEvent. */
    4747    bool event(QEvent *pEvent);
    4848
    49     /** Handles Qt paint-event to draw About-VirtualBox image. */
     49    /** Handles Qt paint @a pEvent. */
    5050    void paintEvent(QPaintEvent *pEvent);
    5151
     
    5555private:
    5656
    57     /** Prepare About-VirtualBox dialog. */
     57    /** Prepares About-VirtualBox dialog. */
    5858    void prepare();
    5959
    60     /** Prepare main-layout routine. */
     60    /** Prepares main-layout. */
    6161    void prepareMainLayout();
    6262
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