]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/Mainwindow.cxx
Move the interpreters to the core InformationManager
[frida/frida.git] / src / gui / Mainwindow.cxx
index 269f3e7359d7c82b89e613c011d6f614097cee0a..859311032c79c45a49e1721d97ab32b1c67e61a6 100644 (file)
@@ -19,7 +19,7 @@
 
 Mainwindow::Mainwindow(InformationManager* mgr)
        : manager(mgr)
-       , logger(log4cxx::Logger::getLogger("Mainwindow")) {
+       , logger(log4cxx::Logger::getLogger("gui.Mainwindow")) {
        openAction = new QAction(tr("&Open"), this);
        loadAction = new QAction(tr("&Load"), this);
        saveAction = new QAction(tr("&Save"), this);
@@ -43,15 +43,11 @@ Mainwindow::Mainwindow(InformationManager* mgr)
 
        QMenu* interpretermenu = menuBar()->addMenu(tr("&Interpreter"));
 
-       QPluginLoader* loader = new QPluginLoader("libguilePlugin", this);
-       if (!loader->load())
-               LOG4CXX_ERROR(logger, "Loading plugin failed: " << loader->errorString().toStdString());
-       interpreter["GUILE"] = qobject_cast<Interpreter*>(loader->instance());
        fdock = new FridaDock(tr("Frida Dock"), this);
 
        fdock->addTab(new LogDock(fdock), "Log");
 
-       fdock->addTab(new ScriptingDock(interpreter["GUILE"], fdock), "guile");
+       fdock->addTab(new ScriptingDock(manager->getInterpreter("GUILE"), fdock), "guile");
        fdock->setAllowedAreas(Qt::BottomDockWidgetArea);
        addDockWidget(Qt::BottomDockWidgetArea, fdock);
        QAction* guileLoad = new QAction(tr("&GUILE"), this);
@@ -60,10 +56,10 @@ Mainwindow::Mainwindow(InformationManager* mgr)
                [&]() {
                        QString fileName = QFileDialog::getOpenFileName(this, tr("Open Script"), "",
                                                                        tr("Binaries") + " (*." +
-                                                                       interpreter["GUILE"]->fileExtension().c_str() + ")");
+                                                                       manager->getInterpreter("GUILE")->fileExtension().c_str() + ")");
                        std::stringstream a, b;
                        std::string c;
-                       interpreter["GUILE"]->loadFile(fileName.toStdString(), a, b, c);
+                       manager->getInterpreter("GUILE")->loadFile(fileName.toStdString(), a, b, c);
                });
 
        listWidget = new QTreeWidget();