forked from qt-creator/qt-creator
MiniTargetSelector: If the project's displayname is non unique show path
Task-number: QTCREATORBUG-8329 Change-Id: Ia256c09a634ff4794b67007e5013680a8a740201 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
#include <utils/tooltip/tooltip.h>
|
||||||
|
#include <utils/tooltip/tipcontents.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/imode.h>
|
#include <coreplugin/imode.h>
|
||||||
@@ -87,6 +89,12 @@ bool FancyToolButton::event(QEvent *e)
|
|||||||
animation->start(QAbstractAnimation::DeleteWhenStopped);
|
animation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case QEvent::ToolTip:
|
||||||
|
{
|
||||||
|
QHelpEvent *he = static_cast<QHelpEvent *>(e);
|
||||||
|
Utils::ToolTip::instance()->show(mapToGlobal(he->pos()), Utils::TextContent(toolTip()), this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return QToolButton::event(e);
|
return QToolButton::event(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1371,6 +1371,7 @@ void MiniProjectTargetSelector::mousePressEvent(QMouseEvent *e)
|
|||||||
void MiniProjectTargetSelector::updateActionAndSummary()
|
void MiniProjectTargetSelector::updateActionAndSummary()
|
||||||
{
|
{
|
||||||
QString projectName;
|
QString projectName;
|
||||||
|
QString fileName; // contains the path if projectName is not unique
|
||||||
QString targetName;
|
QString targetName;
|
||||||
QString targetToolTipText;
|
QString targetToolTipText;
|
||||||
QString buildConfig;
|
QString buildConfig;
|
||||||
@@ -1381,6 +1382,12 @@ void MiniProjectTargetSelector::updateActionAndSummary()
|
|||||||
Project *project = ProjectExplorerPlugin::instance()->startupProject();
|
Project *project = ProjectExplorerPlugin::instance()->startupProject();
|
||||||
if (project) {
|
if (project) {
|
||||||
projectName = project->displayName();
|
projectName = project->displayName();
|
||||||
|
foreach (Project *p, ProjectExplorerPlugin::instance()->session()->projects()) {
|
||||||
|
if (p != project && p->displayName() == projectName) {
|
||||||
|
fileName = project->document()->fileName();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Target *target = project->activeTarget()) {
|
if (Target *target = project->activeTarget()) {
|
||||||
targetName = project->activeTarget()->displayName();
|
targetName = project->activeTarget()->displayName();
|
||||||
@@ -1406,6 +1413,8 @@ void MiniProjectTargetSelector::updateActionAndSummary()
|
|||||||
m_projectAction->setIcon(targetIcon);
|
m_projectAction->setIcon(targetIcon);
|
||||||
QStringList lines;
|
QStringList lines;
|
||||||
lines << tr("<b>Project:</b> %1").arg(projectName);
|
lines << tr("<b>Project:</b> %1").arg(projectName);
|
||||||
|
if (!fileName.isEmpty())
|
||||||
|
lines << tr("<b>Path:</b> %1").arg(fileName);
|
||||||
if (!targetName.isEmpty())
|
if (!targetName.isEmpty())
|
||||||
lines << tr("<b>Kit:</b> %1").arg(targetName);
|
lines << tr("<b>Kit:</b> %1").arg(targetName);
|
||||||
if (!buildConfig.isEmpty())
|
if (!buildConfig.isEmpty())
|
||||||
|
|||||||
Reference in New Issue
Block a user