changeset 2728:981c22b02736

Merge remote-tracking branch 'github/merge-requests/589' * github/merge-requests/589: layout_util: fix passing an rvalue to WEXITSTATUS Just to complete Colins commit
author Klaus Ethgen <Klaus@Ethgen.de>
date Sat, 10 Feb 2018 18:50:21 +0100
parents 37c2e1a7d08b (diff) c3dfec854b7b (current diff)
children 92c66393fce2
files
diffstat 8 files changed, 60 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/doc/docbook/GuideOptionsWindow.xml	Wed Feb 07 23:04:01 2018 -0800
+++ b/doc/docbook/GuideOptionsWindow.xml	Sat Feb 10 18:50:21 2018 +0100
@@ -197,6 +197,10 @@
             <entry>JPEG image comment</entry>
           </row>
           <row>
+            <entry>rating</entry>
+            <entry>Image rating</entry>
+          </row>
+          <row>
             <entry>&lt;meta_tag&gt;</entry>
             <entry>The Exif, XMP, or IPTC tag from metadata</entry>
           </row>
--- a/src/cache_maint.c	Wed Feb 07 23:04:01 2018 -0800
+++ b/src/cache_maint.c	Sat Feb 10 18:50:21 2018 +0100
@@ -816,7 +816,7 @@
 	hbox = pref_box_new(cd->group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
 	pref_label_new(hbox, _("Folder:"));
 
-	label = tab_completion_new(&cd->entry, path, NULL, NULL);
+	label = tab_completion_new(&cd->entry, path, NULL, NULL, NULL, NULL);
 	tab_completion_add_select_button(cd->entry,_("Select folder") , TRUE);
 	gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
 	gtk_widget_show(label);
--- a/src/image-overlay.c	Wed Feb 07 23:04:01 2018 -0800
+++ b/src/image-overlay.c	Sat Feb 10 18:50:21 2018 +0100
@@ -340,6 +340,10 @@
 			{
 			data = exif_get_image_comment(imd->image_fd);
 			}
+		else if (strcmp(name, "rating") == 0)
+			{
+			data = metadata_read_string(imd->image_fd, RATING_KEY, METADATA_PLAIN);
+			}
 #ifdef HAVE_LUA
 		else if (strncmp(name, "lua/", 4) == 0)
 			{
--- a/src/layout.c	Wed Feb 07 23:04:01 2018 -0800
+++ b/src/layout.c	Sat Feb 10 18:50:21 2018 +0100
@@ -2123,7 +2123,7 @@
 	pref_label_new(group, _("Home path (empty to use your home directory)"));
 	hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
 
-	tabcomp = tab_completion_new(&lc->home_path_entry, lc->options.home_path, NULL, NULL);
+	tabcomp = tab_completion_new(&lc->home_path_entry, lc->options.home_path, NULL, NULL, NULL, NULL);
 	tab_completion_add_select_button(lc->home_path_entry, NULL, TRUE);
 	gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0);
 	gtk_widget_show(tabcomp);
--- a/src/preferences.c	Wed Feb 07 23:04:01 2018 -0800
+++ b/src/preferences.c	Sat Feb 10 18:50:21 2018 +0100
@@ -1850,7 +1850,8 @@
 	gtk_widget_set_tooltip_markup(image_overlay_template_view,
 	_("<i>%name%</i> results in the filename of the picture.\n"
 	  "Also available: <i>%collection%</i>, <i>%number%</i>, <i>%total%</i>, <i>%date%</i>,\n"
-	  "<i>%size%</i> (filesize), <i>%width%</i>, <i>%height%</i>, <i>%res%</i> (resolution)\n"
+	  "<i>%size%</i> (filesize), <i>%width%</i>, <i>%height%</i>, <i>%res%</i> (resolution),\n"
+	  "<i>%rating%</i>, <i>%keywords%</i>, <i>%comment%</i> (XMP), <i>%imagecomment%</i> (JPEG)\n"
 	  "To access exif data use the exif name, e. g. <i>%formatted.Camera%</i> is the formatted camera name,\n"
 	  "<i>%Exif.Photo.DateTimeOriginal%</i> the date of the original shot.\n"
 	  "<i>%formatted.Camera:20</i> notation will truncate the displayed data to 20 characters and will add 3 dots at the end to denote the truncation.\n"
@@ -2283,7 +2284,7 @@
 		gtk_widget_show(entry);
 		color_profile_input_name_entry[i] = entry;
 
-		tabcomp = tab_completion_new(&entry, options->color_profile.input_file[i], NULL, NULL);
+		tabcomp = tab_completion_new(&entry, options->color_profile.input_file[i], NULL, ".icc", "ICC Files", NULL);
 		tab_completion_add_select_button(entry, _("Select color profile"), FALSE);
 		gtk_widget_set_size_request(entry, 160, -1);
 		gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, i + 1, i + 2,
@@ -2303,7 +2304,7 @@
 
 	pref_table_label(table, 0, 0, _("Screen:"), 1.0);
 	tabcomp = tab_completion_new(&color_profile_screen_file_entry,
-				     options->color_profile.screen_file, NULL, NULL);
+				     options->color_profile.screen_file, NULL, ".icc", "ICC Files", NULL);
 	tab_completion_add_select_button(color_profile_screen_file_entry, _("Select color profile"), FALSE);
 	gtk_widget_set_size_request(color_profile_screen_file_entry, 160, -1);
 #ifdef HAVE_LCMS
@@ -2346,7 +2347,7 @@
 	pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_SPACE);
 	pref_label_new(hbox, _("Folder:"));
 
-	tabcomp = tab_completion_new(&safe_delete_path_entry, options->file_ops.safe_delete_path, NULL, NULL);
+	tabcomp = tab_completion_new(&safe_delete_path_entry, options->file_ops.safe_delete_path, NULL, NULL, NULL, NULL);
 	tab_completion_add_select_button(safe_delete_path_entry, NULL, TRUE);
 	gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0);
 	gtk_widget_show(tabcomp);
--- a/src/ui_tabcomp.c	Wed Feb 07 23:04:01 2018 -0800
+++ b/src/ui_tabcomp.c	Sat Feb 10 18:50:21 2018 +0100
@@ -87,6 +87,8 @@
 	gchar *fd_title;
 	gboolean fd_folders_only;
 	GtkWidget *fd_button;
+	gchar *filter;
+	gchar *filter_desc;
 
 	guint choices;
 };
@@ -168,6 +170,9 @@
 	if (td->fd) file_dialog_close(td->fd);
 	g_free(td->fd_title);
 
+	g_free(td->filter);
+	g_free(td->filter_desc);
+
 	g_free(td);
 }
 
@@ -738,7 +743,7 @@
 	gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
 	gtk_widget_show(button);
 
-	tab_completion_add_to_entry(combo_entry, enter_func, data);
+	tab_completion_add_to_entry(combo_entry, enter_func, NULL, NULL, data);
 
 	td = g_object_get_data(G_OBJECT(combo_entry), "tab_completion_data");
 	if (!td) return NULL; /* this should never happen! */
@@ -821,7 +826,7 @@
 }
 
 GtkWidget *tab_completion_new(GtkWidget **entry, const gchar *text,
-			      void (*enter_func)(const gchar *, gpointer), gpointer data)
+			      void (*enter_func)(const gchar *, gpointer), const gchar *filter, const gchar *filter_desc, gpointer data)
 {
 	GtkWidget *hbox;
 	GtkWidget *button;
@@ -838,13 +843,12 @@
 	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
 	gtk_widget_show(button);
 
-	tab_completion_add_to_entry(newentry, enter_func, data);
-
+	tab_completion_add_to_entry(newentry, enter_func, filter, filter_desc, data);
 	if (entry) *entry = newentry;
 	return hbox;
 }
 
-void tab_completion_add_to_entry(GtkWidget *entry, void (*enter_func)(const gchar *, gpointer), gpointer data)
+void tab_completion_add_to_entry(GtkWidget *entry, void (*enter_func)(const gchar *, gpointer), const gchar *filter, const gchar *filter_desc, gpointer data)
 {
 	TabCompData *td;
 	if (!entry)
@@ -858,6 +862,8 @@
 	td->entry = entry;
 	td->enter_func = enter_func;
 	td->enter_data = data;
+	td->filter = g_strdup(filter);
+	td->filter_desc = g_strdup(filter_desc);
 
 	g_object_set_data(G_OBJECT(td->entry), "tab_completion_data", td);
 
@@ -923,6 +929,8 @@
 {
 	const gchar *title;
 	const gchar *path;
+	gchar *filter = NULL;
+	gchar *filter_desc = NULL;
 
 	if (td->fd)
 		{
@@ -938,6 +946,23 @@
 
 	generic_dialog_add_message(GENERIC_DIALOG(td->fd), NULL, title, NULL, FALSE);
 
+	if (td->filter)
+		{
+		filter = td->filter;
+		}
+	else
+		{
+		filter = "*";
+		}
+	if (td->filter_desc)
+		{
+		filter_desc = td->filter_desc;
+		}
+	else
+		{
+		filter_desc = _("All files");
+		}
+
 	path = gtk_entry_get_text(GTK_ENTRY(td->entry));
 	if (strlen(path) == 0) path = NULL;
 	if (td->fd_folders_only)
@@ -946,7 +971,7 @@
 		}
 	else
 		{
-		file_dialog_add_path_widgets(td->fd, NULL, path, td->history_key, "*", _("All files"));
+		file_dialog_add_path_widgets(td->fd, NULL, path, td->history_key, filter, filter_desc);
 		}
 
 	gtk_widget_show(GENERIC_DIALOG(td->fd)->dialog);
--- a/src/ui_tabcomp.h	Wed Feb 07 23:04:01 2018 -0800
+++ b/src/ui_tabcomp.h	Sat Feb 10 18:50:21 2018 +0100
@@ -30,8 +30,8 @@
 void tab_completion_append_to_history(GtkWidget *entry, const gchar *path);
 
 GtkWidget *tab_completion_new(GtkWidget **entry, const gchar *text,
-			      void (*enter_func)(const gchar *, gpointer), gpointer data);
-void tab_completion_add_to_entry(GtkWidget *entry, void (*enter_func)(const gchar *, gpointer), gpointer data);
+			      void (*enter_func)(const gchar *, gpointer), const gchar *filter, const gchar *filter_desc, gpointer data);
+void tab_completion_add_to_entry(GtkWidget *entry, void (*enter_func)(const gchar *, gpointer), const gchar *filter, const gchar *filter_desc, gpointer data);
 void tab_completion_add_tab_func(GtkWidget *entry, void (*tab_func)(const gchar *, gpointer), gpointer data);
 gchar *remove_trailing_slash(const gchar *path);
 
--- a/src/window.c	Wed Feb 07 23:04:01 2018 -0800
+++ b/src/window.c	Sat Feb 10 18:50:21 2018 +0100
@@ -244,7 +244,18 @@
 
 	if (key && strstr(key, ".html") != 0)
 		{
-		gchar *path = g_build_filename("file://", GQ_HTMLDIR, key, NULL);
+		path = g_build_filename(GQ_HTMLDIR, key, NULL);
+		if (!isfile(path))
+			{
+			if (g_strcmp0(key, "index.html") == 0)
+				{
+				path = g_build_filename("http://geeqie.org/help/", "GuideIndex.html", NULL);
+				}
+			else
+				{
+				path = g_build_filename("http://geeqie.org/help/", key, NULL);
+				}
+			}
 		help_browser_run(path);
 		g_free(path);
 		return;