added tooltips to external editors on toolbar
authorVladimir Nadvornik <nadvornik@suse.cz>
Fri, 20 Mar 2009 17:02:00 +0000 (17:02 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Fri, 20 Mar 2009 17:02:00 +0000 (17:02 +0000)
- patch by Colin Clark

src/editors.c
src/editors.h
src/layout_util.c

index f28a913..d8cc518 100644 (file)
@@ -84,6 +84,7 @@ void editor_description_free(EditorDescription *editor)
        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 @@ static gboolean editor_read_desktop_file(const gchar *path)
        
        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);
index c253131..e2d1a18 100644 (file)
@@ -45,6 +45,7 @@ struct _EditorDescription {
        gchar *hotkey;
        GList *ext_list;
        gchar *file;
+       gchar *comment;         /* .desktop Comment key, used to show a tooltip */
        EditorFlags flags;
        gboolean hidden;
 };
index d2a9cd6..c1fda5a 100644 (file)
@@ -1684,7 +1684,7 @@ static void layout_actions_setup_editors(LayoutWindow *lw)
                {
                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))
                        {