ros-visualization / qt_gui_core

BSD 3-Clause "New" or "Revised" License
37 stars 76 forks source link

Enable basic help information if no plugins are running #261

Closed mjeronimo closed 2 years ago

mjeronimo commented 2 years ago

If there are no plug-ins loaded, enable the display of an optional help widget on the main window that can display basic usage information.

Fixes: ros-visualization/rqt#267

Signed-off-by: Michael Jeronimo michael.jeronimo@openrobotics.org

mjeronimo commented 2 years ago

To test, you can update ros-visualization/rqt/rqt_gui/src/rqt_gui/main.py as follows:

diff --git a/rqt_gui/src/rqt_gui/main.py b/rqt_gui/src/rqt_gui/main.py
index 87f441b..e2e63ee 100644
--- a/rqt_gui/src/rqt_gui/main.py
+++ b/rqt_gui/src/rqt_gui/main.py
@@ -53,10 +53,16 @@ class Main(Base):

         # ignore ROS specific remapping arguments
         argv = rclpy.utilities.remove_ros_args(args=argv)
-
-        return super(
-            Main, self).main(argv, standalone=standalone,
-                             plugin_argument_provider=plugin_argument_provider)
+        help_text = """<p><b>rqt</b> is a GUI framework that is able to load various plug-in tools as dockable windows.
+There are currently no plug-ins selected. To add plug-ins, select items from the <b>Plugins</b> menu.</p>
+<p>You may also save a particular arrangement of plug-ins as a <i>perspective</i> using the <b>Perspectives</b> menu.
+<p>See <a href="http://wiki.ros.org/rqt/">the rqt Wiki page</a> for more information</p>
+"""
+        return super(Main, self).main(
+            argv,
+            standalone=standalone,
+            plugin_argument_provider=plugin_argument_provider,
+            help_text=help_text)

     def create_application(self, argv):
         from python_qt_binding.QtGui import QIcon

This will be submitted as a subsequent PR which, when combined with the current PR, will fix: ros-visualization/rqt#267

mjeronimo commented 2 years ago

@clalancette Ok, I've made the background transparent so that it is the same as the main window. Also committed your change.

mjeronimo commented 2 years ago

CI (build: --packages-above-and-dependencies rqt_gui_cpp test: --packages-select rqt_gui_cpp)