forked from qt-creator/qt-creator
Enable restoring the default names of project configuration items
* Enable support for this in all ProjectConfiguration items (Targets, projects, BCs, DCs, RCs, etc.). This is nicer than having custom code in individual configuraiton items. Reviewed-by: dt
This commit is contained in:
@@ -108,7 +108,7 @@ CMakeRunConfiguration::~CMakeRunConfiguration()
|
||||
|
||||
void CMakeRunConfiguration::ctor()
|
||||
{
|
||||
setDisplayName(m_title);
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
}
|
||||
|
||||
CMakeTarget *CMakeRunConfiguration::cmakeTarget() const
|
||||
@@ -205,6 +205,13 @@ bool CMakeRunConfiguration::fromMap(const QVariantMap &map)
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
QString CMakeRunConfiguration::defaultDisplayName() const
|
||||
{
|
||||
if (m_title.isEmpty())
|
||||
return tr("Run CMake target");
|
||||
return m_title + (m_enabled ? "" : tr(" (disabled)"));
|
||||
}
|
||||
|
||||
QWidget *CMakeRunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
return new CMakeRunConfigurationWidget(this);
|
||||
@@ -302,7 +309,7 @@ void CMakeRunConfiguration::setEnabled(bool b)
|
||||
return;
|
||||
m_enabled = b;
|
||||
emit isEnabledChanged(isEnabled());
|
||||
setDisplayName(m_title + (m_enabled ? "" : tr(" (disabled)")));
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
}
|
||||
|
||||
bool CMakeRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *bc) const
|
||||
|
||||
Reference in New Issue
Block a user