forked from qt-creator/qt-creator
Simplify logic for showing UnconfiguredTargetPanel/TargetPanel
This doesn't change when the those panes are shown. Change-Id: Ie5a2d27321e5268f59775892198999a8414a0adb Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
committed by
Tim Jenssen
parent
90279e6d2b
commit
1c38aa287a
@@ -389,7 +389,7 @@ bool CMakeProject::needsConfiguration() const
|
|||||||
|
|
||||||
bool CMakeProject::requiresTargetPanel() const
|
bool CMakeProject::requiresTargetPanel() const
|
||||||
{
|
{
|
||||||
return false;
|
return !targets().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMakeProject::isProjectFile(const FileName &fileName)
|
bool CMakeProject::isProjectFile(const FileName &fileName)
|
||||||
|
@@ -605,7 +605,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
unconfiguredProjectPanel->setPriority(-10);
|
unconfiguredProjectPanel->setPriority(-10);
|
||||||
unconfiguredProjectPanel->setDisplayName(tr("Configure Project"));
|
unconfiguredProjectPanel->setDisplayName(tr("Configure Project"));
|
||||||
unconfiguredProjectPanel->setSupportsFunction([](Project *project){
|
unconfiguredProjectPanel->setSupportsFunction([](Project *project){
|
||||||
return project->targets().isEmpty() && !project->requiresTargetPanel();
|
return project->needsConfiguration();
|
||||||
});
|
});
|
||||||
icon = QIcon(QLatin1String(":/projectexplorer/images/unconfigured.png"));
|
icon = QIcon(QLatin1String(":/projectexplorer/images/unconfigured.png"));
|
||||||
unconfiguredProjectPanel->setSimpleCreateWidgetFunction<TargetSetupPageWrapper>(icon);
|
unconfiguredProjectPanel->setSimpleCreateWidgetFunction<TargetSetupPageWrapper>(icon);
|
||||||
@@ -616,8 +616,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
displayName = QCoreApplication::translate("TargetSettingsPanelFactory", "Build & Run");
|
displayName = QCoreApplication::translate("TargetSettingsPanelFactory", "Build & Run");
|
||||||
targetSettingsPanelFactory->setDisplayName(displayName);
|
targetSettingsPanelFactory->setDisplayName(displayName);
|
||||||
targetSettingsPanelFactory->setSupportsFunction([](Project *project) {
|
targetSettingsPanelFactory->setSupportsFunction([](Project *project) {
|
||||||
return !project->targets().isEmpty()
|
return project->requiresTargetPanel();
|
||||||
|| project->requiresTargetPanel();
|
|
||||||
});
|
});
|
||||||
targetSettingsPanelFactory->setCreateWidgetFunction([](Project *project) {
|
targetSettingsPanelFactory->setCreateWidgetFunction([](Project *project) {
|
||||||
return new TargetSettingsPanelWidget(project);
|
return new TargetSettingsPanelWidget(project);
|
||||||
|
@@ -1363,7 +1363,7 @@ void QmakeProject::configureAsExampleProject(const QStringList &platforms)
|
|||||||
|
|
||||||
bool QmakeProject::requiresTargetPanel() const
|
bool QmakeProject::requiresTargetPanel() const
|
||||||
{
|
{
|
||||||
return false;
|
return !targets().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
// All the Qmake run configurations should share code.
|
// All the Qmake run configurations should share code.
|
||||||
|
Reference in New Issue
Block a user