ros-visualization/rviz

Option to call load_config service without triggering "There are unsaved changes" dialogue?

Closed this issue · 1 comments

FSund commented

Calling the load_service service nearly always triggers a "There are unsaved changes" dialogue.

image

An option (perhaps via an additional field in the service definition) to always discard changes would be nice for our workflow.

FSund commented

I've had a look at the code, and it seems like this shouldn't require too many changes. Looks like a if (!discard_changes) around this prepareToExit() call should do the trick:
https://github.com/ros-visualization/rviz/blob/noetic-devel/src/rviz/visualization_frame.cpp#L750

This would mean adding a discard_changes argument to VisualizationFrame::loadDisplayConfigHelper.

I thought about adding a discard_changes field to SendFilePath.srv, but that seems like it should rather be a new service. Perhaps something like LoadConfig.srv

std_msgs/String path # absolute path to file or directory
bool discard_changes # discard changes to RViz config
---
bool success

The main issue is how to implement this sercice. I'm guessing changing the service type of load_config is not an option, since it would be a breaking change?

I could always make a new service like load_config_discard_changes or similarly, but that might pollute the namespace too much?

Let me know if you have any suggestions, and I'll try to make a proper PR.