Revision: 1048 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1048&view=re... Author: eht16 Date: 2009-11-01 17:11:23 +0000 (Sun, 01 Nov 2009)
Log Message: ----------- Improve handling of the notebook page (closes #2889415).
Modified Paths: -------------- trunk/geany-plugins/addons/ChangeLog trunk/geany-plugins/addons/src/ao_bookmarklist.c
Modified: trunk/geany-plugins/addons/ChangeLog =================================================================== --- trunk/geany-plugins/addons/ChangeLog 2009-11-01 16:56:22 UTC (rev 1047) +++ trunk/geany-plugins/addons/ChangeLog 2009-11-01 17:11:23 UTC (rev 1048) @@ -2,6 +2,8 @@
* src/addons.c: Fix setting up keybindings. + * src/bookmarklist.c: + Improve handling of the notebook page (closes #2889415).
2009-10-26 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/geany-plugins/addons/src/ao_bookmarklist.c =================================================================== --- trunk/geany-plugins/addons/src/ao_bookmarklist.c 2009-11-01 16:56:22 UTC (rev 1047) +++ trunk/geany-plugins/addons/src/ao_bookmarklist.c 2009-11-01 17:11:23 UTC (rev 1048) @@ -55,8 +55,7 @@ { gboolean enable_bookmarklist;
- gint page_number; - + GtkWidget *page; GtkListStore *store; GtkWidget *tree;
@@ -243,7 +242,11 @@ { AoBookmarkListPrivate *priv = AO_BOOKMARK_LIST_GET_PRIVATE(bm);
- gtk_notebook_remove_page(GTK_NOTEBOOK(geany->main_widgets->sidebar_notebook), priv->page_number); + if (priv->page) + { + gtk_widget_destroy(priv->page); + priv->page = NULL; + } }
@@ -301,13 +304,14 @@ gtk_container_add(GTK_CONTAINER(scrollwin), GTK_WIDGET(tree));
gtk_widget_show_all(scrollwin); - priv->page_number = gtk_notebook_append_page( + gtk_notebook_append_page( GTK_NOTEBOOK(geany->main_widgets->sidebar_notebook), scrollwin, gtk_label_new(_("Bookmarks")));
priv->store = store; priv->tree = GTK_WIDGET(tree); + priv->page = scrollwin; }
@@ -317,8 +321,10 @@
if (priv->enable_bookmarklist) { - gtk_notebook_set_current_page( - GTK_NOTEBOOK(geany->main_widgets->sidebar_notebook), priv->page_number); + GtkNotebook *notebook = GTK_NOTEBOOK(geany->main_widgets->sidebar_notebook); + gint page_number = gtk_notebook_page_num(notebook, priv->page); + + gtk_notebook_set_current_page(notebook, page_number); gtk_widget_grab_focus(priv->tree); } } @@ -358,6 +364,9 @@
static void ao_bookmark_list_init(AoBookmarkList *self) { + AoBookmarkListPrivate *priv = AO_BOOKMARK_LIST_GET_PRIVATE(self); + + priv->page = NULL; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org