diff --git a/retroshare-gui/src/gui/settings/WebuiPage.cpp b/retroshare-gui/src/gui/settings/WebuiPage.cpp index d7e35c381..aea611312 100644 --- a/retroshare-gui/src/gui/settings/WebuiPage.cpp +++ b/retroshare-gui/src/gui/settings/WebuiPage.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "util/misc.h" #include "api/ApiServer.h" @@ -26,6 +27,8 @@ WebuiPage::WebuiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/) { ui.setupUi(this); connect(ui.enableWebUI_CB, SIGNAL(clicked(bool)), this, SLOT(onEnableCBClicked(bool))); + connect(ui.port_SB, SIGNAL(valueChanged(int)), this, SLOT(onPortValueChanged(int))); + connect(ui.allIp_CB, SIGNAL(clicked(bool)), this, SLOT(onAllIPCBClicked(bool))); connect(ui.applyStartBrowser_PB, SIGNAL(clicked()), this, SLOT(onApplyClicked())); } @@ -63,11 +66,11 @@ bool WebuiPage::updateParams(QString &errmsg) void WebuiPage::load() { - std::cerr << "WebuiPage::load()" << std::endl; - whileBlocking(ui.enableWebUI_CB)->setChecked(Settings->getWebinterfaceEnabled()); - onEnableCBClicked(Settings->getWebinterfaceEnabled()); - whileBlocking(ui.port_SB)->setValue(Settings->getWebinterfacePort()); - whileBlocking(ui.allIp_CB)->setChecked(Settings->getWebinterfaceAllowAllIps()); + std::cerr << "WebuiPage::load()" << std::endl; + whileBlocking(ui.enableWebUI_CB)->setChecked(Settings->getWebinterfaceEnabled()); + whileBlocking(ui.port_SB)->setValue(Settings->getWebinterfacePort()); + whileBlocking(ui.allIp_CB)->setChecked(Settings->getWebinterfaceAllowAllIps()); + onEnableCBClicked(Settings->getWebinterfaceEnabled()); } QString WebuiPage::helpText() const @@ -139,19 +142,22 @@ QString WebuiPage::helpText() const void WebuiPage::onEnableCBClicked(bool checked) { - if(checked) - { - ui.params_GB->setEnabled(true); - ui.applyStartBrowser_PB->setEnabled(true); - } - else - { - ui.params_GB->setEnabled(false); - ui.applyStartBrowser_PB->setEnabled(false); - } + ui.params_GB->setEnabled(checked); + ui.applyStartBrowser_PB->setEnabled(checked); + QString S; + updateParams(S); +} - QString S; - updateParams(S); +void WebuiPage::onPortValueChanged(int /*value*/) +{ + QString S; + updateParams(S); +} + +void WebuiPage::onAllIPCBClicked(bool /*checked*/) +{ + QString S; + updateParams(S); } void WebuiPage::onApplyClicked() diff --git a/retroshare-gui/src/gui/settings/WebuiPage.h b/retroshare-gui/src/gui/settings/WebuiPage.h index c7e167ff8..66af0327b 100644 --- a/retroshare-gui/src/gui/settings/WebuiPage.h +++ b/retroshare-gui/src/gui/settings/WebuiPage.h @@ -39,6 +39,8 @@ public: public slots: void onEnableCBClicked(bool checked); + void onPortValueChanged(int value); + void onAllIPCBClicked(bool checked); void onApplyClicked(); private: diff --git a/retroshare-gui/src/gui/settings/WebuiPage.ui b/retroshare-gui/src/gui/settings/WebuiPage.ui index e1f51df40..25b26468c 100644 --- a/retroshare-gui/src/gui/settings/WebuiPage.ui +++ b/retroshare-gui/src/gui/settings/WebuiPage.ui @@ -6,14 +6,14 @@ 0 0 - 442 + 497 404 Form - + @@ -29,7 +29,7 @@ Web parameters - + @@ -41,7 +41,7 @@ - + Port: @@ -65,7 +65,7 @@ - + Note: these settings do not affect retroshare-nogui. Retroshare-nogui has a command line switch to activate the web interface. @@ -75,7 +75,7 @@ - + Qt::Vertical