35 from collections
import OrderedDict
38 from python_qt_binding
import loadUi
39 from python_qt_binding.QtCore
import Signal
40 from python_qt_binding.QtWidgets
import QVBoxLayout, QWidget, QWidgetItem
49 This class represents a pane where parameter editor widgets of multiple 50 nodes are shown. In rqt_reconfigure, this pane occupies right half of the 55 sig_node_disabled_selected = Signal(str)
59 super(ParameditWidget, self).
__init__()
61 ui_file = os.path.join(rospack.get_path(
'rqt_reconfigure'),
62 'resource',
'paramedit_pane.ui')
63 loadUi(ui_file, self, {
'ParameditWidget': ParameditWidget})
68 self.
vlayout = QVBoxLayout(self.scrollarea_holder_widget)
73 self.destroyed.connect(self.
close)
77 @deprecated: Causes error 80 for p
in paramitems_dict:
81 view.setIndexWidget(i, p)
86 Callback when user chooses a node. 88 @param dynreconf_widget: 90 node_grn = dynreconf_widget.get_node_grn()
91 logging.debug(
'ParameditWidget.show str(node_grn)=%s', str(node_grn))
93 if node_grn
not in self._dynreconf_clients.keys():
98 self._dynreconf_clients.__setitem__(node_grn, dynreconf_widget)
99 self.vlayout.addWidget(dynreconf_widget)
100 dynreconf_widget.sig_node_disabled_selected.connect(
113 LayoutUtil.alternate_color(
114 self._dynreconf_clients.values(),
115 [self.palette().window().color().lighter(125),
116 self.palette().window().color().darker(125)])
124 self._paramedit_scrollarea.deleteLater()
139 i = self._dynreconf_clients.keys().index(node_grn)
152 item = self.vlayout.itemAt(i)
153 if isinstance(item, QWidgetItem):
154 item.widget().
close()
155 w = self._dynreconf_clients.pop(node_grn)
157 logging.debug(
'popped={} Len of left clients={}'.format(
158 w, len(self._dynreconf_clients)
162 logging.debug(
'paramedit_w _node_disabled grn={}'.format(node_grn))
166 self.sig_node_disabled_selected.emit(node_grn)