VirtualBox

Changeset 47196 in vbox


Ignore:
Timestamp:
Jul 16, 2013 3:08:55 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Global preferences: *Proxy* page cleanup/rework.

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

Legend:

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

    r43695 r47196  
    3737    m_pHostEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pHostEditor));
    3838    m_pPortEditor->setValidator(new QRegExpValidator(QRegExp("\\d+"), m_pPortEditor));
    39 #if 0
    40     m_pLoginEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pLoginEditor));
    41     m_pPasswordEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pPasswordEditor));
    42 #else
    43     m_pLoginLabel->hide();
    44     m_pLoginEditor->hide();
    45     m_pPasswordLabel->hide();
    46     m_pPasswordEditor->hide();
    47 #endif
    4839
    4940    /* Setup connections: */
    50     connect(m_pProxyCheckbox, SIGNAL(stateChanged(int)), this, SLOT(sltProxyToggled()));
    51 #if 0
    52     connect(m_pAuthCheckbox, SIGNAL(stateChanged(int)), this, SLOT(sltAuthToggled()));
    53 #else
    54     m_pAuthCheckbox->hide();
    55 #endif
     41    connect(m_pCheckboxProxy, SIGNAL(toggled(bool)), this, SLOT(sltProxyToggled()));
    5642
    5743    /* Apply language settings: */
     
    7157    m_cache.m_strProxyHost = proxyManager.proxyHost();
    7258    m_cache.m_strProxyPort = proxyManager.proxyPort();
    73 #if 0
    74     m_cache.m_fAuthEnabled = proxyManager.authEnabled();
    75     m_cache.m_strAuthLogin = proxyManager.authLogin();
    76     m_cache.m_strAuthPassword = proxyManager.authPassword();
    77 #endif
    7859
    7960    /* Upload properties & settings to data: */
     
    8667{
    8768    /* Fetch from cache: */
    88     m_pProxyCheckbox->setChecked(m_cache.m_fProxyEnabled);
     69    m_pCheckboxProxy->setChecked(m_cache.m_fProxyEnabled);
    8970    m_pHostEditor->setText(m_cache.m_strProxyHost);
    9071    m_pPortEditor->setText(m_cache.m_strProxyPort);
    91 #if 0
    92     m_pAuthCheckbox->setChecked(m_cache.m_fAuthEnabled);
    93     m_pLoginEditor->setText(m_cache.m_strAuthLogin);
    94     m_pPasswordEditor->setText(m_cache.m_strAuthPassword);
    95 #endif
    9672    sltProxyToggled();
    9773}
     
    10278{
    10379    /* Upload to cache: */
    104     m_cache.m_fProxyEnabled = m_pProxyCheckbox->isChecked();
     80    m_cache.m_fProxyEnabled = m_pCheckboxProxy->isChecked();
    10581    m_cache.m_strProxyHost = m_pHostEditor->text();
    10682    m_cache.m_strProxyPort = m_pPortEditor->text();
    107 #if 0
    108     m_cache.m_fAuthEnabled = m_pAuthCheckbox->isChecked();
    109     m_cache.m_strAuthLogin = m_pLoginEditor->text();
    110     m_cache.m_strAuthPassword = m_pPasswordEditor->text();
    111 #endif
    11283}
    11384
     
    12394    proxyManager.setProxyHost(m_cache.m_strProxyHost);
    12495    proxyManager.setProxyPort(m_cache.m_strProxyPort);
    125 #if 0
    126     proxyManager.setAuthEnabled(m_cache.m_fAuthEnabled);
    127     proxyManager.setAuthLogin(m_cache.m_strAuthLogin);
    128     proxyManager.setAuthPassword(m_cache.m_strAuthPassword);
    129 #endif
    13096    m_settings.setProxySettings(proxyManager.toString());
    13197
     
    134100}
    135101
    136 /* Validation stuff: */
    137102void UIGlobalSettingsProxy::setValidator(QIWidgetValidator *pValidator)
    138103{
     104    /* Configure validation: */
    139105    m_pValidator = pValidator;
    140106}
    141107
    142 /* Navigation stuff: */
    143108void UIGlobalSettingsProxy::setOrderAfter(QWidget *pWidget)
    144109{
    145     setTabOrder(pWidget, m_pProxyCheckbox);
    146     setTabOrder(m_pProxyCheckbox, m_pHostEditor);
     110    /* Configure navigation: */
     111    setTabOrder(pWidget, m_pCheckboxProxy);
     112    setTabOrder(m_pCheckboxProxy, m_pHostEditor);
    147113    setTabOrder(m_pHostEditor, m_pPortEditor);
    148 #if 0
    149     setTabOrder(m_pPortEditor, m_pAuthCheckbox);
    150     setTabOrder(m_pAuthCheckbox, m_pLoginEditor);
    151     setTabOrder(m_pLoginEditor, m_pPasswordEditor);
    152 #endif
    153114}
    154115
    155 /* Translation stuff: */
    156116void UIGlobalSettingsProxy::retranslateUi()
    157117{
     
    163123{
    164124    /* Update widgets availability: */
    165     m_pHostLabel->setEnabled(m_pProxyCheckbox->isChecked());
    166     m_pHostEditor->setEnabled(m_pProxyCheckbox->isChecked());
    167     m_pPortLabel->setEnabled(m_pProxyCheckbox->isChecked());
    168     m_pPortEditor->setEnabled(m_pProxyCheckbox->isChecked());
    169 #if 0
    170     m_pAuthCheckbox->setEnabled(m_pProxyCheckbox->isChecked());
    171 
    172     /* Update auth widgets also: */
    173     sltAuthToggled();
    174 #endif
     125    m_pContainerProxy->setEnabled(m_pCheckboxProxy->isChecked());
    175126
    176127    /* Revalidate if possible: */
     
    179130}
    180131
    181 #if 0
    182 void UIGlobalSettingsProxy::sltAuthToggled()
    183 {
    184     /* Update widgets availability: */
    185     m_pLoginLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());
    186     m_pLoginEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());
    187     m_pPasswordLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());
    188     m_pPasswordEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());
    189 }
    190 #endif
    191 
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.h

    r43678 r47196  
    2929    UISettingsCacheGlobalProxy()
    3030        : m_fProxyEnabled(false)
    31 #if 0
    32         , m_fAuthEnabled(false)
    33 #endif
    3431    {}
    3532    bool m_fProxyEnabled;
    3633    QString m_strProxyHost;
    3734    QString m_strProxyPort;
    38 #if 0
    39     bool m_fAuthEnabled;
    40     QString m_strAuthLogin;
    41     QString m_strAuthPassword;
    42 #endif
    4335};
    4436
     
    6961    void saveFromCacheTo(QVariant &data);
    7062
    71     /* Validation stuff: */
     63    /* Helper: Validation stuff: */
    7264    void setValidator(QIWidgetValidator *pValidator);
    7365
    74     /* Navigation stuff: */
     66    /* Helper: Navigation stuff: */
    7567    void setOrderAfter(QWidget *pWidget);
    7668
    77     /* Translation stuff: */
     69    /* Helper: Translation stuff: */
    7870    void retranslateUi();
    7971
    8072private slots:
    8173
     74    /* Handler: Proxy-checkbox stuff: */
    8275    void sltProxyToggled();
    83 #if 0
    84     void sltAuthToggled();
    85 #endif
    8676
    8777private:
    8878
    89     /* Validator: */
     79    /* Variable: Validation stuff: */
    9080    QIWidgetValidator *m_pValidator;
    9181
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.ui

    r43106 r47196  
    33 VBox frontends: Qt4 GUI ("VirtualBox"):
    44
    5  Copyright (C) 2011-2012 Oracle Corporation
     5 Copyright (C) 2011-2013 Oracle Corporation
    66
    77 This file is part of VirtualBox Open Source Edition (OSE), as
     
    1515 <class>UIGlobalSettingsProxy</class>
    1616 <widget class="QWidget" name="UIGlobalSettingsProxy">
    17   <property name="geometry">
    18    <rect>
    19     <x>0</x>
    20     <y>0</y>
    21     <width>300</width>
    22     <height>150</height>
    23    </rect>
    24   </property>
    2517  <layout class="QGridLayout">
    2618   <property name="margin">
    2719    <number>0</number>
    2820   </property>
    29    <item row="0" column="0">
     21   <item row="0" column="0" colspan="2">
     22    <widget class="QCheckBox" name="m_pCheckboxProxy">
     23     <property name="whatsThis">
     24      <string>When checked, VirtualBox will use the proxy settings supplied for tasks like downloading Guest Additions from the network or checking for updates.</string>
     25     </property>
     26     <property name="text">
     27      <string>&amp;Enable proxy</string>
     28     </property>
     29    </widget>
     30   </item>
     31   <item row="1" column="0">
    3032    <spacer>
    3133     <property name="orientation">
     
    3739     <property name="sizeHint">
    3840      <size>
    39        <width>40</width>
    40        <height>20</height>
    41       </size>
    42      </property>
    43     </spacer>
    44    </item>
    45    <item row="0" column="1" colspan="4">
    46     <widget class="QCheckBox" name="m_pProxyCheckbox">
    47      <property name="whatsThis">
    48       <string>When checked, VirtualBox will use the proxy settings supplied for tasks like downloading Guest Additions from the network or checking for updates.</string>
    49      </property>
    50      <property name="text">
    51       <string>&amp;Enable proxy</string>
    52      </property>
    53      <property name="checked">
    54       <bool>false</bool>
    55      </property>
    56     </widget>
    57    </item>
    58    <item row="1" column="1">
    59     <spacer>
    60      <property name="orientation">
    61       <enum>Qt::Horizontal</enum>
    62      </property>
    63      <property name="sizeType">
    64       <enum>QSizePolicy::Fixed</enum>
    65      </property>
    66      <property name="sizeHint">
    67       <size>
    68        <width>16</width>
     41       <width>20</width>
    6942       <height>0</height>
    7043      </size>
     
    7245    </spacer>
    7346   </item>
    74    <item row="1" column="2" colspan="3">
    75     <layout class="QHBoxLayout">
    76      <property name="margin">
    77       <number>0</number>
     47   <item row="1" column="1" colspan="2">
     48    <widget class="QWidget" name="m_pContainerProxy">
     49     <property name="sizePolicy">
     50      <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding">
     51       <horstretch>1</horstretch>
     52       <verstretch>0</verstretch>
     53      </sizepolicy>
    7854     </property>
    79      <item>
    80       <widget class="QLabel" name="m_pHostLabel">
    81        <property name="text">
    82         <string>Ho&amp;st:</string>
    83        </property>
    84        <property name="alignment">
    85         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    86        </property>
    87        <property name="buddy">
    88         <cstring>m_pHostEditor</cstring>
    89        </property>
    90       </widget>
    91      </item>
    92      <item>
    93       <widget class="QILineEdit" name="m_pHostEditor">
    94        <property name="whatsThis">
    95         <string>Changes the proxy host.</string>
    96        </property>
    97       </widget>
    98      </item>
    99      <item>
    100       <widget class="QLabel" name="m_pPortLabel">
    101        <property name="text">
    102         <string>&amp;Port:</string>
    103        </property>
    104        <property name="alignment">
    105         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    106        </property>
    107        <property name="buddy">
    108         <cstring>m_pPortEditor</cstring>
    109        </property>
    110       </widget>
    111      </item>
    112      <item>
    113       <widget class="QILineEdit" name="m_pPortEditor">
    114        <property name="whatsThis">
    115         <string>Changes the proxy port.</string>
    116        </property>
    117       </widget>
    118      </item>
    119     </layout>
    120    </item>
    121    <item row="2" column="2" colspan="3">
    122     <widget class="QCheckBox" name="m_pAuthCheckbox">
    123      <property name="whatsThis">
    124       <string>When checked the authentication supplied will be used with the proxy server.</string>
    125      </property>
    126      <property name="text">
    127       <string>&amp;Use authentication</string>
    128      </property>
    129      <property name="checked">
    130       <bool>false</bool>
    131      </property>
     55     <layout class="QHBoxLayout">
     56      <property name="margin">
     57       <number>0</number>
     58      </property>
     59      <item>
     60       <widget class="QLabel" name="m_pHostLabel">
     61        <property name="text">
     62         <string>Ho&amp;st:</string>
     63        </property>
     64        <property name="alignment">
     65         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     66        </property>
     67        <property name="buddy">
     68         <cstring>m_pHostEditor</cstring>
     69        </property>
     70       </widget>
     71      </item>
     72      <item>
     73       <widget class="QILineEdit" name="m_pHostEditor">
     74        <property name="whatsThis">
     75         <string>Changes the proxy host.</string>
     76        </property>
     77       </widget>
     78      </item>
     79      <item>
     80       <widget class="QLabel" name="m_pPortLabel">
     81        <property name="text">
     82         <string>&amp;Port:</string>
     83        </property>
     84        <property name="alignment">
     85         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     86        </property>
     87        <property name="buddy">
     88         <cstring>m_pPortEditor</cstring>
     89        </property>
     90       </widget>
     91      </item>
     92      <item>
     93       <widget class="QILineEdit" name="m_pPortEditor">
     94        <property name="whatsThis">
     95         <string>Changes the proxy port.</string>
     96        </property>
     97       </widget>
     98      </item>
     99     </layout>
    132100    </widget>
    133101   </item>
    134    <item row="3" column="2" rowspan="2">
    135     <spacer>
    136      <property name="orientation">
    137       <enum>Qt::Horizontal</enum>
    138      </property>
    139      <property name="sizeType">
    140       <enum>QSizePolicy::Fixed</enum>
    141      </property>
    142      <property name="sizeHint">
    143       <size>
    144        <width>16</width>
    145        <height>0</height>
    146       </size>
    147      </property>
    148     </spacer>
    149    </item>
    150    <item row="3" column="3">
    151     <widget class="QLabel" name="m_pLoginLabel">
    152      <property name="text">
    153       <string>User &amp;name:</string>
    154      </property>
    155      <property name="alignment">
    156       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    157      </property>
    158      <property name="buddy">
    159       <cstring>m_pLoginEditor</cstring>
    160      </property>
    161     </widget>
    162    </item>
    163    <item row="3" column="4">
    164     <widget class="QILineEdit" name="m_pLoginEditor">
    165      <property name="whatsThis">
    166       <string>Changes the user name used for authentication.</string>
    167      </property>
    168     </widget>
    169    </item>
    170    <item row="4" column="3">
    171     <widget class="QLabel" name="m_pPasswordLabel">
    172      <property name="text">
    173       <string>Pass&amp;word:</string>
    174      </property>
    175      <property name="alignment">
    176       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    177      </property>
    178      <property name="buddy">
    179       <cstring>m_pPasswordEditor</cstring>
    180      </property>
    181     </widget>
    182    </item>
    183    <item row="4" column="4">
    184     <widget class="QILineEdit" name="m_pPasswordEditor">
    185      <property name="whatsThis">
    186       <string>Changes the password used for authentication.</string>
    187      </property>
    188     </widget>
    189    </item>
    190    <item row="5" column="1" colspan="4">
     102   <item row="2" column="0" colspan="3">
    191103    <spacer>
    192104     <property name="orientation">
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