diff --git a/README.md b/README.md index ef26b7c..d939a3e 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ [robot_systemd](https://github.com/LucidOne/robot_systemd) to provide a GUI for Systemd based control of roslaunch units. -![Indicator](https://raw.githubusercontent.com/LucidOne/robot_indicator/master/doc/indicator.png) +![Indicator](doc/indicator.png) -![Launch Package Selection](https://raw.githubusercontent.com/LucidOne/robot_indicator/master/doc/launch_package.png) -![Launch UI](https://raw.githubusercontent.com/LucidOne/robot_indicator/master/doc/launch_ui.png) +![Launch Package Selection](doc/launch_package.png) +![Launch UI](doc/launch_ui.png) ## TL;DR ```bash @@ -17,4 +17,8 @@ mkdir -p ~/.config/autostart cp `rospack find robot_indicator`/robot_indicator.desktop ~/.config/autostart/robot_indicator.desktop rosrun robot_indicator robot_indicator # or log out and log back in + +# or as a service with robot_systemd +systemctl --user enable roslaunch@robot_indicator:robot_indicator.service +systemctl --user start roslaunch@robot_indicator:robot_indicator.service ``` diff --git a/doc/launch_package.png b/doc/launch_package.png index 0c86dad..a25f75e 100644 Binary files a/doc/launch_package.png and b/doc/launch_package.png differ diff --git a/doc/launch_ui.png b/doc/launch_ui.png index cb4efea..8eea6bc 100644 Binary files a/doc/launch_ui.png and b/doc/launch_ui.png differ diff --git a/scripts/robot_indicator_launch b/scripts/robot_indicator_launch index 05144be..b23cfe5 100755 --- a/scripts/robot_indicator_launch +++ b/scripts/robot_indicator_launch @@ -44,22 +44,24 @@ class LaunchWindow(Gtk.Window): self._box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6) self.add(self._box) - self._pkg_label = Gtk.Label("ROS Package") + self._pkg_label = Gtk.Label.new("ROS Package") self._pkg_label.set_xalign(0) self._box.pack_start(self._pkg_label, True, True, 0) self._entrycompletion = Gtk.EntryCompletion() self._entrycompletion.set_model(self._pkg_liststore) self._entrycompletion.set_text_column(0) - self._entrycompletion.connect("match-selected",self.on_selected_pkg_update_launch) - - self._entry = Gtk.Entry() - self._entry.set_completion(self._entrycompletion) - self._entry.set_max_width_chars(42) - self._entry.connect("focus-out-event",self.on_focus_update_launch) + self._entrycompletion.connect("match-selected", self.on_selected_pkg_update_launch) + + self._entry = Gtk.ComboBoxText.new_with_entry() + self._entry.set_model(self._pkg_liststore) + self._entry.get_child().set_completion(self._entrycompletion) + self._entry.get_child().set_max_width_chars(42) + self._entry.get_child().connect("focus-out-event", self.on_focus_update_launch) + self._entry.connect("changed", self.on_change_update_launch) self._box.pack_start(self._entry, True, True, 0) - self._pkg_label = Gtk.Label("Launch File") + self._pkg_label = Gtk.Label.new("Launch File") self._pkg_label.set_xalign(0) self._box.pack_start(self._pkg_label, True, True, 0) @@ -99,8 +101,12 @@ class LaunchWindow(Gtk.Window): pkg = entry.get_text() self.update_launch_files(pkg) + def on_change_update_launch(self, combo): + pkg = combo.get_active_text() + self.update_launch_files(pkg) + def on_selected_pkg_update_launch(self, widget, model, i): - pkg = model.get_value(i,0) + pkg = model.get_value(i, 0) self.update_launch_files(pkg) def on_change_set_launch(self, combo):