VirtualBox

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


Ignore:
Timestamp:
Jun 20, 2011 6:19:31 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72385
Message:

FE/Qt: 4029: Allow to set http proxy information: Fields completeness validation added.

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

Legend:

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

    r37546 r37548  
    2222
    2323/* Local includes */
     24#include "QIWidgetValidator.h"
    2425#include "UIGlobalSettingsProxy.h"
    2526#include "VBoxUtils.h"
     
    2728/* General page constructor: */
    2829UIGlobalSettingsProxy::UIGlobalSettingsProxy()
     30    : m_pValidator(0)
    2931{
    3032    /* Apply UI decorations: */
     
    3335    /* Setup widgets: */
    3436    m_pPortEditor->setFixedWidthByText(QString().fill('0', 6));
    35     m_pHostEditor->setValidator(new QRegExpValidator(QRegExp("\\S*"), m_pPortEditor));
    36     m_pPortEditor->setValidator(new QRegExpValidator(QRegExp("\\d*"), m_pPortEditor));
    37     m_pLoginEditor->setValidator(new QRegExpValidator(QRegExp("\\S*"), m_pPortEditor));
    38     m_pPasswordEditor->setValidator(new QRegExpValidator(QRegExp("\\S*"), m_pPortEditor));
     37    m_pHostEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pHostEditor));
     38    m_pPortEditor->setValidator(new QRegExpValidator(QRegExp("\\d+"), m_pPortEditor));
     39    m_pLoginEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pLoginEditor));
     40    m_pPasswordEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pPasswordEditor));
    3941
    4042    /* Setup connections: */
     
    113115}
    114116
     117/* Validation stuff: */
     118void UIGlobalSettingsProxy::setValidator(QIWidgetValidator *pValidator)
     119{
     120    m_pValidator = pValidator;
     121}
     122
    115123/* Navigation stuff: */
    116124void UIGlobalSettingsProxy::setOrderAfter(QWidget *pWidget)
     
    133141void UIGlobalSettingsProxy::sltProxyToggled()
    134142{
     143    /* Update widgets availability: */
    135144    m_pHostLabel->setEnabled(m_pProxyCheckbox->isChecked());
    136145    m_pHostEditor->setEnabled(m_pProxyCheckbox->isChecked());
     
    138147    m_pPortEditor->setEnabled(m_pProxyCheckbox->isChecked());
    139148    m_pAuthCheckbox->setEnabled(m_pProxyCheckbox->isChecked());
     149
     150    /* Update auth widgets also: */
    140151    sltAuthToggled();
    141152}
     
    143154void UIGlobalSettingsProxy::sltAuthToggled()
    144155{
     156    /* Update widgets availability: */
    145157    m_pLoginLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());
    146158    m_pLoginEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());
    147159    m_pPasswordLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());
    148160    m_pPasswordEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());
     161
     162    /* Revalidate if possible: */
     163    if (m_pValidator)
     164        m_pValidator->revalidate();
    149165}
    150166
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.h

    r37544 r37548  
    6262    void saveFromCacheTo(QVariant &data);
    6363
     64    /* Validation stuff: */
     65    void setValidator(QIWidgetValidator *pValidator);
     66
    6467    /* Navigation stuff: */
    6568    void setOrderAfter(QWidget *pWidget);
     
    7578private:
    7679
     80    /* Validator: */
     81    QIWidgetValidator *m_pValidator;
     82
    7783    /* Cache: */
    7884    UISettingsCacheGlobalProxy m_cache;
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