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);
|
||||
|
||||
// designer is buggy, so do it programmatically
|
||||
manualSettings->setEnabled(false);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
hostLineEdit->setPlaceholderText(QApplication::translate("proxyDialog", "Hostname of proxy server"));
|
||||
userLineEdit->setPlaceholderText(QApplication::translate("proxyDialog", "Username to authenticate on proxy server"));
|
||||
hostLineEdit->setPlaceholderText(tr("Hostname of proxy server"));
|
||||
userLineEdit->setPlaceholderText(tr("Username for proxy server"));
|
||||
passwordLineEdit->setPlaceholderText(tr("Password for proxy server"));
|
||||
#endif
|
||||
|
||||
// load current proxy settings
|
||||
|
@ -40,7 +44,7 @@ Mirall::ProxyDialog::ProxyDialog( QWidget* parent )
|
|||
manualProxyRadioButton->setChecked(true);
|
||||
hostLineEdit->setText(cfgFile.proxyHostName());
|
||||
portSpinBox->setValue(cfgFile.proxyPort());
|
||||
if (cfgFile.proxyUser() != QString())
|
||||
if (!cfgFile.proxyUser().isEmpty())
|
||||
{
|
||||
authRequiredcheckBox->setChecked(true);
|
||||
userLineEdit->setText(cfgFile.proxyUser());
|
||||
|
@ -83,13 +87,13 @@ void Mirall::ProxyDialog::on_authRequiredcheckBox_stateChanged(int state)
|
|||
bool e = (state == Qt::Checked);
|
||||
userLineEdit->setEnabled(e);
|
||||
passwordLineEdit->setEnabled(e);
|
||||
proxyUserLabel->setEnabled(e);
|
||||
proxyPasswordLabel->setEnabled(e);
|
||||
}
|
||||
|
||||
void Mirall::ProxyDialog::on_manualProxyRadioButton_toggled(bool checked)
|
||||
{
|
||||
hostLineEdit->setEnabled(checked);
|
||||
portSpinBox->setEnabled(checked);
|
||||
authRequiredcheckBox->setEnabled(checked);
|
||||
manualSettings->setEnabled(checked);
|
||||
}
|
||||
|
||||
void Mirall::ProxyDialog::on_buttonBox_accepted()
|
||||
|
|
|
@ -6,15 +6,13 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>509</width>
|
||||
<height>360</height>
|
||||
<width>465</width>
|
||||
<height>362</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Proxy Settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
|
@ -27,28 +25,18 @@
|
|||
<property name="text">
|
||||
<string>Configure Proxies to access your ownCloud</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>manualSettings</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="noProxyRadioButton">
|
||||
<property name="text">
|
||||
|
@ -66,45 +54,40 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="manualProxyRadioButton">
|
||||
<property name="text">
|
||||
<string>Manual proxy configuration:</string>
|
||||
<string>Manual proxy configuration</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<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>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QWidget" name="manualSettings" native="true">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</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">
|
||||
<string>Proxy User:</string>
|
||||
<string>User</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -113,18 +96,24 @@
|
|||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<widget class="QLabel" name="proxyPasswordLabel">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Password:</string>
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -133,6 +122,12 @@
|
|||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
@ -157,18 +152,37 @@
|
|||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="hostLineEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</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">
|
||||
<widget class="QSpinBox" name="portSpinBox">
|
||||
<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 name="minimum">
|
||||
<number>1</number>
|
||||
|
@ -181,28 +195,11 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="authRequiredcheckBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Authentication required</string>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
|
Loading…
Reference in a new issue