Mercurial > geeqie
changeset 825:ee33d2ddb661
Optionnally display directory's date in list view.
It can be set through Preferences > Advanced > Behavior and
is saved to rc file as layout.show_directory_date option.
author | zas_ |
---|---|
date | Fri, 13 Jun 2008 11:11:57 +0000 |
parents | 4a913f093f56 |
children | daebdd1f5bc6 |
files | src/options.c src/options.h src/preferences.c src/rcfile.c src/view_dir.h src/view_dir_list.c |
diffstat | 6 files changed, 26 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/options.c Thu Jun 12 22:43:32 2008 +0000 +++ b/src/options.c Fri Jun 13 11:11:57 2008 +0000 @@ -107,6 +107,7 @@ options->layout.properties_window.w = DEF_PROPERTY_WIDTH; options->layout.properties_window.h = DEF_PROPERTY_HEIGHT; options->layout.save_window_positions = FALSE; + options->layout.show_directory_date = FALSE; options->layout.show_marks = FALSE; options->layout.show_thumbnails = FALSE; options->layout.style = 0;
--- a/src/options.h Thu Jun 12 22:43:32 2008 +0000 +++ b/src/options.h Fri Jun 13 11:11:57 2008 +0000 @@ -165,6 +165,7 @@ gint show_thumbnails; gint show_marks; + gboolean show_directory_date; struct { gint w;
--- a/src/preferences.c Thu Jun 12 22:43:32 2008 +0000 +++ b/src/preferences.c Fri Jun 13 11:11:57 2008 +0000 @@ -360,6 +360,12 @@ g_free(layout_order); } + if (options->layout.show_directory_date != c_options->layout.show_directory_date) + { + options->layout.show_directory_date = c_options->layout.show_directory_date; + refresh = TRUE; + } + image_options_sync(); if (refresh) @@ -1465,6 +1471,9 @@ pref_checkbox_new_int(group, _("Descend folders in tree view"), options->tree_descend_subdirs, &c_options->tree_descend_subdirs); + pref_checkbox_new_int(group, _("Show date in directories list view"), + options->layout.show_directory_date, &c_options->layout.show_directory_date); + pref_checkbox_new_int(group, _("In place renaming"), options->file_ops.enable_in_place_rename, &c_options->file_ops.enable_in_place_rename);
--- a/src/rcfile.c Thu Jun 12 22:43:32 2008 +0000 +++ b/src/rcfile.c Fri Jun 13 11:11:57 2008 +0000 @@ -376,6 +376,7 @@ WRITE_UINT(layout.file_view_type); WRITE_BOOL(layout.show_marks); WRITE_BOOL(layout.show_thumbnails); + WRITE_BOOL(layout.show_directory_date); WRITE_SEPARATOR(); WRITE_BOOL(layout.save_window_positions); @@ -745,6 +746,7 @@ READ_UINT(layout.file_view_type); READ_BOOL(layout.show_marks); READ_BOOL(layout.show_thumbnails); + READ_BOOL(layout.show_directory_date); /* window positions */
--- a/src/view_dir.h Thu Jun 12 22:43:32 2008 +0000 +++ b/src/view_dir.h Fri Jun 13 11:11:57 2008 +0000 @@ -17,6 +17,7 @@ DIR_COLUMN_ICON, DIR_COLUMN_NAME, DIR_COLUMN_COLOR, + DIR_COLUMN_DATE, DIR_COLUMN_COUNT };
--- a/src/view_dir_list.c Thu Jun 12 22:43:32 2008 +0000 +++ b/src/view_dir_list.c Fri Jun 13 11:11:57 2008 +0000 @@ -157,6 +157,7 @@ FileData *fd; GtkTreeIter iter; GdkPixbuf *pixbuf; + const gchar *date = ""; fd = work->data; @@ -173,6 +174,8 @@ else { pixbuf = vd->pf->close; + if (options->layout.show_directory_date) + date = text_from_time(fd->date); } } else @@ -184,7 +187,9 @@ gtk_list_store_set(store, &iter, DIR_COLUMN_POINTER, fd, DIR_COLUMN_ICON, pixbuf, - DIR_COLUMN_NAME, fd->name, -1); + DIR_COLUMN_NAME, fd->name, + DIR_COLUMN_DATE, date, + -1); work = work->next; } @@ -368,7 +373,7 @@ VDLIST_INFO(vd, list) = NULL; - store = gtk_list_store_new(4, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN); + store = gtk_list_store_new(5, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING); vd->view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); g_object_unref(store); @@ -391,6 +396,11 @@ gtk_tree_view_column_add_attribute(column, renderer, "text", DIR_COLUMN_NAME); gtk_tree_view_column_set_cell_data_func(column, renderer, vd_color_cb, vd, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(column, renderer, TRUE); + gtk_tree_view_column_add_attribute(column, renderer, "text", DIR_COLUMN_DATE); + gtk_tree_view_column_set_cell_data_func(column, renderer, vd_color_cb, vd, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(vd->view), column); return vd;