aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer
diff options
context:
space:
mode:
authordt <qtc-committer@nokia.com>2010-03-24 18:36:06 +0100
committerdt <qtc-committer@nokia.com>2010-03-25 17:37:23 +0100
commit184fd353d294d9688919b8861b370ffa0733e046 (patch)
tree80b54fc77ea2257432b421f6195f9ba5aca293c1 /src/plugins/projectexplorer
parentd5db7e9a0becafe7e23287e37d1e54f5af8dd7f4 (diff)
Synchronize startup project and current project on projects mode
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r--src/plugins/projectexplorer/projectwindow.cpp13
-rw-r--r--src/plugins/projectexplorer/projectwindow.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp
index f2f27a20e5..c2cb2c28bc 100644
--- a/src/plugins/projectexplorer/projectwindow.cpp
+++ b/src/plugins/projectexplorer/projectwindow.cpp
@@ -280,6 +280,9 @@ ProjectWindow::ProjectWindow(QWidget *parent)
connect(session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
this, SLOT(deregisterProject(ProjectExplorer::Project*)));
+ connect(session, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
+ this, SLOT(startupProjectChanged(ProjectExplorer::Project *)));
+
// Update properties to empty project for now:
showProperties(-1, -1);
}
@@ -353,8 +356,17 @@ void ProjectWindow::refreshProject()
if (!m_tabIndexToProject.contains(project))
return;
+ // TODO this changes the subindex
+ int index = m_tabWidget->currentIndex();
deregisterProject(project);
registerProject(project);
+ m_tabWidget->setCurrentIndex(index);
+}
+
+void ProjectWindow::startupProjectChanged(ProjectExplorer::Project *p)
+{
+ int index = m_tabIndexToProject.indexOf(p);
+ m_tabWidget->setCurrentIndex(index);
}
void ProjectWindow::showProperties(int index, int subIndex)
@@ -386,6 +398,7 @@ void ProjectWindow::showProperties(int index, int subIndex)
}
++pos;
}
+ ProjectExplorerPlugin::instance()->session()->setStartupProject(project);
}
void ProjectWindow::removeCurrentWidget()
diff --git a/src/plugins/projectexplorer/projectwindow.h b/src/plugins/projectexplorer/projectwindow.h
index 8edcb66d59..cb3a81892a 100644
--- a/src/plugins/projectexplorer/projectwindow.h
+++ b/src/plugins/projectexplorer/projectwindow.h
@@ -92,6 +92,7 @@ private slots:
void saveStatus();
void registerProject(ProjectExplorer::Project*);
void deregisterProject(ProjectExplorer::Project*);
+ void startupProjectChanged(ProjectExplorer::Project *);
void refreshProject();