Commit 55c08495 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Made sure idle handlers werent updating treeviews after the object is


	* gladeui/glade-base-editor.c: Made sure idle handlers werent
	  updating treeviews after the object is destroyed (also bug 506713).


svn path=/trunk/; revision=1711
parent 2f75bffd
......@@ -5,8 +5,12 @@
- Reset "events" property for newly created widgets
(workaround for bug 472555).
* gladeui/glade-editor-property.c: added return_if_fail guard
as per bug 479468.
* gladeui/glade-editor-property.c:
- added return_if_fail guard as per bug 479468.
- Fixed crasher bug 506713.
* gladeui/glade-base-editor.c: Made sure idle handlers werent
updating treeviews after the object is destroyed (also bug 506713).
2008-02-16 Juan Pablo Ugarte <juanpablougarte@gmail.com>
......
......@@ -78,6 +78,8 @@ struct _GladeBaseEditorPrivate
gint row;
gboolean updating_treeview;
guint properties_idle;
};
typedef struct _GladeBaseEditorSignal GladeBaseEditorSignal;
......@@ -350,7 +352,9 @@ glade_base_editor_treeview_cursor_changed (GtkTreeView *treeview,
GObject *child;
GladeWidget *gchild;
if (! glade_base_editor_get_child_selected (editor, &iter))
g_return_if_fail (GTK_IS_TREE_VIEW (treeview));
if (!glade_base_editor_get_child_selected (editor, &iter))
return;
glade_base_editor_clear (editor);
......@@ -372,15 +376,21 @@ glade_base_editor_treeview_cursor_changed (GtkTreeView *treeview,
static gboolean
glade_base_editor_update_properties_idle (gpointer data)
{
glade_base_editor_treeview_cursor_changed (NULL, (GladeBaseEditor *)data);
return FALSE;
GladeBaseEditor *editor = (GladeBaseEditor *)data;
glade_base_editor_treeview_cursor_changed (NULL, editor);
editor->priv->properties_idle = 0;
return FALSE;
}
static void
glade_base_editor_update_properties (GladeBaseEditor *editor)
{
g_idle_add (glade_base_editor_update_properties_idle, editor);
g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
if (!editor->priv->properties_idle)
editor->priv->properties_idle =
g_idle_add (glade_base_editor_update_properties_idle, editor);
}
static void
......@@ -993,6 +1003,12 @@ glade_base_editor_project_disconnect (GladeBaseEditor *editor)
g_signal_handlers_disconnect_by_func (e->project,
glade_base_editor_project_changed, editor);
if (e->properties_idle)
g_source_remove (e->properties_idle);
e->properties_idle = 0;
}
static void
......
......@@ -1835,6 +1835,8 @@ glade_eprop_text_create_input (GladeEditorProperty *eprop)
gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (swindow), TRUE, TRUE, 0);
gtk_widget_show_all (swindow);
/* XXX Use changed signal directly !!! */
g_signal_connect (G_OBJECT (eprop_text->text_entry), "focus-out-event",
G_CALLBACK (glade_eprop_text_text_view_focus_out),
......
......@@ -646,6 +646,8 @@ glade_editor_get_table_from_class (GladeEditor *editor,
GladeEditorTable *table;
GList *list;
g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
for (list = editor->widget_tables; list; list = list->next)
{
table = list->data;
......@@ -741,7 +743,15 @@ glade_editor_load_page (GladeEditor *editor,
void
glade_editor_update_widget_name (GladeEditor *editor)
{
GladeEditorTable *table = glade_editor_get_table_from_class
GladeEditorTable *table;
/* it can happen that a widget name is changing that is only
* available in a custom editor so we have no table
*/
if (!editor->loaded_adaptor)
return;
table = glade_editor_get_table_from_class
(editor, editor->loaded_adaptor, TABLE_TYPE_GENERAL);
g_signal_handlers_block_by_func (G_OBJECT (table->name_entry), glade_editor_widget_name_changed, editor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment