35 from python_qt_binding.QtCore
import Qt, Signal
36 from python_qt_binding.QtWidgets
import QWidget, QVBoxLayout, QCheckBox, QScrollArea, QPushButton
37 from .node_selection
import NodeSelection
42 recordSettingsSelected = Signal(bool, list)
45 super(TopicSelection, self).
__init__()
46 master = rosgraph.Master(
'rqt_bag_recorder')
47 self.setWindowTitle(
"Select the topics you want to record")
54 self.
area = QScrollArea(self)
58 self.ok_button.setEnabled(
False)
64 self.main_vlayout.addWidget(self.
area)
65 self.main_vlayout.addWidget(self.
ok_button)
71 self.item_all.stateChanged.connect(self.
updateList)
72 self.selection_vlayout.addWidget(self.
item_all)
73 topic_data_list = master.getPublishedTopics(
'')
74 topic_data_list.sort()
75 for topic, datatype
in topic_data_list:
84 self.topic_list.append(topic)
85 item = QCheckBox(topic, self)
86 item.stateChanged.connect(
lambda x: self.
updateList(x, topic))
87 self.items_list.append(item)
88 self.selection_vlayout.addWidget(item)
92 if item.text() == topic:
93 item.setCheckState(state)
96 def updateList(self, state, topic=None, force_update_state=False):
98 if state == Qt.Checked:
99 self.item_all.setTristate(
False)
101 if item.checkState() == Qt.Unchecked:
102 item.setCheckState(Qt.Checked)
103 elif state == Qt.Unchecked:
104 self.item_all.setTristate(
False)
106 if item.checkState() == Qt.Checked:
107 item.setCheckState(Qt.Unchecked)
109 if state == Qt.Checked:
110 self.selected_topics.append(topic)
112 self.selected_topics.remove(topic)
113 if self.item_all.checkState() == Qt.Checked:
114 self.item_all.setCheckState(Qt.PartiallyChecked)
117 self.ok_button.setEnabled(
False)
119 self.ok_button.setEnabled(
True)
123 self.recordSettingsSelected.emit(
def updateList(self, state, topic=None, force_update_state=False)
def changeTopicCheckState(self, topic, state)
def addCheckBox(self, topic)
def onButtonClicked(self)
def onFromNodesButtonClicked(self)