[glade3] * plugins/gtk+/glade-activatable-editor.c,



commit b15f23e0c02eef1d8a913f8cd472ecac63468e90
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sat Apr 18 14:51:29 2009 -0400

    	* plugins/gtk+/glade-activatable-editor.c,
    	gladeui/glade-editor-property.c: Maintain current widget selection
    	during commits of related-action (was causing crashes when the
    	selection changed as a result of a commit, bug 578869).
---
 ChangeLog                               |    7 +++++++
 gladeui/glade-editor-property.c         |    7 +++++--
 plugins/gtk+/glade-activatable-editor.c |    5 ++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f44ec07..6d8ef44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-18  Tristan Van Berkom <tvb gnome org>
+
+	* plugins/gtk+/glade-activatable-editor.c, 
+	gladeui/glade-editor-property.c: Maintain current widget selection
+	during commits of related-action (was causing crashes when the
+	selection changed as a result of a commit, bug 578869).
+
 2009-04-15  Tristan Van Berkom <tvb gnome org>
 
 	* configure.ac, NEWS, data/gladeui.pc.in: Bumping
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index 4adba61..ba184ac 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -2101,8 +2101,9 @@ glade_eprop_text_create_input (GladeEditorProperty *eprop)
 						"stock-id", COMBO_COLUMN_PIXBUF,
 						NULL);
 
-		if (klass->stock)
-			gtk_entry_set_editable (GTK_ENTRY (GTK_BIN (combo)->child), FALSE);
+		/* Allow any stock item, even when we should require valid builtin
+		 * item with a label */
+		gtk_entry_set_editable (GTK_ENTRY (GTK_BIN (combo)->child), TRUE);
 		
 		gtk_widget_show (combo);
 		gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0); 
@@ -2910,6 +2911,8 @@ glade_eprop_object_show_dialog (GtkWidget           *dialog_button,
 		/* Dont bother if the user canceled the widget */
 		if ((new_widget = glade_command_create (create_adaptor, NULL, NULL, project)) != NULL)
 		{
+			glade_project_selection_set (project, eprop->property->widget->object, TRUE);
+
 			value = glade_property_class_make_gvalue_from_string
 				(eprop->klass, new_widget->name, project, NULL);
 
diff --git a/plugins/gtk+/glade-activatable-editor.c b/plugins/gtk+/glade-activatable-editor.c
index d651f71..59d0b80 100644
--- a/plugins/gtk+/glade-activatable-editor.c
+++ b/plugins/gtk+/glade-activatable-editor.c
@@ -236,7 +236,6 @@ reset_properties (GladeWidget *gwidget,
 				list.data = image;
 				glade_command_unlock_widget (image);
 				glade_command_delete (&list);
-				glade_project_selection_set (gwidget->project, gwidget->object, TRUE);
 			}
 
 			property = glade_widget_get_property (gwidget, "label");
@@ -313,6 +312,10 @@ reset_properties (GladeWidget *gwidget,
 			//reset_property (gwidget, "use-stock");
 		}
 	}
+	/* Make sure none of our property resets screw with the current selection,
+	 * since we rely on the selection during commit time.
+	 */
+	glade_project_selection_set (gwidget->project, gwidget->object, TRUE);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]