diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-10-14 01:38:16 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-10-14 01:38:16 +0800 |
commit | 442741fc4fb9b63c78c37f305d443f8aa57ff67e (patch) | |
tree | 834a2350618ff9378d1aaea422e1db9e0e9a304b /embed/ephy-embed-utils.c | |
parent | ab827f639671b79f2b802b19f86e937a92612ad7 (diff) | |
download | gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.gz gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.bz2 gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.lz gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.xz gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.zst gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.zip |
Encodings menu improvements, part 3: Refactored the encodings list; it no
2003-10-13 Christian Persch <chpe@cvs.gnome.org>
* embed/ephy-embed-single.c: (ephy_embed_single_free_passwords):
* embed/ephy-embed-single.h:
* embed/ephy-embed-utils.c:
(ephy_embed_utils_build_encodings_submenu):
* embed/mozilla/mozilla-embed-single.cpp:
* embed/mozilla/mozilla-notifiers.cpp:
* lib/Makefile.am:
* lib/ephy-encodings.c: (ephy_encoding_info_free),
(encodings_info_cmp), (ephy_encodings_get_list):
* lib/ephy-encodings.h:
* lib/ephy-langs.c: (ephy_lang_group_info_free),
(lang_group_info_cmp), (ephy_lang_get_group_list),
(fonts_language_info_cmp), (ephy_font_langs_get_codes_list),
(ephy_font_langs_get_list):
* lib/ephy-langs.h:
* po/POTFILES.in:
* src/ephy-encoding-menu.c: (ephy_encoding_menu_set_window),
(ephy_encoding_menu_rebuild):
* src/prefs-dialog.c: (prefs_dialog_finalize),
(get_current_language_code), (create_fonts_language_menu),
(default_encoding_menu_changed_cb), (find_encoding_in_list_cmp),
(create_default_encoding_menu):
Encodings menu improvements, part 3: Refactored the encodings
list; it no longer is neccessary to have it in the embed single.
Ported all callers to new infrastructure.
Diffstat (limited to 'embed/ephy-embed-utils.c')
-rw-r--r-- | embed/ephy-embed-utils.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c index ff3dcbef5..5da187c89 100644 --- a/embed/ephy-embed-utils.c +++ b/embed/ephy-embed-utils.c @@ -29,6 +29,7 @@ #include "ephy-gui.h" #include "ephy-debug.h" #include "ephy-langs.h" +#include "ephy-encodings.h" #include <gtk/gtkdialog.h> #include <gtk/gtkmessagedialog.h> @@ -210,34 +211,26 @@ ephy_embed_utils_build_encodings_submenu (BonoboUIComponent *ui_component, GString *xml_string; GList *groups, *gl, *encodings, *l; GList *verbs = NULL; - EphyEmbedSingle *single; - - single = ephy_embed_shell_get_embed_single (EPHY_EMBED_SHELL (embed_shell)); - g_return_if_fail (EPHY_IS_EMBED_SHELL (embed_shell)); START_PROFILER ("Encodings menu") - ephy_embed_single_get_language_groups (single, &groups); - g_return_if_fail (groups != NULL); - xml_string = g_string_new (NULL); g_string_append (xml_string, "<submenu name=\"Encoding\" _label=\"_Encoding\">"); + groups = ephy_lang_get_group_list (); for (gl = groups; gl != NULL; gl = gl->next) { - const LanguageGroupInfo *lang_info = (LanguageGroupInfo *) gl->data; + const EphyLanguageGroupInfo *lang_info = (EphyLanguageGroupInfo *) gl->data; tmp = g_strdup_printf ("<submenu label=\"%s\" name=\"EncodingGroup%d\">\n", lang_info->title, lang_info->group); xml_string = g_string_append (xml_string, tmp); g_free (tmp); - ephy_embed_single_get_encodings (single, lang_info->group, - FALSE, &encodings); - + encodings = ephy_encodings_get_list (lang_info->group, FALSE); for (l = encodings; l != NULL; l = l->next) { - const EncodingInfo *info = (EncodingInfo *) l->data; + const EphyEncodingInfo *info = (EphyEncodingInfo *) l->data; verb = g_strdup_printf ("Encoding%s", info->encoding); tmp = g_strdup_printf ("<menuitem label=\"%s\" name=\"%s\" verb=\"%s\"/>\n", @@ -249,13 +242,13 @@ ephy_embed_utils_build_encodings_submenu (BonoboUIComponent *ui_component, g_free (tmp); } - g_list_foreach (encodings, (GFunc) encoding_info_free, NULL); + g_list_foreach (encodings, (GFunc) ephy_encoding_info_free, NULL); g_list_free (encodings); g_string_append (xml_string, "</submenu>"); } - g_list_foreach (groups, (GFunc) language_group_info_free, NULL); + g_list_foreach (groups, (GFunc) ephy_lang_group_info_free, NULL); g_list_free (groups); g_string_append (xml_string, "</submenu>"); @@ -263,8 +256,6 @@ ephy_embed_utils_build_encodings_submenu (BonoboUIComponent *ui_component, bonobo_ui_component_set_translate (ui_component, path, xml_string->str, NULL); - verbs = g_list_reverse (verbs); - for (l = verbs; l != NULL; l = l->next) { bonobo_ui_component_add_verb (ui_component, |