From 4c326f5e808f261bb3e4522d6cbaba2927224dc9 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sun, 23 Apr 2017 10:27:18 +0200 Subject: [PATCH] Fix Relay setting page. --- retroshare-gui/src/gui/settings/RelayPage.cpp | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/retroshare-gui/src/gui/settings/RelayPage.cpp b/retroshare-gui/src/gui/settings/RelayPage.cpp index 258bc05aa..3124f40db 100644 --- a/retroshare-gui/src/gui/settings/RelayPage.cpp +++ b/retroshare-gui/src/gui/settings/RelayPage.cpp @@ -29,6 +29,7 @@ #include #include #include +#include "util/misc.h" #include @@ -127,35 +128,37 @@ void RelayPage::load() uint32_t count; uint32_t bandwidth; rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, count, bandwidth); - ui.noFriendSpinBox->setValue(count); - ui.bandFriendSpinBox->setValue(bandwidth / 1000); + whileBlocking(ui.noFriendSpinBox)->setValue(count); + whileBlocking(ui.bandFriendSpinBox)->setValue(bandwidth / 1000); rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FOF, count, bandwidth); - ui.noFOFSpinBox->setValue(count); - ui.bandFOFSpinBox->setValue(bandwidth / 1000); + whileBlocking(ui.noFOFSpinBox)->setValue(count); + whileBlocking(ui.bandFOFSpinBox)->setValue(bandwidth / 1000); rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, count, bandwidth); - ui.noGeneralSpinBox->setValue(count); - ui.bandGeneralSpinBox->setValue(bandwidth / 1000); + whileBlocking(ui.noGeneralSpinBox)->setValue(count); + whileBlocking(ui.bandGeneralSpinBox)->setValue(bandwidth / 1000); + + updateTotals(); uint32_t relayMode = rsDht->getRelayMode(); 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) { - ui.serverCheckBox->setCheckState(Qt::Unchecked); + whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Unchecked); } else { - ui.serverCheckBox->setCheckState(Qt::Checked); + whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Checked); } } else { - ui.enableCheckBox->setCheckState(Qt::Unchecked); - ui.serverCheckBox->setCheckState(Qt::Unchecked); + whileBlocking(ui.enableCheckBox)->setCheckState(Qt::Unchecked); + whileBlocking(ui.serverCheckBox)->setCheckState(Qt::Unchecked); } loadServers();