]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/Mainwindow.cxx
Properly implement plane selection
[frida/frida.git] / src / gui / Mainwindow.cxx
index d929094d618ba9533d0fe0f4a518c66273822bdd..8a62ef8d2257386cf17b6df7074d48b82a414c29 100644 (file)
@@ -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 {