Synchronize startup project and current project on projects mode

This commit is contained in:
dt
2010-03-24 18:36:06 +01:00
parent d5db7e9a0b
commit 184fd353d2
2 changed files with 14 additions and 0 deletions

View File

@@ -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()