X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=9d8e45f66e5f69749e06223d96e620e6be761bec;hp=a42d3f4e9ef67d588b4922b71ac110ce913da40c;hb=adb0e762792c23674633b8513f4106b82aa38d15;hpb=fc58083a9eee8534fe3f67ddd3c020c87cd42a5f diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index a42d3f4..9d8e45f 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -46,9 +46,23 @@ Mainwindow::Mainwindow(InformationManager* mgr) fileMenu->addSeparator(); fileMenu->addAction(exitAction); - scripting = new ScriptingDock(new GuileInterpreter, 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);