From 184fd353d294d9688919b8861b370ffa0733e046 Mon Sep 17 00:00:00 2001 From: dt <qtc-committer@nokia.com> Date: Wed, 24 Mar 2010 18:36:06 +0100 Subject: [PATCH] Synchronize startup project and current project on projects mode --- src/plugins/projectexplorer/projectwindow.cpp | 13 +++++++++++++ src/plugins/projectexplorer/projectwindow.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index f2f27a20e5f..c2cb2c28bcb 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 8edcb66d59a..cb3a81892af 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(); -- GitLab