diff options
author | Lauris Kaplinski <lauris@src.gnome.org> | 2000-09-08 02:30:30 +0800 |
---|---|---|
committer | Lauris Kaplinski <lauris@src.gnome.org> | 2000-09-08 02:30:30 +0800 |
commit | 0db696fa4205edb578c56cade278061b4bbe54f2 (patch) | |
tree | b481424b3de3f269586f7658dd463864974bda6c /filter | |
parent | 722a05828e68522a639a04ae0b13855e6b70820b (diff) | |
download | gsoc2013-evolution-0db696fa4205edb578c56cade278061b4bbe54f2.tar.gz gsoc2013-evolution-0db696fa4205edb578c56cade278061b4bbe54f2.tar.zst gsoc2013-evolution-0db696fa4205edb578c56cade278061b4bbe54f2.zip |
Bunch of unicode related changes
svn path=/trunk/; revision=5235
Diffstat (limited to 'filter')
-rw-r--r-- | filter/ChangeLog | 6 | ||||
-rw-r--r-- | filter/filter-editor.c | 16 | ||||
-rw-r--r-- | filter/filter-filter.c | 6 | ||||
-rw-r--r-- | filter/filter-folder.c | 12 | ||||
-rw-r--r-- | filter/filter-option.c | 6 | ||||
-rw-r--r-- | filter/filter-rule.c | 5 | ||||
-rw-r--r-- | filter/score-editor.c | 18 | ||||
-rw-r--r-- | filter/vfolder-editor.c | 17 | ||||
-rw-r--r-- | filter/vfolder-rule.c | 11 |
9 files changed, 78 insertions, 19 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index 0796572667..03e1ecd565 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,9 @@ +2000-09-07 Lauris Kaplinski <lauris@helixcode.com> + + * filter-editor.c, filter-filter.c, filter-folder.c, filter-option.c: + * filter-rule.c, score-editor.c, vfolder-editor.c, vfolder-rule.c: + More UTF-8 wrapping + 2000-09-06 Jeffrey Stedfast <fejj@helixcode.com> * filter-driver.c (filter_driver_run): Totally rewritten to filter diff --git a/filter/filter-editor.c b/filter/filter-editor.c index 9f4a0e1872..99fb869e6d 100644 --- a/filter/filter-editor.c +++ b/filter/filter-editor.c @@ -22,6 +22,7 @@ #include <gnome.h> #include <glade/glade.h> +#include <e-util/e-unicode.h> #include "filter-editor.h" #include "filter-context.h" #include "filter-filter.h" @@ -158,9 +159,11 @@ static void rule_add(GtkWidget *widget, struct _editor_data *data) gtk_widget_show((GtkWidget *)gd); result = gnome_dialog_run_and_close(gd); if (result == 0) { - GtkListItem *item = (GtkListItem *)gtk_list_item_new_with_label(((FilterRule *)rule)->name); + GtkListItem *item; GList *l = NULL; - + gchar *s = e_utf8_to_gtk_string ((GtkWidget *) data->list, ((FilterRule *)rule)->name); + item = (GtkListItem *)gtk_list_item_new_with_label (s); + g_free (s); gtk_object_set_data((GtkObject *)item, "rule", rule); gtk_widget_show((GtkWidget *)item); l = g_list_append(l, item); @@ -196,7 +199,9 @@ static void rule_edit(GtkWidget *widget, struct _editor_data *data) pos = rule_context_get_rank_rule_with_source (data->f, data->current, data->current_source); if (pos != -1) { GtkListItem *item = g_list_nth_data(data->list->children, pos); - gtk_label_set_text((GtkLabel *)(((GtkBin *)item)->child), data->current->name); + gchar *s = e_utf8_to_gtk_string ((GtkWidget *) item, data->current->name); + gtk_label_set_text((GtkLabel *)(((GtkBin *)item)->child), s); + g_free (s); } } } @@ -319,6 +324,7 @@ select_source (GtkMenuItem *mi, struct _editor_data *data) d(printf("Checking for rules that are of type %d\n", source)); while ((rule = rule_context_next_rule (data->f, rule)) != NULL) { GtkWidget *item; + gchar *s; if (rule->source != source) { d(printf(" skipping %s: %d != %d\n", rule->name, rule->source, source)); @@ -326,7 +332,9 @@ select_source (GtkMenuItem *mi, struct _editor_data *data) } d(printf(" hit %s (%d)\n", rule->name, source)); - item = gtk_list_item_new_with_label (rule->name); + s = e_utf8_to_gtk_string ((GtkWidget *) data->list, rule->name); + item = gtk_list_item_new_with_label (s); + g_free (s); gtk_object_set_data (GTK_OBJECT (item), "rule", rule); gtk_widget_show (GTK_WIDGET (item)); newitems = g_list_append (newitems, item); diff --git a/filter/filter-filter.c b/filter/filter-filter.c index b0699ce827..86cc3baff2 100644 --- a/filter/filter-filter.c +++ b/filter/filter-filter.c @@ -22,6 +22,7 @@ #include <gnome.h> #include <gnome-xml/xmlmemory.h> +#include <e-util/e-unicode.h> #include "filter-filter.h" #include "filter-context.h" @@ -272,6 +273,7 @@ get_rule_part_widget(FilterContext *f, FilterPart *newpart, FilterRule *fr) GtkWidget *p; int index=0, current=0; struct _part_data *data; + gchar *s; data = g_malloc0(sizeof(*data)); data->fr = fr; @@ -286,7 +288,9 @@ get_rule_part_widget(FilterContext *f, FilterPart *newpart, FilterRule *fr) menu = (GtkMenu *)gtk_menu_new(); while ((part=filter_context_next_action(f, part))) { - item = (GtkMenuItem *)gtk_menu_item_new_with_label(part->title); + s = e_utf8_to_gtk_string ((GtkWidget *) menu, part->title); + item = (GtkMenuItem *)gtk_menu_item_new_with_label(s); + g_free (s); gtk_object_set_data((GtkObject *)item, "part", part); gtk_signal_connect((GtkObject *)item, "activate", option_activate, data); gtk_menu_append(menu, (GtkWidget *)item); diff --git a/filter/filter-folder.c b/filter/filter-folder.c index cb2d87c29f..4e9523b57a 100644 --- a/filter/filter-folder.c +++ b/filter/filter-folder.c @@ -178,6 +178,7 @@ static void button_clicked(GtkButton *button, FilterFolder *ff) #ifdef SHELL const char *allowed_types[] = { "mail", NULL }; char *def, *physical_uri, *evolution_uri; + gchar *s; def = ff->uri ? ff->uri : ""; @@ -192,9 +193,10 @@ static void button_clicked(GtkButton *button, FilterFolder *ff) ff->uri = physical_uri; g_free(ff->name); - ff->name = g_strdup(g_basename (evolution_uri)); - - gtk_label_set_text((GtkLabel *)GTK_BIN(button)->child, ff->name); + ff->name = g_strdup (g_basename (evolution_uri)); + s = e_utf8_to_gtk_string((GtkWidget *) button, ff->name); + gtk_label_set_text((GtkLabel *)GTK_BIN(button)->child, s); + g_free (s); } else { g_free (physical_uri); } @@ -227,7 +229,9 @@ static void button_clicked(GtkButton *button, FilterFolder *ff) else str = uri; ff->name = g_strdup(str); - gtk_label_set_text((GtkLabel *)GTK_BIN(button)->child, ff->name); + s = e_utf8_to_gtk_string ((GtkWidget *) button, ff->name); + gtk_label_set_text((GtkLabel *)GTK_BIN(button)->child, s); + g_free (s); case 1: gnome_dialog_close(gd); case -1: diff --git a/filter/filter-option.c b/filter/filter-option.c index bbf1a8ef90..28a57ccf0e 100644 --- a/filter/filter-option.c +++ b/filter/filter-option.c @@ -25,6 +25,7 @@ #include "filter-option.h" #include "filter-part.h" #include "e-util/e-sexp.h" +#include "e-util/e-unicode.h" #define d(x) @@ -238,11 +239,14 @@ static GtkWidget *get_widget(FilterElement *fe) GList *l = fo->options; struct _filter_option *op; int index = 0, current=0; + gchar *s; menu = (GtkMenu *)gtk_menu_new(); while (l) { op = l->data; - item = (GtkMenuItem *)gtk_menu_item_new_with_label(op->title); + s = e_utf8_to_gtk_string ((GtkWidget *) menu, op->title); + item = (GtkMenuItem *)gtk_menu_item_new_with_label(s); + g_free (s); gtk_object_set_data((GtkObject *)item, "option", op); gtk_signal_connect((GtkObject *)item, "activate", option_activate, fo); gtk_menu_append(menu, (GtkWidget *)item); diff --git a/filter/filter-rule.c b/filter/filter-rule.c index 21aa5ed396..bf26845d38 100644 --- a/filter/filter-rule.c +++ b/filter/filter-rule.c @@ -364,6 +364,7 @@ get_rule_part_widget(RuleContext *f, FilterPart *newpart, FilterRule *fr) GtkWidget *p; int index=0, current=0; struct _part_data *data; + gchar *s; data = g_malloc0(sizeof(*data)); data->fr = fr; @@ -382,7 +383,9 @@ get_rule_part_widget(RuleContext *f, FilterPart *newpart, FilterRule *fr) menu = (GtkMenu *)gtk_menu_new(); /* sigh, this is a little ugly */ while ((part=rule_context_next_part(f, part))) { - item = (GtkMenuItem *)gtk_menu_item_new_with_label(part->title); + s = e_utf8_to_gtk_string ((GtkWidget *) menu, part->title); + item = (GtkMenuItem *)gtk_menu_item_new_with_label (s); + g_free (s); gtk_object_set_data((GtkObject *)item, "part", part); gtk_signal_connect((GtkObject *)item, "activate", option_activate, data); gtk_menu_append(menu, (GtkWidget *)item); diff --git a/filter/score-editor.c b/filter/score-editor.c index 6598cd9e33..1f45036e61 100644 --- a/filter/score-editor.c +++ b/filter/score-editor.c @@ -22,6 +22,7 @@ #include <gnome.h> #include <glade/glade.h> +#include <e-util/e-unicode.h> #include "score-editor.h" #include "score-context.h" #include "score-rule.h" @@ -130,9 +131,13 @@ static void rule_add(GtkWidget *widget, struct _editor_data *data) gtk_widget_show((GtkWidget *)gd); result = gnome_dialog_run_and_close(gd); if (result == 0) { - GtkListItem *item = (GtkListItem *)gtk_list_item_new_with_label(((FilterRule *)rule)->name); + GtkListItem *item; GList *l = NULL; + gchar *s; + s = e_utf8_to_gtk_string ((GtkWidget *) data->list, ((FilterRule *) rule)->name); + item = (GtkListItem *)gtk_list_item_new_with_label (s); + g_free (s); gtk_object_set_data((GtkObject *)item, "rule", rule); gtk_widget_show((GtkWidget *)item); l = g_list_append(l, item); @@ -166,7 +171,9 @@ static void rule_edit(GtkWidget *widget, struct _editor_data *data) pos = rule_context_get_rank_rule(data->f, data->current); if (pos != -1) { GtkListItem *item = g_list_nth_data(data->list->children, pos); - gtk_label_set_text((GtkLabel *)(((GtkBin *)item)->child), data->current->name); + gchar *s = e_utf8_to_gtk_string ((GtkWidget *) data->list, data->current->name); + gtk_label_set_text((GtkLabel *)(((GtkBin *)item)->child), s); + g_free (s); } } } @@ -298,7 +305,12 @@ GtkWidget *score_editor_construct (struct _ScoreContext *f) data->list = (GtkList *)w; l = NULL; while ((rule = rule_context_next_rule((RuleContext *)f, rule))) { - GtkListItem *item = (GtkListItem *)gtk_list_item_new_with_label(rule->name); + GtkListItem *item; + gchar *s; + + s = e_utf8_to_gtk_string ((GtkWidget *) data->list, rule->name); + item = (GtkListItem *)gtk_list_item_new_with_label (s); + g_free (s); gtk_object_set_data((GtkObject *)item, "rule", rule); gtk_widget_show((GtkWidget *)item); l = g_list_append(l, item); diff --git a/filter/vfolder-editor.c b/filter/vfolder-editor.c index c5bf378625..45c4648368 100644 --- a/filter/vfolder-editor.c +++ b/filter/vfolder-editor.c @@ -22,6 +22,7 @@ #include <gnome.h> #include <glade/glade.h> +#include <e-util/e-unicode.h> #include "vfolder-editor.h" #include "vfolder-context.h" #include "vfolder-rule.h" @@ -156,8 +157,13 @@ static void rule_add(GtkWidget *widget, struct _editor_data *data) gtk_widget_show((GtkWidget *)gd); result = gnome_dialog_run_and_close(gd); if (result == 0) { - GtkListItem *item = (GtkListItem *)gtk_list_item_new_with_label(rule->name); + GtkListItem *item; GList *l = NULL; + gchar *s; + + s = e_utf8_to_gtk_string ((GtkWidget *) data->list, rule->name); + item = (GtkListItem *)gtk_list_item_new_with_label(rule->name); + g_free (s); gtk_object_set_data((GtkObject *)item, "rule", rule); gtk_widget_show((GtkWidget *)item); @@ -192,7 +198,9 @@ static void rule_edit(GtkWidget *widget, struct _editor_data *data) pos = rule_context_get_rank_rule(data->f, data->current); if (pos != -1) { GtkListItem *item = g_list_nth_data(data->list->children, pos); - gtk_label_set_text((GtkLabel *)(((GtkBin *)item)->child), data->current->name); + gchar *s = e_utf8_to_gtk_string ((GtkWidget *) item, data->current->name); + gtk_label_set_text((GtkLabel *)(((GtkBin *)item)->child), s); + g_free (s); } } } @@ -324,7 +332,10 @@ GtkWidget *vfolder_editor_construct (struct _VfolderContext *f) data->list = (GtkList *)w; l = NULL; while ((rule = rule_context_next_rule((RuleContext *)f, rule))) { - GtkListItem *item = (GtkListItem *)gtk_list_item_new_with_label(rule->name); + GtkListItem *item; + gchar *s = e_utf8_to_gtk_string ((GtkWidget *) data->list, rule->name); + item = (GtkListItem *)gtk_list_item_new_with_label(s); + g_free (s); gtk_object_set_data((GtkObject *)item, "rule", rule); gtk_widget_show((GtkWidget *)item); l = g_list_append(l, item); diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c index d6da471b07..1ee769057f 100644 --- a/filter/vfolder-rule.c +++ b/filter/vfolder-rule.c @@ -22,6 +22,7 @@ #include <gnome.h> #include <glade/glade.h> +#include <e-util/e-unicode.h> #include "vfolder-context.h" #include "vfolder-rule.h" #include "shell/evolution-shell-client.h" @@ -263,6 +264,7 @@ static void source_add(GtkWidget *widget, struct _source_data *data) char *def, *uri; GtkListItem *item; GList *l; + gchar *s; def = ""; evolution_shell_client_user_select_folder (global_shell_client, @@ -273,7 +275,9 @@ static void source_add(GtkWidget *widget, struct _source_data *data) data->vr->sources = g_list_append(data->vr->sources, uri); l = NULL; - item = (GtkListItem *)gtk_list_item_new_with_label(uri); + s = e_utf8_to_gtk_string ((GtkWidget *) data->list, uri); + item = (GtkListItem *)gtk_list_item_new_with_label (s); + g_free (s); gtk_object_set_data((GtkObject *)item, "source", uri); gtk_widget_show((GtkWidget *)item); l = g_list_append(NULL, item); @@ -340,7 +344,10 @@ static GtkWidget *get_widget(FilterRule *fr, struct _RuleContext *f) l = NULL; source = NULL; while ((source = vfolder_rule_next_source(vr, source))) { - GtkListItem *item = (GtkListItem *)gtk_list_item_new_with_label(source); + GtkListItem *item; + gchar *s = e_utf8_to_gtk_string ((GtkWidget *) data->list, source); + item = (GtkListItem *)gtk_list_item_new_with_label (s); + g_free (s); gtk_object_set_data((GtkObject *)item, "source", (void *)source); gtk_widget_show((GtkWidget *)item); l = g_list_append(l, item); |