This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
gtk_widget_set_sensitive (dialog->change_button, FALSE);
gtk_widget_set_sensitive (dialog->add_button, TRUE);
}
gtk_widget_set_sensitive (dialog->change_button, FALSE);
gtk_widget_set_sensitive (dialog->add_button, TRUE);
}
g_signal_handler_unblock (GTK_ENTRY (dialog->label_entry),
dialog->change_handler_id);
g_signal_handler_unblock (GTK_ENTRY (dialog->label_entry),
dialog->change_handler_id);
on_cancel (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
val_labs_cancel (dialog);
on_cancel (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
val_labs_cancel (dialog);
}
static void repopulate_dialog (struct val_labs_dialog *dialog);
/* Callback which occurs when the "Change" button is clicked */
}
static void repopulate_dialog (struct val_labs_dialog *dialog);
/* Callback which occurs when the "Change" button is clicked */
on_change (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
on_change (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
val_labs_replace (dialog->labs, &v,
gtk_entry_get_text (GTK_ENTRY (dialog->label_entry)));
val_labs_replace (dialog->labs, &v,
gtk_entry_get_text (GTK_ENTRY (dialog->label_entry)));
on_add (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
on_add (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
- if ( ! val_labs_add (dialog->labs, &v,
- gtk_entry_get_text
- ( GTK_ENTRY (dialog->label_entry)) ) )
- return FALSE;
-
- gtk_widget_set_sensitive (dialog->add_button, FALSE);
+ if (val_labs_add (dialog->labs, &v,
+ gtk_entry_get_text
+ ( GTK_ENTRY (dialog->label_entry)) ) )
+ {
+ gtk_widget_set_sensitive (dialog->add_button, FALSE);
on_remove (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
union value value;
on_remove (GtkWidget *w, gpointer data)
{
struct val_labs_dialog *dialog = data;
union value value;
get_selected_tuple (dialog, &value, NULL);
vl = val_labs_lookup (dialog->labs, &value);
get_selected_tuple (dialog, &value, NULL);
vl = val_labs_lookup (dialog->labs, &value);
gtk_widget_grab_focus (dialog->value_entry);
gtk_widget_set_sensitive (dialog->remove_button, FALSE);
gtk_widget_grab_focus (dialog->value_entry);
gtk_widget_set_sensitive (dialog->remove_button, FALSE);
g_signal_handler_block (GTK_ENTRY (dialog->value_entry),
dialog->value_handler_id);
g_signal_handler_block (GTK_ENTRY (dialog->value_entry),
dialog->value_handler_id);
dialog->window = get_widget_assert (xml,"val_labs_dialog");
dialog->value_entry = get_widget_assert (xml,"value_entry");
dialog->label_entry = get_widget_assert (xml,"label_entry");
dialog->window = get_widget_assert (xml,"val_labs_dialog");
dialog->value_entry = get_widget_assert (xml,"value_entry");
dialog->label_entry = get_widget_assert (xml,"label_entry");
gtk_window_set_transient_for
(GTK_WINDOW (dialog->window), toplevel);
gtk_window_set_transient_for
(GTK_WINDOW (dialog->window), toplevel);
dialog->change_handler_id =
g_signal_connect (dialog->label_entry,
"changed",
dialog->change_handler_id =
g_signal_connect (dialog->label_entry,
"changed",
dialog->value_handler_id =
g_signal_connect (dialog->value_entry,
"changed",
dialog->value_handler_id =
g_signal_connect (dialog->value_entry,
"changed",
- gchar *const text = g_strdup_printf ("%s = \"%s\"",
- vstr, val_lab_get_label (vl));
+ gchar *const text = g_strdup_printf (_("%s = `%s'"), vstr,
+ val_lab_get_escaped_label (vl));
gtk_list_store_append (list_store, &iter);
gtk_list_store_set (list_store, &iter,
gtk_list_store_append (list_store, &iter);
gtk_list_store_set (list_store, &iter,