Commit dffbc440 authored by Eike Ziller's avatar Eike Ziller
Browse files

Examples: Fix showing documentation in side bar.



Opening the project jumped to project mode, which doesn't have a help
side bar. We now configure the example project and jump to edit mode
before opening the documentation.

Change-Id: Ic87d3fd0856862ac9297d43307037f994664acdc
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent d3e25481
......@@ -1281,7 +1281,7 @@ void ProjectExplorerPlugin::openProjectWelcomePage(const QString &fileName)
QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to open project"), errorMessage);
}
bool ProjectExplorerPlugin::openProject(const QString &fileName, QString *errorString)
Project *ProjectExplorerPlugin::openProject(const QString &fileName, QString *errorString)
{
if (debug)
qDebug() << "ProjectExplorerPlugin::openProject";
......@@ -1290,9 +1290,9 @@ bool ProjectExplorerPlugin::openProject(const QString &fileName, QString *errorS
if (!list.isEmpty()) {
addToRecentProjects(fileName, list.first()->displayName());
d->m_session->setStartupProject(list.first());
return true;
return list.first();
}
return false;
return 0;
}
static inline QList<IProjectManager*> allProjectManagers()
......
......@@ -80,7 +80,7 @@ public:
static ProjectExplorerPlugin *instance();
bool openProject(const QString &fileName, QString *error);
Project *openProject(const QString &fileName, QString *error);
QList<Project *> openProjects(const QStringList &fileNames, QString *error);
Q_SLOT void openProjectWelcomePage(const QString &fileName);
......
......@@ -40,9 +40,11 @@
#include <utils/pathchooser.h>
#include <utils/fileutils.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreplugin.h>
#include <coreplugin/icore.h>
#include <coreplugin/helpmanager.h>
#include <coreplugin/modemanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/project.h>
......@@ -406,23 +408,17 @@ void ExamplesWelcomePage::openProject(const QString &projectFile, const QStringL
// don't try to load help and files if loading the help request is being cancelled
QString errorMessage;
ProjectExplorer::ProjectExplorerPlugin *peplugin = ProjectExplorer::ProjectExplorerPlugin::instance();
if (!proFile.isEmpty() && peplugin->openProject(proFile, &errorMessage)) {
if (proFile.isEmpty())
return;
if (ProjectExplorer::Project *project = peplugin->openProject(proFile, &errorMessage)) {
Core::ICore::openFiles(filesToOpen);
if (project->needsConfiguration())
project->configureAsExampleProject(platforms);
Core::ModeManager::activateModeType(QLatin1String(Core::Constants::MODE_EDIT_TYPE));
Core::ICore::helpManager()->handleHelpRequest(help.toString()+QLatin1String("?view=split"));
}
if (!errorMessage.isEmpty())
QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to open project"), errorMessage);
// Configure project for building
ProjectExplorer::Project *project = 0;
foreach (ProjectExplorer::Project *pro, peplugin->session()->projects()) {
if (pro->rootProjectNode()->path() == proFile) {
project = pro;
break;
}
}
if (project && project->needsConfiguration())
project->configureAsExampleProject(platforms);
}
void ExamplesWelcomePage::updateTagsModel()
......
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