X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=654dc16aafd6f7ad386b7840a15f155ba0b84531;hp=625e7acad7d99ae890ee650615b4600f86032b51;hb=11fd69cdfce58707599bf57c07c5a784905e23f6;hpb=efaafdaf4a18b5f2f4dd743aa3f0e609d428b15a diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index 625e7ac..654dc16 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -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) {