]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/Mainwindow.cxx
Finish archive loading
[frida/frida.git] / src / gui / Mainwindow.cxx
index 625e7acad7d99ae890ee650615b4600f86032b51..654dc16aafd6f7ad386b7840a15f155ba0b84531 100644 (file)
@@ -24,11 +24,14 @@ Mainwindow::Mainwindow(InformationManager* mgr)
        : manager(mgr)
        , logger(log4cxx::Logger::getLogger("Mainwindow")) {
        openAction = new QAction(tr("&Open"), this);
+       loadAction = new QAction(tr("&Load"), this);
        saveAction = new QAction(tr("&Save"), this);
        exitAction = new QAction(tr("E&xit"), this);
 
        connect(openAction, &QAction::triggered,
                this, &Mainwindow::open);
+       connect(loadAction, &QAction::triggered,
+               this, &Mainwindow::load);
        connect(saveAction, &QAction::triggered,
                this, &Mainwindow::save);
        connect(exitAction, &QAction::triggered,
@@ -36,6 +39,7 @@ Mainwindow::Mainwindow(InformationManager* mgr)
 
        fileMenu = menuBar()->addMenu(tr("&File"));
        fileMenu->addAction(openAction);
+       fileMenu->addAction(loadAction);
        fileMenu->addAction(saveAction);
        fileMenu->addSeparator();
        fileMenu->addAction(exitAction);
@@ -46,6 +50,7 @@ Mainwindow::Mainwindow(InformationManager* mgr)
 
        listWidget = new QTreeWidget();
        listWidget->setColumnCount(1);
+       listWidget->setDragDropMode(QAbstractItemView::InternalMove);
        listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
        connect(listWidget, SIGNAL(customContextMenuRequested(const QPoint&)),
                this, SLOT(showListContextMenu(const QPoint&)));
@@ -101,13 +106,18 @@ void Mainwindow::quit()
 void Mainwindow::open() {
        QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
                                                        tr("Binaries (*)"));
-
        manager->reset(fileName.toStdString());
 }
 
+void Mainwindow::load() {
+       QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
+                                                       tr("Frida Archives (*.frida)"));
+       manager->load(fileName.toStdString());
+}
+
 void Mainwindow::save() {
        QString filename = QFileDialog::getSaveFileName(this, tr("Save File"), "", tr("Frida Archives (*.frida)"));
-       manager->save(filename);
+       manager->save(filename.toStdString());
 }
 
 void Mainwindow::switchMainPlaneToAddress(uint64_t address) {