8 logging.debug(__name__ +
': __init__')
9 QDialog.__init__(self, parent)
10 self.setWindowFlags(Qt.Window)
11 self.setWindowTitle(
"Set box content...")
19 logging.debug(__name__ +
': fill')
24 self._applyButton.setDefault(
True)
28 self.setLayout(QVBoxLayout())
34 self.layout().addStretch()
35 self.layout().addLayout(self.
_layout3)
36 self.layout().addLayout(self.
_layout4)
40 self._layout4.addStretch()
45 self.connect(self.
_cancelButton, SIGNAL(
'clicked(bool)'), self.reject)
51 self._layout3.addStretch()
54 button = QPushButton(name)
55 button.script = script
57 self._layout3.addWidget(button)
64 self._scriptTextEdit.textCursor().insertText(
"+")
65 self._scriptTextEdit.textCursor().insertText(button.script)
68 logging.debug(__name__ +
': onScreen')
72 self._scriptTextEdit.setFocus()
77 if event.modifiers() == Qt.ControlModifier
and event.key() == Qt.Key_W:
79 QDialog.keyPressEvent(self, event)
82 return str(self._scriptTextEdit.toPlainText().toAscii()).
replace(
"\n",
"\\n")
85 self._scriptTextEdit.insertPlainText(script)
88 self.emit(SIGNAL(
"scriptChanged"), self.
script())
92 QMessageBox.about(self,
'Info',
"This dialog allows you to specify what text shall be displayed inside the boxes of the center view. You can specify any valid Python string or use the buttons to fill the string.")