diff --git a/mirall.qrc b/mirall.qrc
index 166f2d228..8fa43ed64 100644
--- a/mirall.qrc
+++ b/mirall.qrc
@@ -11,6 +11,7 @@
resources/view-refresh.png
resources/warning-16.png
resources/settings.png
+ resources/network.png
resources/owncloud_logo_blue.png
diff --git a/resources/network.png b/resources/network.png
new file mode 100644
index 000000000..9fe126e17
Binary files /dev/null and b/resources/network.png differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 38fcab91b..44c7b1f31 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,6 +21,7 @@ mirall/owncloudwizardresultpage.ui
mirall/sslerrordialog.ui
mirall/settingsdialog.ui
mirall/generalsettings.ui
+mirall/networksettings.ui
mirall/accountsettings.ui
mirall/ignorelisteditor.ui
mirall/fileitemdialog.ui
@@ -160,8 +161,9 @@ set(mirall_SRCS
mirall/fileitemdialog.cpp
mirall/settingsdialog.cpp
mirall/generalsettings.cpp
- mirall/ignorelisteditor.cpp
+ mirall/networksettings.cpp
mirall/accountsettings.cpp
+ mirall/ignorelisteditor.cpp
)
set(mirall_HEADERS
@@ -177,6 +179,7 @@ set(mirall_HEADERS
mirall/fileitemdialog.h
mirall/settingsdialog.h
mirall/generalsettings.h
+ mirall/networksettings.h
mirall/accountsettings.h
mirall/ignorelisteditor.h
)
diff --git a/src/mirall/accountsettings.ui b/src/mirall/accountsettings.ui
index 45692c94a..1009cd4d0 100644
--- a/src/mirall/accountsettings.ui
+++ b/src/mirall/accountsettings.ui
@@ -6,7 +6,7 @@
0
0
- 639
+ 607
385
diff --git a/src/mirall/csyncthread.cpp b/src/mirall/csyncthread.cpp
index 990aed361..a8864a948 100644
--- a/src/mirall/csyncthread.cpp
+++ b/src/mirall/csyncthread.cpp
@@ -315,6 +315,24 @@ void CSyncThread::startSync()
// cleans up behind us and emits finished() to ease error handling
CSyncRunScopeHelper helper(_csync_ctx, this);
+ // maybe move this somewhere else where it can influence a running sync?
+ MirallConfigFile cfg;
+
+ int downloadLimit = 0;
+ if (cfg.useDownloadLimit()) {
+ downloadLimit = cfg.downloadLimit();
+ }
+ csync_set_module_property(_csync_ctx, "bandwidth_limit_download", &downloadLimit);
+
+ int uploadLimit = -75; // 75%
+ int useDlLimit = cfg.useDownloadLimit();
+ if ( useDlLimit > 1) {
+ uploadLimit = cfg.downloadLimit();
+ } else if (useDlLimit == 0) {
+ uploadLimit = 0;
+ }
+ csync_set_module_property(_csync_ctx, "bandwidth_limit_upload", &uploadLimit);
+
csync_set_file_progress_callback( _csync_ctx, cb_file_progress );
csync_set_overall_progress_callback( _csync_ctx, cb_overall_progress );
diff --git a/src/mirall/generalsettings.cpp b/src/mirall/generalsettings.cpp
index 85c1980b7..aedab297e 100644
--- a/src/mirall/generalsettings.cpp
+++ b/src/mirall/generalsettings.cpp
@@ -30,15 +30,6 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
{
_ui->setupUi(this);
- _ui->hostLineEdit->setPlaceholderText(tr("Hostname of proxy server"));
- _ui->userLineEdit->setPlaceholderText(tr("Username for proxy server"));
- _ui->passwordLineEdit->setPlaceholderText(tr("Password for proxy server"));
-
- _ui->typeComboBox->addItem(tr("HTTP(S) proxy"), QNetworkProxy::HttpProxy);
- _ui->typeComboBox->addItem(tr("SOCKS5 proxy"), QNetworkProxy::Socks5Proxy);
-
- MirallConfigFile cfgFile;
- _ui->desktopNotificationsCheckBox->setChecked(cfgFile.optionalDesktopNotifications());
connect(_ui->desktopNotificationsCheckBox, SIGNAL(toggled(bool)),
SLOT(slotToggleOptionalDesktopNotifications(bool)));
@@ -54,28 +45,10 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
_ui->aboutLabel->setOpenExternalLinks(true);
}
- _ui->authRequiredcheckBox->setEnabled(true);
-
- connect(_ui->manualProxyRadioButton, SIGNAL(toggled(bool)),
- _ui->manualSettings, SLOT(setEnabled(bool)));
- connect(_ui->manualProxyRadioButton, SIGNAL(toggled(bool)),
- _ui->typeComboBox, SLOT(setEnabled(bool)));
- connect(_ui->authRequiredcheckBox, SIGNAL(toggled(bool)),
- _ui->authWidgets, SLOT(setEnabled(bool)));
-
- loadProxySettings();
loadMiscSettings();
// misc
connect(_ui->monoIconsCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
-
- // proxy
- connect(_ui->typeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(saveProxySettings()));
- connect(_ui->proxyButtonGroup, SIGNAL(buttonClicked(int)), SLOT(saveProxySettings()));
- connect(_ui->hostLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
- connect(_ui->userLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
- connect(_ui->passwordLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
- connect(_ui->portSpinBox, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
}
GeneralSettings::~GeneralSettings()
@@ -83,44 +56,11 @@ GeneralSettings::~GeneralSettings()
delete _ui;
}
-void GeneralSettings::loadProxySettings()
-{
- // load current proxy settings
- Mirall::MirallConfigFile cfgFile;
- int type = cfgFile.proxyType();
- switch (type) {
- case QNetworkProxy::NoProxy:
- _ui->noProxyRadioButton->setChecked(true);
- break;
- case QNetworkProxy::DefaultProxy:
- _ui->systemProxyRadioButton->setChecked(true);
- break;
- case QNetworkProxy::Socks5Proxy:
- case QNetworkProxy::HttpProxy:
- _ui->typeComboBox->setCurrentIndex(_ui->typeComboBox->findData(type));
- _ui->manualProxyRadioButton->setChecked(true);
- break;
- default:
- break;
- }
-
- _ui->hostLineEdit->setText(cfgFile.proxyHostName());
- int port = cfgFile.proxyPort();
- if (port == 0)
- port = 8080;
- _ui->portSpinBox->setValue(port);
- if (!cfgFile.proxyUser().isEmpty())
- {
- _ui->authRequiredcheckBox->setChecked(true);
- _ui->userLineEdit->setText(cfgFile.proxyUser());
- _ui->passwordLineEdit->setText(cfgFile.proxyPassword());
- }
-}
-
void GeneralSettings::loadMiscSettings()
{
MirallConfigFile cfgFile;
_ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons());
+ _ui->desktopNotificationsCheckBox->setChecked(cfgFile.optionalDesktopNotifications());
}
void GeneralSettings::saveMiscSettings()
@@ -143,24 +83,4 @@ void GeneralSettings::slotToggleOptionalDesktopNotifications(bool enable)
cfgFile.setOptionalDesktopNotifications(enable);
}
-void GeneralSettings::saveProxySettings()
-{
- MirallConfigFile cfgFile;
-
- if (_ui->noProxyRadioButton->isChecked()){
- cfgFile.setProxyType(QNetworkProxy::NoProxy);
- } else if (_ui->systemProxyRadioButton->isChecked()){
- cfgFile.setProxyType(QNetworkProxy::DefaultProxy);
- } else if (_ui->manualProxyRadioButton->isChecked()) {
- int type = _ui->typeComboBox->itemData(_ui->typeComboBox->currentIndex()).toInt();
- bool needsAuth = _ui->authRequiredcheckBox->isChecked();
- QString user = _ui->userLineEdit->text();
- QString pass = _ui->passwordLineEdit->text();
- cfgFile.setProxyType(type, _ui->hostLineEdit->text(),
- _ui->portSpinBox->value(), needsAuth, user, pass);
- }
-
- emit proxySettingsChanged();
-}
-
} // namespace Mirall
diff --git a/src/mirall/generalsettings.h b/src/mirall/generalsettings.h
index a81c9d4c2..f0c9ca671 100644
--- a/src/mirall/generalsettings.h
+++ b/src/mirall/generalsettings.h
@@ -35,13 +35,11 @@ signals:
void proxySettingsChanged();
private slots:
- void saveProxySettings();
void saveMiscSettings();
void slotToggleLaunchOnStartup(bool);
void slotToggleOptionalDesktopNotifications(bool);
private:
- void loadProxySettings();
void loadMiscSettings();
Ui::GeneralSettings *_ui;
diff --git a/src/mirall/generalsettings.ui b/src/mirall/generalsettings.ui
index 6a9851d3e..5c67c13dd 100644
--- a/src/mirall/generalsettings.ui
+++ b/src/mirall/generalsettings.ui
@@ -7,7 +7,7 @@
0
0
468
- 408
+ 169
@@ -44,168 +44,6 @@
- -
-
-
- true
-
-
- Proxy Settings
-
-
-
-
-
-
- No Proxy
-
-
- true
-
-
- proxyButtonGroup
-
-
-
- -
-
-
- Use system proxy
-
-
- proxyButtonGroup
-
-
-
- -
-
-
- Specify proxy manually as
-
-
- proxyButtonGroup
-
-
-
- -
-
-
- false
-
-
-
- -
-
-
- false
-
-
-
- 0
-
-
-
-
-
-
-
-
- Host
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
- :
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- 1
-
-
- 65535
-
-
- 8080
-
-
-
-
-
- -
-
-
- false
-
-
- Proxy server requires authentication
-
-
-
- -
-
-
- false
-
-
-
- 0
-
-
-
-
-
- true
-
-
-
-
-
-
- -
-
-
- true
-
-
-
-
-
- QLineEdit::Password
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/mirall/mirallconfigfile.cpp b/src/mirall/mirallconfigfile.cpp
index 687f194f2..21817c944 100644
--- a/src/mirall/mirallconfigfile.cpp
+++ b/src/mirall/mirallconfigfile.cpp
@@ -46,6 +46,11 @@ static const char proxyUserC[] = "Proxy/user";
static const char proxyPassC[] = "Proxy/pass";
static const char proxyNeedsAuthC[] = "Proxy/needsAuth";
+static const char useUploadLimitC[] = "BWLimit/useUploadLimit";
+static const char useDownloadLimitC[] = "BWLimit/useDownloadLimit";
+static const char uploadLimitC[] = "BWLimit/uploadLimit";
+static const char downloadLimitC[] = "BWLimit/downloadLimit";
+
static const char seenVersionC[] = "Updater/seenVersion";
static const char maxLogLinesC[] = "Logging/maxLogLines";
@@ -556,14 +561,23 @@ void MirallConfigFile::setProxyType(int proxyType,
settings.sync();
}
-QVariant MirallConfigFile::getValue(const QString& param, const QString& group) const
+QVariant MirallConfigFile::getValue(const QString& param, const QString& group,
+ const QVariant& defaultValue) const
{
QSettings settings( configFile(), QSettings::IniFormat );
settings.setIniCodec( "UTF-8" );
if (!group.isEmpty())
settings.beginGroup(group);
- return settings.value(param);
+ return settings.value(param, defaultValue);
+}
+
+void MirallConfigFile::setValue(const QString& key, const QVariant &value)
+{
+ QSettings settings( configFile(), QSettings::IniFormat );
+ settings.setIniCodec( "UTF-8" );
+
+ settings.setValue(key, value);
}
int MirallConfigFile::proxyType() const
@@ -597,6 +611,46 @@ QString MirallConfigFile::proxyPassword() const
return QString::fromUtf8(QByteArray::fromBase64(pass));
}
+int MirallConfigFile::useUploadLimit() const
+{
+ return getValue(useUploadLimitC, QString::null, -1).toInt();
+}
+
+bool MirallConfigFile::useDownloadLimit() const
+{
+ return getValue(useDownloadLimitC, QString::null, false).toBool();
+}
+
+void MirallConfigFile::setUseUploadLimit(int val)
+{
+ setValue(useUploadLimitC, val);
+}
+
+void MirallConfigFile::setUseDownloadLimit(bool enable)
+{
+ setValue(useDownloadLimitC, enable);
+}
+
+int MirallConfigFile::uploadLimit() const
+{
+ return getValue(uploadLimitC, QString::null, 10).toInt();
+}
+
+int MirallConfigFile::downloadLimit() const
+{
+ return getValue(downloadLimitC, QString::null, 80).toInt();
+}
+
+void MirallConfigFile::setUploadLimit(int kbytes)
+{
+ setValue(uploadLimitC, kbytes);
+}
+
+void MirallConfigFile::setDownloadLimit(int kbytes)
+{
+ setValue(downloadLimitC, kbytes);
+}
+
bool MirallConfigFile::monoIcons() const
{
QSettings settings( configFile(), QSettings::IniFormat );
diff --git a/src/mirall/mirallconfigfile.h b/src/mirall/mirallconfigfile.h
index 7965affbb..e2707fd3d 100644
--- a/src/mirall/mirallconfigfile.h
+++ b/src/mirall/mirallconfigfile.h
@@ -16,8 +16,8 @@
#define MIRALLCONFIGFILE_H
#include
+#include
-class QVariant;
class QWidget;
namespace Mirall {
@@ -95,6 +95,16 @@ public:
QString proxyUser() const;
QString proxyPassword() const;
+ /** 0: no limit, 1: manual, >0: automatic */
+ int useUploadLimit() const;
+ bool useDownloadLimit() const;
+ void setUseUploadLimit(int);
+ void setUseDownloadLimit(bool);
+ int uploadLimit() const;
+ int downloadLimit() const;
+ void setUploadLimit(int kbytes);
+ void setDownloadLimit(int kbytes);
+
static void setConfDir(const QString &value);
bool optionalDesktopNotifications() const;
@@ -114,15 +124,15 @@ protected:
bool writePassword( const QString& passwd, const QString& connection = QString() );
private:
- QVariant getValue(const QString& param, const QString& group = QString::null) const;
-
+ QVariant getValue(const QString& param, const QString& group = QString::null,
+ const QVariant& defaultValue = QVariant()) const;
+ void setValue(const QString& key, const QVariant &value);
private:
static bool _askedUser;
static QString _oCVersion;
static QString _confDir;
QString _customHandle;
-
};
}
diff --git a/src/mirall/networksettings.cpp b/src/mirall/networksettings.cpp
new file mode 100644
index 000000000..2d184999c
--- /dev/null
+++ b/src/mirall/networksettings.cpp
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) by Daniel Molkentin
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program 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 General Public License
+ * for more details.
+ */
+
+#include "networksettings.h"
+#include "ui_networksettings.h"
+
+#include "mirall/theme.h"
+#include "mirall/mirallconfigfile.h"
+#include "mirall/application.h"
+#include "mirall/utility.h"
+#include "mirall/mirallconfigfile.h"
+
+#include
+
+namespace Mirall {
+
+NetworkSettings::NetworkSettings(QWidget *parent) :
+ QWidget(parent),
+ _ui(new Ui::NetworkSettings)
+{
+ _ui->setupUi(this);
+
+ _ui->hostLineEdit->setPlaceholderText(tr("Hostname of proxy server"));
+ _ui->userLineEdit->setPlaceholderText(tr("Username for proxy server"));
+ _ui->passwordLineEdit->setPlaceholderText(tr("Password for proxy server"));
+
+ _ui->typeComboBox->addItem(tr("HTTP(S) proxy"), QNetworkProxy::HttpProxy);
+ _ui->typeComboBox->addItem(tr("SOCKS5 proxy"), QNetworkProxy::Socks5Proxy);
+
+ _ui->authRequiredcheckBox->setEnabled(true);
+
+ connect(_ui->manualProxyRadioButton, SIGNAL(toggled(bool)),
+ _ui->manualSettings, SLOT(setEnabled(bool)));
+ connect(_ui->manualProxyRadioButton, SIGNAL(toggled(bool)),
+ _ui->typeComboBox, SLOT(setEnabled(bool)));
+ connect(_ui->authRequiredcheckBox, SIGNAL(toggled(bool)),
+ _ui->authWidgets, SLOT(setEnabled(bool)));
+
+ loadProxySettings();
+ loadBWLimitSettings();
+
+ // proxy
+ connect(_ui->typeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(saveProxySettings()));
+ connect(_ui->proxyButtonGroup, SIGNAL(buttonClicked(int)), SLOT(saveProxySettings()));
+ connect(_ui->hostLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
+ connect(_ui->userLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
+ connect(_ui->passwordLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
+ connect(_ui->portSpinBox, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
+
+ connect(_ui->uploadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
+ connect(_ui->noUploadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
+ connect(_ui->autoUploadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
+ connect(_ui->downloadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
+ connect(_ui->noDownloadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
+ connect(_ui->downloadSpinBox, SIGNAL(valueChanged(int)), SLOT(saveBWLimitSettings()));
+ connect(_ui->uploadSpinBox, SIGNAL(valueChanged(int)), SLOT(saveBWLimitSettings()));
+}
+
+NetworkSettings::~NetworkSettings()
+{
+ delete _ui;
+}
+
+void NetworkSettings::loadProxySettings()
+{
+ // load current proxy settings
+ Mirall::MirallConfigFile cfgFile;
+ int type = cfgFile.proxyType();
+ switch (type) {
+ case QNetworkProxy::NoProxy:
+ _ui->noProxyRadioButton->setChecked(true);
+ break;
+ case QNetworkProxy::DefaultProxy:
+ _ui->systemProxyRadioButton->setChecked(true);
+ break;
+ case QNetworkProxy::Socks5Proxy:
+ case QNetworkProxy::HttpProxy:
+ _ui->typeComboBox->setCurrentIndex(_ui->typeComboBox->findData(type));
+ _ui->manualProxyRadioButton->setChecked(true);
+ break;
+ default:
+ break;
+ }
+
+ _ui->hostLineEdit->setText(cfgFile.proxyHostName());
+ int port = cfgFile.proxyPort();
+ if (port == 0)
+ port = 8080;
+ _ui->portSpinBox->setValue(port);
+ if (!cfgFile.proxyUser().isEmpty())
+ {
+ _ui->authRequiredcheckBox->setChecked(true);
+ _ui->userLineEdit->setText(cfgFile.proxyUser());
+ _ui->passwordLineEdit->setText(cfgFile.proxyPassword());
+ }
+}
+
+void NetworkSettings::loadBWLimitSettings()
+{
+ MirallConfigFile cfgFile;
+ _ui->downloadLimitRadioButton->setChecked(cfgFile.useDownloadLimit());
+ int uploadLimit = cfgFile.useUploadLimit();
+ if ( uploadLimit >= 1 ) {
+ _ui->downloadLimitRadioButton->setChecked(true);
+ } else if (uploadLimit == 0){
+ _ui->noDownloadLimitRadioButton->setChecked(true);
+ } else {
+ _ui->autoUploadLimitRadioButton->setChecked(true);
+ }
+ _ui->downloadSpinBox->setValue(cfgFile.downloadLimit());
+ _ui->uploadSpinBox->setValue(cfgFile.uploadLimit());
+}
+
+void NetworkSettings::saveProxySettings()
+{
+ MirallConfigFile cfgFile;
+
+ if (_ui->noProxyRadioButton->isChecked()){
+ cfgFile.setProxyType(QNetworkProxy::NoProxy);
+ } else if (_ui->systemProxyRadioButton->isChecked()){
+ cfgFile.setProxyType(QNetworkProxy::DefaultProxy);
+ } else if (_ui->manualProxyRadioButton->isChecked()) {
+ int type = _ui->typeComboBox->itemData(_ui->typeComboBox->currentIndex()).toInt();
+ bool needsAuth = _ui->authRequiredcheckBox->isChecked();
+ QString user = _ui->userLineEdit->text();
+ QString pass = _ui->passwordLineEdit->text();
+ cfgFile.setProxyType(type, _ui->hostLineEdit->text(),
+ _ui->portSpinBox->value(), needsAuth, user, pass);
+ }
+
+ emit proxySettingsChanged();
+}
+
+void NetworkSettings::saveBWLimitSettings()
+{
+ MirallConfigFile cfgFile;
+ cfgFile.setUseDownloadLimit(_ui->downloadLimitRadioButton->isChecked());
+
+ if (_ui->uploadLimitRadioButton->isChecked()) {
+ cfgFile.setUseUploadLimit(1);
+ } else if (_ui->noUploadLimitRadioButton->isChecked()) {
+ cfgFile.setUseUploadLimit(0);
+ } else if (_ui->autoUploadLimitRadioButton->isChecked()) {
+ cfgFile.setUseUploadLimit(-1);
+ }
+
+ cfgFile.setDownloadLimit(_ui->downloadSpinBox->value());
+ cfgFile.setUploadLimit(_ui->uploadSpinBox->value());
+}
+
+} // namespace Mirall
diff --git a/src/mirall/networksettings.h b/src/mirall/networksettings.h
new file mode 100644
index 000000000..9788ba554
--- /dev/null
+++ b/src/mirall/networksettings.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) by Daniel Molkentin
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program 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 General Public License
+ * for more details.
+ */
+
+#ifndef MIRALL_NETWORKSETTINGS_H
+#define MIRALL_NETWORKSETTINGS_H
+
+#include
+
+
+namespace Mirall {
+
+namespace Ui {
+class NetworkSettings;
+}
+
+class NetworkSettings : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit NetworkSettings(QWidget *parent = 0);
+ ~NetworkSettings();
+
+signals:
+ void proxySettingsChanged();
+
+private slots:
+ void saveProxySettings();
+ void saveBWLimitSettings();
+
+private:
+ void loadProxySettings();
+ void loadBWLimitSettings();
+
+ Ui::NetworkSettings *_ui;
+};
+
+
+} // namespace Mirall
+#endif // MIRALL_NETWORKSETTINGS_H
diff --git a/src/mirall/networksettings.ui b/src/mirall/networksettings.ui
new file mode 100644
index 000000000..0c5fb8ce4
--- /dev/null
+++ b/src/mirall/networksettings.ui
@@ -0,0 +1,399 @@
+
+
+ Mirall::NetworkSettings
+
+
+
+ 0
+ 0
+ 558
+ 390
+
+
+
+ Form
+
+
+
-
+
+
+ true
+
+
+ Proxy Settings
+
+
+
-
+
+
+ No Proxy
+
+
+ true
+
+
+ proxyButtonGroup
+
+
+
+ -
+
+
+ Use system proxy
+
+
+ proxyButtonGroup
+
+
+
+ -
+
+
+ Specify proxy manually as
+
+
+ proxyButtonGroup
+
+
+
+ -
+
+
+ false
+
+
+
+ -
+
+
+ false
+
+
+
+ 0
+
+
-
+
+
-
+
+
+ Host
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+ -
+
+
+ :
+
+
+
+ -
+
+
+ false
+
+
+
+ 0
+ 0
+
+
+
+ 1
+
+
+ 65535
+
+
+ 8080
+
+
+
+
+
+ -
+
+
+ false
+
+
+ Proxy server requires authentication
+
+
+
+ -
+
+
+ false
+
+
+
+ 0
+
+
-
+
+
+ false
+
+
+
+
+
+
+ -
+
+
+ false
+
+
+
+
+
+ QLineEdit::Password
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ Download Bandwidth
+
+
+
-
+
+
+ Limit to
+
+
+
+ -
+
+
-
+
+
+ false
+
+
+ 9999
+
+
+ 80
+
+
+
+ -
+
+
+ KBytes/s
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 147
+ 25
+
+
+
+
+ -
+
+
+ Do not Limit
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+ -
+
+
+ Upload Bandwidth
+
+
+
-
+
+
+ Do Not Limit
+
+
+
+ -
+
+
+ Automatically Limit
+
+
+ true
+
+
+
+ -
+
+
+ Limit to
+
+
+
+ -
+
+
-
+
+
+ false
+
+
+ 1
+
+
+ 9999
+
+
+ 10
+
+
+
+ -
+
+
+ KBytes/s
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 147
+ 6
+
+
+
+
+
+ autoUploadLimitRadioButton
+ uploadLimitRadioButton
+ verticalSpacer_3
+ horizontalSpacer_2
+ noUploadLimitRadioButton
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 0
+
+
+
+
+
+
+
+
+
+ downloadLimitRadioButton
+ toggled(bool)
+ downloadSpinBox
+ setEnabled(bool)
+
+
+ 73
+ 69
+
+
+ 131
+ 78
+
+
+
+
+ uploadLimitRadioButton
+ toggled(bool)
+ uploadSpinBox
+ setEnabled(bool)
+
+
+ 322
+ 101
+
+
+ 411
+ 106
+
+
+
+
+
+
+
+
diff --git a/src/mirall/settingsdialog.cpp b/src/mirall/settingsdialog.cpp
index e588b265f..d27ea6f1b 100644
--- a/src/mirall/settingsdialog.cpp
+++ b/src/mirall/settingsdialog.cpp
@@ -17,6 +17,7 @@
#include "mirall/folderman.h"
#include "mirall/theme.h"
#include "mirall/generalsettings.h"
+#include "mirall/networksettings.h"
#include "mirall/accountsettings.h"
#include "mirall/application.h"
#include "mirall/mirallconfigfile.h"
@@ -52,10 +53,17 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) :
general->setSizeHint(QSize(0, 32));
_ui->labelWidget->addItem(general);
GeneralSettings *generalSettings = new GeneralSettings;
- connect(generalSettings, SIGNAL(proxySettingsChanged()), app, SLOT(slotSetupProxy()));
- connect(generalSettings, SIGNAL(proxySettingsChanged()), FolderMan::instance(), SLOT(slotScheduleAllFolders()));
_ui->stack->addWidget(generalSettings);
+ QIcon networkIcon(QLatin1String(":/mirall/resources/network.png"));
+ QListWidgetItem *network = new QListWidgetItem(networkIcon, tr("Network"), _ui->labelWidget);
+ network->setSizeHint(QSize(0, 32));
+ _ui->labelWidget->addItem(network);
+ NetworkSettings *networkSettings = new NetworkSettings;
+ _ui->stack->addWidget(networkSettings);
+ connect(networkSettings, SIGNAL(proxySettingsChanged()), app, SLOT(slotSetupProxy()));
+ connect(networkSettings, SIGNAL(proxySettingsChanged()), FolderMan::instance(), SLOT(slotScheduleAllFolders()));
+
//connect(generalSettings, SIGNAL(resizeToSizeHint()), SLOT(resizeToSizeHint()));
_accountSettings = new AccountSettings(this);
diff --git a/src/mirall/settingsdialog.ui b/src/mirall/settingsdialog.ui
index fbbbce77b..6fdf6e422 100644
--- a/src/mirall/settingsdialog.ui
+++ b/src/mirall/settingsdialog.ui
@@ -7,7 +7,7 @@
0
0
704
- 515
+ 299