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;
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;
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);
}
gchar *utf8_text;
gchar *name;
gchar *buf;
+ gchar *description;
name = list->data;
list = list->prev;
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);
gtk_widget_show(eb->custom_name[i]);
gtk_widget_show(eb->custom_value[i]);
- gtk_widget_show(eb->custom_remove[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]);
i++;
}
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;