5 from python_qt_binding.QtCore
import Qt
6 from python_qt_binding.QtGui
import QInputDialog
13 _SETTING_LASTPKG =
'last_pkg' 14 _SETTING_LASTLAUNCHFILE =
'last_launch' 15 _SETTING_LASTLAUNCHARGS =
'last_args' 18 super(LaunchtreePlugin, self).
__init__(context)
21 if context.serial_number() > 1:
22 self._widget.setWindowTitle(self._widget.windowTitle() +
23 (
' (%d)' % context.serial_number()))
24 context.add_widget(self.
_widget)
27 self._widget.shutdown()
30 instance_settings.set_value(
'editor', self._widget.editor)
31 _curr_pkg = self._widget.package_select.currentText()
32 rospy.logdebug(
'save_settings) currentIndex={}'.format(_curr_pkg))
38 self._widget.editor = instance_settings.value(
'editor',
'gedit')
40 pkg_idx = self._widget.package_select.findText(instance_settings.value(self.
_SETTING_LASTPKG))
42 self._widget.package_select.blockSignals(
True)
43 self._widget.package_select.setCurrentIndex(pkg_idx)
44 self._widget.package_select.blockSignals(
False)
45 self._widget.update_launchfiles(pkg_idx)
49 self._widget.launchfile_select.blockSignals(
True)
50 self._widget.launchfile_select.setCurrentIndex(launch_idx)
51 self._widget.launchfile_select.blockSignals(
False)
52 self._widget.block_load(
False)
53 self._widget.load_launchfile()
56 (text, ok) = QInputDialog.getText(self.
_widget,
57 'Settings for %s' % self._widget.windowTitle(),
58 'Command to edit launch files (vim, gedit, ...), can accept args:',
59 text = self._widget.editor
62 self._widget.editor = text
def shutdown_plugin(self)
def restore_settings(self, plugin_settings, instance_settings)
def save_settings(self, plugin_settings, instance_settings)
def __init__(self, context)
string _SETTING_LASTLAUNCHFILE
def trigger_configuration(self)
string _SETTING_LASTLAUNCHARGS