diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-main.c | 22 | ||||
-rw-r--r-- | src/prefs-dialog.c | 49 | ||||
-rw-r--r-- | src/window-commands.c | 33 |
3 files changed, 67 insertions, 37 deletions
diff --git a/src/ephy-main.c b/src/ephy-main.c index 787140248..97121fe97 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -29,6 +29,7 @@ #include <libbonoboui.h> #include <libgnome/gnome-program.h> #include <libgnomeui/gnome-ui-init.h> +#include <libgnomeui/gnome-icon-theme.h> #include <gtk/gtkwindow.h> #include <libgnomevfs/gnome-vfs-init.h> #include <glade/glade-init.h> @@ -145,17 +146,28 @@ main (int argc, char *argv[]) if (first_instance) { + GnomeIconTheme *icon_theme; + gnome_vfs_init (); glade_gnome_init (); ephy_shell_new (); - file = gnome_program_locate_file - (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP, - "epiphany.png", TRUE, NULL); - gtk_window_set_default_icon_from_file (file, NULL); - g_free (file); + icon_theme = gnome_icon_theme_new (); + file = gnome_icon_theme_lookup_icon (icon_theme, "web-browser", + -1, NULL, NULL); + g_object_unref (icon_theme); + + if (file) + { + gtk_window_set_default_icon_from_file (file, NULL); + g_free (file); + } + else + { + g_warning ("Web browser gnome icon not found"); + } g_idle_add ((GSourceFunc) ephy_main_start, NULL); diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index b07df0fd3..763a2e395 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -167,13 +167,6 @@ char *cookies_accept_enum [] = static guint n_cookies_accept_enum = G_N_ELEMENTS (cookies_accept_enum); static const -char *cache_compare_enum [] = -{ - "once per session", "every time", "never", "automatic" -}; -static guint n_cache_compare_enum = G_N_ELEMENTS (cache_compare_enum); - -static const char *proportional_enum [] = { "serif", "sans-serif" @@ -231,18 +224,20 @@ enum USE_COLORS_PROP, USE_FONTS_PROP, - /* Security */ + /* Privacy */ ALLOW_POPUPS_PROP, ALLOW_JAVA_PROP, ALLOW_JS_PROP, ACCEPT_COOKIES_PROP, - - /* Advanced */ - CACHE_COMPARE_PROP, DISK_CACHE_PROP, + + /* Language */ AUTO_ENCODING_PROP, DEFAULT_ENCODING_PROP, LANGUAGE_PROP, + LANGUAGE_LABEL_PROP, + DEFAULT_ENCODING_LABEL_PROP, + AUTO_ENCODING_LABEL_PROP }; #define CONF_FONTS_FOR_LANGUAGE "/apps/epiphany/dialogs/preferences_font_language" @@ -269,22 +264,33 @@ EphyDialogProperty properties [] = { USE_COLORS_PROP, "use_colors_checkbutton", CONF_RENDERING_USE_OWN_COLORS, PT_AUTOAPPLY, NULL }, { USE_FONTS_PROP, "use_fonts_checkbutton", CONF_RENDERING_USE_OWN_FONTS, PT_AUTOAPPLY, NULL }, - /* Security */ + /* Privacy */ { ALLOW_POPUPS_PROP, "popups_allow_checkbutton", CONF_SECURITY_ALLOW_POPUPS, PT_AUTOAPPLY, NULL }, { ALLOW_JAVA_PROP, "enable_java_checkbutton", CONF_SECURITY_JAVA_ENABLED, PT_AUTOAPPLY, NULL }, { ALLOW_JS_PROP, "enable_javascript_checkbutton", CONF_SECURITY_JAVASCRIPT_ENABLED, PT_AUTOAPPLY, NULL }, { ACCEPT_COOKIES_PROP, "cookies_radiobutton", CONF_SECURITY_COOKIES_ACCEPT, PT_AUTOAPPLY, NULL }, - - /* Advanced */ - { CACHE_COMPARE_PROP, "cache_compare_radiobutton", CONF_NETWORK_CACHE_COMPARE, PT_AUTOAPPLY, NULL }, { DISK_CACHE_PROP, "disk_cache_spin", CONF_NETWORK_CACHE_SIZE, PT_AUTOAPPLY, NULL }, + + /* Languages */ { AUTO_ENCODING_PROP, "auto_encoding_optionmenu", NULL, PT_NORMAL, NULL }, { DEFAULT_ENCODING_PROP, "default_encoding_optionmenu", NULL, PT_NORMAL, NULL }, { LANGUAGE_PROP, "language_optionmenu", NULL, PT_NORMAL, NULL }, + { LANGUAGE_LABEL_PROP, "language_label", NULL, PT_NORMAL, NULL }, + { DEFAULT_ENCODING_LABEL_PROP, "default_encoding_label", NULL, PT_NORMAL, NULL }, + { AUTO_ENCODING_LABEL_PROP, "auto_encoding_label", NULL, PT_NORMAL, NULL }, { -1, NULL, NULL } }; +static +int lang_size_group [] = +{ + LANGUAGE_LABEL_PROP, + DEFAULT_ENCODING_LABEL_PROP, + AUTO_ENCODING_LABEL_PROP +}; +static guint n_lang_size_group = G_N_ELEMENTS (lang_size_group); + typedef struct { gchar *name; @@ -1075,13 +1081,14 @@ prefs_dialog_init (PrefsDialog *pd) "prefs-dialog.glade", "prefs_dialog"); - ephy_dialog_add_enum (EPHY_DIALOG (pd), CACHE_COMPARE_PROP, - n_cache_compare_enum, cache_compare_enum); ephy_dialog_add_enum (EPHY_DIALOG (pd), ACCEPT_COOKIES_PROP, n_cookies_accept_enum, cookies_accept_enum); ephy_dialog_add_enum (EPHY_DIALOG (pd), PROPORTIONAL_PROP, n_proportional_enum, proportional_enum); + ephy_dialog_set_size_group (EPHY_DIALOG (pd), lang_size_group, + n_lang_size_group); + pd->priv->window = ephy_dialog_get_control (dialog, WINDOW_PROP); pd->priv->notebook = ephy_dialog_get_control (dialog, NOTEBOOK_PROP); pd->priv->langs = NULL; @@ -1108,8 +1115,6 @@ prefs_dialog_init (PrefsDialog *pd) create_language_menu (pd); } -/* Network page callbacks */ - void prefs_dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer data) { @@ -1175,7 +1180,7 @@ void prefs_homepage_blank_button_clicked_cb (GtkWidget *button, EphyDialog *dialog) { - set_homepage_entry (dialog, "about:blank"); + set_homepage_entry (dialog, ""); } static void @@ -1202,11 +1207,11 @@ fill_language_editor (LanguageEditor *le, PrefsDialog *dialog) { i = g_list_position (dialog->priv->langs, lang); li = (EphyLangItem *) lang->data; - + language_editor_add (le, li->name, i); } } - + g_slist_foreach (strings, (GFunc) g_free, NULL); g_slist_free (strings); } diff --git a/src/window-commands.c b/src/window-commands.c index 10e154293..d1a93099f 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -46,6 +46,7 @@ #include <bonobo/bonobo-i18n.h> #include <libgnomeui/gnome-about.h> #include <libgnomeui/gnome-stock-icons.h> +#include <libgnomeui/gnome-icon-theme.h> #include <libgnome/gnome-program.h> #include <gtk/gtkeditable.h> @@ -723,8 +724,9 @@ window_cmd_help_about (EggAction *action, static GtkWidget *about = NULL; GtkWidget** ptr; GdkPixbuf *icon; - const char *icon_path; + char *icon_path; GdkPixbuf *logo; + GnomeIconTheme *icon_theme; static gchar *authors[] = { "Marco Pesenti Gritti <mpeseng@tin.it>", @@ -750,10 +752,21 @@ window_cmd_help_about (EggAction *action, return; } - icon_path = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP, - "epiphany.png", TRUE, NULL); - logo = gdk_pixbuf_new_from_file (icon_path, NULL); - g_return_if_fail (logo != NULL); + icon_theme = gnome_icon_theme_new (); + icon_path = gnome_icon_theme_lookup_icon (icon_theme, "web-browser", + -1, NULL, NULL); + g_object_unref (icon_theme); + + if (icon_path) + { + logo = gdk_pixbuf_new_from_file (icon_path, NULL); + g_free (icon_path); + } + else + { + logo = NULL; + g_warning ("Web browser gnome icon not found"); + } about = gnome_about_new( "Epiphany", VERSION, @@ -768,11 +781,11 @@ window_cmd_help_about (EggAction *action, gtk_window_set_transient_for (GTK_WINDOW (about), GTK_WINDOW (window)); - - icon = gtk_widget_render_icon (about, - GNOME_STOCK_ABOUT, - GTK_ICON_SIZE_MENU, - NULL); + + icon = gtk_widget_render_icon (about, + GNOME_STOCK_ABOUT, + GTK_ICON_SIZE_MENU, + NULL); gtk_window_set_icon (GTK_WINDOW (about), icon); g_object_unref(icon); |