Browse Source

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
shortcuts
Daniel Grunwald 17 years ago
parent
commit
472350384f
  1. 15
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs

15
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs

@ -7,6 +7,7 @@ @@ -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 @@ -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 @@ -151,8 +152,10 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
List<ExternalTool> newlist = new List<ExternalTool>();
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));

Loading…
Cancel
Save