From b47075448a59c1419cc21ac8104a58d549962ce6 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 13 Jun 2003 12:46:09 +0000 Subject: Add support for string enums. 2003-06-13 Marco Pesenti Gritti * lib/ephy-dialog.c: (set_config_from_editable), (set_config_from_optionmenu), (set_config_from_radiobuttongroup), (set_config_from_spin_button), (set_config_from_togglebutton), (set_config_from_color), (set_editable_from_config), (set_optionmenu_from_config), (set_radiobuttongroup_from_config), (set_spin_button_from_config), (set_togglebutton_from_config), (set_color_from_config), (prefs_togglebutton_clicked_cb), (prefs_radiobutton_clicked_cb), (prefs_spinbutton_timeout_cb), (prefs_color_changed_cb), (prefs_entry_changed_cb), (prefs_optionmenu_selected_cb), (ephy_dialog_init), (load_props), (save_props), (free_props), (ephy_dialog_finalize), (ephy_dialog_add_enum), (init_props), (impl_construct), (impl_show): Add support for string enums. * lib/ephy-dialog.h: * lib/ephy-prefs.h: * src/prefs-dialog.c: (prefs_dialog_init): * data/epiphany.schemas.in: * embed/downloader-view.c: * embed/ephy-embed-prefs.h: * embed/find-dialog.c: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-notifiers.cpp: * embed/print-dialog.c: * lib/Makefile.am: Cleanup gconf prefs. This breaks compatibility but better now that later. --- embed/mozilla/mozilla-embed-single.cpp | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'embed/mozilla/mozilla-embed-single.cpp') diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 808d61f24..fa67a9ea3 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -37,6 +37,8 @@ #include #include #include +#include +#include "nsBuildID.h" #include #include #include @@ -322,6 +324,34 @@ mozilla_embed_single_class_init (MozillaEmbedSingleClass *klass) shell_class->show_file_picker = impl_show_file_picker; } +static char * +build_user_agent () +{ + static char *user_agent; + struct utsname name; + char *system; + + if (uname (&name) == 0) + { + system = g_strdup_printf ("%s %s", + name.sysname, + name.machine); + } + else + { + system = g_strdup ("Unknown"); + } + + user_agent = g_strdup_printf + ("Mozilla/5.0 (X11; U; %s) Gecko/%d Epiphany/" VERSION, + system, + NS_BUILD_ID/100); + + g_free (system); + + return user_agent; +} + static void mozilla_set_default_prefs (MozillaEmbedSingle *mes) { @@ -392,6 +422,13 @@ mozilla_set_default_prefs (MozillaEmbedSingle *mes) /* Enable Image Auto-Resizing */ pref->SetBoolPref ("browser.enable_automatic_image_resizing", PR_TRUE); + + /* User agent */ + char *user_agent; + + user_agent = build_user_agent (); + pref->SetCharPref ("general.useragent.override", user_agent); + g_free (user_agent); } static char * -- cgit v1.2.3