diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index a1688867d..7651ec42b 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -1599,6 +1599,9 @@ void MainWindow::setStatus(QObject *pObject, RsStatusValue nStatus) setStatusObject(*it, nStatus); } } + + rsConfig->setIsIdle(isIdle); + rsConfig->setOperatingMode(rsConfig->getOperatingMode()); } /* new status from context menu */ diff --git a/retroshare-gui/src/gui/QuickStartWizard.cpp b/retroshare-gui/src/gui/QuickStartWizard.cpp index 1b74bbb34..3509b69ee 100644 --- a/retroshare-gui/src/gui/QuickStartWizard.cpp +++ b/retroshare-gui/src/gui/QuickStartWizard.cpp @@ -159,10 +159,10 @@ void QuickStartWizard::on_pushButtonConnectionNext_clicked() { rsPeers->setVisState(rsPeers->getOwnId(), vs_disc, vs_dht); } - - rsConfig->SetMaxDataRates( ui.doubleSpinBoxDownloadSpeed->value(), ui.doubleSpinBoxUploadSpeed->value() ); - ui.pagesWizard->setCurrentIndex(2); + rsConfig->setMaxDataRates( ui.doubleSpinBoxDownloadSpeed->value(), ui.doubleSpinBoxUploadSpeed->value(), ui.doubleSpinBoxDownloadSpeed->value(), ui.doubleSpinBoxUploadSpeed->value() ); + + ui.pagesWizard->setCurrentIndex(2); } void QuickStartWizard::on_pushButtonConnectionExit_clicked() @@ -488,10 +488,12 @@ void QuickStartWizard::loadNetwork() ui.discoveryComboBox->setCurrentIndex(netIndex); int dlrate = 0; - int ulrate = 0; - rsConfig->GetMaxDataRates(dlrate, ulrate); - ui.doubleSpinBoxDownloadSpeed->setValue(dlrate); - ui.doubleSpinBoxUploadSpeed->setValue(ulrate); + int ulrate = 0; + int dlratewi = 0; + int ulratewi = 0; + rsConfig->getMaxDataRates(dlrate, ulrate, dlratewi, ulratewi); + ui.doubleSpinBoxDownloadSpeed->setValue(dlrate); + ui.doubleSpinBoxUploadSpeed->setValue(ulrate); } @@ -575,7 +577,7 @@ void QuickStartWizard::saveChanges() rsPeers->setExtAddress(rsPeers->getOwnId(), ui.extAddress->text().toStdString(), ui.extPort->value()); }*/ - rsConfig->SetMaxDataRates( ui.doubleSpinBoxDownloadSpeed->value(), ui.doubleSpinBoxUploadSpeed->value() ); + rsConfig->setMaxDataRates( ui.doubleSpinBoxDownloadSpeed->value(), ui.doubleSpinBoxUploadSpeed->value(), ui.doubleSpinBoxDownloadSpeed->value(), ui.doubleSpinBoxUploadSpeed->value() ); loadNetwork(); } diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp index 9fba74a84..9554eb042 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.cpp +++ b/retroshare-gui/src/gui/settings/ServerPage.cpp @@ -228,6 +228,8 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags) connect(ui.totalDownloadRate,SIGNAL(valueChanged(int)),this,SLOT(saveRates())); connect(ui.totalUploadRate, SIGNAL(valueChanged(int)),this,SLOT(saveRates())); + connect(ui.totalDownloadRateWhenIdle,SIGNAL(valueChanged(int)),this,SLOT(saveRates())); + connect(ui.totalUploadRateWhenIdle, SIGNAL(valueChanged(int)),this,SLOT(saveRates())); //Relay Tab QObject::connect(ui.noFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateRelayOptions())); @@ -457,9 +459,13 @@ void ServerPage::load() int dlrate = 0; int ulrate = 0; - rsConfig->GetMaxDataRates(dlrate, ulrate); + int dlratewi = 0; + int ulratewi = 0; + rsConfig->getMaxDataRates(dlrate, ulrate, dlratewi, ulratewi); whileBlocking(ui.totalDownloadRate)->setValue(dlrate); whileBlocking(ui.totalUploadRate)->setValue(ulrate); + whileBlocking(ui.totalDownloadRateWhenIdle)->setValue(dlratewi); + whileBlocking(ui.totalUploadRateWhenIdle)->setValue(ulratewi); toggleUPnP(); @@ -1085,7 +1091,10 @@ void ServerPage::saveAddresses() void ServerPage::saveRates() { - rsConfig->SetMaxDataRates( ui.totalDownloadRate->value(), ui.totalUploadRate->value() ); + rsConfig->setMaxDataRates( ui.totalDownloadRate->value() + , ui.totalUploadRate->value() + , ui.totalDownloadRateWhenIdle->value() + , ui.totalUploadRateWhenIdle->value()); } void ServerPage::tabChanged(int page) @@ -1171,9 +1180,13 @@ void ServerPage::loadHiddenNode() // Download Rates - Stay the same as before. int dlrate = 0; int ulrate = 0; - rsConfig->GetMaxDataRates(dlrate, ulrate); + int dlratewi = 0; + int ulratewi = 0; + rsConfig->getMaxDataRates(dlrate, ulrate, dlratewi, ulratewi); whileBlocking(ui.totalDownloadRate)->setValue(dlrate); whileBlocking(ui.totalUploadRate)->setValue(ulrate); + whileBlocking(ui.totalDownloadRateWhenIdle)->setValue(dlratewi); + whileBlocking(ui.totalUploadRateWhenIdle)->setValue(ulratewi); // Addresses. ui.localAddress->setEnabled(false); @@ -1365,7 +1378,10 @@ void ServerPage::saveAddressesHiddenNode() rsPeers->setHiddenNode(ownId, hiddenAddr, hiddenPort); } - rsConfig->SetMaxDataRates( ui.totalDownloadRate->value(), ui.totalUploadRate->value() ); + rsConfig->setMaxDataRates( ui.totalDownloadRate->value() + , ui.totalUploadRate->value() + , ui.totalDownloadRateWhenIdle->value() + , ui.totalUploadRateWhenIdle->value() ); load(); } diff --git a/retroshare-gui/src/gui/settings/ServerPage.ui b/retroshare-gui/src/gui/settings/ServerPage.ui index 93eb82637..83fd99a44 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.ui +++ b/retroshare-gui/src/gui/settings/ServerPage.ui @@ -90,7 +90,7 @@ - Download limit (KB/s) + Download limit when active (KB/s) @@ -103,7 +103,33 @@ - Upload limit (KB/s) + Upload limit when active (KB/s) + + + + + + + + 50 + false + + + + Download limit when idle (KB/s) + + + + + + + + 50 + false + + + + Upload limit when idle (KB/s) @@ -139,6 +165,31 @@ + + + + + 0 + 0 + + + + <html><head/><body><p>This download limit covers the whole application. However, in some situations, such as when transfering many small files at once, the estimated bandwidth becomes unreliable and the total value reported by Retroshare might exceed that limit. </p></body></html> + + + kB/s + + + 1 + + + 100000 + + + 1 + + + @@ -361,6 +412,34 @@ + + + + + 0 + 0 + + + + <html><head/><body><p>The upload limit covers the entire software. Too small an upload limit might eventually block low priority services (forums, channels). A minimum recommended value is 50KB/s. </p></body></html> + + + kB/s + + + + + + 1 + + + 100000 + + + 1 + + + @@ -451,7 +530,7 @@ - +