kcontrol: adjust kio KCM to kdelibs changes

for proxy settings there can be KCM that sets klauncher variables for
proxy preferences, has yet to be decided tho

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-29 10:01:27 +02:00
parent 649c7b8876
commit d86f77ad00
10 changed files with 1 additions and 1754 deletions

View file

@ -2,7 +2,6 @@
set(kcm_kio_PART_SRCS
main.cpp
kproxydlg.cpp
netpref.cpp
bookmarks.cpp
ksaveioconfig.cpp
@ -10,7 +9,6 @@ set(kcm_kio_PART_SRCS
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kproxydlg.cpp
${CMAKE_CURRENT_SOURCE_DIR}/netpref.cpp
${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ksaveioconfig.cpp
@ -35,6 +33,5 @@ install(
FILES
bookmarks.desktop
netpref.desktop
proxy.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)

View file

@ -1,506 +0,0 @@
/*
kproxydlg.cpp - Proxy configuration dialog
Copyright (C) 2001, 2011 Dawit Alemayehu <adawit@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License (GPL) version 2 as published by the Free Software
Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
// Own
#include "kproxydlg.h"
// Local
#include "ksaveioconfig.h"
// KDE
#include <kpluginfactory.h>
#include <klineedit.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kurifilter.h>
// Qt
#include <QLabel>
#include <QRadioButton>
#include <QLineEdit>
#include <QSpinBox>
#define QL1C(x) QLatin1Char(x)
#define QL1S(x) QLatin1String(x)
#define ENV_HTTP_PROXY QL1S("HTTP_PROXY,http_proxy,HTTPPROXY,httpproxy,PROXY,proxy")
#define ENV_HTTPS_PROXY QL1S("HTTPS_PROXY,https_proxy,HTTPSPROXY,httpsproxy,PROXY,proxy")
#define ENV_FTP_PROXY QL1S("FTP_PROXY,ftp_proxy,FTPPROXY,ftpproxy,PROXY,proxy")
#define ENV_SOCKS_PROXY QL1S("SOCKS_PROXY,socks_proxy,SOCKSPROXY,socksproxy,PROXY,proxy")
#define ENV_NO_PROXY QL1S("NO_PROXY,no_proxy")
K_PLUGIN_FACTORY_DECLARATION (KioConfigFactory)
class InputValidator : public QValidator
{
public:
QValidator::State validate(QString& input, int& pos) const
{
if (input.isEmpty())
return QValidator::Acceptable;
const QChar ch = input.at((pos > 0 ? pos - 1 : pos));
if (ch.isSpace())
return QValidator::Invalid;
return QValidator::Acceptable;
}
};
static QString manualProxyToText(const QLineEdit* edit, const QSpinBox* spinBox, const QChar& separator)
{
QString value;
value = edit->text();
value += separator;
value += QString::number(spinBox->value());
return value;
}
static void setManualProxyFromText(const QString& value, QLineEdit* edit, QSpinBox* spinBox)
{
if (value.isEmpty())
return;
const QStringList values = value.split(QL1S(" "));
edit->setText(values.at(0));
bool ok = false;
const int num = values.at(1).toInt(&ok);
if (ok) {
spinBox->setValue(num);
}
}
static void showSystemProxyUrl(QLineEdit* edit, QString* value)
{
Q_ASSERT(edit);
Q_ASSERT(value);
*value = edit->text();
edit->setEnabled(false);
const QByteArray envVar(edit->text().toUtf8());
edit->setText(QString::fromUtf8(qgetenv(envVar.constData())));
}
static QString proxyUrlFromInput(const QLineEdit* edit, const QSpinBox* spinBox)
{
Q_ASSERT(edit);
Q_ASSERT(spinBox);
QString proxyStr;
if (edit->text().isEmpty())
return proxyStr;
KUriFilterData data;
data.setData(edit->text());
data.setCheckForExecutables(false);
if (KUriFilter::self()->filterUri(data, QStringList() << QL1S("kshorturifilter"))) {
KUrl url = data.uri();
const int portNum = (spinBox->value() > 0 ? spinBox->value() : url.port());
url.setPort(-1);
proxyStr = url.url();
proxyStr += QL1C(' ');
if (portNum > -1) {
proxyStr += QString::number(portNum);
}
} else {
proxyStr = edit->text();
if (spinBox->value() > 0) {
proxyStr += QL1C(' ');
proxyStr += QString::number(spinBox->value());
}
}
return proxyStr;
}
static void setProxyInformation(const QString& value,
int proxyType,
QLineEdit* manEdit,
QLineEdit* sysEdit,
QSpinBox* spinBox)
{
const bool isSysProxy = (!value.contains(QL1C(' ')) &&
!value.contains(QL1C('.')) &&
!value.contains(QL1C(',')) &&
!value.contains(QL1C(':')));
if (proxyType == KProtocolManager::EnvVarProxy || isSysProxy) {
sysEdit->setText(value);
return;
}
if (spinBox) {
QString urlStr;
int portNum = -1;
int index = value.lastIndexOf(QL1C(' '));
if (index == -1)
index = value.lastIndexOf(QL1C(':'));
if (index > 0) {
bool ok = false;
portNum = value.mid(index+1).toInt(&ok);
if (!ok) {
portNum = -1;
}
urlStr = value.left(index).trimmed();
} else {
urlStr = value.trimmed();
}
KUriFilterData data;
data.setData(urlStr);
data.setCheckForExecutables(false);
if (KUriFilter::self()->filterUri(data, QStringList() << QL1S("kshorturifilter"))) {
KUrl url (data.uri());
if (portNum == -1 && url.port() > -1) {
portNum = url.port();
}
url.setPort(-1);
url.setUserName(QString());
url.setPassword(QString());
url.setPath(QString());
manEdit->setText(url.url());
} else {
manEdit->setText(urlStr);
}
if (spinBox && portNum > -1) {
spinBox->setValue(portNum);
}
return;
}
manEdit->setText(value); // Manual proxy exception...
}
KProxyDialog::KProxyDialog(QWidget* parent, const QVariantList& args)
: KCModule(KioConfigFactory::componentData(), parent)
{
Q_UNUSED(args);
mUi.setupUi(this);
mUi.systemProxyGroupBox->setVisible(false);
mUi.manualProxyGroupBox->setVisible(false);
mUi.autoDetectButton->setVisible(false);
InputValidator* v = new InputValidator;
mUi.manualProxyHttpEdit->setValidator(v);
mUi.manualProxyHttpsEdit->setValidator(v);
mUi.manualProxyFtpEdit->setValidator(v);
mUi.manualProxySocksEdit->setValidator(v);
mUi.manualNoProxyEdit->setValidator(v);
connect(mUi.systemProxyRadioButton, SIGNAL(toggled(bool)), mUi.systemProxyGroupBox, SLOT(setVisible(bool)));
// signals and slots connections
connect(mUi.noProxyRadioButton, SIGNAL(clicked()), SLOT(slotChanged()));
connect(mUi.manualProxyRadioButton, SIGNAL(clicked()), SLOT(slotChanged()));
connect(mUi.systemProxyRadioButton, SIGNAL(clicked()), SLOT(slotChanged()));
connect(mUi.noProxyRadioButton, SIGNAL(clicked()), SLOT(slotChanged()));
connect(mUi.useReverseProxyCheckBox, SIGNAL(clicked()), SLOT(slotChanged()));
connect(mUi.useSameProxyCheckBox, SIGNAL(clicked()), SLOT(slotChanged()));
connect(mUi.manualProxyHttpEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
connect(mUi.manualProxyHttpsEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
connect(mUi.manualProxyFtpEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
connect(mUi.manualProxySocksEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
connect(mUi.manualNoProxyEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
connect(mUi.manualProxyHttpSpinBox, SIGNAL(valueChanged(int)), SLOT(slotChanged()));
connect(mUi.manualProxyHttpsSpinBox, SIGNAL(valueChanged(int)), SLOT(slotChanged()));
connect(mUi.manualProxyFtpSpinBox, SIGNAL(valueChanged(int)), SLOT(slotChanged()));
connect(mUi.manualProxySocksSpinBox, SIGNAL(valueChanged(int)), SLOT(slotChanged()));
connect(mUi.systemProxyHttpEdit, SIGNAL(textEdited(QString)), SLOT(slotChanged()));
connect(mUi.systemProxyHttpsEdit, SIGNAL(textEdited(QString)), SLOT(slotChanged()));
connect(mUi.systemProxyFtpEdit, SIGNAL(textEdited(QString)), SLOT(slotChanged()));
connect(mUi.systemProxySocksEdit, SIGNAL(textEdited(QString)), SLOT(slotChanged()));
connect(mUi.systemNoProxyEdit, SIGNAL(textEdited(QString)), SLOT(slotChanged()));
}
KProxyDialog::~KProxyDialog()
{
}
void KProxyDialog::load()
{
mProxyMap[QL1S("HttpProxy")] = KProtocolManager::proxyFor(QL1S("http"));
mProxyMap[QL1S("HttpsProxy")] = KProtocolManager::proxyFor(QL1S("https"));
mProxyMap[QL1S("FtpProxy")] = KProtocolManager::proxyFor(QL1S("ftp"));
mProxyMap[QL1S("SocksProxy")] = KProtocolManager::proxyFor(QL1S("socks"));
mProxyMap[QL1S("NoProxy")] = KSaveIOConfig::noProxyFor();
const int proxyType = KProtocolManager::proxyType();
// Make sure showEnvValueCheckBox is unchecked before setting proxy env var names
mUi.showEnvValueCheckBox->setChecked(false);
setProxyInformation(mProxyMap.value(QL1S("HttpProxy")), proxyType, mUi.manualProxyHttpEdit, mUi.systemProxyHttpEdit, mUi.manualProxyHttpSpinBox);
setProxyInformation(mProxyMap.value(QL1S("HttpsProxy")), proxyType, mUi.manualProxyHttpsEdit, mUi.systemProxyHttpsEdit, mUi.manualProxyHttpsSpinBox);
setProxyInformation(mProxyMap.value(QL1S("FtpProxy")), proxyType, mUi.manualProxyFtpEdit, mUi.systemProxyFtpEdit, mUi.manualProxyFtpSpinBox);
setProxyInformation(mProxyMap.value(QL1S("SocksProxy")), proxyType, mUi.manualProxySocksEdit, mUi.systemProxySocksEdit, mUi.manualProxySocksSpinBox);
setProxyInformation(mProxyMap.value(QL1S("NoProxy")), proxyType, mUi.manualNoProxyEdit, mUi.systemNoProxyEdit, 0);
// Check the "Use this proxy server for all protocols" if all the proxy URLs are the same...
const QString httpProxy(mUi.manualProxyHttpEdit->text());
if (!httpProxy.isEmpty()) {
const int httpProxyPort = mUi.manualProxyHttpSpinBox->value();
mUi.useSameProxyCheckBox->setChecked(httpProxy == mUi.manualProxyHttpsEdit->text() &&
httpProxy == mUi.manualProxyFtpEdit->text() &&
httpProxy == mUi.manualProxySocksEdit->text() &&
httpProxyPort == mUi.manualProxyHttpsSpinBox->value() &&
httpProxyPort == mUi.manualProxyFtpSpinBox->value() &&
httpProxyPort == mUi.manualProxySocksSpinBox->value());
}
// Set use reverse proxy checkbox...
mUi.useReverseProxyCheckBox->setChecked((!mProxyMap.value(QL1S("NoProxy")).isEmpty()
&& KProtocolManager::useReverseProxy()));
switch (proxyType) {
case KProtocolManager::ManualProxy:
mUi.manualProxyRadioButton->setChecked(true);
break;
case KProtocolManager::EnvVarProxy:
mUi.systemProxyRadioButton->setChecked(true);
break;
case KProtocolManager::NoProxy:
default:
mUi.noProxyRadioButton->setChecked(true);
break;
}
}
void KProxyDialog::save()
{
KProtocolManager::ProxyType proxyType = KProtocolManager::NoProxy;
if (mUi.manualProxyRadioButton->isChecked()) {
proxyType = KProtocolManager::ManualProxy;
mProxyMap[QL1S("HttpProxy")] = proxyUrlFromInput(mUi.manualProxyHttpEdit, mUi.manualProxyHttpSpinBox);
mProxyMap[QL1S("HttpsProxy")] = proxyUrlFromInput(mUi.manualProxyHttpsEdit, mUi.manualProxyHttpsSpinBox);
mProxyMap[QL1S("FtpProxy")] = proxyUrlFromInput(mUi.manualProxyFtpEdit, mUi.manualProxyFtpSpinBox);
mProxyMap[QL1S("SocksProxy")] = proxyUrlFromInput(mUi.manualProxySocksEdit, mUi.manualProxySocksSpinBox);
mProxyMap[QL1S("NoProxy")] = mUi.manualNoProxyEdit->text();
} else if (mUi.systemProxyRadioButton->isChecked()) {
proxyType = KProtocolManager::EnvVarProxy;
if (!mUi.showEnvValueCheckBox->isChecked()) {
mProxyMap[QL1S("HttpProxy")] = mUi.systemProxyHttpEdit->text();
mProxyMap[QL1S("HttpsProxy")] = mUi.systemProxyHttpsEdit->text();
mProxyMap[QL1S("FtpProxy")] = mUi.systemProxyFtpEdit->text();
mProxyMap[QL1S("SocksProxy")] = mUi.systemProxySocksEdit->text();
mProxyMap[QL1S("NoProxy")] = mUi.systemNoProxyEdit->text();
} else {
mProxyMap[QL1S("HttpProxy")] = mProxyMap.take(mUi.systemProxyHttpEdit->objectName());
mProxyMap[QL1S("HttpsProxy")] = mProxyMap.take(mUi.systemProxyHttpsEdit->objectName());
mProxyMap[QL1S("FtpProxy")] = mProxyMap.take(mUi.systemProxyFtpEdit->objectName());
mProxyMap[QL1S("SocksProxy")] = mProxyMap.take(mUi.systemProxySocksEdit->objectName());
mProxyMap[QL1S("NoProxy")] = mProxyMap.take(mUi.systemNoProxyEdit->objectName());
}
}
KSaveIOConfig::setProxyType(proxyType);
KSaveIOConfig::setUseReverseProxy(mUi.useReverseProxyCheckBox->isChecked());
// Save the common proxy setting...
KSaveIOConfig::setProxyFor(QL1S("http"), mProxyMap.value(QL1S("HttpProxy")));
KSaveIOConfig::setProxyFor(QL1S("https"), mProxyMap.value(QL1S("HttpsProxy")));
KSaveIOConfig::setProxyFor(QL1S("ftp"), mProxyMap.value(QL1S("FtpProxy")));
KSaveIOConfig::setProxyFor(QL1S("socks"), mProxyMap.value(QL1S("SocksProxy")));
KSaveIOConfig::setNoProxyFor (mProxyMap.value(QL1S("NoProxy")));
KSaveIOConfig::updateRunningIOSlaves (this);
emit changed (false);
}
void KProxyDialog::defaults()
{
mUi.noProxyRadioButton->setChecked(true);
mUi.manualProxyHttpEdit->clear();
mUi.manualProxyHttpsEdit->clear();
mUi.manualProxyFtpEdit->clear();
mUi.manualProxySocksEdit->clear();
mUi.manualNoProxyEdit->clear();
mUi.manualProxyHttpSpinBox->setValue(0);
mUi.manualProxyHttpsSpinBox->setValue(0);
mUi.manualProxyFtpSpinBox->setValue(0);
mUi.manualProxySocksSpinBox->setValue(0);
mUi.systemProxyHttpEdit->clear();
mUi.systemProxyHttpsEdit->clear();
mUi.systemProxyFtpEdit->clear();
mUi.systemProxySocksEdit->clear();
emit changed (true);
}
bool KProxyDialog::autoDetectSystemProxy(QLineEdit* edit, const QString& envVarStr, bool showValue)
{
const QStringList envVars = envVarStr.split(QL1S(","), QString::SkipEmptyParts);
Q_FOREACH (const QString & envVar, envVars) {
const QByteArray envVarUtf8(envVar.toUtf8());
const QByteArray envVarValue = qgetenv(envVarUtf8.constData());
if (!envVarValue.isEmpty()) {
if (showValue) {
mProxyMap[edit->objectName()] = envVar;
edit->setText(envVarValue);
} else {
edit->setText(envVar);
}
edit->setEnabled(!showValue);
return true;
}
}
return false;
}
void KProxyDialog::on_autoDetectButton_clicked()
{
const bool showValue = mUi.showEnvValueCheckBox->isChecked();
bool wasChanged = false;
wasChanged |= autoDetectSystemProxy(mUi.systemProxyHttpEdit, ENV_HTTP_PROXY, showValue);
wasChanged |= autoDetectSystemProxy(mUi.systemProxyHttpsEdit, ENV_HTTPS_PROXY, showValue);
wasChanged |= autoDetectSystemProxy(mUi.systemProxyFtpEdit, ENV_FTP_PROXY, showValue);
wasChanged |= autoDetectSystemProxy(mUi.systemProxySocksEdit, ENV_SOCKS_PROXY, showValue);
wasChanged |= autoDetectSystemProxy(mUi.systemNoProxyEdit, ENV_NO_PROXY, showValue);
if (wasChanged)
emit changed (true);
}
void KProxyDialog::on_manualProxyHttpEdit_textChanged(const QString& text)
{
mUi.useSameProxyCheckBox->setEnabled(!text.isEmpty());
}
void KProxyDialog::on_manualNoProxyEdit_textChanged (const QString& text)
{
mUi.useReverseProxyCheckBox->setEnabled(!text.isEmpty());
}
void KProxyDialog::on_manualProxyHttpEdit_textEdited(const QString& text)
{
if (!mUi.useSameProxyCheckBox->isChecked()) {
return;
}
mUi.manualProxyHttpsEdit->setText(text);
mUi.manualProxyFtpEdit->setText(text);
mUi.manualProxySocksEdit->setText(text);
}
void KProxyDialog::on_manualProxyHttpSpinBox_valueChanged (int value)
{
if (!mUi.useSameProxyCheckBox->isChecked()) {
return;
}
mUi.manualProxyHttpsSpinBox->setValue(value);
mUi.manualProxyFtpSpinBox->setValue(value);
mUi.manualProxySocksSpinBox->setValue(value);
}
void KProxyDialog::on_showEnvValueCheckBox_toggled (bool on)
{
if (on) {
showSystemProxyUrl(mUi.systemProxyHttpEdit, &mProxyMap[mUi.systemProxyHttpEdit->objectName()]);
showSystemProxyUrl(mUi.systemProxyHttpsEdit, &mProxyMap[mUi.systemProxyHttpsEdit->objectName()]);
showSystemProxyUrl(mUi.systemProxyFtpEdit, &mProxyMap[mUi.systemProxyFtpEdit->objectName()]);
showSystemProxyUrl(mUi.systemProxySocksEdit, &mProxyMap[mUi.systemProxySocksEdit->objectName()]);
showSystemProxyUrl(mUi.systemNoProxyEdit, &mProxyMap[mUi.systemNoProxyEdit->objectName()]);
return;
}
mUi.systemProxyHttpEdit->setText(mProxyMap.take(mUi.systemProxyHttpEdit->objectName()));
mUi.systemProxyHttpEdit->setEnabled(true);
mUi.systemProxyHttpsEdit->setText(mProxyMap.take(mUi.systemProxyHttpsEdit->objectName()));
mUi.systemProxyHttpsEdit->setEnabled(true);
mUi.systemProxyFtpEdit->setText(mProxyMap.take(mUi.systemProxyFtpEdit->objectName()));
mUi.systemProxyFtpEdit->setEnabled(true);
mUi.systemProxySocksEdit->setText(mProxyMap.take(mUi.systemProxySocksEdit->objectName()));
mUi.systemProxySocksEdit->setEnabled(true);
mUi.systemNoProxyEdit->setText(mProxyMap.take(mUi.systemNoProxyEdit->objectName()));
mUi.systemNoProxyEdit->setEnabled(true);
}
void KProxyDialog::on_useSameProxyCheckBox_clicked(bool on)
{
if (on) {
mProxyMap[QL1S("ManProxyHttps")] = manualProxyToText (mUi.manualProxyHttpsEdit, mUi.manualProxyHttpsSpinBox, QL1C (' '));
mProxyMap[QL1S("ManProxyFtp")] = manualProxyToText (mUi.manualProxyFtpEdit, mUi.manualProxyFtpSpinBox, QL1C (' '));
mProxyMap[QL1S("ManProxySocks")] = manualProxyToText (mUi.manualProxySocksEdit, mUi.manualProxySocksSpinBox, QL1C (' '));
const QString& httpProxy = mUi.manualProxyHttpEdit->text();
if (!httpProxy.isEmpty()) {
mUi.manualProxyHttpsEdit->setText(httpProxy);
mUi.manualProxyFtpEdit->setText(httpProxy);
mUi.manualProxySocksEdit->setText(httpProxy);
}
const int httpProxyPort = mUi.manualProxyHttpSpinBox->value();
if (httpProxyPort > 0) {
mUi.manualProxyHttpsSpinBox->setValue(httpProxyPort);
mUi.manualProxyFtpSpinBox->setValue(httpProxyPort);
mUi.manualProxySocksSpinBox->setValue(httpProxyPort);
}
return;
}
setManualProxyFromText(mProxyMap.take (QL1S("ManProxyHttps")), mUi.manualProxyHttpsEdit, mUi.manualProxyHttpsSpinBox);
setManualProxyFromText(mProxyMap.take (QL1S("ManProxyFtp")), mUi.manualProxyFtpEdit, mUi.manualProxyFtpSpinBox);
setManualProxyFromText(mProxyMap.take (QL1S("ManProxySocks")), mUi.manualProxySocksEdit, mUi.manualProxySocksSpinBox);
}
void KProxyDialog::slotChanged()
{
emit changed(true);
}
QString KProxyDialog::quickHelp() const
{
return i18n ("<h1>Proxy</h1>"
"<p>A proxy server is an intermediate program that sits between "
"your machine and the Internet and provides services such as "
"web page caching and/or filtering.</p>"
"<p>Caching proxy servers give you faster access to sites you have "
"already visited by locally storing or caching the content of those "
"pages; filtering proxy servers, on the other hand, provide the "
"ability to block out requests for ads, spam, or anything else you "
"want to block.</p>"
"<p><u>Note:</u> Some proxy servers provide both services.</p>");
}
#include "moc_kproxydlg.cpp"

View file

@ -1,61 +0,0 @@
/*
kproxydlg.h - Proxy configuration dialog
Copyright (C) 2001, 2011 Dawit Alemayehu <adawit@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License (GPL) version 2 as published by the Free Software
Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KPROXYDLG_H
#define KPROXYDLG_H
#include <kcmodule.h>
#include "ui_kproxydlg.h"
class KProxyDialog : public KCModule
{
Q_OBJECT
public:
KProxyDialog(QWidget* parent, const QVariantList& args);
~KProxyDialog();
virtual void load();
virtual void save();
virtual void defaults();
QString quickHelp() const;
private Q_SLOTS:
void on_autoDetectButton_clicked();
void on_showEnvValueCheckBox_toggled(bool);
void on_useSameProxyCheckBox_clicked(bool);
void on_manualProxyHttpEdit_textChanged(const QString&);
void on_manualNoProxyEdit_textChanged(const QString&);
void on_manualProxyHttpEdit_textEdited(const QString&);
void on_manualProxyHttpSpinBox_valueChanged(int);
void slotChanged();
private:
bool autoDetectSystemProxy(QLineEdit* edit, const QString& envVarStr, bool showValue);
Ui::ProxyDialogUI mUi;
QStringList mNoProxyForList;
QMap<QString, QString> mProxyMap;
};
#endif // KPROXYDLG_H

View file

@ -1,867 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ProxyDialogUI</class>
<widget class="QWidget" name="ProxyDialogUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>513</width>
<height>578</height>
</rect>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;
Setup proxy configuration.
&lt;p&gt;
A proxy server is an intermediate machine that sits between your computer and the Internet and provides services such as web page caching and filtering. Caching proxy servers give you faster access to web sites you have already visited by locally storing or caching those pages; filtering proxy servers usually provide the ability to block out requests for ads, spam, or anything else you want to block.
&lt;p&gt;
If you are uncertain whether or not you need to use a proxy server to connect to the Internet, consult your Internet service provider's setup guide or your system administrator.
&lt;/qt&gt;</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0" colspan="4">
<widget class="QGroupBox" name="manualProxyGroupBox">
<property name="title">
<string/>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="manualProxyHttpEditLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>HTTP Proxy:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>manualProxyHttpEdit</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="KLineEdit" name="manualProxyHttpEdit">
<property name="whatsThis">
<string>Enter the address of the HTTP proxy server.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="manualProxyHttpSpinBoxLabel">
<property name="text">
<string>Port:</string>
</property>
<property name="buddy">
<cstring>manualProxyHttpSpinBox</cstring>
</property>
</widget>
</item>
<item>
<widget class="KIntSpinBox" name="manualProxyHttpSpinBox">
<property name="maximumSize">
<size>
<width>32767</width>
<height>32767</height>
</size>
</property>
<property name="whatsThis">
<string>Enter the port number of the HTTP proxy server.</string>
</property>
<property name="maximum">
<number>65536</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="useSameProxyCheckBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Use this proxy server for a&amp;ll protocols</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="manualProxyHttpsEditLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>SSL Proxy:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>manualProxyHttpsEdit</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="KLineEdit" name="manualProxyHttpsEdit">
<property name="whatsThis">
<string>Enter the address of the HTTPS proxy server.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="manualProxyHttpsSpinBoxLabel">
<property name="text">
<string>Port:</string>
</property>
<property name="buddy">
<cstring>manualProxyHttpsSpinBox</cstring>
</property>
</widget>
</item>
<item>
<widget class="KIntSpinBox" name="manualProxyHttpsSpinBox">
<property name="whatsThis">
<string>Enter the port number of the HTTPS proxy server.</string>
</property>
<property name="maximum">
<number>65536</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="manualProxyFtpEditLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>FTP Proxy:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>manualProxyFtpEdit</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="KLineEdit" name="manualProxyFtpEdit">
<property name="whatsThis">
<string>Enter the address of the FTP proxy server.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="manualProxyFtpSpinBoxLabel">
<property name="text">
<string>Port:</string>
</property>
<property name="buddy">
<cstring>manualProxyFtpSpinBox</cstring>
</property>
</widget>
</item>
<item>
<widget class="KIntSpinBox" name="manualProxyFtpSpinBox">
<property name="whatsThis">
<string>Enter the port number of the FTP proxy server.</string>
</property>
<property name="maximum">
<number>65536</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="manualProxySocksEditLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>SOCKS Proxy:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>manualProxySocksEdit</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="KLineEdit" name="manualProxySocksEdit">
<property name="whatsThis">
<string>Enter the address of the SOCKS proxy server.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="manualProxySocksSpinBoxLabel">
<property name="text">
<string>Port:</string>
</property>
<property name="buddy">
<cstring>manualProxySocksSpinBox</cstring>
</property>
</widget>
</item>
<item>
<widget class="KIntSpinBox" name="manualProxySocksSpinBox">
<property name="whatsThis">
<string>Enter the port number of the SOCKS proxy server.</string>
</property>
<property name="maximum">
<number>65536</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QLabel" name="manNoProxyLabel">
<property name="whatsThis">
<string>&lt;qt&gt;
Enter the environment variable, e.g. &lt;b&gt;NO_PROXY&lt;/b&gt;, used to store the addresses of sites for which the proxy server should not be used.&lt;p&gt;
Alternatively, you can click on the &lt;b&gt;&quot;Auto Detect&quot;&lt;/b&gt; button to attempt an automatic discovery of this variable.
&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Exceptions:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>manualNoProxyEdit</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="KLineEdit" name="manualNoProxyEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;
&lt;p&gt;Enter a comma separated list of hostnames or ip addresses that should be excluded from using the above proxy settings.&lt;/p&gt;
&lt;p&gt;If you want to exclude all hosts for a given domain, then simply enter the domain name preceded by a dot. For example, to exclude all hostnames for &lt;i&gt;kde.org&lt;/i&gt;, enter &lt;i&gt;.kde.org&lt;/i&gt;. Wildcard characters such as '*' or '?' are not supported and will have no effect.&lt;/p&gt;
&lt;p&gt;Additionally, you can also enter IP addresses, e.g. 127.0.0.1 and IP addresses with a subnet, e.g. 192.168.0.1/24.&lt;/p&gt;
&lt;/qt&gt;</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="useReverseProxyCheckBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;
Check this box if you want the above proxy settings to apply only to the addresses listed in the &lt;i&gt;Exceptions&lt;/i&gt; list.&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Use proxy settings only for addresses in the Exceptions list</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="5" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>42</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="autoDetectButton">
<property name="whatsThis">
<string>&lt;qt&gt;Attempt automatic discovery of the environment variables used for setting system wide proxy information.&lt;p&gt; This feature works by searching for commonly used variable names such as HTTP_PROXY, FTP_PROXY and NO_PROXY.&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Auto D&amp;etect</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="systemProxyRadioButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;&lt;p&gt;Use proxy settings defined on the system.&lt;/p&gt;
&lt;p&gt;Some platforms offer system wide proxy configuration information and selecting this option allows you to use those settings.&lt;/p&gt;
&lt;p&gt;On Mac platforms&lt;/p&gt;
&lt;p&gt;On Windows platforms&lt;/p&gt;
&lt;p&gt;On Unix and Linux platforms, such system proxy settings are usually defined through environment variables. The following environment variables are detected and used when present: &lt;b&gt;HTTP_PROXY&lt;/b&gt;, &lt;b&gt;HTTPS_PROXY&lt;/b&gt;, &lt;b&gt;FTP_PROXY&lt;/b&gt;, &lt;b&gt;NO_PROXY&lt;/b&gt;.&lt;/p&gt;
&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Use system proxy configuration:</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QRadioButton" name="manualProxyRadioButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>Manually enter proxy server configuration information.</string>
</property>
<property name="text">
<string>Use manually specified proxy configuration:</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="4">
<widget class="QGroupBox" name="systemProxyGroupBox">
<property name="flat">
<bool>true</bool>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="systemProxyHttpLabel">
<property name="whatsThis">
<string>&lt;qt&gt;
Enter the name of the environment variable, e.g. &lt;b&gt;HTTP_PROXY&lt;/b&gt;, used to store the address of the HTTP proxy server.&lt;p&gt;
Alternatively, you can click on the &lt;b&gt;&quot;Auto Detect&quot;&lt;/b&gt; button to attempt automatic discovery of this variable.&lt;/p&gt;
&lt;/qt&gt;</string>
</property>
<property name="text">
<string>HTTP Proxy:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>systemProxyHttpEdit</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KLineEdit" name="systemProxyHttpEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;
Enter the name of the environment variable, e.g. &lt;b&gt;HTTP_PROXY&lt;/b&gt;, used to store the address of the HTTP proxy server.&lt;p&gt;
Alternatively, you can click on the &lt;b&gt;&quot;Auto Detect&quot;&lt;/b&gt; button to attempt automatic discovery of this variable.&lt;/p&gt;
&lt;/qt&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="systemProxyHttpsLabel">
<property name="whatsThis">
<string>&lt;qt&gt;
Enter the name of the environment variable, e.g. &lt;b&gt;HTTPS_PROXY&lt;/b&gt;, used to store the address of the HTTPS proxy server.&lt;p&gt;
Alternatively, you can click on the &lt;b&gt;&quot;Auto Detect&quot;&lt;/b&gt; button to attempt an automatic discovery of this variable.&lt;/p&gt;
&lt;/qt&gt;</string>
</property>
<property name="text">
<string>SSL Proxy:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>systemProxyHttpsEdit</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KLineEdit" name="systemProxyHttpsEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;
Enter the name of the environment variable, e.g. &lt;b&gt;HTTPS_PROXY&lt;/b&gt;, used to store the address of the HTTPS proxy server.&lt;p&gt;
Alternatively, you can click on the &lt;b&gt;&quot;Auto Detect&quot;&lt;/b&gt; button to attempt an automatic discovery of this variable.&lt;/p&gt;
&lt;/qt&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="systemProxyFtpLabel">
<property name="whatsThis">
<string>&lt;qt&gt;
Enter the name of the environment variable, e.g. &lt;b&gt;FTP_PROXY&lt;/b&gt;, used to store the address of the FTP proxy server.&lt;p&gt;
Alternatively, you can click on the &lt;b&gt;&quot;Auto Detect&quot;&lt;/b&gt; button to attempt an automatic discovery of this variable.&lt;/p&gt;
&lt;/qt&gt;</string>
</property>
<property name="text">
<string>FTP Proxy:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>systemProxyFtpEdit</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KLineEdit" name="systemProxyFtpEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;
Enter the name of the environment variable, e.g. &lt;b&gt;FTP_PROXY&lt;/b&gt;, used to store the address of the FTP proxy server.&lt;p&gt;
Alternatively, you can click on the &lt;b&gt;&quot;Auto Detect&quot;&lt;/b&gt; button to attempt an automatic discovery of this variable.&lt;/p&gt;
&lt;/qt&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="systemProxySocksLabel">
<property name="whatsThis">
<string>&lt;qt&gt;
Enter the name of the environment variable, e.g. &lt;b&gt;SOCKS_PROXY&lt;/b&gt;, used to store the address of the SOCKS proxy server.&lt;p&gt;
Alternatively, you can click on the &lt;b&gt;&quot;Auto Detect&quot;&lt;/b&gt; button to attempt an automatic discovery of this variable.&lt;/p&gt;
&lt;/qt&gt;</string>
</property>
<property name="text">
<string>SOCKS Proxy:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>systemProxySocksEdit</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="KLineEdit" name="systemProxySocksEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;Enter the name of the environment variable, e.g. &lt;b&gt;SOCKS_PROXY&lt;/b&gt;, used to store the address of the SOCKS proxy server.&lt;p&gt;Alternatively, you can click on the &lt;b&gt;&amp;quot;Auto Detect&amp;quot;&lt;/b&gt; button to attempt an automatic discovery of this variable.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="sysNoProxyLabel">
<property name="whatsThis">
<string>&lt;qt&gt;
Enter the environment variable, e.g. &lt;b&gt;NO_PROXY&lt;/b&gt;, used to store the addresses of sites for which the proxy server should not be used.&lt;p&gt;
Alternatively, you can click on the &lt;b&gt;&quot;Auto Detect&quot;&lt;/b&gt; button to attempt an automatic discovery of this variable.
&lt;/qt&gt;</string>
</property>
<property name="text">
<string>Exceptions:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>systemNoProxyEdit</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="KLineEdit" name="systemNoProxyEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>&lt;qt&gt;Enter the environment variable, e.g. &lt;b&gt;NO_PROXY&lt;/b&gt;, used to store the addresses of sites for which the above proxy settings should not be used.&lt;p&gt;Alternatively, you can click on the &lt;b&gt;&amp;quot;Auto Detect&amp;quot;&lt;/b&gt; button to attempt an automatic discovery of this variable.&lt;/p&gt;&lt;/qt&gt;</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="showEnvValueCheckBox">
<property name="text">
<string>Show the &amp;value of the environment variables</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QRadioButton" name="noProxyRadioButton">
<property name="whatsThis">
<string>Connect to the Internet directly.</string>
</property>
<property name="text">
<string>No Proxy</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>noProxyRadioButton</tabstop>
<tabstop>systemProxyRadioButton</tabstop>
<tabstop>autoDetectButton</tabstop>
<tabstop>systemProxyHttpEdit</tabstop>
<tabstop>systemProxyHttpsEdit</tabstop>
<tabstop>systemProxyFtpEdit</tabstop>
<tabstop>systemProxySocksEdit</tabstop>
<tabstop>systemNoProxyEdit</tabstop>
<tabstop>showEnvValueCheckBox</tabstop>
<tabstop>manualProxyRadioButton</tabstop>
<tabstop>manualProxyHttpEdit</tabstop>
<tabstop>manualProxyHttpSpinBox</tabstop>
<tabstop>useSameProxyCheckBox</tabstop>
<tabstop>manualProxyHttpsEdit</tabstop>
<tabstop>manualProxyHttpsSpinBox</tabstop>
<tabstop>manualProxyFtpEdit</tabstop>
<tabstop>manualProxyFtpSpinBox</tabstop>
<tabstop>manualProxySocksEdit</tabstop>
<tabstop>manualProxySocksSpinBox</tabstop>
<tabstop>manualNoProxyEdit</tabstop>
<tabstop>useReverseProxyCheckBox</tabstop>
</tabstops>
<includes>
<include location="local">kpushbutton.h</include>
</includes>
<connections>
<connection>
<sender>systemProxyRadioButton</sender>
<signal>toggled(bool)</signal>
<receiver>systemProxyGroupBox</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>97</x>
<y>121</y>
</hint>
<hint type="destinationlabel">
<x>23</x>
<y>150</y>
</hint>
</hints>
</connection>
<connection>
<sender>manualProxyRadioButton</sender>
<signal>toggled(bool)</signal>
<receiver>manualProxyGroupBox</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>76</x>
<y>304</y>
</hint>
<hint type="destinationlabel">
<x>18</x>
<y>333</y>
</hint>
</hints>
</connection>
<connection>
<sender>useSameProxyCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>manualProxyHttpsEdit</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>249</x>
<y>370</y>
</hint>
<hint type="destinationlabel">
<x>250</x>
<y>384</y>
</hint>
</hints>
</connection>
<connection>
<sender>useSameProxyCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>manualProxyFtpEdit</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>218</x>
<y>364</y>
</hint>
<hint type="destinationlabel">
<x>215</x>
<y>414</y>
</hint>
</hints>
</connection>
<connection>
<sender>useSameProxyCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>manualProxySocksEdit</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>191</x>
<y>362</y>
</hint>
<hint type="destinationlabel">
<x>187</x>
<y>440</y>
</hint>
</hints>
</connection>
<connection>
<sender>showEnvValueCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>systemNoProxyEdit</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>352</x>
<y>282</y>
</hint>
<hint type="destinationlabel">
<x>353</x>
<y>259</y>
</hint>
</hints>
</connection>
<connection>
<sender>showEnvValueCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>systemProxySocksEdit</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>275</x>
<y>278</y>
</hint>
<hint type="destinationlabel">
<x>273</x>
<y>231</y>
</hint>
</hints>
</connection>
<connection>
<sender>showEnvValueCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>systemProxyFtpEdit</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>299</x>
<y>279</y>
</hint>
<hint type="destinationlabel">
<x>299</x>
<y>206</y>
</hint>
</hints>
</connection>
<connection>
<sender>showEnvValueCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>systemProxyHttpsEdit</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>349</x>
<y>280</y>
</hint>
<hint type="destinationlabel">
<x>336</x>
<y>185</y>
</hint>
</hints>
</connection>
<connection>
<sender>showEnvValueCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>systemProxyHttpEdit</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>272</x>
<y>279</y>
</hint>
<hint type="destinationlabel">
<x>236</x>
<y>156</y>
</hint>
</hints>
</connection>
<connection>
<sender>systemProxyRadioButton</sender>
<signal>toggled(bool)</signal>
<receiver>autoDetectButton</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>186</x>
<y>119</y>
</hint>
<hint type="destinationlabel">
<x>433</x>
<y>124</y>
</hint>
</hints>
</connection>
<connection>
<sender>useSameProxyCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>manualProxyHttpsSpinBox</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>155</x>
<y>361</y>
</hint>
<hint type="destinationlabel">
<x>464</x>
<y>385</y>
</hint>
</hints>
</connection>
<connection>
<sender>useSameProxyCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>manualProxyFtpSpinBox</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>139</x>
<y>364</y>
</hint>
<hint type="destinationlabel">
<x>451</x>
<y>421</y>
</hint>
</hints>
</connection>
<connection>
<sender>useSameProxyCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>manualProxySocksSpinBox</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>157</x>
<y>363</y>
</hint>
<hint type="destinationlabel">
<x>438</x>
<y>449</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View file

@ -80,13 +80,6 @@ void KSaveIOConfig::setConnectTimeout( int _timeout )
cfg.sync();
}
void KSaveIOConfig::setProxyConnectTimeout( int _timeout )
{
KConfigGroup cfg (config(), QString());
cfg.writeEntry("ProxyConnectTimeout", qMax(MIN_TIMEOUT_VALUE,_timeout));
cfg.sync();
}
void KSaveIOConfig::setResponseTimeout( int _timeout )
{
KConfigGroup cfg (config(), QString());
@ -116,41 +109,6 @@ void KSaveIOConfig::setAutoResume( bool _mode )
cfg.sync();
}
void KSaveIOConfig::setUseReverseProxy( bool mode )
{
KConfigGroup cfg (config(), "Proxy Settings");
cfg.writeEntry("ReversedException", mode);
cfg.sync();
}
void KSaveIOConfig::setProxyType(KProtocolManager::ProxyType type)
{
KConfigGroup cfg (config(), "Proxy Settings");
cfg.writeEntry("ProxyType", static_cast<int>(type));
cfg.sync();
}
QString KSaveIOConfig::noProxyFor()
{
KConfigGroup cfg(config(), "Proxy Settings");
return cfg.readEntry("NoProxyFor");
}
void KSaveIOConfig::setNoProxyFor( const QString& _noproxy )
{
KConfigGroup cfg (config(), "Proxy Settings");
cfg.writeEntry("NoProxyFor", _noproxy);
cfg.sync();
}
void KSaveIOConfig::setProxyFor( const QString& protocol,
const QString& _proxy )
{
KConfigGroup cfg (config(), "Proxy Settings");
cfg.writeEntry(protocol.toLower() + "Proxy", _proxy);
cfg.sync();
}
void KSaveIOConfig::updateRunningIOSlaves (QWidget *parent)
{
// Inform all running io-slaves about the changes...

View file

@ -34,22 +34,8 @@ void setReadTimeout (int);
void setConnectTimeout (int);
void setProxyConnectTimeout (int);
void setResponseTimeout (int);
/** Proxy Settings */
void setUseReverseProxy (bool);
void setProxyType (KProtocolManager::ProxyType);
void setProxyFor (const QString&, const QString&);
QString noProxyFor();
void setNoProxyFor (const QString&);
/** Miscellaneous Settings */
void setMarkPartial (bool);

View file

@ -34,12 +34,10 @@
// Local
#include "netpref.h"
#include "kproxydlg.h"
#include "bookmarks.h"
K_PLUGIN_FACTORY(KioConfigFactory,
registerPlugin<KIOPreferences>("netpref");
registerPlugin<KProxyDialog>("proxy");
registerPlugin<BookmarksConfigModule>("bookmarks");
)
K_EXPORT_PLUGIN(KioConfigFactory("kcmkio"))

View file

@ -46,11 +46,6 @@ KIOPreferences::KIOPreferences(QWidget *parent, const QVariantList &)
connect(sb_socketRead, SIGNAL(valueChanged(int)), SLOT(configChanged()));
timeoutLayout->addRow(i18n( "Soc&ket read:" ), sb_socketRead);
sb_proxyConnect = new KIntNumInput( 0, this );
sb_proxyConnect->setSuffix( ki18np( " second", " seconds" ) );
connect(sb_proxyConnect, SIGNAL(valueChanged(int)), SLOT(configChanged()));
timeoutLayout->addRow(i18n( "Pro&xy connect:" ), sb_proxyConnect);
sb_serverConnect = new KIntNumInput( 0, this );
sb_serverConnect->setSuffix( ki18np( " second", " seconds" ) );
connect(sb_serverConnect, SIGNAL(valueChanged(int)), SLOT(configChanged()));
@ -110,12 +105,10 @@ void KIOPreferences::load()
sb_socketRead->setRange( MIN_TIMEOUT_VALUE, MAX_TIMEOUT_VALUE );
sb_serverResponse->setRange( MIN_TIMEOUT_VALUE, MAX_TIMEOUT_VALUE );
sb_serverConnect->setRange( MIN_TIMEOUT_VALUE, MAX_TIMEOUT_VALUE );
sb_proxyConnect->setRange( MIN_TIMEOUT_VALUE, MAX_TIMEOUT_VALUE );
sb_socketRead->setValue( proto.readTimeout() );
sb_serverResponse->setValue( proto.responseTimeout() );
sb_serverConnect->setValue( proto.connectTimeout() );
sb_proxyConnect->setValue( proto.proxyConnectTimeout() );
KConfig config( "kio_ftprc", KConfig::NoGlobals );
cb_ftpEnablePasv->setChecked( !config.group("").readEntry( "DisablePassiveMode", false ) );
@ -132,7 +125,6 @@ void KIOPreferences::save()
KSaveIOConfig::setReadTimeout( sb_socketRead->value() );
KSaveIOConfig::setResponseTimeout( sb_serverResponse->value() );
KSaveIOConfig::setConnectTimeout( sb_serverConnect->value() );
KSaveIOConfig::setProxyConnectTimeout( sb_proxyConnect->value() );
KConfig config("kio_ftprc", KConfig::NoGlobals);
config.group("").writeEntry( "DisablePassiveMode", !cb_ftpEnablePasv->isChecked() );
@ -152,13 +144,12 @@ void KIOPreferences::defaults()
sb_socketRead->setValue( DEFAULT_READ_TIMEOUT );
sb_serverResponse->setValue( DEFAULT_RESPONSE_TIMEOUT );
sb_serverConnect->setValue( DEFAULT_CONNECT_TIMEOUT );
sb_proxyConnect->setValue( DEFAULT_PROXY_CONNECT_TIMEOUT );
cb_ftpEnablePasv->setChecked( true );
cb_ftpMarkPartial->setChecked( true );
sb_minimumKeepSize->setValue( DEFAULT_MINIMUM_KEEP_SIZE );
cb_AutoResume->setChecked( false );
cb_AutoResume->setChecked( true );
emit changed(true);
}

View file

@ -34,7 +34,6 @@ private:
QCheckBox* cb_ftpMarkPartial;
KIntNumInput* sb_socketRead;
KIntNumInput* sb_proxyConnect;
KIntNumInput* sb_serverConnect;
KIntNumInput* sb_serverResponse;

View file

@ -1,248 +0,0 @@
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KCModule
X-DocPath=kcontrol/proxy/index.html
Icon=preferences-system-network-proxy
Exec=kcmshell4 proxy
X-KDE-Library=kcm_kio
X-KDE-PluginKeyword=proxy
X-KDE-ParentApp=kcontrol
X-KDE-System-Settings-Parent-Category=network-settings
X-KDE-Weight=50
Name=Proxy
Name[af]=Volmag
Name[ar]=الوكيل
Name[as]=
Name[ast]=Proxy
Name[be]=Проксі
Name[be@latin]=Proxy
Name[bg]=Прокси сървър
Name[bn]=ি
Name[bn_IN]=ি
Name[br]=Proksi
Name[bs]=Proksi
Name[ca]=Intermediari
Name[ca@valencia]=Intermediari
Name[cs]=Proxy
Name[csb]=Pòstrzédnik (Proxy)
Name[cy]=Dirprwy
Name[da]=Proxy
Name[de]=Proxy
Name[el]=Διαμεσολαβητής
Name[en_GB]=Proxy
Name[eo]=Prokuriloj
Name[es]=Proxy
Name[et]=Puhverserver
Name[eu]=Proxy-a
Name[fa]=پیشکار
Name[fi]=Välityspalvelin
Name[fr]=Serveur mandataire (proxy)
Name[fy]=Proxy
Name[ga]=Seachfhreastalaí
Name[gl]=Proxy
Name[gu]=
Name[he]=מתווך
Name[hi]=
Name[hne]=
Name[hr]=Proxy
Name[hsb]=Proxy
Name[hu]=Proxy
Name[ia]=Proxy
Name[id]=Proxy
Name[is]=Milliþjónn
Name[it]=Proxy
Name[ja]=
Name[ka]=
Name[kk]=Прокси
Name[km]=
Name[kn]=ಿಿಿ (ಿ)
Name[ko]=
Name[ku]=Cihgir
Name[lt]=Įgaliotasis serveris
Name[lv]=Starpniekserveris
Name[mai]=
Name[mk]=Прокси
Name[ml]=ി
Name[mr]=
Name[ms]=Proksi
Name[nb]=Mellomtjener
Name[nds]=Proxy
Name[ne]=
Name[nl]=Proxy
Name[nn]=Mellomtenar
Name[oc]=Proxy
Name[or]=ି
Name[pa]=
Name[pl]=Pośrednik
Name[pt]=Proxy
Name[pt_BR]=Proxy
Name[ro]=Proxy
Name[ru]=Прокси-сервер
Name[se]=Gaskabálvá
Name[si]=
Name[sk]=Proxy
Name[sl]=Posredniški strežnik
Name[sr]=Прокси
Name[sr@ijekavian]=Прокси
Name[sr@ijekavianlatin]=Proksi
Name[sr@latin]=Proksi
Name[sv]=Proxyservrar
Name[ta]=ி
Name[te]=ి
Name[tg]=Proxy
Name[th]=
Name[tr]=Vekil Sunucu
Name[ug]=ۋاكالەتچى
Name[uk]=Проксі
Name[uz]=Proksi
Name[uz@cyrillic]=Прокси
Name[vi]=y nhim
Name[wa]=Procsi
Name[xh]=Umntu onegunya lokusebenzela omnye
Name[x-test]=xxProxyxx
Name[zh_CN]=
Name[zh_TW]=
Comment=Configure the proxy servers used
Comment[af]=Konfigureer die volmag bedieners gebruik word
Comment[ar]=اضبط خوادم الوكيل المستخدمة
Comment[as]= ি
Comment[ast]=Configuración de los sirvidores proxy usaos
Comment[be]=Настаўленні сервераў проксі
Comment[be@latin]=Naładź dziejnyja proxy-servery
Comment[bg]=Настройки на прокси сървъра
Comment[bn]= ি ি
Comment[bn_IN]= ি (ি) ি
Comment[br]=Kefluniañ ar servijeroù proksi implijet
Comment[bs]=Podešavanje proksi servera
Comment[ca]=Configura els servidors intermediaris emprats
Comment[ca@valencia]=Configura els servidors intermediaris emprats
Comment[cs]=Nastavení proxy serverů
Comment[csb]=Kònfigùracëjô pòstrzédniczącëch serwerów (proxy)
Comment[cy]=Ffurfweddu gweinyddion dirprwyol i'w defnyddio
Comment[da]=Indstil de proxyservere der bruges
Comment[de]=Proxy-Server einrichten
Comment[el]=Διαμορφώστε τους διαμεσολαβητές που χρησιμοποιούνται
Comment[en_GB]=Configure the proxy servers used
Comment[eo]=Agordi la prokurilon
Comment[es]=Configuración de los servidores proxy usados
Comment[et]=Kasutatavate puhverserverite seadistamine
Comment[eu]=Konfiguratu erabilitako proxy zerbitzariak
Comment[fa]=پیکربندی پیشکارهای استفادهشده
Comment[fi]=Välityspalvelimien asetukset
Comment[fr]=Configuration des serveurs mandataires (proxy) utilisés
Comment[fy]=Hjir kinne jo de Proxy-tsjinner ynstelle
Comment[ga]=Cumraigh na seachfhreastalaithe
Comment[gl]=Configurar os servidores proxy empregados
Comment[gu]= િ
Comment[he]=הגדרת שרתי הפרוקסי שבשימוש
Comment[hi]= ि
Comment[hne]= ि
Comment[hr]=Konfiguriranje proxy poslužitelja
Comment[hsb]=Nastajić, kotre proxyje so wužiwaja
Comment[hu]=A proxy kiszolgálók beállításai
Comment[ia]=Configura le servitores de proxy usate
Comment[id]=Atur server proxy yang digunakan
Comment[is]=Stilla milliþjóna sem á að nota
Comment[it]=Configura i server proxy da usare
Comment[ja]=
Comment[ka]=
Comment[kk]=Қолданатын прокси серверлерді баптау
Comment[km]=
Comment[kn]= ಿಿಿ ಿ (ಿ ) ಿ
Comment[ko]=
Comment[ku]=Proksiyan ava bike
Comment[lt]=Konfigūruoti naudojamus įgaliotuosius serverius
Comment[lv]=Šeit jūs varat konfigurēt izmantojamos starpniekserverus
Comment[mai]= ि
Comment[mk]=Конфигурирајте ги прокси-серверите кои се користат
Comment[ml]=ിിി ി ി
Comment[mr]=
Comment[ms]=Konfigur pelayan proksi yang digunakan
Comment[nb]=Sett opp mellomtjenere
Comment[nds]=De bruukten Proxies instellen
Comment[ne]= ि ि
Comment[nl]=Hier kunt u de Proxy-servers instellen
Comment[nn]=Oppsett av mellomtenarar
Comment[or]= ି ି
Comment[pa]=
Comment[pl]=Ustawienia serwerów pośredniczących (proxy)
Comment[pt]=Configurar os servidores 'proxy' usados
Comment[pt_BR]=Configura os servidores proxy usados
Comment[ro]=Configurează serverele proxy utilizate
Comment[ru]=Настройка соединения через прокси-сервер
Comment[se]=Heivet gaskabálváid mat geavahuvvojit
Comment[si]=
Comment[sk]=Nastavenie proxy serverov
Comment[sl]=Nastavitve posredniških strežnikov
Comment[sr]=Подешавање прокси сервера
Comment[sr@ijekavian]=Подешавање прокси сервера
Comment[sr@ijekavianlatin]=Podešavanje proksi servera
Comment[sr@latin]=Podešavanje proksi servera
Comment[sv]=Anpassa proxyservrar som används
Comment[ta]= ி ி ி
Comment[te]=ిి ి ి
Comment[tg]=Танзимоти хидматҳои proxy истифодашуда
Comment[th]=
Comment[tr]=Kullanılan vekil sunucuları yapılandır
Comment[ug]=ئىشلەتكەن ۋاكالەتچى مۇلازىمېتىر سەپلىمىسى
Comment[uk]=Налаштування проксі-сервера
Comment[uz]=Proksi serverlarini moslash
Comment[uz@cyrillic]=Прокси серверларини мослаш
Comment[vi]=Cu hình máy phc v y nhim đưc s dng
Comment[wa]=Apontyî les sierveus procsi eployîs
Comment[xh]=Qwalasela indlela abasebenziswa ngayo abancedisi be proxy
Comment[x-test]=xxConfigure the proxy servers usedxx
Comment[zh_CN]=
Comment[zh_TW]=使
X-KDE-Keywords=Proxy,Proxy server,Firewall,Squid
X-KDE-Keywords[bg]=Прокси,Прокси сървър,Защитна стена,Proxy,Proxy server,Firewall,Squid
X-KDE-Keywords[bs]=Proxy,Proxy server,Firewall,Squid
X-KDE-Keywords[ca]=Intermediari,Servidor intermediari,Tallafocs,Squid
X-KDE-Keywords[ca@valencia]=Intermediari,Servidor intermediari,Tallafocs,Squid
X-KDE-Keywords[da]=Proxy,Proxy-server,Firewall,Squid
X-KDE-Keywords[de]=Proxy,Proxy-Server,Firewall,Squid
X-KDE-Keywords[el]=Διαμεσολαβητής,εξυπηρετητής διαμεσολάβησης,τείχος προστασίας,squid
X-KDE-Keywords[en_GB]=Proxy,Proxy server,Firewall,Squid
X-KDE-Keywords[es]=Proxy,Servidor proxy,Cortafuegos,Squid
X-KDE-Keywords[et]=Puhver,Puhverserver,Tulemüür,Squid
X-KDE-Keywords[fi]=Proxy,Välitys,Välityspalvelin,Firewall,Palomuuri,Squid
X-KDE-Keywords[fr]=Serveur mandataire, serveur (proxy), pare-feu, squid
X-KDE-Keywords[ga]=Seachfhreastalaí,Balla Dóiteáin,Squid
X-KDE-Keywords[gl]=Proxy,servidor proxy,devasa,Squid
X-KDE-Keywords[he]=Proxy,Proxy server,Firewall,Squid,פרוקסי,מתווך,שרת,חמת אש, חומה
X-KDE-Keywords[hu]=Proxy,Proxy kiszolgáló,Tűzfal,Squid
X-KDE-Keywords[ia]=Proxy,Servitor de Proxy,Talia Foco,Squid
X-KDE-Keywords[id]=Proxy,server Proxy,Firewall,Squid
X-KDE-Keywords[it]=Proxy,Server proxy server,Firewall,Squid
X-KDE-Keywords[kk]=Proxy,Proxy server,Firewall,Squid,Прокси
X-KDE-Keywords[km]= Squid
X-KDE-Keywords[ko]=Proxy,Proxy server,Firewall,Squid,proxy,, ,
X-KDE-Keywords[lt]=Įgaliotasis serveris,Įgaliotasis,Užkarda,Squid
X-KDE-Keywords[nb]=Mellomtjener,Brannmur,Squid
X-KDE-Keywords[nds]=Proxy,Proxy-Server,Nettdiek,Squid
X-KDE-Keywords[nl]=Proxy,proxy-server,firewall,squid
X-KDE-Keywords[pa]=, ,,ਿ
X-KDE-Keywords[pl]=Pośrednik,Serwer pośrednika,Zapora sieciowa,Squid
X-KDE-Keywords[pt]=Proxy,servidor proxy,Firewall,Squid
X-KDE-Keywords[pt_BR]=Proxy,Servidor proxy,Firewall,Squid
X-KDE-Keywords[ro]=Proxy,server proxy,paravan de protecție,squid
X-KDE-Keywords[ru]=Proxy,Proxy server,Firewall,Squid,прокси,прокси-сервер,брандмауэр,защитный экран
X-KDE-Keywords[sk]=Proxy,Proxy server,Firewall,Squid
X-KDE-Keywords[sl]=Proxy,Posredniški strežnik,Požarni zid,Squid
X-KDE-Keywords[sr]=Proxy,Proxy server,Firewall,Squid,прокси,прокси сервер,Сквид,заштитни зид
X-KDE-Keywords[sr@ijekavian]=Proxy,Proxy server,Firewall,Squid,прокси,прокси сервер,Сквид,заштитни зид
X-KDE-Keywords[sr@ijekavianlatin]=Proxy,Proxy server,Firewall,Squid,proksi,proksi server,Squid,zaštitni zid
X-KDE-Keywords[sr@latin]=Proxy,Proxy server,Firewall,Squid,proksi,proksi server,Squid,zaštitni zid
X-KDE-Keywords[sv]=Proxy,Proxyserver,Brandvägg,Squid
X-KDE-Keywords[tr]=Vekil,Vekil sunucu,Firewall,Squid
X-KDE-Keywords[uk]=Proxy;Proxy server;Firewall;Squid;proxy;проксі;сервер;проксі-сервер;брандмауер;файрвол
X-KDE-Keywords[wa]=Procsi,sierveu Procsi,Côpe-feu,Squid
X-KDE-Keywords[x-test]=xxProxy,Proxy server,Firewall,Squidxx
X-KDE-Keywords[zh_CN]=Proxy,Proxy server,Firewall,Squid,,,
X-KDE-Keywords[zh_TW]=Proxy,Proxy server,Firewall,Squid