changeset 1468:e9f9d3da3f43

added tooltips to external editors on toolbar - patch by Colin Clark
author nadvornik
date Fri, 20 Mar 2009 17:02:00 +0000
parents 2b95dbb20a87
children 607c60506863
files src/editors.c src/editors.h src/layout_util.c
diffstat 3 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/editors.c	Fri Mar 20 16:28:43 2009 +0000
+++ b/src/editors.c	Fri Mar 20 17:02:00 2009 +0000
@@ -84,6 +84,7 @@
 	g_free(editor->exec);
 	g_free(editor->menu_path);
 	g_free(editor->hotkey);
+	g_free(editor->comment);
 	string_list_free(editor->ext_list);
 	g_free(editor->file);
 	g_free(editor);
@@ -266,6 +267,8 @@
 	
 	editor->hotkey = g_key_file_get_string(key_file, DESKTOP_GROUP, "X-Geeqie-Hotkey", NULL);
 
+	editor->comment = g_key_file_get_string(key_file, DESKTOP_GROUP, "Comment", NULL);
+
 	extensions = g_key_file_get_string(key_file, DESKTOP_GROUP, "X-Geeqie-File-Extensions", NULL);
 	if (extensions)
 		editor->ext_list = filter_to_list(extensions);
--- a/src/editors.h	Fri Mar 20 16:28:43 2009 +0000
+++ b/src/editors.h	Fri Mar 20 17:02:00 2009 +0000
@@ -45,6 +45,7 @@
 	gchar *hotkey;
 	GList *ext_list;
 	gchar *file;
+	gchar *comment;		/* .desktop Comment key, used to show a tooltip */
 	EditorFlags flags;
 	gboolean hidden;
 };
--- a/src/layout_util.c	Fri Mar 20 16:28:43 2009 +0000
+++ b/src/layout_util.c	Fri Mar 20 17:02:00 2009 +0000
@@ -1684,7 +1684,7 @@
 		{
 		GList *path;
 		EditorDescription *editor = work->data;
-		GtkActionEntry entry = { editor->key, NULL, editor->name, editor->hotkey, NULL, G_CALLBACK(layout_menu_edit_cb) };
+		GtkActionEntry entry = { editor->key, NULL, editor->name, editor->hotkey, editor->comment, G_CALLBACK(layout_menu_edit_cb) };
 		
 		if (editor->icon && register_theme_icon_as_stock(editor->key, editor->icon))
 			{