[Monodevelop-patches-list] r2676 - in trunk/MonoDevelop/Core/src/MonoDevelop.Base: . Gui/Pads/ProjectPad
Lluis Sanchez <lluis@ximian.com>
lluis at mono-cvs.ximian.com
Wed Jul 20 07:06:27 EDT 2005
Author: lluis
Date: 2005-07-20 07:06:26 -0400 (Wed, 20 Jul 2005)
New Revision: 2676
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/FolderNodeBuilder.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/ProjectFolder.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs
Log:
2005-07-20 Lluis Sanchez Gual <lluis at novell.com>
* Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs: When a folder is
renamed, update the whole tree branch starting from the parent node.
* Gui/Pads/ProjectPad/ProjectFolder.cs: Don't update the path of the
folder when receiving the Renamed event. Just signal that the name
has changed.
* Gui/Pads/ProjectPad/FolderNodeBuilder.cs: ProjectFile objects that
represent a folder generate ProjectFolder nodes, so the renaming callback
must be attached to a ProjectFolder object.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-07-20 10:34:11 UTC (rev 2675)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-07-20 11:06:26 UTC (rev 2676)
@@ -1,3 +1,14 @@
+2005-07-20 Lluis Sanchez Gual <lluis at novell.com>
+
+ * Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs: When a folder is
+ renamed, update the whole tree branch starting from the parent node.
+ * Gui/Pads/ProjectPad/ProjectFolder.cs: Don't update the path of the
+ folder when receiving the Renamed event. Just signal that the name
+ has changed.
+ * Gui/Pads/ProjectPad/FolderNodeBuilder.cs: ProjectFile objects that
+ represent a folder generate ProjectFolder nodes, so the renaming callback
+ must be attached to a ProjectFolder object.
+
2005-07-20 Lluis Sanchez Gual <lluis at novell.com>
* Commands/SearchCommands.cs:
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/FolderNodeBuilder.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/FolderNodeBuilder.cs 2005-07-20 10:34:11 UTC (rev 2675)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/FolderNodeBuilder.cs 2005-07-20 11:06:26 UTC (rev 2676)
@@ -309,7 +309,7 @@
newFolder.Subtype = Subtype.Directory;
project.ProjectFiles.Add (newFolder);
- Tree.AddNodeInsertCallback (newFolder, new TreeNodeCallback (OnFileInserted));
+ Tree.AddNodeInsertCallback (new ProjectFolder (directoryName, project), new TreeNodeCallback (OnFileInserted));
}
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/ProjectFolder.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/ProjectFolder.cs 2005-07-20 10:34:11 UTC (rev 2675)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/ProjectFolder.cs 2005-07-20 11:06:26 UTC (rev 2676)
@@ -110,7 +110,10 @@
{
if (!e.IsDirectory || e.SourceFile != absolutePath) return;
- absolutePath = e.TargetFile;
+ // The folder path can't be updated because we would be changing
+ // the identity of the object. Another folder object will need
+ // to be created by updating the tree.
+
if (FolderRenamed != null) {
FolderRenamed(this, e);
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs 2005-07-20 10:34:11 UTC (rev 2675)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs 2005-07-20 11:06:26 UTC (rev 2676)
@@ -97,8 +97,8 @@
void OnFolderRenamed (object sender, FileEventArgs e)
{
ProjectFolder f = (ProjectFolder) sender;
- ITreeBuilder tb = Context.GetTreeBuilder (new ProjectFolder (e.SourceFile, f.Project, null));
- if (tb != null) tb.Update ();
+ ITreeBuilder tb = Context.GetTreeBuilder (f.Parent);
+ if (tb != null) tb.UpdateAll ();
}
void OnFolderRemoved (object sender, FileEventArgs e)
More information about the Monodevelop-patches-list
mailing list