VirtualBox

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


Ignore:
Timestamp:
Aug 25, 2023 11:37:51 AM (16 months ago)
Author:
vboxsync
Message:

FE/Qt: UISettingsDialog: Adjusting UISettingsWarningPane to have more obvious show/hide API; S.a. r158899.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings
Files:
3 edited

Legend:

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

    r100961 r100967  
    193193#endif
    194194
    195     /* Translate warning stuff: */
    196     m_strWarningHint = tr("Invalid settings detected");
    197     if (!m_fValid || !m_fSilent)
    198         m_pWarningPane->setWarningLabel(m_strWarningHint);
     195    /* Translate warning-pane stuff: */
     196    m_pWarningPane->setWarningLabelText(tr("Invalid settings detected"));
    199197
    200198    /* Retranslate all validators: */
     
    493491    m_fValid = true;
    494492    m_fSilent = true;
    495     m_pWarningPane->setWarningLabel(QString());
    496493
    497494    /* Enumerating all the validators we have: */
     
    514511                m_fSilent = false;
    515512
    516             /* Configure warning-pane label: */
    517             m_pWarningPane->setWarningLabel(m_strWarningHint);
    518 
    519513            /* Stop dialog revalidation on first error/warning: */
    520514            break;
    521515        }
    522516    }
     517
     518    /* Update warning-pane visibility: */
     519    m_pWarningPane->setWarningLabelVisible(!m_fValid || !m_fSilent);
    523520
    524521    /* Make sure warning-pane visible if necessary: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsWarningPane.cpp

    r100961 r100967  
    5050}
    5151
    52 void UISettingsWarningPane::setWarningLabel(const QString &strWarningLabel)
    53 {
    54     /* Assign passed text directly to warning-label: */
    55     m_pTextLabel->setText(strWarningLabel);
     52void UISettingsWarningPane::setWarningLabelText(const QString &strText)
     53{
     54    m_pTextLabel->setText(strText);
     55}
     56
     57void UISettingsWarningPane::setWarningLabelVisible(bool fVisible)
     58{
     59    m_pTextLabel->setVisible(fVisible);
    5660}
    5761
     
    175179        m_pTextLabel = new QLabel;
    176180        {
    177             /* Add into layout: */
     181            m_pTextLabel->setVisible(false);
    178182            pMainLayout->addWidget(m_pTextLabel);
    179183        }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsWarningPane.h

    r100961 r100967  
    6868    UISettingsWarningPane(QWidget *pParent = 0);
    6969
    70     /** Defines current @a strWarningLabel text. */
    71     void setWarningLabel(const QString &strWarningLabel);
     70    /** Defines current warning-label @a strText. */
     71    void setWarningLabelText(const QString &strText);
     72    /** Defines whether warning-label should be @a fVisible. */
     73    void setWarningLabelVisible(bool fVisible);
    7274
    7375    /** Registers corresponding @a pValidator. */
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