-----------------------------------------------------------------------------
| 283 | |
| 284 | //----------------------------------------------------------------------------- |
| 285 | void pqPythonShell::printString(const QString& text, pqPythonShell::PrintMode mode) |
| 286 | { |
| 287 | pqConsoleWidget* consoleWidget = this->Internals->Ui.consoleWidget; |
| 288 | const QString& string = text; |
| 289 | if (!string.isEmpty()) |
| 290 | { |
| 291 | QTextCharFormat format = consoleWidget->getFormat(); |
| 292 | format.setForeground(this->Internals->foregroundColor(mode)); |
| 293 | consoleWidget->setFormat(format); |
| 294 | consoleWidget->printString(string); |
| 295 | format.setForeground(QApplication::palette().windowText().color()); |
| 296 | consoleWidget->setFormat(format); |
| 297 | |
| 298 | this->Prompted = false; |
| 299 | |
| 300 | // printString by itself should never affect the Prompt, just whether it |
| 301 | // needs to be shown. |
| 302 | } |
| 303 | } |
| 304 | //----------------------------------------------------------------------------- |
| 305 | void pqPythonShell::setPreamble(const QStringList& statements) |
| 306 | { |
no test coverage detected