diff --git a/retroshare-gui/src/gui/settings/WebuiPage.cpp b/retroshare-gui/src/gui/settings/WebuiPage.cpp index d7ff0b894..a14cc022d 100644 --- a/retroshare-gui/src/gui/settings/WebuiPage.cpp +++ b/retroshare-gui/src/gui/settings/WebuiPage.cpp @@ -142,6 +142,8 @@ void WebuiPage::loadParams() if(it != smap.end()) whileBlocking(ui.password_LE)->setText(QString::fromStdString(it->second)); + else + whileBlocking(ui.enableWebUI_CB)->setChecked(false); if(rsWebUi->isRunning()) ui.statusLabelLED->setPixmap(FilesDefs::getPixmapFromQtResourcePath(IMAGE_LEDON)) ; diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index e33fe795d..ff091ccf9 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -22,6 +22,7 @@ #include "util/stacktrace.h" #include "util/argstream.h" +#include "retroshare/rswebui.h" CrashStackTrace gCrashStackTrace; @@ -380,7 +381,7 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); return 1; } - /* recreate global settings object, now with correct path */ + /* recreate global settings object, now with correct path, specific to the selected node */ RshareSettings::Create(true); Rshare::resetLanguageAndStyle(); @@ -571,13 +572,18 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); notify->enable() ; // enable notification system after GUI creation, to avoid data races in Qt. -#ifdef RS_JSONAPI - JsonApiPage::checkStartJsonApi(); + // Read webui params in settings. We cannot save them to some webui.cfg because cfg needs the node id and + // jsonapi is started before node ID selection in retroshare-service. +#ifdef RS_JSONAPI #ifdef RS_WEBUI - WebuiPage::checkStartWebui(); // normally we should rather save the UI flags internally to p3webui + conf.enableWebUI = Settings->getWebinterfaceEnabled(); + + if(!Settings->getWebinterfaceFilesDirectory().isNull()) + rsWebUi->setHtmlFilesDirectory(Settings->getWebinterfaceFilesDirectory().toStdString()); +#endif + RsInit::startupWebServices(conf); #endif -#endif // RS_JSONAPI /* dive into the endless loop */ int ti = rshare.exec();