diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-06-23 11:53:41 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-06-23 11:53:41 +0100 |
commit | ee74f9ac8cacc89a1f8a94f63feac662bb13cbad (patch) | |
tree | eddc0008404293cc2f4e7b0f70c530a4f1bdd049 /gtk/preferences.c | |
parent | 11dc7304d96a2ac3e2ac346e3cb6236f8e14225b (diff) | |
download | netsurf-ee74f9ac8cacc89a1f8a94f63feac662bb13cbad.tar.gz netsurf-ee74f9ac8cacc89a1f8a94f63feac662bb13cbad.tar.bz2 |
Change gtk message and language handling to use resource names
The GTK resource handling can now provide the path to resources rather
than having to compute them separately. This reduces run time
allocation and allows for the resources to be built in if required.
Additionally this tweaks the resource scheme handling to redirect
favicon.ico to resource:favicon.png instead of rewriting directly to
file scheme path allowing the favicon to be a compiled in resource.
Diffstat (limited to 'gtk/preferences.c')
-rw-r--r-- | gtk/preferences.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gtk/preferences.c b/gtk/preferences.c index ba58bc905..5b6e332f1 100644 --- a/gtk/preferences.c +++ b/gtk/preferences.c @@ -548,19 +548,25 @@ nsgtk_preferences_comboboxLanguage_changed(GtkComboBox *combo, } } +/** + * Fill content language list store. + */ G_MODULE_EXPORT void nsgtk_preferences_comboboxLanguage_realize(GtkWidget *widget, struct ppref *priv) { - /* Fill content language list store */ int active_language = 0; GtkTreeIter iter; FILE *fp; char buf[50]; const char *default_accept_language = "en"; + const char *languages_file_location; + nserror ret; + + ret = nsgtk_path_from_resname("languages", &languages_file_location); if ((priv->content_language != NULL) && - (languages_file_location != NULL) && + (ret == NSERROR_OK) && ((fp = fopen(languages_file_location, "r")) != NULL)) { int combo_row_count = 0; |