Open Project: Don't show a error dialog for duplicated projects

Instead, switch to edit mode, show sidebar, scroll to project,
and show a tooltip next to the project.

The tooltip is somewhat easy to miss, but this is a clear improvement
in most cases.

Change-Id: Icd27f76e7d434f33e731b6fd56473ff913986a89
Task-number: QTCREATORBUG-8422
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Daniel Teske
2015-08-20 14:47:02 +02:00
parent bce3335365
commit b82311024d
17 changed files with 175 additions and 59 deletions

View File

@@ -46,6 +46,8 @@
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/documentmanager.h>
#include <coreplugin/navigationwidget.h>
#include <coreplugin/modemanager.h>
#include <QApplication>
#include <QMenu>
@@ -531,6 +533,19 @@ void ProjectTree::showContextMenu(ProjectTreeWidget *focus, const QPoint &global
}
}
void ProjectTree::highlightProject(Project *project, const QString &message)
{
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
Core::NavigationWidget *navigation = Core::NavigationWidget::instance();
// Shows and focusses a project tree
QWidget *widget = navigation->activateSubWidget(ProjectExplorer::Constants::PROJECTTREE_ID);
if (auto *projectTreeWidget = qobject_cast<ProjectTreeWidget *>(widget))
projectTreeWidget->showMessage(project->rootProjectNode(), message);
}
void ProjectTree::hideContextMenu()
{
m_focusForContextMenu = 0;