It makes no sense if the total Transfer rate is lower than the individual rate.

Avoid this due setting uper limit for individual rate, and correct old wrong saved settings.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1160 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
notdefine 2009-05-03 00:41:38 +00:00
parent bdd56208ac
commit d870ae4ef2
2 changed files with 51 additions and 36 deletions

View File

@ -91,6 +91,12 @@ ServerDialog::save(QString &errmsg)
}
/** Change of maxDataRate limits the Individual Data Rate */
void ServerDialog::setMaximumIndivRate(int maximum) {
ui.indivRate->setMaximum(maximum);
}
/** Loads the settings for this page */
void ServerDialog::load()
{
@ -137,10 +143,20 @@ void ServerDialog::load()
rsiface->lockData(); /* Lock Interface */
ui.totalRate->setValue(rsiface->getConfig().maxDataRate);
// It makes no sense if the total Transfer rate is lower than the individual rate.
// Avoid this due setting uper limit for individual rate, and correct old wrong saved settings.
if (rsiface->getConfig().maxDataRate < rsiface->getConfig().maxIndivDataRate) {
ui.indivRate->setValue(rsiface->getConfig().maxDataRate);
} else {
ui.indivRate->setValue(rsiface->getConfig().maxIndivDataRate);
}
QObject::connect(ui.totalRate, SIGNAL (valueChanged(int)),
this, SLOT (setMaximumIndivRate(int)));
rsiface->unlockData(); /* UnLock Interface */
toggleUPnP();
//ui.check_net->setCheckable(true);
@ -171,7 +187,6 @@ void ServerDialog::load()
ui.extPort -> setValue(detail.extPort);
}
/** Loads the settings for this page */
void ServerDialog::updateStatus()
{

View File

@ -50,7 +50,7 @@ private slots:
void saveAddresses();
void toggleUPnP();
void toggleIpDetermination(bool) ;
void setMaximumIndivRate(int);
private:
/** A RshareSettings object used for saving/loading settings */