mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 14:10:54 -04:00
improved UI of webUI and JsonAPI and interaction between these two (unfinished)
This commit is contained in:
parent
c90fab0136
commit
d83f0125f3
7 changed files with 169 additions and 86 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "rsharesettings.h"
|
||||
#include "jsonapi/jsonapi.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
|
||||
#include <QTimer>
|
||||
#include <QStringListModel>
|
||||
|
@ -58,7 +59,16 @@ JsonApiPage::JsonApiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/)
|
|||
|
||||
ui.listenAddressLineEdit->setValidator(ipValidator);
|
||||
|
||||
mEventHandlerId = 0;
|
||||
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> /* event */)
|
||||
{
|
||||
std::cerr << "Caught JSONAPI event!" << std::endl;
|
||||
RsQThreadUtils::postToObject([=]() { load(); }, this );
|
||||
},
|
||||
mEventHandlerId, RsEventType::JSON_API );
|
||||
}
|
||||
|
||||
QString JsonApiPage::helpText() const
|
||||
{
|
||||
return tr("<h1><img width=\"24\" src=\":/icons/help_64.png\"> Webinterface</h1> \
|
||||
|
@ -101,9 +111,9 @@ bool JsonApiPage::updateParams()
|
|||
|
||||
void JsonApiPage::load()
|
||||
{
|
||||
whileBlocking(ui.portSpinBox)->setValue(Settings->getJsonApiPort());
|
||||
whileBlocking(ui.listenAddressLineEdit)->setText(Settings->getJsonApiListenAddress());
|
||||
whileBlocking(ui.enableCheckBox)->setChecked(Settings->getJsonApiEnabled());
|
||||
whileBlocking(ui.portSpinBox)->setValue(rsJsonApi->listeningPort());
|
||||
whileBlocking(ui.listenAddressLineEdit)->setText(QString::fromStdString(rsJsonApi->getBindingAddress()));
|
||||
whileBlocking(ui.enableCheckBox)->setChecked(rsJsonApi->isRunning());
|
||||
|
||||
QStringList newTk;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue