# HG changeset patch # User Colin Clark # Date 1527186345 -3600 # Node ID dc29a31b7c47a3e918fdaf1cc97a8ccdf1274b24 # Parent de18b5afdd1a4bedd3c52b892a399233d56df7be Pan view - implement exif data display The option to display exif data in pan view was NULLed out. This commit implements the display of exif data. The parameters displayed are the same as in the info sidebar. diff -r de18b5afdd1a -r dc29a31b7c47 src/bar_exif.c --- a/src/bar_exif.c Thu May 24 10:04:39 2018 +0100 +++ b/src/bar_exif.c Thu May 24 19:25:45 2018 +0100 @@ -33,6 +33,7 @@ #include "rcfile.h" #include "dnd.h" #include "ui_utildlg.h" +#include "layout.h" #include @@ -725,6 +726,38 @@ WRITE_NL(); WRITE_STRING(""); } +GList * bar_pane_exif_list() +{ + PaneExifData *ped; + GList *list; + GList *work_windows; + GList *exif_list = NULL; + LayoutWindow *lw; + GtkWidget *bar; + GtkWidget *pane; + GtkWidget *entry; + ExifEntry *ee; + + work_windows = layout_window_list; + lw = work_windows->data; + bar = lw->bar; + pane = bar_find_pane_by_id(bar, PANE_EXIF, "exif"); + ped = g_object_get_data(G_OBJECT(pane), "pane_data"); + + list = gtk_container_get_children(GTK_CONTAINER(ped->vbox)); + while (list) + { + entry = list->data; + list = list->next; + ee = g_object_get_data(G_OBJECT(entry), "entry_data"); + exif_list = g_list_append(exif_list, g_strdup(ee->title)); + exif_list = g_list_append(exif_list, g_strdup(ee->key)); + } + + g_list_free(list); + + return exif_list; +} void bar_pane_exif_close(GtkWidget *widget) { diff -r de18b5afdd1a -r dc29a31b7c47 src/bar_exif.h --- a/src/bar_exif.h Thu May 24 10:04:39 2018 +0100 +++ b/src/bar_exif.h Thu May 24 19:25:45 2018 +0100 @@ -31,7 +31,7 @@ const gchar **bar_exif_key_list; const gint bar_exif_key_count; - +GList *bar_pane_exif_list(); #endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff -r de18b5afdd1a -r dc29a31b7c47 src/pan-view/pan-view.c --- a/src/pan-view/pan-view.c Thu May 24 10:04:39 2018 +0100 +++ b/src/pan-view/pan-view.c Thu May 24 19:25:45 2018 +0100 @@ -1322,10 +1322,31 @@ static void pan_info_add_exif(PanTextAlignment *ta, FileData *fd) { + GList *exif_list; + gchar *text; + gchar *title; + gchar *key; if (!fd) return; - pan_text_alignment_add(ta, NULL, NULL); + exif_list = bar_pane_exif_list(); + while (exif_list) + { + title = exif_list->data; + exif_list = exif_list->next; + key = exif_list->data; + exif_list = exif_list->next; + + text = metadata_read_string(fd, key, METADATA_FORMATTED); + if (text && text[0] != '\0') + { + pan_text_alignment_add(ta, title, text); + } + + g_free(text); + } + + string_list_free(exif_list); }