4 import vigir_footstep_planning_msgs.msg
6 from python_qt_binding.QtCore
import Qt, Signal, Slot
7 from python_qt_binding.QtGui
import QWidget, QVBoxLayout, QHBoxLayout, QTextEdit, QPushButton, QCheckBox, QSizePolicy, QColor
9 from vigir_footstep_planning_msgs.msg
import ErrorStatus
17 QTextEdit.__init__(self)
18 self.setReadOnly(
True)
22 self.setTextColor(color)
30 if error_status.error != 0:
31 self.
out_log(error_status.error_msg, Qt.red)
33 if error_status.warning != 0:
34 self.
out_log(error_status.warning_msg, QColor(255, 165, 0))
40 error_status_signal = Signal(ErrorStatus)
42 def __init__(self, parent=None, subscribe=False):
43 QWidget.__init__(self, parent)
48 vbox.setContentsMargins(0, 0, 0, 0)
61 self.execute_command.clicked.connect(self.error_status_text_box.clear)
67 hide_window_check_box = QCheckBox(
"Hide")
68 hide_window_check_box.stateChanged.connect(self.
state_changed)
69 hbox.addWidget(hide_window_check_box)
88 self.error_status_sub.unregister()
91 self.error_status_signal.emit(error_status)
98 self.error_status_text_box.clear()
103 self.error_status_text_box.out_log(msg, color)
107 self.error_status_text_box.set_error_status(error_status)
111 self.error_status_text_box.append_error_status(error_status)
115 if state == Qt.Unchecked:
117 self.error_status_text_box.setVisible(
True)
118 elif state == Qt.Checked:
120 self.error_status_text_box.setVisible(
False)