From 2507de9eae5d185af79d6425178ac571c4f48a75 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 2 Jul 2003 09:09:26 +0000 Subject: Use the browser icon from gnome icon theme. Get rid of cache comparing 2003-07-02 Marco Pesenti Gritti * data/art/Makefile.am: * data/art/epiphany.png: * data/epiphany.desktop.in: * data/epiphany.schemas.in: * data/glade/prefs-dialog.glade: * embed/mozilla/mozilla-notifiers.cpp: * lib/ephy-dialog.c: (ephy_dialog_set_size_group): * lib/ephy-dialog.h: * src/ephy-main.c: (main): * src/prefs-dialog.c: (prefs_dialog_init), (prefs_homepage_blank_button_clicked_cb), (fill_language_editor): * src/window-commands.c: (window_cmd_help_about): Use the browser icon from gnome icon theme. Get rid of cache comparing prefs and rehash prefs pages to make them more specific. --- ChangeLog | 19 ++ data/art/Makefile.am | 2 +- data/art/epiphany.png | Bin 3539 -> 0 bytes data/epiphany.desktop.in | 2 +- data/epiphany.schemas.in | 12 - data/glade/prefs-dialog.glade | 548 ++++++++++++++++++------------------ embed/mozilla/mozilla-notifiers.cpp | 38 --- lib/ephy-dialog.c | 22 ++ lib/ephy-dialog.h | 4 + src/ephy-main.c | 22 +- src/prefs-dialog.c | 49 ++-- src/window-commands.c | 33 ++- 12 files changed, 386 insertions(+), 365 deletions(-) delete mode 100644 data/art/epiphany.png diff --git a/ChangeLog b/ChangeLog index 1aa89f3cb..8c17a4896 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2003-07-02 Marco Pesenti Gritti + + * data/art/Makefile.am: + * data/art/epiphany.png: + * data/epiphany.desktop.in: + * data/epiphany.schemas.in: + * data/glade/prefs-dialog.glade: + * embed/mozilla/mozilla-notifiers.cpp: + * lib/ephy-dialog.c: (ephy_dialog_set_size_group): + * lib/ephy-dialog.h: + * src/ephy-main.c: (main): + * src/prefs-dialog.c: (prefs_dialog_init), + (prefs_homepage_blank_button_clicked_cb), (fill_language_editor): + * src/window-commands.c: (window_cmd_help_about): + + Use the browser icon from gnome icon theme. + Get rid of cache comparing prefs and rehash prefs pages to + make them more specific. + 2003-07-02 Christian Persch * src/bookmarks/ephy-topic-action.c: (ephy_topic_action_sync_label), diff --git a/data/art/Makefile.am b/data/art/Makefile.am index 755ec912b..bfd94661d 100644 --- a/data/art/Makefile.am +++ b/data/art/Makefile.am @@ -12,7 +12,7 @@ art_DATA = \ epiphany-bookmarks.png \ epiphany-tab-loading.gif -appicon_DATA = epiphany.png epiphany-bookmarks.png +appicon_DATA = epiphany-bookmarks.png appicondir = $(datadir)/pixmaps artdir = $(pkgdatadir)/art diff --git a/data/art/epiphany.png b/data/art/epiphany.png deleted file mode 100644 index 82869dc80..000000000 Binary files a/data/art/epiphany.png and /dev/null differ diff --git a/data/epiphany.desktop.in b/data/epiphany.desktop.in index e0fe8c546..649ea2189 100644 --- a/data/epiphany.desktop.in +++ b/data/epiphany.desktop.in @@ -5,7 +5,7 @@ Exec=epiphany %U StartupNotify=true Terminal=0 Type=Application -Icon=epiphany.png +Icon=web-browser.png X-GNOME-DocPath= X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=epiphany diff --git a/data/epiphany.schemas.in b/data/epiphany.schemas.in index 6bd35aebb..cfa5565ae 100644 --- a/data/epiphany.schemas.in +++ b/data/epiphany.schemas.in @@ -203,18 +203,6 @@ Size of disk cache, in MB. - - /schemas/apps/epiphany/web/cache_compare - /apps/epiphany/web/cache_compare - epiphany - string - automatic - - When to compare cached copy - When to compare cached copy to web copy. Possible values are - once per session, every time, never, automatic. - - /schemas/apps/epiphany/web/language /apps/epiphany/web/language diff --git a/data/glade/prefs-dialog.glade b/data/glade/prefs-dialog.glade index f92f54b5d..c492247dc 100644 --- a/data/glade/prefs-dialog.glade +++ b/data/glade/prefs-dialog.glade @@ -1431,38 +1431,6 @@ True - - - False - True - - - - - - True - Security - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - - 12 - True - False - 18 @@ -1530,102 +1498,6 @@ False 6 - - - True - Compare page: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - True - Once per _session - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - True - True - - - - - - True - True - E_very time - True - GTK_RELIEF_NORMAL - False - False - True - cache_compare_radiobutton - - - 0 - True - True - - - - - - True - True - _Never - True - GTK_RELIEF_NORMAL - False - False - True - cache_compare_radiobutton - - - 0 - True - True - - - - - - True - True - _Automatically - True - GTK_RELIEF_NORMAL - False - False - True - cache_compare_radiobutton - - - 0 - True - True - - - True @@ -1760,10 +1632,42 @@ 0 - False - False + True + True + + + False + True + + + + + + True + Privacy + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + + + + + 12 + True + False + 18 @@ -1774,7 +1678,7 @@ True - <b>Language</b> + <b>Encodings</b> True True GTK_JUSTIFY_LEFT @@ -1820,177 +1724,269 @@ - + True - 3 - 3 False - 6 - 12 - - - - True - Autodetec_t encoding: - True - False - GTK_JUSTIFY_CENTER - False - False - 1 - 0.5 - 0 - 0 - auto_encoding_optionmenu - - - 0 - 1 - 0 - 1 - fill - - - + 6 - + True - _Default encoding: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - default_encoding_optionmenu - - - 0 - 1 - 1 - 2 - fill - - - + False + 12 - - - True - _Language: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - language_optionmenu - - - 0 - 1 - 2 - 3 - fill - - - + + + True + _Default: + True + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + default_encoding_optionmenu + + + 0 + False + False + + - - - True - True - -1 + + + True + True + -1 + + + 0 + True + True + + - 1 - 2 - 2 - 3 - fill - + 0 + True + True - + True - True - -1 - - - 1 - 2 - 1 - 2 - fill - - - + False + 12 - - - True - True - -1 + + + True + Autodetec_t: + True + False + GTK_JUSTIFY_CENTER + False + False + 1 + 0.5 + 0 + 0 + auto_encoding_optionmenu + + + 0 + False + False + + - - + + True + True + -1 + + + + True + + + + 0 + True + True + - 1 - 2 - 0 - 1 - + 0 + True + True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + False + True + + - - - True - True - True - Mo_re... - True - GTK_RELIEF_NORMAL - - - - 2 - 3 - 2 - 3 - - - + + + True + False + 6 + + + + True + <b>Languages</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + True + False + 12 - + True - gtk-select-font - 6 - 0.5 - 0.5 - 0 - 0 + False + 6 + + + + True + False + 12 + + + + True + _Language: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + language_optionmenu + + + 0 + False + False + + + + + + True + True + -1 + + + 0 + True + True + + + + + + True + True + True + Mo_re... + True + GTK_RELIEF_NORMAL + + + + 0 + False + False + + + + + 0 + True + True + + - 2 - 3 - 0 - 2 - fill + 0 + True + True @@ -2003,8 +1999,8 @@ 0 - True - True + False + False @@ -2024,7 +2020,7 @@ True - Advanced + Language False False GTK_JUSTIFY_LEFT diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp index bf06296f8..81120997b 100644 --- a/embed/mozilla/mozilla-notifiers.cpp +++ b/embed/mozilla/mozilla-notifiers.cpp @@ -102,11 +102,6 @@ mozilla_cookies_accept_notifier (GConfClient *client, guint cnxn_id, GConfEntry *entry, char *pref); -static void -mozilla_cache_compare_notifier (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - char *pref); /* Keeps the list of the notifiers we installed for mozilla prefs */ /* to be able to remove them when exiting */ @@ -165,8 +160,6 @@ custom_notifiers [] = (GConfClientNotifyFunc) mozilla_proxy_autoconfig_notifier }, { CONF_NETWORK_CACHE_SIZE, (GConfClientNotifyFunc) mozilla_cache_size_notifier }, - { CONF_NETWORK_CACHE_COMPARE, - (GConfClientNotifyFunc) mozilla_cache_compare_notifier }, { CONF_SECURITY_COOKIES_ACCEPT, (GConfClientNotifyFunc) mozilla_cookies_accept_notifier }, @@ -307,37 +300,6 @@ mozilla_cookies_accept_notifier (GConfClient *client, mozilla_prefs_set_int ("network.cookie.cookieBehavior", mozilla_mode); } -static void -mozilla_cache_compare_notifier (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - char *pref) -{ - const char *mode; - int mozilla_mode = 0; - - mode = gconf_value_get_string(entry->value); - - if (strcmp (mode, "once per session") == 0) - { - mozilla_mode = 0; - } - else if (strcmp (mode, "every time") == 0) - { - mozilla_mode = 1; - } - else if (strcmp (mode, "never") == 0) - { - mozilla_mode = 2; - } - else if (strcmp (mode, "automatic") == 0) - { - mozilla_mode = 3; - } - - mozilla_prefs_set_int ("browser.cache.check_doc_frequency", mozilla_mode); -} - static void mozilla_font_notifier (GConfClient *client, guint cnxn_id, diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c index 2100eb1f6..aa5ed1a16 100644 --- a/lib/ephy-dialog.c +++ b/lib/ephy-dialog.c @@ -1283,3 +1283,25 @@ ephy_dialog_get_value (EphyDialog *dialog, return klass->get_value (dialog, property_id, value); } +void +ephy_dialog_set_size_group (EphyDialog *dialog, + int *controls_id, + guint n_controls) +{ + GtkSizeGroup *size_group; + int i; + + size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + + for (i = 0; i < n_controls; i++) + { + GtkWidget *widget; + guint id; + + id = controls_id[i]; + widget = dialog->priv->props[id].widget; + g_return_if_fail (GTK_IS_WIDGET (widget)); + + gtk_size_group_add_widget (size_group, widget); + } +} diff --git a/lib/ephy-dialog.h b/lib/ephy-dialog.h index 0a6f16a2d..9bc054e6b 100644 --- a/lib/ephy-dialog.h +++ b/lib/ephy-dialog.h @@ -99,6 +99,10 @@ void ephy_dialog_add_enum (EphyDialog *dialog, guint n_items, const char **items); +void ephy_dialog_set_size_group (EphyDialog *dialog, + int *controls_id, + guint n_controls); + gint ephy_dialog_run (EphyDialog *dialog); void ephy_dialog_show (EphyDialog *dialog); 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 #include #include +#include #include #include #include @@ -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 @@ -166,13 +166,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 [] = { @@ -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 #include #include +#include #include #include @@ -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 ", @@ -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); -- cgit v1.2.3