Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2015-10-22 18:57:34 +0300
committerOlivier Goffart <ogoffart@woboq.com>2015-10-22 18:57:34 +0300
commit6a0633083d5dc3823439e4648573b6cc319c679b (patch)
treeb3b8e56104645cb7415ab894738d09f1beb7c141 /src/gui/networksettings.cpp
parentc8590c44685e4ef00c0e868774b68207fb6829c3 (diff)
Network Settings: Adjust the bandwidth limit option with old Qt
- Disable the whole group box - Add a tooltip explaining why it is disabled - Make sure it is disabled in the settings in case of upgrade - Do a runtime check in case the running Qt is greater
Diffstat (limited to 'src/gui/networksettings.cpp')
-rw-r--r--src/gui/networksettings.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/gui/networksettings.cpp b/src/gui/networksettings.cpp
index 2c5a22a71..6a21f0466 100644
--- a/src/gui/networksettings.cpp
+++ b/src/gui/networksettings.cpp
@@ -117,23 +117,29 @@ void NetworkSettings::loadProxySettings()
void NetworkSettings::loadBWLimitSettings()
{
+ ConfigFile cfgFile;
+
#if QT_VERSION < QT_VERSION_CHECK(5,3,3)
- // QNAM bandwith limiting only works with versions of Qt greater or equal to 5.3.3
+ // QNAM bandwidth limiting only works with versions of Qt greater or equal to 5.3.3
// (It needs Qt commits 097b641 and b99fa32)
- _ui->noDownloadLimitRadioButton->setChecked(true);
- _ui->downloadLimitRadioButton->setEnabled(false);
- _ui->noDownloadLimitRadioButton->setEnabled(false);
- _ui->autoDownloadLimitRadioButton->setEnabled(false);
-
- _ui->noUploadLimitRadioButton->setChecked(true);
- _ui->uploadLimitRadioButton->setEnabled(false);
- _ui->noUploadLimitRadioButton->setEnabled(false);
- _ui->autoUploadLimitRadioButton->setEnabled(false);
- return;
-#endif
- ConfigFile cfgFile;
+ const char *v = qVersion(); // "x.y.z";
+ if (QLatin1String(v) < QLatin1String("5.3.3")) {
+ QString tooltip = tr("Qt >= 5.4 is required in order to use the bandwidth limit");
+ _ui->downloadBox->setEnabled(false);
+ _ui->uploadBox->setEnabled(false);
+ _ui->downloadBox->setToolTip(tooltip);
+ _ui->uploadBox->setToolTip(tooltip);
+ _ui->noDownloadLimitRadioButton->setChecked(true);
+ _ui->noUploadLimitRadioButton->setChecked(true);
+ if (cfgFile.useUploadLimit() != 0 || cfgFile.useDownloadLimit() != 0) {
+ // Update from old mirall that was using neon propagator jobs.
+ saveBWLimitSettings();
+ }
+ return;
+ }
+#endif
int useDownloadLimit = cfgFile.useDownloadLimit();
if ( useDownloadLimit >= 1 ) {
_ui->downloadLimitRadioButton->setChecked(true);