[Monodevelop-patches-list] r1407 - in trunk/MonoDevelop/src/Main/Base: . Commands/ProjectBrowserCommands
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Wed Apr 7 06:33:39 EDT 2004
Author: tberman
Date: 2004-04-07 06:33:39 -0400 (Wed, 07 Apr 2004)
New Revision: 1407
Modified:
trunk/MonoDevelop/src/Main/Base/ChangeLog
trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs
Log:
patch to close vlad's (final i think) bug #56275, based on a patch from eddie, and added some exception handling.
Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-07 08:24:54 UTC (rev 1406)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-07 10:33:39 UTC (rev 1407)
@@ -1,3 +1,10 @@
+2004-04-07 Todd Berman <tberman at sevenl.net>
+
+ * Commands/ProjectBrowserCommands/FolderNodeCommands: Incorporate bug
+ fix for bug #56275 based on a patch from eddie tejeda
+ <eddie AT nailchipper DOT com>. Also fix an exception that could
+ occur when the file already exists in the target directory.
+
2004-04-07 Nick Drochak <ndrochak at gol.com>
* Gui/Pads/ProjectBrowser/ProjectBrowserView.cs: Before the actual edit
Modified: trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs 2004-04-07 08:24:54 UTC (rev 1406)
+++ trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs 2004-04-07 10:33:39 UTC (rev 1407)
@@ -30,6 +30,7 @@
{
public class AddFilesToProject : AbstractMenuCommand
{
+
public override void Run()
{
ProjectBrowserView browser = (ProjectBrowserView)Owner;
@@ -39,44 +40,55 @@
}
AbstractBrowserNode node = (AbstractBrowserNode)browser.SelectedNode;
+ PropertyService props = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
using (FileSelection fdiag = new FileSelection (GettextCatalog.GetString ("Add a file"))) {
- fdiag.SelectMultiple = true;
- string defaultPath = Path.Combine (Environment.GetEnvironmentVariable ("HOME"), "MonoDevelopProjects");
- fdiag.Complete (defaultPath);
-
- int result = fdiag.Run ();
- try {
- if (result != (int) ResponseType.Ok)
- return;
+ fdiag.SelectMultiple = true;
- foreach (string file in fdiag.Selections) {
- if (file.StartsWith(node.Project.BaseDirectory)) {
- ProjectBrowserView.MoveCopyFile (file, node, true, true);
- } else {
- using (MessageDialog md = new MessageDialog (
- (Window) WorkbenchSingleton.Workbench,
- DialogFlags.Modal | DialogFlags.DestroyWithParent,
- MessageType.Question, ButtonsType.None,
- GettextCatalog.GetString ("The file is outside the project directory, what should I do?"))) {
- md.AddButton (Gtk.Stock.Copy, 1);
- md.AddButton (GettextCatalog.GetString ("_Move"), 2);
- md.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
-
- int ret = md.Run ();
- md.Hide ();
-
- if (ret < 0)
- return;
-
- ProjectBrowserView.MoveCopyFile (file, node, ret == 2, false);
+ string defaultPath = props.GetProperty ("MonoDevelop.Project.AddFilePath", node.Project.BaseDirectory);
+
+ fdiag.Complete(defaultPath);
+
+ int result = fdiag.Run ();
+ try {
+ if (result != (int) ResponseType.Ok)
+ return;
+
+ foreach (string file in fdiag.Selections) {
+ if (file.StartsWith(node.Project.BaseDirectory)) {
+ ProjectBrowserView.MoveCopyFile (file, node, true, true);
+ } else {
+ using (MessageDialog md = new MessageDialog (
+ (Window) WorkbenchSingleton.Workbench,
+ DialogFlags.Modal | DialogFlags.DestroyWithParent,
+ MessageType.Question, ButtonsType.None,
+ GettextCatalog.GetString ("The file is outside the project directory, what should I do?"))) {
+ md.AddButton (Gtk.Stock.Copy, 1);
+ md.AddButton (GettextCatalog.GetString ("_Move"), 2);
+ md.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
+
+ int ret = md.Run ();
+ md.Hide ();
+
+ if (ret < 0)
+ return;
+
+ try
+ {
+ ProjectBrowserView.MoveCopyFile (file, node, ret == 2, false);
+ }
+ catch
+ {
+ ((MessageService)ServiceManager.Services.GetService (typeof (MessageService))).ShowError (GettextCatalog.GetString ("An error occurred while attempt to move/copy that file. Please check your permissions."));
+ }
+ }
}
+ props.SetProperty ("MonoDevelop.Project.AddFilePath", System.IO.Path.GetDirectoryName (file));
}
+ } finally {
+ fdiag.Hide ();
}
- } finally {
- fdiag.Hide ();
}
- }
}
}
More information about the Monodevelop-patches-list
mailing list