[glade] 2011-10-11 Benjamin Otte <otte redhat com>
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] 2011-10-11 Benjamin Otte <otte redhat com>
- Date: Tue, 11 Oct 2011 19:37:26 +0000 (UTC)
commit 881f163a952891af7ed1ff9128fe596e8d13d4f9
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Tue Oct 11 15:35:23 2011 -0400
2011-10-11 Benjamin Otte <otte redhat com>
* gladeui/glade-editor-property.c:
Make size groups widget selection work (bug 647984)
ChangeLog | 5 +++++
gladeui/glade-editor-property.c | 25 +++++++++++++------------
2 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cb0d98d..f917fd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-11 Benjamin Otte <otte redhat com>
+
+ * gladeui/glade-editor-property.c:
+ Make size groups widget selection work (bug 647984)
+
2011-10-09 Tristan Van Berkom <tvb gnome org>
* gladeui/glade-project.c: Fix glade_project_notify_has_child() to notify
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index 81897c0..3aeb4a6 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -3235,7 +3235,12 @@ glade_eprop_objects_show_dialog (GtkWidget * dialog_button,
GParamSpec *pspec;
gchar *title = glade_eprop_object_dialog_title (eprop);
gint res;
- GList *selected_list = NULL, *exception_list = NULL, *selected_objects = NULL;
+ GList *selected_list = NULL, *exception_list = NULL, *selected_objects = NULL, *l;
+
+ /* It's improbable but possible the editor is visible with no
+ * property selected, in this case avoid crashes */
+ if (!eprop->priv->property)
+ return;
widget = glade_property_get_widget (eprop->priv->property);
project = glade_widget_get_project (widget);
@@ -3278,21 +3283,17 @@ glade_eprop_objects_show_dialog (GtkWidget * dialog_button,
tree_view = glade_eprop_object_view (FALSE);
-
+ /* Dont allow selecting the widget owning this property (perhaps this is wrong) */
exception_list = g_list_prepend (exception_list, widget);
- /* XXX This looks broken, do "object list" properties hold an object ? I doubt it... */
- if (g_value_get_object (glade_property_inline_value (eprop->priv->property)))
- {
- GList *l;
- glade_property_get (eprop->priv->property, &selected_objects);
- for (l = selected_objects; l; l = l->next)
- selected_list = g_list_prepend (selected_list,
- glade_widget_get_from_gobject (l->data));
- }
+ /* Build the list of already selected objects */
+ glade_property_get (eprop->priv->property, &selected_objects);
+ for (l = selected_objects; l; l = l->next)
+ selected_list = g_list_prepend (selected_list, glade_widget_get_from_gobject (l->data));
+
glade_eprop_object_populate_view (project, GTK_TREE_VIEW (tree_view),
selected_list, exception_list,
- pspec->value_type,
+ glade_param_spec_objects_get_type (GLADE_PARAM_SPEC_OBJECTS (pspec)),
glade_property_class_parentless_widget (eprop->priv->klass));
g_list_free (selected_list);
g_list_free (exception_list);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]