X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=03910a1be4801334ade968cbb237f6cd8cfe4d46;hp=18dcc8bef99f180c7a193962a2ac674709b9de75;hb=64cdefa8eebaedef3a852b061d4df431b7e6c654;hpb=7d4bf581b5f2885d00a86f8a6235bc12fca10731 diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index 18dcc8b..03910a1 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -20,18 +20,19 @@ Mainwindow::Mainwindow(InformationManager* mgr) : manager(mgr) , logger(log4cxx::Logger::getLogger("Mainwindow")) { openAction = new QAction(tr("&Open"), this); - // saveAction = new QAction(tr("&Save"), this); + saveAction = new QAction(tr("&Save"), this); exitAction = new QAction(tr("E&xit"), this); connect(openAction, SIGNAL(triggered()), this, SLOT(open())); - // connect(saveAction, SIGNAL(triggered()), this, SLOT(save())); + connect(saveAction, SIGNAL(triggered()), + this, SLOT(save())); connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit())); fileMenu = menuBar()->addMenu(tr("&File")); fileMenu->addAction(openAction); - // fileMenu->addAction(saveAction); + fileMenu->addAction(saveAction); fileMenu->addSeparator(); fileMenu->addAction(exitAction); @@ -94,6 +95,11 @@ void Mainwindow::open() { manager->reset(fileName.toStdString()); } +void Mainwindow::save() { + QString filename = QFileDialog::getSaveFileName(this, tr("Save File"), "", tr("Frida Archives (*.frida)")); + manager->save(filename); +} + void Mainwindow::switchMainPlaneToAddress(uint64_t address) { if (objects_list_by_address.find(address) != objects_list_by_address.end()) { LOG4CXX_DEBUG(logger, "Switching to function " << std::hex << address);