--- a/gf_theme_editor.c Sat Jan 03 07:30:04 2004 +0000
+++ b/gf_theme_editor.c Sat Jan 03 11:00:13 2004 +0000
@@ -119,9 +119,9 @@
- window = make_window();
+ window = make_window(); @@ -420,7 +420,7 @@
make_advanced_page(GtkWidget *notebook) {
GtkWidget *vbox, *scrolled_window, *dir_tree_view;
vbox = add_page(GTK_NOTEBOOK(notebook), "Advanced Theme", -1);
scrolled_window = gtk_scrolled_window_new(NULL, NULL);
@@ -431,6 +431,7 @@
dir_tree_view = grim_dir_tree_view_new();
g_signal_connect(G_OBJECT(dir_tree_view), "row-activated", G_CALLBACK(moved_cursor), NULL);
gtk_container_add(GTK_CONTAINER(scrolled_window), dir_tree_view);
grim_dir_tree_view_set_path(GRIM_DIR_TREE_VIEW(dir_tree_view), g_get_home_dir());
/**********************************************************************/
--- a/grimdirtreeview.c Sat Jan 03 07:30:04 2004 +0000
+++ b/grimdirtreeview.c Sat Jan 03 11:00:13 2004 +0000
@@ -1,6 +1,6 @@
Guifications - The notification plugin to end all notification plugins!
- Copyright (C) 2003 Gary Kramlich
+ Copyright (C) 2003-2004 Gary Kramlich This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -19,6 +19,7 @@
@@ -313,6 +314,8 @@
GtkTreeIter current, child;
+ printf("add dir; parent: %s child: %s\n", parent_path, child_path); /* tweak when show hidden property is added */
if (child_path[0] == '.')
@@ -336,9 +339,27 @@
gtk_tree_store_set(store, &child, DIR_COL_TEXT, "", DIR_COL_PATH, NULL, -1);
+ printf("length: %d\n", strlen(child_path)); + if (strlen(child_path) == 3 ) { + if (isalpha(child_path[0]) && child_path[1] == ':' && child_path[2] == G_DIR_SEPARATOR) { + gtk_tree_store_append(store, ¤t, parent); + gtk_tree_store_set(store, ¤t, DIR_COL_ICON, pixbuf, DIR_COL_TEXT, child_path, DIR_COL_PATH, new_path, -1); + if (has_subdir(child_path)) { + gtk_tree_store_append(store, &child, ¤t); + gtk_tree_store_set(store, &child, DIR_COL_TEXT, "", DIR_COL_PATH, NULL, -1); + printf("add dir exit\n"); @@ -351,6 +372,8 @@
gchar *dir_path, *child_path = NULL;
+ printf("expand callback\n"); gtk_tree_model_get(GTK_TREE_MODEL(dir_tree_view->store), iter, DIR_COL_PATH, &dir_path, -1);
pixbuf = gdk_pixbuf_new_from_xpm_data(folder_open_xpm);
@@ -380,6 +403,8 @@
gtk_tree_sortable_set_sort_column_id(sortable, DIR_COL_TEXT, GTK_SORT_ASCENDING);
+ printf("expand callback exit\n"); @@ -388,6 +413,8 @@
GtkTreeIter holder, child;
+ printf("collapse callback\n"); pixbuf = gdk_pixbuf_new_from_xpm_data(folder_xpm);
gtk_tree_store_set(dir_tree_view->store, iter, DIR_COL_ICON, pixbuf, -1);
@@ -401,6 +428,8 @@
gtk_tree_model_iter_children(GTK_TREE_MODEL(dir_tree_view->store), &child, iter);
gtk_tree_store_remove(dir_tree_view->store, &child);
+ printf("collapse callback exit\n"); @@ -414,6 +443,8 @@
gchar *path = NULL, *ret_path;
selection = gtk_tree_view_get_selection(&dir_tree_view->tree_view);
if (gtk_tree_selection_get_selected(selection, NULL, &selected)) {
gtk_tree_model_get(GTK_TREE_MODEL(dir_tree_view->store), &selected, DIR_COL_PATH, &path, -1);
@@ -423,7 +454,9 @@
ret_path = g_strdup(path);
+ printf("get path exit\n"); @@ -432,24 +465,39 @@
GtkTreeSelection *selection;
GtkTreeIter parent, child;
+ gchar **directories = NULL; gchar *search_path = NULL, *new_path = NULL, *child_path = NULL;
+ gint dir = 0, drives = 0; + printf("set path: %s\n", path); + path = g_strdup("c:\\windows\\"); + if (!g_path_is_absolute(path)) directories = g_strsplit(path, G_DIR_SEPARATOR_S, 0);
while (directories[dir] != NULL) {
- search_path = g_strdup(G_DIR_SEPARATOR_S);
- gtk_tree_model_get_iter_first(GTK_TREE_MODEL(dir_tree_view->store), &parent);
+ printf("dir: %s\n", directories[dir]); + drives = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(dir_tree_view->store), NULL); + printf("drives: %d", drives); + search_path = g_strdup(G_DIR_SEPARATOR_S); - tree_path = gtk_tree_model_get_path(GTK_TREE_MODEL(dir_tree_view->store), &parent);
- gtk_tree_view_expand_row(GTK_TREE_VIEW(dir_tree_view), tree_path, TRUE);
- gtk_tree_path_free(tree_path);
+ gtk_tree_model_get_iter_first(GTK_TREE_MODEL(dir_tree_view->store), &parent);
+ tree_path = gtk_tree_model_get_path(GTK_TREE_MODEL(dir_tree_view->store), &parent); + gtk_tree_view_expand_row(GTK_TREE_VIEW(dir_tree_view), tree_path, TRUE); + gtk_tree_path_free(tree_path); new_path = g_strdup_printf("%s%s%s", search_path, directories[dir], G_DIR_SEPARATOR_S);
@@ -495,7 +543,9 @@
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dir_tree_view));
gtk_tree_selection_unselect_all(selection);
gtk_tree_selection_select_iter(selection, &child);
+ printf("set path exit");