| 25 | static QPlainTextEdit *g_jsConsoleLog = 0; |
| 26 | |
| 27 | static void createConsoleWindow() |
| 28 | { |
| 29 | if (g_jsConsoleWindow.exists()) |
| 30 | return; |
| 31 | |
| 32 | g_jsConsoleWindow->setButtons(KDialog::Close | KDialog::User1); |
| 33 | g_jsConsoleWindow->setButtonGuiItem(KDialog::User1, KStandardGuiItem::clear()); |
| 34 | |
| 35 | QVBoxLayout *mainLay = new QVBoxLayout(g_jsConsoleWindow->mainWidget()); |
| 36 | mainLay->setContentsMargins(0, 0, 0, 0); |
| 37 | g_jsConsoleLog = new QPlainTextEdit(g_jsConsoleWindow->mainWidget()); |
| 38 | g_jsConsoleLog->setReadOnly(true); |
| 39 | mainLay->addWidget(g_jsConsoleLog); |
| 40 | |
| 41 | QObject::connect(g_jsConsoleWindow, SIGNAL(closeClicked()), g_jsConsoleWindow, SLOT(close())); |
| 42 | QObject::connect(g_jsConsoleWindow, SIGNAL(user1Clicked()), g_jsConsoleLog, SLOT(clear())); |
| 43 | } |
| 44 | #endif |
| 45 | |
| 46 | void JSConsole::show() |