mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-27 15:57:08 -05:00
Merge pull request #784 from PhenomRetroShare/Fix_RelaySettingsPage
Fix Relay setting page.
This commit is contained in:
commit
73bfc27f47
@ -29,6 +29,7 @@
|
|||||||
#include <retroshare/rsfiles.h>
|
#include <retroshare/rsfiles.h>
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
#include <retroshare/rsdht.h>
|
#include <retroshare/rsdht.h>
|
||||||
|
#include "util/misc.h"
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
@ -127,35 +128,37 @@ void RelayPage::load()
|
|||||||
uint32_t count;
|
uint32_t count;
|
||||||
uint32_t bandwidth;
|
uint32_t bandwidth;
|
||||||
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, count, bandwidth);
|
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, count, bandwidth);
|
||||||
ui.noFriendSpinBox->setValue(count);
|
whileBlocking(ui.noFriendSpinBox)->setValue(count);
|
||||||
ui.bandFriendSpinBox->setValue(bandwidth / 1000);
|
whileBlocking(ui.bandFriendSpinBox)->setValue(bandwidth / 1000);
|
||||||
|
|
||||||
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FOF, count, bandwidth);
|
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FOF, count, bandwidth);
|
||||||
ui.noFOFSpinBox->setValue(count);
|
whileBlocking(ui.noFOFSpinBox)->setValue(count);
|
||||||
ui.bandFOFSpinBox->setValue(bandwidth / 1000);
|
whileBlocking(ui.bandFOFSpinBox)->setValue(bandwidth / 1000);
|
||||||
|
|
||||||
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, count, bandwidth);
|
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, count, bandwidth);
|
||||||
ui.noGeneralSpinBox->setValue(count);
|
whileBlocking(ui.noGeneralSpinBox)->setValue(count);
|
||||||
ui.bandGeneralSpinBox->setValue(bandwidth / 1000);
|
whileBlocking(ui.bandGeneralSpinBox)->setValue(bandwidth / 1000);
|
||||||
|
|
||||||
|
updateTotals();
|
||||||
|
|
||||||
|
|
||||||
uint32_t relayMode = rsDht->getRelayMode();
|
uint32_t relayMode = rsDht->getRelayMode();
|
||||||
if (relayMode & RSDHT_RELAY_ENABLED)
|
if (relayMode & RSDHT_RELAY_ENABLED)
|
||||||
{
|
{
|
||||||
ui.enableCheckBox->setCheckState(Qt::Checked);
|
whileBlocking(ui.enableCheckBox)->setCheckState(Qt::Checked);
|
||||||
if ((relayMode & RSDHT_RELAY_MODE_MASK) == RSDHT_RELAY_MODE_OFF)
|
if ((relayMode & RSDHT_RELAY_MODE_MASK) == RSDHT_RELAY_MODE_OFF)
|
||||||
{
|
{
|
||||||
ui.serverCheckBox->setCheckState(Qt::Unchecked);
|
whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Unchecked);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui.serverCheckBox->setCheckState(Qt::Checked);
|
whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Checked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui.enableCheckBox->setCheckState(Qt::Unchecked);
|
whileBlocking(ui.enableCheckBox)->setCheckState(Qt::Unchecked);
|
||||||
ui.serverCheckBox->setCheckState(Qt::Unchecked);
|
whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Unchecked);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadServers();
|
loadServers();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user