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
44 from rqt_reconfigure
import logging
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 param_client_widget: 90 node_grn = param_client_widget.get_node_grn()
91 logging.debug(
'ParameditWidget.show' 92 ' str(node_grn)={}'.format(str(node_grn)))
94 if node_grn
not in self._param_client_widgets.keys():
99 self._param_client_widgets.__setitem__(node_grn, param_client_widget)
100 self.vlayout.addWidget(param_client_widget)
101 param_client_widget.sig_node_disabled_selected.connect(
114 LayoutUtil.alternate_color(
115 self._param_client_widgets.values(),
116 [self.palette().window().color().lighter(125),
117 self.palette().window().color().darker(125)])
125 self._paramedit_scrollarea.deleteLater()
128 return self._param_client_widgets.keys()
143 i = list(self._param_client_widgets.keys()).index(node_grn)
156 item = self.vlayout.itemAt(i)
157 if isinstance(item, QWidgetItem):
158 item.widget().
close()
159 w = self._param_client_widgets.pop(node_grn)
161 logging.debug(
'popped={} Len of left clients={}'.format(
162 w, len(self._param_client_widgets)
166 logging.debug(
'paramedit_w _node_disabled grn={}'.format(node_grn))
170 self.sig_node_disabled_selected.emit(node_grn)