mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 13:48:59 -04:00
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:
parent
bdd56208ac
commit
d870ae4ef2
2 changed files with 51 additions and 36 deletions
|
@ -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 */
|
/** Loads the settings for this page */
|
||||||
void ServerDialog::load()
|
void ServerDialog::load()
|
||||||
{
|
{
|
||||||
|
@ -137,10 +143,20 @@ void ServerDialog::load()
|
||||||
rsiface->lockData(); /* Lock Interface */
|
rsiface->lockData(); /* Lock Interface */
|
||||||
|
|
||||||
ui.totalRate->setValue(rsiface->getConfig().maxDataRate);
|
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 */
|
rsiface->unlockData(); /* UnLock Interface */
|
||||||
|
|
||||||
|
|
||||||
toggleUPnP();
|
toggleUPnP();
|
||||||
|
|
||||||
//ui.check_net->setCheckable(true);
|
//ui.check_net->setCheckable(true);
|
||||||
|
@ -171,7 +187,6 @@ void ServerDialog::load()
|
||||||
ui.extPort -> setValue(detail.extPort);
|
ui.extPort -> setValue(detail.extPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Loads the settings for this page */
|
/** Loads the settings for this page */
|
||||||
void ServerDialog::updateStatus()
|
void ServerDialog::updateStatus()
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,48 +17,48 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
#ifndef _SERVERDIALOG_H
|
#ifndef _SERVERDIALOG_H
|
||||||
#define _SERVERDIALOG_H
|
#define _SERVERDIALOG_H
|
||||||
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
||||||
#include "rsharesettings.h"
|
#include "rsharesettings.h"
|
||||||
|
|
||||||
#include "configpage.h"
|
#include "configpage.h"
|
||||||
#include "ui_ServerDialog.h"
|
#include "ui_ServerDialog.h"
|
||||||
|
|
||||||
class ServerDialog : public ConfigPage
|
class ServerDialog : public ConfigPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Default Constructor */
|
/** Default Constructor */
|
||||||
ServerDialog(QWidget *parent = 0);
|
ServerDialog(QWidget *parent = 0);
|
||||||
/** Default Destructor */
|
/** Default Destructor */
|
||||||
|
|
||||||
/** Saves the changes on this page */
|
/** Saves the changes on this page */
|
||||||
bool save(QString &errmsg);
|
bool save(QString &errmsg);
|
||||||
/** Loads the settings for this page */
|
/** Loads the settings for this page */
|
||||||
void load();
|
void load();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateStatus();
|
void updateStatus();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void saveAddresses();
|
void saveAddresses();
|
||||||
void toggleUPnP();
|
void toggleUPnP();
|
||||||
void toggleIpDetermination(bool) ;
|
void toggleIpDetermination(bool) ;
|
||||||
|
void setMaximumIndivRate(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** A RshareSettings object used for saving/loading settings */
|
/** A RshareSettings object used for saving/loading settings */
|
||||||
RshareSettings* _settings;
|
RshareSettings* _settings;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::ServerDialog ui;
|
Ui::ServerDialog ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue