diff options
author | Michael Hutchinson <mhutchinson@novell.com> | 2009-02-20 04:48:54 +0300 |
---|---|---|
committer | Michael Hutchinson <mhutchinson@novell.com> | 2009-02-20 04:48:54 +0300 |
commit | e9c0101c9b11b05f497903817a4a486b7fc8460c (patch) | |
tree | cd488b005c8bcee57d1e091837aa6ad7a0629160 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs | |
parent | 2839d7c79f6769bb303da1b800cec60c4ebea55e (diff) |
* MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
* MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
* MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
Better error messages for file rename. Fixes 'Bug 473688 - Reports
problem about "already in use" when it should report non-existance'.
svn path=/trunk/monodevelop/; revision=127487
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs index bf2a9ad870..290afd2af9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs @@ -156,16 +156,19 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad if (oldFoldername != newFoldername) { try { - - if (FileService.IsValidPath (newFoldername)) { + if (!FileService.IsValidPath (newFoldername)) { + MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name.")); + } else if (File.Exists (newFoldername) || Directory.Exists (newFoldername)) { + MessageService.ShowWarning (GettextCatalog.GetString ("File or directory name is already in use. Please choose a different one.")); + } else { FileService.RenameDirectory (oldFoldername, newName); if (folder.Project != null) IdeApp.ProjectOperations.Save (folder.Project); } - } catch (System.IO.IOException) { // assume duplicate file - MessageService.ShowError(GettextCatalog.GetString ("File or directory name is already in use. Please choose a different one.")); } catch (System.ArgumentException) { // new file name with wildcard (*, ?) characters in it - MessageService.ShowError(GettextCatalog.GetString ("The file name you have chosen contains illegal characters. Please choose a different file name.")); + MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name.")); + } catch (System.IO.IOException ex) { + MessageService.ShowException (ex, GettextCatalog.GetString ("There was an error renaming the directory.")); } } } |