Issue/2000 automatically update gui (#3289)

* Make it possible to query a propertyowner by uri with the getpropertytopic

* Remove automatic reloading of ui from drag and drop script

* Add function for uri for propertyowners

* Add uri to the to_json for the propertyowner

* Add comment for the propertyOwner function and update the comment for the property function to clearer distinguish between uris and identifiers

* Go back to the old events but with uris instead as their member

* Apply feedback from PR

* Address PR comments

---------

Co-authored-by: Ylva Selling <ylva.selling@liu.se>
This commit is contained in:
Ylva Selling
2024-06-04 18:32:41 +02:00
committed by GitHub
parent 1f30719470
commit 1cae99ebfc
11 changed files with 128 additions and 110 deletions
+3 -14
View File
@@ -168,20 +168,11 @@ Layer* LayerGroup::addLayer(const ghoul::Dictionary& layerDict) {
// initialize function. This means that the layerManager does not exists yet, and
// we cannot find which SGN it belongs to... Want to avoid doing this check, so
// this should be fixed (probably as part of a cleanup/rewite of the LayerManager)
if (!layerManager) {
global::eventEngine->publishEvent<events::EventLayerAdded>(
"", // we don't know this yet
layerGroup->identifier(),
ptr->identifier()
);
}
else {
if (layerManager) {
properties::PropertyOwner* globe = layerManager->owner();
properties::PropertyOwner* sceneGraphNode = globe->owner();
global::eventEngine->publishEvent<events::EventLayerAdded>(
sceneGraphNode->identifier(),
layerGroup->identifier(),
ptr->identifier()
ptr->uri()
);
}
@@ -203,9 +194,7 @@ void LayerGroup::deleteLayer(const std::string& layerName) {
properties::PropertyOwner* globe = layerManager->owner();
properties::PropertyOwner* sceneGraphNode = globe->owner();
global::eventEngine->publishEvent<events::EventLayerRemoved>(
sceneGraphNode->identifier(),
layerGroup->identifier(),
it->get()->identifier()
it->get()->uri()
);
// We need to keep the name of the layer since we only get it as a reference
// and the name needs to survive the deletion