aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-embed-single.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-06-13 20:46:09 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-13 20:46:09 +0800
commitb47075448a59c1419cc21ac8104a58d549962ce6 (patch)
tree4a27993881f98b9f97559982b78721b364495566 /embed/mozilla/mozilla-embed-single.cpp
parent52c6654061e8bd5c8607defd279fa77dfb3dfb87 (diff)
downloadgsoc2013-epiphany-b47075448a59c1419cc21ac8104a58d549962ce6.tar
gsoc2013-epiphany-b47075448a59c1419cc21ac8104a58d549962ce6.tar.gz
gsoc2013-epiphany-b47075448a59c1419cc21ac8104a58d549962ce6.tar.bz2
gsoc2013-epiphany-b47075448a59c1419cc21ac8104a58d549962ce6.tar.lz
gsoc2013-epiphany-b47075448a59c1419cc21ac8104a58d549962ce6.tar.xz
gsoc2013-epiphany-b47075448a59c1419cc21ac8104a58d549962ce6.tar.zst
gsoc2013-epiphany-b47075448a59c1419cc21ac8104a58d549962ce6.zip
Add support for string enums.
2003-06-13 Marco Pesenti Gritti <marco@it.gnome.org> * 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.
Diffstat (limited to 'embed/mozilla/mozilla-embed-single.cpp')
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp37
1 files changed, 37 insertions, 0 deletions
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 <time.h>
#include <libgnome/gnome-i18n.h>
#include <string.h>
+#include <sys/utsname.h>
+#include "nsBuildID.h"
#include <nsICacheService.h>
#include <nsCOMPtr.h>
#include <nsIPrefService.h>
@@ -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 *