mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-29 12:19:03 +03:00
Some code cleanups for the proxy dialog.
This commit is contained in:
parent
343f646660
commit
42283e4684
2 changed files with 186 additions and 185 deletions
|
@ -24,9 +24,13 @@ Mirall::ProxyDialog::ProxyDialog( QWidget* parent )
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
// designer is buggy, so do it programmatically
|
||||||
|
manualSettings->setEnabled(false);
|
||||||
|
|
||||||
#if QT_VERSION >= 0x040700
|
#if QT_VERSION >= 0x040700
|
||||||
hostLineEdit->setPlaceholderText(QApplication::translate("proxyDialog", "Hostname of proxy server"));
|
hostLineEdit->setPlaceholderText(tr("Hostname of proxy server"));
|
||||||
userLineEdit->setPlaceholderText(QApplication::translate("proxyDialog", "Username to authenticate on proxy server"));
|
userLineEdit->setPlaceholderText(tr("Username for proxy server"));
|
||||||
|
passwordLineEdit->setPlaceholderText(tr("Password for proxy server"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// load current proxy settings
|
// load current proxy settings
|
||||||
|
@ -40,7 +44,7 @@ Mirall::ProxyDialog::ProxyDialog( QWidget* parent )
|
||||||
manualProxyRadioButton->setChecked(true);
|
manualProxyRadioButton->setChecked(true);
|
||||||
hostLineEdit->setText(cfgFile.proxyHostName());
|
hostLineEdit->setText(cfgFile.proxyHostName());
|
||||||
portSpinBox->setValue(cfgFile.proxyPort());
|
portSpinBox->setValue(cfgFile.proxyPort());
|
||||||
if (cfgFile.proxyUser() != QString())
|
if (!cfgFile.proxyUser().isEmpty())
|
||||||
{
|
{
|
||||||
authRequiredcheckBox->setChecked(true);
|
authRequiredcheckBox->setChecked(true);
|
||||||
userLineEdit->setText(cfgFile.proxyUser());
|
userLineEdit->setText(cfgFile.proxyUser());
|
||||||
|
@ -83,13 +87,13 @@ void Mirall::ProxyDialog::on_authRequiredcheckBox_stateChanged(int state)
|
||||||
bool e = (state == Qt::Checked);
|
bool e = (state == Qt::Checked);
|
||||||
userLineEdit->setEnabled(e);
|
userLineEdit->setEnabled(e);
|
||||||
passwordLineEdit->setEnabled(e);
|
passwordLineEdit->setEnabled(e);
|
||||||
|
proxyUserLabel->setEnabled(e);
|
||||||
|
proxyPasswordLabel->setEnabled(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mirall::ProxyDialog::on_manualProxyRadioButton_toggled(bool checked)
|
void Mirall::ProxyDialog::on_manualProxyRadioButton_toggled(bool checked)
|
||||||
{
|
{
|
||||||
hostLineEdit->setEnabled(checked);
|
manualSettings->setEnabled(checked);
|
||||||
portSpinBox->setEnabled(checked);
|
|
||||||
authRequiredcheckBox->setEnabled(checked);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mirall::ProxyDialog::on_buttonBox_accepted()
|
void Mirall::ProxyDialog::on_buttonBox_accepted()
|
||||||
|
|
|
@ -6,15 +6,13 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>509</width>
|
<width>465</width>
|
||||||
<height>360</height>
|
<height>362</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Proxy Settings</string>
|
<string>Proxy Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
|
@ -27,28 +25,18 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Configure Proxies to access your ownCloud</string>
|
<string>Configure Proxies to access your ownCloud</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>manualSettings</cstring>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Minimum</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>20</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="noProxyRadioButton">
|
<widget class="QRadioButton" name="noProxyRadioButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -66,45 +54,40 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="manualProxyRadioButton">
|
<widget class="QRadioButton" name="manualProxyRadioButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Manual proxy configuration:</string>
|
<string>Manual proxy configuration</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
</layout>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Minimum</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<widget class="QWidget" name="manualSettings" native="true">
|
||||||
<property name="fieldGrowthPolicy">
|
|
||||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
|
||||||
</property>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>40</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="proxyUserLabel">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Proxy User:</string>
|
<string>User</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -113,18 +96,24 @@
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="proxyPasswordLabel">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Password:</string>
|
<string>Password</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -133,6 +122,12 @@
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
|
@ -157,18 +152,37 @@
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLineEdit" name="hostLineEdit">
|
<widget class="QLineEdit" name="hostLineEdit">
|
||||||
<property name="enabled">
|
<property name="maximumSize">
|
||||||
<bool>false</bool>
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QCheckBox" name="authRequiredcheckBox">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Proxy server requires password</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="portSpinBox">
|
<widget class="QSpinBox" name="portSpinBox">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
|
@ -181,28 +195,11 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
</layout>
|
||||||
<widget class="QCheckBox" name="authRequiredcheckBox">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Authentication required</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
Loading…
Reference in a new issue