Inspector: Make properties editable :^)

This patch makes it possible to live-edit remote object properties by
simply double clicking on them in the property table view.

This is pretty neat! :^)
This commit is contained in:
Andreas Kling 2020-03-05 15:47:24 +01:00
parent 3edcaa9b99
commit b2be8466fb
Notes: sideshowbarker 2024-07-19 08:53:48 +09:00
5 changed files with 39 additions and 0 deletions

View file

@ -31,11 +31,19 @@
#include <stdio.h>
#include <stdlib.h>
RemoteProcess* s_the;
RemoteProcess& RemoteProcess::the()
{
return *s_the;
}
RemoteProcess::RemoteProcess(pid_t pid)
: m_pid(pid)
, m_object_graph_model(RemoteObjectGraphModel::create(*this))
, m_socket(Core::LocalSocket::construct())
{
s_the = this;
}
void RemoteProcess::handle_identify_response(const JsonObject& response)
@ -104,6 +112,16 @@ void RemoteProcess::set_inspected_object(uintptr_t address)
send_request(request);
}
void RemoteProcess::set_property(uintptr_t object, const StringView& name, const JsonValue& value)
{
JsonObject request;
request.set("type", "SetProperty");
request.set("address", object);
request.set("name", JsonValue(name));
request.set("value", value);
send_request(request);
}
void RemoteProcess::update()
{
m_socket->on_connected = [this] {