mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
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:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "RemoteObjectPropertyModel.h"
|
||||
#include "RemoteObject.h"
|
||||
#include "RemoteProcess.h"
|
||||
|
||||
RemoteObjectPropertyModel::RemoteObjectPropertyModel(RemoteObject& object)
|
||||
: m_object(object)
|
||||
@@ -70,3 +71,12 @@ void RemoteObjectPropertyModel::update()
|
||||
});
|
||||
did_update();
|
||||
}
|
||||
|
||||
void RemoteObjectPropertyModel::set_data(const GUI::ModelIndex& index, const GUI::Variant& new_value)
|
||||
{
|
||||
auto& property = m_properties[index.row()];
|
||||
uintptr_t address = m_object.json.get("address").to_number<uintptr_t>();
|
||||
RemoteProcess::the().set_property(address, property.name.to_string(), new_value.to_string());
|
||||
property.value = new_value.to_string();
|
||||
did_update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user