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);
ui.indivRate->setValue(rsiface->getConfig().maxIndivDataRate);
// 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

@ -17,48 +17,48 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
****************************************************************/
#ifndef _SERVERDIALOG_H
#define _SERVERDIALOG_H
#include <QFileDialog>
#define _SERVERDIALOG_H
#include <QFileDialog>
#include "rsharesettings.h"
#include "configpage.h"
#include "ui_ServerDialog.h"
class ServerDialog : public ConfigPage
{
Q_OBJECT
public:
/** Default Constructor */
ServerDialog(QWidget *parent = 0);
/** Default Destructor */
/** Saves the changes on this page */
bool save(QString &errmsg);
/** Loads the settings for this page */
void load();
#include "configpage.h"
#include "ui_ServerDialog.h"
class ServerDialog : public ConfigPage
{
Q_OBJECT
public:
/** Default Constructor */
ServerDialog(QWidget *parent = 0);
/** Default Destructor */
/** Saves the changes on this page */
bool save(QString &errmsg);
/** Loads the settings for this page */
void load();
public slots:
void updateStatus();
private slots:
private slots:
void saveAddresses();
void toggleUPnP();
void toggleIpDetermination(bool) ;
private:
/** A RshareSettings object used for saving/loading settings */
void setMaximumIndivRate(int);
private:
/** A RshareSettings object used for saving/loading settings */
RshareSettings* _settings;
/** Qt Designer generated object */
Ui::ServerDialog ui;
};
#endif
/** Qt Designer generated object */
Ui::ServerDialog ui;
};
#endif