X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=8a62ef8d2257386cf17b6df7074d48b82a414c29;hp=764eb0376d1ca4acb12f56fb0faa7b37c27c98d1;hb=e483d95e6b01bc5c6b97bb596409db0b35e213f7;hpb=21463b5c215974f253a0100231890ed909cd19e3 diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index 764eb03..8a62ef8 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -4,11 +4,8 @@ #include "widgets/CFGScene.hxx" #include "dialogs/NewFunctionDialog.hxx" -#include -#include -#include -#include +#include namespace { BasicBlockWidget * @@ -54,7 +51,7 @@ Mainwindow::Mainwindow(InformationManager* mgr) setCentralWidget(stackedWidget); connect(listWidget, SIGNAL(currentRowChanged(int)), - stackedWidget, SLOT(setCurrentIndex(int))); + this, SLOT(switchMainPlane(int))); setWindowTitle(tr("FRIDA")); @@ -83,6 +80,10 @@ void Mainwindow::open() { manager->reset(fileName.toStdString()); } +void Mainwindow::switchMainPlane(int index) { + stackedWidget->setCurrentWidget(objects_list[listWidget->currentItem()]); +} + void Mainwindow::showListContextMenu(const QPoint& point) { QListWidgetItem * item = listWidget->itemAt(point); if (item) { @@ -140,8 +141,9 @@ void Mainwindow::addFunction(Function* fun) { w->addTab(t, "Listing"); - listWidget->addItem(fun->getName().c_str()); + QListWidgetItem * item = new QListWidgetItem(fun->getName().c_str(), listWidget); stackedWidget->addWidget(w); + objects_list.insert(std::make_pair(item, w)); } namespace {