From 84e557b3b63087a5b936a6ebf74b0a3e16d6966c Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Fri, 28 Jul 2017 15:49:16 +0100 Subject: [Ide] Fix failure to create CocoaApp project from New Project dialog Fixed bug #58412 - Unable to create CocoaApp from recent templates https://bugzilla.xamarin.com/show_bug.cgi?id=58412 After creating a CocoaApp (Mac - App - General) that targets Mavericks if the CocoaApp project template was selected from the recent projects list in the New Project dialog the project would not be created if a later Mac OS was selected. In the IDE log an error would be reported: No template found matching condition 'Yosemite=false'. The problem was that the selected project template was part of a group but the group was not selected. When a different Mac OS was selected for the new project the condition applied would result in no template being found. --- .../MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionTemplate.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main/src/core/MonoDevelop.Ide') diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionTemplate.cs index 2c1acc5cce..f5f888f330 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionTemplate.cs @@ -114,14 +114,18 @@ namespace MonoDevelop.Ide.Templates public void AddGroupTemplate (SolutionTemplate template) { groupedTemplates.Add (template); + template.Parent = this; if (!availableLanguages.Contains (template.Language)) { availableLanguages.Add (template.Language); } } + internal SolutionTemplate Parent { get; set; } + internal void ClearGroupedTemplates () { + Parent = null; groupedTemplates.Clear (); } @@ -141,6 +145,9 @@ namespace MonoDevelop.Ide.Templates return this; } + if (Parent != null) + return Parent.GetTemplate (predicate); + return groupedTemplates.FirstOrDefault (template => predicate (template)); } -- cgit v1.2.3