Author: lluis
Date: 2006-10-18 11:21:10 -0400 (Wed, 18 Oct 2006)
New Revision: 66791

Modified:
   trunk/monodevelop/Extras/MonoDevelop.GtkCore/ChangeLog
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs
Log:
2006-10-18 Lluis Sanchez Gual  <[EMAIL PROTECTED]> 

        * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added RemoveExportedWidget 
method.
        * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: track
          API changes.
        * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the name of a
          widget changes and it is being exported, update it in the objects.xml
          file. Fixes bug #79656.



Modified: trunk/monodevelop/Extras/MonoDevelop.GtkCore/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.GtkCore/ChangeLog      2006-10-18 
14:57:27 UTC (rev 66790)
+++ trunk/monodevelop/Extras/MonoDevelop.GtkCore/ChangeLog      2006-10-18 
15:21:10 UTC (rev 66791)
@@ -1,3 +1,12 @@
+2006-10-18 Lluis Sanchez Gual  <[EMAIL PROTECTED]> 
+
+       * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added RemoveExportedWidget 
method.
+       * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: track
+         API changes.
+       * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the name of a
+         widget changes and it is being exported, update it in the objects.xml
+         file. Fixes bug #79656.
+
 2006-09-23 Lluis Sanchez Gual  <[EMAIL PROTECTED]> 
 
        * lib/*: Updated from Stetic module. It provides a redesigned API

Modified: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs
   2006-10-18 14:57:27 UTC (rev 66790)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs
   2006-10-18 15:21:10 UTC (rev 66791)
@@ -118,9 +118,9 @@
                        get { return exportedWidgets.Count > 0; }
                }
                
-               public bool IsExported (IClass cls)
+               public bool IsExported (string name)
                {
-                       return exportedWidgets.Contains 
(cls.FullyQualifiedName);
+                       return exportedWidgets.Contains (name);
                }
                
                public void AddExportedWidget (string name)
@@ -129,6 +129,11 @@
                                exportedWidgets.Add (name);
                }
 
+               public void RemoveExportedWidget (string name)
+               {
+                       exportedWidgets.Remove (name);
+               }
+               
                public IClass[] GetExportedClasses ()
                {
                        IParserContext pctx = 
GuiBuilderProject.GetParserContext ();

Modified: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
        2006-10-18 14:57:27 UTC (rev 66790)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
        2006-10-18 15:21:10 UTC (rev 66791)
@@ -91,7 +91,7 @@
                                        selection.AddRange 
(designInfo.ExportedWidgets);
                                
                                foreach (IClass cls in 
GtkCoreService.GetExportableClasses (project)) {
-                                       bool exported = designInfo != null && 
designInfo.IsExported (cls);
+                                       bool exported = designInfo != null && 
designInfo.IsExported (cls.FullyQualifiedName);
                                        string icon = 
IdeApp.Services.Icons.GetIcon (cls);
                                        Pixbuf pic = 
IdeApp.Services.Resources.GetIcon (icon);
                                        store.AppendValues (exported, pic, 
cls.FullyQualifiedName, cls);

Modified: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
       2006-10-18 14:57:27 UTC (rev 66790)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
       2006-10-18 15:21:10 UTC (rev 66791)
@@ -183,10 +183,27 @@
                public override void Save (string fileName)
                {
                        base.Save (fileName);
+                       
+                       string oldName = codeBinder.TargetObject.Name;
                        codeBinder.UpdateBindings (fileName);
                        designer.Save ();
                        actionsBox.Save ();
                        window.Project.Save ();
+                       
+                       if (codeBinder.TargetObject.Name != oldName) {
+                               // The name of the component has changed. If 
this component is being
+                               // exported by the library, then the component 
reference also has to
+                               // be updated in the project configuration
+                               
+                               GtkDesignInfo info = GtkCoreService.GetGtkInfo 
(window.Project.Project);
+                               if (info.IsExported (oldName)) {
+                                       info.RemoveExportedWidget (oldName);
+                                       info.AddExportedWidget 
(codeBinder.TargetObject.Name);
+                                       info.UpdateGtkFolder ();
+                                       GtkCoreService.UpdateObjectsFile 
(window.Project.Project);
+                                       IdeApp.ProjectOperations.SaveProject 
(window.Project.Project);
+                               }
+                       }
                }
                
                public override bool IsDirty {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to