X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=8a62ef8d2257386cf17b6df7074d48b82a414c29;hp=d929094d618ba9533d0fe0f4a518c66273822bdd;hb=e483d95e6b01bc5c6b97bb596409db0b35e213f7;hpb=8f1f0c36f5ac59b59ecbf041b0f006f05c1352cb diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index d929094..8a62ef8 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -51,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")); @@ -80,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) { @@ -137,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 {