1 #ifndef INCLUDE__ScriptingDock_hxx
2 #define INCLUDE__ScriptingDock_hxx
5 #include <log4cxx/logger.h>
7 class ScriptingDock : public QDockWidget {
11 ScriptingDock(const QString& title, QWidget * parent = 0)
12 : QDockWidget(title, parent)
13 , logger(log4cxx::Logger::getLogger("ScriptingDock")) {
14 QTabWidget * tab = new QTabWidget;
15 QWidget * widget = new QWidget;
16 widget->setLayout(layout = new QGridLayout);
17 layout->addWidget(browser = new QTextBrowser, 0, 0, 1, 0);
18 layout->addWidget(line = new QLineEdit, 1, 0);
19 layout->addWidget(button = new QPushButton(tr("Evaluate")), 1, 1);
20 tab->addTab(widget, "GUILE");
21 ((QDockWidget*)this)->setWidget(tab);
22 connect(button, SIGNAL(released()), this, SLOT(doEvaluate()));
23 connect(line, SIGNAL(returnPressed()), this, SLOT(doEvaluate()));
25 guile_output_port = scm_open_output_string();
26 guile_error_port = scm_open_output_string();
27 scm_set_current_output_port(guile_output_port);
28 scm_set_current_error_port(guile_error_port);
31 log4cxx::LoggerPtr logger;
33 QTextBrowser * browser;
38 SCM guile_output_port;