Revision: 1305 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1305&view=re... Author: dimitrov-adrian Date: 2010-04-25 18:43:01 +0000 (Sun, 25 Apr 2010)
Log Message: ----------- Treebrowser: bookmarks expand state remember
Modified Paths: -------------- trunk/geany-plugins/treebrowser/src/treebrowser.c
Modified: trunk/geany-plugins/treebrowser/src/treebrowser.c =================================================================== --- trunk/geany-plugins/treebrowser/src/treebrowser.c 2010-04-25 18:35:12 UTC (rev 1304) +++ trunk/geany-plugins/treebrowser/src/treebrowser.c 2010-04-25 18:43:01 UTC (rev 1305) @@ -29,6 +29,8 @@ static gchar *addressbar_last_address = NULL;
static GtkTreeIter bookmarks_iter; +static gboolean bookmarks_expanded = FALSE; + static GtkTreeViewColumn *treeview_column_icon, *treeview_column_text; static GtkCellRenderer *render_icon, *render_text;
@@ -109,6 +111,7 @@
static void project_change_cb(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED GKeyFile *config, G_GNUC_UNUSED gpointer data); static void treebrowser_browse(gchar *directory, gpointer parent, gint deep_limit); +static void treebrowser_load_bookmarks(void); static void gtk_tree_store_iter_clear_nodes(gpointer iter, gboolean delete_root); static void load_settings(void); static gboolean save_settings(void); @@ -254,9 +257,16 @@ return; }
+ if (CONFIG_SHOW_BOOKMARKS) + bookmarks_expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(treeview), gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), &bookmarks_iter)); + gtk_tree_store_clear(treestore); addressbar_last_address = directory; + treebrowser_browse(directory, NULL, CONFIG_INITIAL_DIR_DEEP); + + if (CONFIG_SHOW_BOOKMARKS) + treebrowser_load_bookmarks(); }
static void @@ -349,14 +359,13 @@ gchar *contents, *path_full; gchar **lines, **line; GtkTreeIter iter; - gboolean expanded = FALSE;
bookmarks = g_build_filename (g_get_home_dir(), ".gtk-bookmarks", NULL); if (g_file_get_contents(bookmarks, &contents, NULL, &error)) { if (gtk_tree_store_iter_is_valid(treestore, &bookmarks_iter)) { - expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(treeview), gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), &bookmarks_iter)); + bookmarks_expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(treeview), gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), &bookmarks_iter)); gtk_tree_store_iter_clear_nodes(&bookmarks_iter, FALSE); } else @@ -410,7 +419,7 @@ else g_error_free(error);
- if (expanded) + if (bookmarks_expanded) gtk_tree_view_expand_row(GTK_TREE_VIEW(treeview), gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), &bookmarks_iter), FALSE); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org