From 265c85e8ab0a90f2a7d389f5cd9f750eeadf3e22 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 16 Jun 2003 10:56:04 +0000 Subject: Merge with popup control, we dont need it for bonobo window anymore. 2003-06-16 Marco Pesenti Gritti * embed/Makefile.am: * embed/ephy-embed-popup-control.c: (ephy_embed_popup_control_get_type), (ephy_embed_popup_control_set_property), (ephy_embed_popup_control_get_property), (ephy_embed_popup_control_class_init), (ephy_embed_popup_control_init), (ephy_embed_popup_control_finalize), (get_popup_path), (ephy_embed_popup_control_show), (setup_element_menu), (setup_document_menu), (ephy_embed_popup_control_set_event), (ephy_embed_popup_control_connect_verbs), (ephy_embed_popup_control_get_event), (embed_popup_copy_location_cmd), (embed_popup_copy_email_cmd), (embed_popup_copy_link_location_cmd), (save_property_url), (embed_popup_open_link_cmd), (embed_popup_download_link_cmd), (embed_popup_save_image_as_cmd), (background_download_completed), (embed_popup_set_image_as_background_cmd), (embed_popup_copy_image_location_cmd), (save_url), (embed_popup_save_page_as_cmd), (embed_popup_save_background_as_cmd), (embed_popup_open_frame_cmd), (embed_popup_reload_frame_cmd), (embed_popup_open_image_cmd), (embed_popup_copy_to_clipboard): * embed/ephy-embed-popup-control.h: Merge with popup control, we dont need it for bonobo window anymore. * embed/mozilla/mozilla-embed-single.cpp: Do not override the UA but set vendor prefs so that mozilla can build it correctly. * lib/ephy-dialog.c: (get_radio_button_active_index), (set_config_from_radiobuttongroup), (set_radiobuttongroup_from_config), (prefs_set_group_sensitivity), (impl_get_value): * lib/ephy-dnd.c: (ephy_dnd_node_list_extract_nodes): * lib/ephy-gui.c: * lib/ephy-gui.h: * lib/ephy-string.c: (ephy_string_shorten), (ephy_string_to_int), (ephy_string_strip_chr), (ephy_string_elide_underscores): * lib/ephy-string.h: * src/ephy-nautilus-view.c: (ephy_nautilus_view_instance_init), (gnv_embed_context_menu_cb), (gnv_embed_location_cb), (gnv_view_from_popup), (gnv_popup_cmd_new_window), (gnv_popup_cmd_image_in_new_window), (gnv_popup_cmd_frame_in_new_window), (gnv_cmd_file_print), (gnv_embed_zoom_change_cb): --- embed/mozilla/mozilla-embed-single.cpp | 46 ++++++++-------------------------- 1 file changed, 10 insertions(+), 36 deletions(-) (limited to 'embed/mozilla') diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index aea368fe0..e5c69ab33 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include "nsBuildID.h" #include #include @@ -318,34 +317,6 @@ 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) { @@ -418,11 +389,11 @@ mozilla_set_default_prefs (MozillaEmbedSingle *mes) 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); + /* FIXME We need to do this because mozilla doesnt set product + sub for embedding apps */ + pref->SetCharPref ("general.useragent.vendor", "Epiphany"); + pref->SetCharPref ("general.useragent.vendorSub", VERSION); } static char * @@ -750,7 +721,7 @@ impl_get_encodings (EphyEmbedSingle *shell, info->encoding = g_strdup (encodings[i].name); - elided = ephy_str_elide_underscores (_(encodings[i].title)); + elided = ephy_string_elide_underscores (_(encodings[i].title)); if (elide_underscores) { @@ -800,7 +771,7 @@ impl_get_language_groups (EphyEmbedSingle *shell, info->group = lang_groups[i].group; /* collate without underscores */ - elided = ephy_str_elide_underscores (info->title); + elided = ephy_string_elide_underscores (info->title); info->key = g_utf8_collate_key (elided, -1); g_free (elided); @@ -1069,7 +1040,10 @@ impl_show_file_picker (EphyEmbedSingle *shell, g_free (expanded_directory); filePicker->InitWithGtkWidget (parentWidget, title, mode); - filePicker->SetDefaultString (NS_ConvertUTF8toUCS2(file).get()); + if (file) + { + filePicker->SetDefaultString (NS_ConvertUTF8toUCS2(file).get()); + } filePicker->SetDisplayDirectory (dir); PRInt16 retval; -- cgit v1.2.3