diff options
author | Tristan Van Berkom <tvb@src.gnome.org> | 2007-07-25 13:57:36 +0000 |
---|---|---|
committer | Tristan Van Berkom <tvb@src.gnome.org> | 2007-07-25 13:57:36 +0000 |
commit | 61782c359e09a79186807887820b7122409ef72f (patch) | |
tree | 75596c2ede583a1e2b64a4ef38122820e2adc315 | |
parent | 046723ba7f969570b4405332da24e2df184862db (diff) | |
download | glade-61782c359e09a79186807887820b7122409ef72f.tar.gz |
Make undoing increasing notebook size work properly (needed to destroy the
* plugins/gtk+/glade-gtk.c: Make undoing increasing notebook size work properly
(needed to destroy the added tab label project widget and remove it from the
project).
svn path=/trunk/; revision=1514
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | doc/tmpl/glade-utils.sgml | 8 | ||||
-rw-r--r-- | doc/tmpl/gladeui-unused.sgml | 7 | ||||
-rw-r--r-- | plugins/gtk+/glade-gtk.c | 24 |
4 files changed, 30 insertions, 15 deletions
@@ -1,3 +1,9 @@ +2006-06-25 Tristan Van Berkom <tvb@gnome.org> + + * plugins/gtk+/glade-gtk.c: Make undoing increasing notebook size work properly + (needed to destroy the added tab label project widget and remove it from the + project). + 2006-06-24 Tristan Van Berkom <tvb@gnome.org> * src/glade-window.c: Set custom label on the property editor sensitive/insensitive diff --git a/doc/tmpl/glade-utils.sgml b/doc/tmpl/glade-utils.sgml index f3b59d5e..ca325fce 100644 --- a/doc/tmpl/glade-utils.sgml +++ b/doc/tmpl/glade-utils.sgml @@ -194,14 +194,6 @@ This is where all of that really usefull miscalanious stuff lands up. @Returns: -<!-- ##### FUNCTION glade_util_queue_draw_nodes ##### --> -<para> - -</para> - -@window: - - <!-- ##### FUNCTION glade_util_container_get_all_children ##### --> <para> diff --git a/doc/tmpl/gladeui-unused.sgml b/doc/tmpl/gladeui-unused.sgml index 377df0c1..6bf1e8da 100644 --- a/doc/tmpl/gladeui-unused.sgml +++ b/doc/tmpl/gladeui-unused.sgml @@ -125,6 +125,13 @@ GladeProjectView @widget: @Returns: +<!-- ##### FUNCTION glade_util_queue_draw_nodes ##### --> +<para> + +</para> + +@window: + <!-- ##### FUNCTION glade_util_widget_pastable ##### --> <para> diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c index 37752d76..654c0409 100644 --- a/plugins/gtk+/glade-gtk.c +++ b/plugins/gtk+/glade-gtk.c @@ -2726,18 +2726,28 @@ glade_gtk_notebook_set_n_pages (GObject *object, const GValue *value) */ while (old_size > new_size) { /* Get the last widget. */ + GladeWidget *gtab; child_widget = gtk_notebook_get_nth_page (notebook, old_size-1); tab_widget = gtk_notebook_get_tab_label (notebook, child_widget); - /* - * If we got it, and its not a placeholder, remove it - * from project. + /* Ok there shouldnt be widget in the content area, that's + * the placeholder, we should clean up the project widget that + * we put in the tab here though (this happens in the case where + * we undo increasing the "pages" property). */ - if (glade_widget_get_from_gobject (child_widget) || - glade_widget_get_from_gobject (tab_widget)) - break; - + if (glade_widget_get_from_gobject (child_widget)) + g_critical ("Bug in notebook_set_n_pages()"); + gtk_notebook_remove_page (notebook, old_size-1); + + /* Cleanup possible tab widgets + */ + if ((gtab = glade_widget_get_from_gobject (tab_widget)) != NULL) + { + glade_project_remove_object (glade_widget_get_project (gtab), gtab->object); + g_object_unref (gtab); + } + old_size--; } } |