X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=9d8e45f66e5f69749e06223d96e620e6be761bec;hp=dfcdc76fdae6d22a6d93599c83c2f7b3f3e73ab4;hb=adb0e762792c23674633b8513f4106b82aa38d15;hpb=30bd2ac7409f9d7496708b77a404fd69be291387 diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index dfcdc76..9d8e45f 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -1,5 +1,6 @@ #include "Mainwindow.hxx" #include "qt.hxx" +#include "bindings/Guile.hxx" #include "disassembler/llvm/LLVMDisassembler.hxx" #include "core/Function.hxx" #include "core/BasicBlock.hxx" @@ -45,9 +46,23 @@ Mainwindow::Mainwindow(InformationManager* mgr) fileMenu->addSeparator(); fileMenu->addAction(exitAction); - scripting = new ScriptingDock(tr("Scripting"), this); + QMenu* interpretermenu = menuBar()->addMenu(tr("&Interpreter")); + + interpreter["GUILE"] = new GuileInterpreter; + scripting = new ScriptingDock(interpreter["GUILE"], tr("Scripting"), this); scripting->setAllowedAreas(Qt::BottomDockWidgetArea); addDockWidget(Qt::BottomDockWidgetArea, scripting); + QAction* guileLoad = new QAction(tr("&GUILE"), this); + interpretermenu->addAction(guileLoad); + connect(guileLoad, &QAction::triggered, + [&]() { + QString fileName = QFileDialog::getOpenFileName(this, tr("Open Script"), "", + tr("Binaries") + " (*." + + interpreter["GUILE"]->fileExtension().c_str() + ")"); + std::stringstream a, b; + std::string c; + interpreter["GUILE"]->loadFile(fileName.toStdString(), a, b, c); + }); listWidget = new QTreeWidget(); listWidget->setColumnCount(1);