- SCM handler (void *data, SCM tag, SCM throw_args) {
- scm_handle_by_message_noexit ((void*)"foo", tag, throw_args);
- return SCM_BOOL_F;
- }
+ class ScriptingLineEdit : public QObject, public QLineEdit {
+ public:
+ void keyPressEvent(QKeyEvent* event) {
+ if (event->key() == Qt::Key_Up) {
+ setText(backlog);
+ }
+ QLineEdit::keyPressEvent(event);
+ }
+
+ void clear() {
+ backlog = text();
+ QLineEdit::clear();
+ }
+ private:
+ QString backlog;
+ };
+}
+
+ScriptingDock::ScriptingDock(Interpreter* interpreter, FridaDock* parent)
+ : QWidget(parent)
+ , logger(log4cxx::Logger::getLogger("gui.ScriptingDock"))
+ , interpreter(interpreter) {
+ setLayout(layout = new QGridLayout);
+ layout->addWidget(browser = new QTextBrowser, 0, 0, 1, 0);
+ layout->addWidget(line = new ScriptingLineEdit, 1, 0);
+ layout->addWidget(button = new QPushButton(tr("Evaluate")), 1, 1);
+ connect(button, SIGNAL(released()), this, SLOT(doEvaluate()));
+ connect(line, SIGNAL(returnPressed()), this, SLOT(doEvaluate()));