From 472350384fe8636748f195d1e9292029c6476414 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 11 Apr 2009 13:41:33 +0000 Subject: [PATCH] Allow saving external tool options when tools in the .NET SDK cannot be found. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3971 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Gui/Dialogs/OptionPanels/ExternalToolPanel.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs index c703d1cb1a..1cfd979e39 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Text.RegularExpressions; using System.Windows.Forms; using ICSharpCode.Core; @@ -57,10 +58,10 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels // these are the control names which are enabled/disabled depending if tool is selected static string[] dependendControlNames = new string[] { - "titleTextBox", "commandTextBox", "argumentTextBox", - "workingDirTextBox", "promptArgsCheckBox", "useOutputPadCheckBox", - "titleLabel", "argumentLabel", "commandLabel", - "workingDirLabel", "browseButton", "argumentQuickInsertButton", + "titleTextBox", "commandTextBox", "argumentTextBox", + "workingDirTextBox", "promptArgsCheckBox", "useOutputPadCheckBox", + "titleLabel", "argumentLabel", "commandLabel", + "workingDirLabel", "browseButton", "argumentQuickInsertButton", "workingDirQuickInsertButton", "moveUpButton", "moveDownButton" }; @@ -151,8 +152,10 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels List newlist = new List(); foreach (ExternalTool tool in ((ListBox)ControlDictionary["toolListBox"]).Items) { if (!FileUtility.IsValidPath(StringParser.Parse(tool.Command))) { - MessageService.ShowError(String.Format("The command of tool \"{0}\" is invalid.", tool.MenuCommand)); - return false; + if (!Regex.IsMatch(tool.Command, @"^\$\{SdkToolPath:[\w\d]+\.exe\}$")) { + MessageService.ShowError(String.Format("The command of tool \"{0}\" is invalid.", tool.MenuCommand)); + return false; + } } if ((tool.InitialDirectory != String.Empty) && (!FileUtility.IsValidPath(tool.InitialDirectory))) { MessageService.ShowError(String.Format("The working directory of tool \"{0}\" is invalid.", tool.MenuCommand));