Revision: 1160
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1160&view=rev
Author:   nadvornik
Date:     2008-10-17 22:00:07 +0000 (Fri, 17 Oct 2008)

Log Message:
-----------
improved custom exif look:
- use toggle instead of remove button 
- display description instead of property key

Modified Paths:
--------------
    trunk/src/bar_exif.c

Modified: trunk/src/bar_exif.c
===================================================================
--- trunk/src/bar_exif.c        2008-10-14 21:24:34 UTC (rev 1159)
+++ trunk/src/bar_exif.c        2008-10-17 22:00:07 UTC (rev 1160)
@@ -63,7 +63,7 @@
 static void table_add_line_custom(GtkWidget *table, gint x, gint y,
                                  const gchar *text1, const gchar *text2,
                                  GtkWidget **label1, GtkWidget **label2,
-                                 GtkWidget **button)
+                                 GtkWidget **remove)
 {
        GtkWidget *label;
        gchar *buf;
@@ -75,7 +75,7 @@
        gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.0);
        pref_label_bold(label, TRUE, FALSE);
        gtk_table_attach(GTK_TABLE(table), label,
-                        x, x + 1, y, y + 1,
+                        x + 1, x + 2, y, y + 1,
                         GTK_FILL, GTK_FILL,
                         2, 2);
        *label1 = label;
@@ -83,16 +83,18 @@
        label = gtk_label_new(text2);
        gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
        gtk_table_attach(GTK_TABLE(table), label,
-                        x + 1, x + 2, y, y + 1,
+                        x + 2, x + 3, y, y + 1,
                         GTK_FILL, GTK_FILL,
                         2, 2);
        *label2 = label;
 
-       if (button)
+       if (remove)
                {
-               *button = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
-               gtk_table_attach(GTK_TABLE(table), *button,
-                                x + 2, x + 3, y, y + 1,
+               *remove = gtk_check_button_new();
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(*remove), TRUE);
+
+               gtk_table_attach(GTK_TABLE(table), *remove,
+                                x, x + 1, y, y + 1,
                                 GTK_FILL, GTK_FILL,
                                 2, 2);
                }
@@ -238,6 +240,7 @@
                        gchar *utf8_text;
                        gchar *name;
                        gchar *buf;
+                       gchar *description;
 
                        name = list->data;
                        list = list->prev;
@@ -246,7 +249,11 @@
                        utf8_text = utf8_validate_or_convert(text);
                        g_free(text);
 
-                       buf = g_strconcat(name, ":", NULL);
+                       description = exif_get_tag_description_by_key(name);
+                       if (!description) description = g_strdup(name);
+                       buf = g_strconcat(description, ":", NULL);
+                       g_free(description);
+                       
                        gtk_label_set_text(GTK_LABEL(eb->custom_name[i]), buf);
                        g_free(buf);
                        gtk_label_set_text(GTK_LABEL(eb->custom_value[i]), 
utf8_text);
@@ -254,8 +261,9 @@
 
                        gtk_widget_show(eb->custom_name[i]);
                        gtk_widget_show(eb->custom_value[i]);
+                       g_object_set_data(G_OBJECT(eb->custom_remove[i]), 
"key", name);
+                       
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(eb->custom_remove[i]), TRUE);
                        gtk_widget_show(eb->custom_remove[i]);
-                       g_object_set_data(G_OBJECT(eb->custom_remove[i]), 
"key", name);
 
                        i++;
                        }
@@ -407,6 +415,9 @@
        ExifBar *eb = data;
        const gchar *key;
 
+       /* continue only if the toggle was deactivated */
+       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) return;
+
        key = g_object_get_data(G_OBJECT(widget), "key");
        if (!key) return;
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to