Commit 184fd353 authored by dt's avatar dt

Synchronize startup project and current project on projects mode

parent d5db7e9a
......@@ -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()
......
......@@ -92,6 +92,7 @@ private slots:
void saveStatus();
void registerProject(ProjectExplorer::Project*);
void deregisterProject(ProjectExplorer::Project*);
void startupProjectChanged(ProjectExplorer::Project *);
void refreshProject();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment