diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-01-05 21:51:43 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-01-05 21:51:43 +0800 |
commit | ae767a6174e353acb3b1a850fdefdffebeec9817 (patch) | |
tree | 6a6cbf8bce7af4c04fabaae2ef4123c4a0fde7f3 | |
parent | a3f1d414e8ae27d380fe224bdf4f0a9e9740285c (diff) | |
download | gsoc2013-epiphany-ae767a6174e353acb3b1a850fdefdffebeec9817.tar gsoc2013-epiphany-ae767a6174e353acb3b1a850fdefdffebeec9817.tar.gz gsoc2013-epiphany-ae767a6174e353acb3b1a850fdefdffebeec9817.tar.bz2 gsoc2013-epiphany-ae767a6174e353acb3b1a850fdefdffebeec9817.tar.lz gsoc2013-epiphany-ae767a6174e353acb3b1a850fdefdffebeec9817.tar.xz gsoc2013-epiphany-ae767a6174e353acb3b1a850fdefdffebeec9817.tar.zst gsoc2013-epiphany-ae767a6174e353acb3b1a850fdefdffebeec9817.zip |
Make GaleonShell inherit from GaleonEmbedShell. Ref the shell when using
2003-01-05 Marco Pesenti Gritti <marco@it.gnome.org>
* data/art/Makefile.am:
* data/art/epiphany.png:
* data/epiphany.schemas.in:
* data/glade/epiphany.glade:
* embed/downloader-view.c: (downloader_view_init),
(downloader_view_finalize):
* embed/ephy-embed-favicon.c: (ephy_embed_favicon_set_property):
* embed/ephy-embed-shell.c: (ephy_embed_shell_get_impl),
(ephy_embed_shell_get_type), (ephy_embed_shell_new):
* embed/ephy-embed-shell.h:
* embed/ephy-embed-utils.c:
(ephy_embed_utils_build_charsets_submenu):
* embed/mozilla/mozilla-embed-persist.cpp:
* embed/mozilla/mozilla-embed.cpp:
* src/appearance-prefs.c: (setup_font_menu):
* src/bookmarks/ephy-bookmarks.c: (compute_lower_fav),
(ephy_setup_history_notifiers):
* src/ephy-main.c: (main):
* src/ephy-nautilus-view.c: (ephy_nautilus_view_instance_init):
* src/ephy-shell.c: (ephy_shell_get_type), (ephy_shell_init),
(ephy_shell_finalize), (build_homepage_url),
(ephy_shell_get_autocompletion):
* src/ephy-shell.h:
* src/ephy-tab.c: (ephy_tab_init), (ephy_tab_location_cb),
(ephy_tab_visibility_cb):
* src/ephy-window.c: (favicon_cache_changed_cb),
(ephy_window_init), (update_favicon_control):
* src/general-prefs.c: (create_default_charset_menu):
* src/history-dialog.c: (history_dialog_init):
* src/pdm-dialog.c: (pdm_dialog_cookie_remove),
(pdm_dialog_password_remove), (pdm_dialog_cookies_free),
(pdm_dialog_passwords_free), (pdm_dialog_init):
* src/prefs-dialog.c: (prefs_clear_memory_cache_button_clicked_cb),
(prefs_clear_disk_cache_button_clicked_cb):
* src/window-commands.c: (window_cmd_file_open):
Make GaleonShell inherit from GaleonEmbedShell.
Ref the shell when using the downloader.
Use favicons for the window icon when possible.
This required to use jimmac icon as default,
we still dont have his permission, I'll remove it
later if necessary.
-rw-r--r-- | ChangeLog | 45 | ||||
-rw-r--r-- | data/art/Makefile.am | 3 | ||||
-rw-r--r-- | data/art/epiphany.png | bin | 0 -> 3539 bytes | |||
-rw-r--r-- | data/epiphany.schemas.in | 11 | ||||
-rw-r--r-- | data/glade/epiphany.glade | 1 | ||||
-rw-r--r-- | embed/downloader-view.c | 8 | ||||
-rw-r--r-- | embed/ephy-embed-favicon.c | 12 | ||||
-rw-r--r-- | embed/ephy-embed-shell.c | 27 | ||||
-rw-r--r-- | embed/ephy-embed-shell.h | 13 | ||||
-rw-r--r-- | embed/ephy-embed-utils.c | 1 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-persist.cpp | 3 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 20 | ||||
-rwxr-xr-x | src/appearance-prefs.c | 5 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks.c | 4 | ||||
-rw-r--r-- | src/ephy-main.c | 8 | ||||
-rw-r--r-- | src/ephy-nautilus-view.c | 4 | ||||
-rw-r--r-- | src/ephy-shell.c | 42 | ||||
-rw-r--r-- | src/ephy-shell.h | 6 | ||||
-rw-r--r-- | src/ephy-tab.c | 5 | ||||
-rw-r--r-- | src/ephy-window.c | 29 | ||||
-rwxr-xr-x | src/general-prefs.c | 2 | ||||
-rwxr-xr-x | src/history-dialog.c | 2 | ||||
-rwxr-xr-x | src/pdm-dialog.c | 17 | ||||
-rw-r--r-- | src/prefs-dialog.c | 4 | ||||
-rw-r--r-- | src/window-commands.c | 3 |
25 files changed, 159 insertions, 116 deletions
@@ -1,3 +1,48 @@ +2003-01-05 Marco Pesenti Gritti <marco@it.gnome.org> + + * data/art/Makefile.am: + * data/art/epiphany.png: + * data/epiphany.schemas.in: + * data/glade/epiphany.glade: + * embed/downloader-view.c: (downloader_view_init), + (downloader_view_finalize): + * embed/ephy-embed-favicon.c: (ephy_embed_favicon_set_property): + * embed/ephy-embed-shell.c: (ephy_embed_shell_get_impl), + (ephy_embed_shell_get_type), (ephy_embed_shell_new): + * embed/ephy-embed-shell.h: + * embed/ephy-embed-utils.c: + (ephy_embed_utils_build_charsets_submenu): + * embed/mozilla/mozilla-embed-persist.cpp: + * embed/mozilla/mozilla-embed.cpp: + * src/appearance-prefs.c: (setup_font_menu): + * src/bookmarks/ephy-bookmarks.c: (compute_lower_fav), + (ephy_setup_history_notifiers): + * src/ephy-main.c: (main): + * src/ephy-nautilus-view.c: (ephy_nautilus_view_instance_init): + * src/ephy-shell.c: (ephy_shell_get_type), (ephy_shell_init), + (ephy_shell_finalize), (build_homepage_url), + (ephy_shell_get_autocompletion): + * src/ephy-shell.h: + * src/ephy-tab.c: (ephy_tab_init), (ephy_tab_location_cb), + (ephy_tab_visibility_cb): + * src/ephy-window.c: (favicon_cache_changed_cb), + (ephy_window_init), (update_favicon_control): + * src/general-prefs.c: (create_default_charset_menu): + * src/history-dialog.c: (history_dialog_init): + * src/pdm-dialog.c: (pdm_dialog_cookie_remove), + (pdm_dialog_password_remove), (pdm_dialog_cookies_free), + (pdm_dialog_passwords_free), (pdm_dialog_init): + * src/prefs-dialog.c: (prefs_clear_memory_cache_button_clicked_cb), + (prefs_clear_disk_cache_button_clicked_cb): + * src/window-commands.c: (window_cmd_file_open): + + Make GaleonShell inherit from GaleonEmbedShell. + Ref the shell when using the downloader. + Use favicons for the window icon when possible. + This required to use jimmac icon as default, + we still dont have his permission, I'll remove it + later if necessary. + 2003-01-04 Marco Pesenti Gritti <marco@it.gnome.org> * embed/ephy-embed-favicon.c: (update_url), (location_changed_cb), diff --git a/data/art/Makefile.am b/data/art/Makefile.am index f4f5c3b5f..302d5eb3b 100644 --- a/data/art/Makefile.am +++ b/data/art/Makefile.am @@ -1,6 +1,7 @@ art_DATA = \ epiphany-secure.png \ - epiphany-unsecure.png + epiphany-unsecure.png \ + epiphany.png artdir = $(pkgdatadir)/art diff --git a/data/art/epiphany.png b/data/art/epiphany.png Binary files differnew file mode 100644 index 000000000..82869dc80 --- /dev/null +++ b/data/art/epiphany.png diff --git a/data/epiphany.schemas.in b/data/epiphany.schemas.in index f45104907..c7a17edfa 100644 --- a/data/epiphany.schemas.in +++ b/data/epiphany.schemas.in @@ -341,6 +341,17 @@ </locale> </schema> <schema> + <key>/schemas/apps/epiphany/downloader/show_details</key> + <applyto>/apps/epiphany/downloader/show_details</applyto> + <owner>epiphany</owner> + <type>bool</type> + <default>false</default> + <locale name="C"> + <short>Show download details</short> + <long>Show download details</long> + </locale> + </schema> + <schema> <key>/schemas/apps/epiphany/filtering/java_enabled</key> <applyto>/apps/epiphany/filtering/java_enabled</applyto> <owner>epiphany</owner> diff --git a/data/glade/epiphany.glade b/data/glade/epiphany.glade index c9d30cb91..773bc0334 100644 --- a/data/glade/epiphany.glade +++ b/data/glade/epiphany.glade @@ -844,7 +844,6 @@ <child> <widget class="GtkVBox" id="details_frame"> - <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> diff --git a/embed/downloader-view.c b/embed/downloader-view.c index 97e05a613..c7cdc2ef6 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -23,6 +23,7 @@ #include "ephy-ellipsizing-label.h" #include "ephy-embed-utils.h" #include "ephy-file-helpers.h" +#include "ephy-embed-shell.h" #include <gtk/gtktreeview.h> #include <gtk/gtkliststore.h> @@ -85,7 +86,7 @@ typedef struct gchar *source; gchar *dest; DownloadStatus status; - + GtkTreeRowReference *ref; } DownloadDetails; @@ -277,8 +278,9 @@ downloader_view_init (DownloaderView *dv) g_direct_equal, NULL, (GDestroyNotify)destroy_details_cb); - downloader_view_build_ui (dv); + + g_object_ref (embed_shell); } static void @@ -295,6 +297,8 @@ downloader_view_finalize (GObject *object) g_hash_table_destroy (dv->priv->details_hash); + g_object_unref (embed_shell); + g_free (dv->priv); G_OBJECT_CLASS (parent_class)->finalize (object); diff --git a/embed/ephy-embed-favicon.c b/embed/ephy-embed-favicon.c index f7fa43e3b..7afbbd831 100644 --- a/embed/ephy-embed-favicon.c +++ b/embed/ephy-embed-favicon.c @@ -134,13 +134,6 @@ update_url (EphyEmbedFavicon *favicon) } static void -location_changed_cb (EphyEmbed *embed, - EphyEmbedFavicon *favicon) -{ - update_url (favicon); -} - -static void favicon_cb (EphyEmbed *embed, const char *favicon_url, EphyEmbedFavicon *favicon) @@ -186,11 +179,6 @@ ephy_embed_favicon_set_property (GObject *object, G_CALLBACK (favicon_cb), favicon, 0); - g_signal_connect_object (G_OBJECT (favicon->priv->embed), - "ge_location", - G_CALLBACK (location_changed_cb), - favicon, - 0); update_url (favicon); } break; diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index 9bb72942a..69d1c98dd 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -46,8 +46,6 @@ static void ephy_embed_shell_init (EphyEmbedShell *ges); static void ephy_embed_shell_finalize (GObject *object); -static void -ephy_embed_shell_finalize (GObject *object); static EphyHistory * impl_get_global_history (EphyEmbedShell *shell); @@ -60,6 +58,12 @@ static guint ephy_embed_shell_signals[LAST_SIGNAL] = { 0 }; EphyEmbedShell *embed_shell; GType +ephy_embed_shell_get_impl (void) +{ + return MOZILLA_EMBED_SHELL_TYPE; +} + +GType ephy_embed_shell_get_type (void) { static GType ephy_embed_shell_type = 0; @@ -80,8 +84,8 @@ ephy_embed_shell_get_type (void) }; ephy_embed_shell_type = g_type_register_static (G_TYPE_OBJECT, - "EphyEmbedShell", - &our_info, 0); + "EphyEmbedShell", + &our_info, 0); } return ephy_embed_shell_type; @@ -175,21 +179,6 @@ ephy_embed_shell_new (const char *type) return NULL; } -const char *supported_embeds [] = { -#ifdef ENABLE_MOZILLA_EMBED - "mozilla", -#endif -#ifdef ENABLE_GTKHTML_EMBED - "gtkhtml", -#endif - NULL }; - -const char ** -ephy_embed_shell_get_supported (void) -{ - return supported_embeds; -} - /** * ephy_embed_shell_get_favicon_cache: * @gs: a #EphyShell diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h index 75d630f23..105db27f2 100644 --- a/embed/ephy-embed-shell.h +++ b/embed/ephy-embed-shell.h @@ -32,10 +32,11 @@ G_BEGIN_DECLS typedef struct EphyEmbedShellClass EphyEmbedShellClass; #define EPHY_EMBED_SHELL_TYPE (ephy_embed_shell_get_type ()) -#define EPHY_EMBED_SHELL(obj) (GTK_CHECK_CAST ((obj), EPHY_EMBED_SHELL_TYPE, EphyEmbedShell)) -#define EPHY_EMBED_SHELL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EPHY_EMBED_SHELL_TYPE, EphyEmbedShellClass)) -#define IS_EPHY_EMBED_SHELL(obj) (GTK_CHECK_TYPE ((obj), EPHY_EMBED_SHELL_TYPE)) -#define IS_EPHY_EMBED_SHELL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EPHY_EMBED_SHELL)) +#define EPHY_EMBED_SHELL_IMPL (ephy_embed_shell_get_impl ()) +#define EPHY_EMBED_SHELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_EMBED_SHELL_TYPE, EphyEmbedShell)) +#define EPHY_EMBED_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_EMBED_SHELL_TYPE, EphyEmbedShellClass)) +#define IS_EPHY_EMBED_SHELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_EMBED_SHELL_TYPE)) +#define IS_EPHY_EMBED_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EPHY_EMBED_SHELL_TYPE)) #define EPHY_EMBED_SHELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EPHY_EMBED_SHELL_TYPE, EphyEmbedShellClass)) typedef struct EphyEmbedShell EphyEmbedShell; @@ -186,6 +187,8 @@ struct EphyEmbedShellClass GType ephy_embed_shell_get_type (void); +GType ephy_embed_shell_get_impl (void); + EphyEmbedShell *ephy_embed_shell_new (const char *type); EphyFaviconCache *ephy_embed_shell_get_favicon_cache (EphyEmbedShell *ges); @@ -200,8 +203,6 @@ EphyEmbed *ephy_embed_shell_get_active_embed (EphyEmbedShell *ges); GList *ephy_embed_shell_get_embeds (EphyEmbedShell *ges); -const char **ephy_embed_shell_get_supported (void); - void ephy_embed_shell_get_capabilities (EphyEmbedShell *shell, EmbedShellCapabilities *caps); diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c index f76a2b7e5..69089daa4 100644 --- a/embed/ephy-embed-utils.c +++ b/embed/ephy-embed-utils.c @@ -240,6 +240,7 @@ ephy_embed_utils_build_charsets_submenu (BonoboUIComponent *ui_component, g_timer_start(timer); #endif + g_return_if_fail (IS_EPHY_EMBED_SHELL (embed_shell)); g_return_if_fail (ephy_embed_shell_get_charset_groups (embed_shell, &groups) == G_OK); xml_string = g_string_new (NULL); diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp index c0c8cb06e..9f9ac185c 100644 --- a/embed/mozilla/mozilla-embed-persist.cpp +++ b/embed/mozilla/mozilla-embed-persist.cpp @@ -167,7 +167,8 @@ impl_save (EphyEmbedPersist *persist) if (embed) { - wrapper = (EphyWrapper *) mozilla_embed_get_galeon_wrapper (MOZILLA_EMBED(embed)); + wrapper = (EphyWrapper *) mozilla_embed_get_galeon_wrapper (MOZILLA_EMBED(embed)); + g_return_val_if_fail (wrapper != NULL, G_FAILED); wrapper->GetDOMWindow (getter_AddRefs (parent)); } diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index 66330db4a..8c39dd460 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -274,7 +274,7 @@ mozilla_embed_get_type (void) static const GInterfaceInfo embed_info = { - (GInterfaceInitFunc) ephy_embed_init, /* interface_init */ + (GInterfaceInitFunc) ephy_embed_init, /* interface_init */ NULL, /* interface_finalize */ NULL /* interface_data */ }; @@ -357,8 +357,6 @@ mozilla_embed_init (MozillaEmbed *embed) gpointer mozilla_embed_get_galeon_wrapper (MozillaEmbed *embed) { - g_return_val_if_fail (embed->priv->wrapper != NULL, NULL); - return embed->priv->wrapper; } @@ -719,6 +717,8 @@ impl_get_location (EphyEmbed *embed, } *location = l; + + if (l == NULL) return G_FAILED; return G_OK; } @@ -1309,14 +1309,16 @@ mozilla_embed_visibility_cb (GtkMozEmbed *embed, gboolean visibility, (do_GetService(WINDOWWATCHER_CONTRACTID, &rv)); if (NS_FAILED(rv) || !wwatch) return; - EphyWrapper *wrapper = (EphyWrapper *)mozilla_embed_get_galeon_wrapper(membed); - if(!wrapper) return; + EphyWrapper *wrapper = membed->priv->wrapper; - nsCOMPtr<nsIDOMWindow> domWindow; - rv = wrapper->GetDOMWindow(getter_AddRefs(domWindow)); - if(NS_FAILED(rv) || !domWindow) return; + if (wrapper) + { + nsCOMPtr<nsIDOMWindow> domWindow; + rv = wrapper->GetDOMWindow(getter_AddRefs(domWindow)); + if(NS_FAILED(rv) || !domWindow) return; - rv = wwatch->SetActiveWindow(domWindow); + rv = wwatch->SetActiveWindow(domWindow); + } } static void diff --git a/src/appearance-prefs.c b/src/appearance-prefs.c index da1056f3f..0cb928cdf 100755 --- a/src/appearance-prefs.c +++ b/src/appearance-prefs.c @@ -179,15 +179,12 @@ setup_font_menu (AppearancePrefs *dialog, { char *default_font; GList *fonts; - EphyEmbedShell *shell; const char *name; char key[255]; int pos; GtkWidget *entry = GTK_COMBO(combo)->entry; - shell = ephy_shell_get_embed_shell (ephy_shell); - - ephy_embed_shell_get_font_list (shell, + ephy_embed_shell_get_font_list (EPHY_EMBED_SHELL (ephy_shell), lang_encode[dialog->priv->language], type, &fonts, &default_font); diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index a4f5412a4..7110a2cd8 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -294,7 +294,7 @@ compute_lower_fav (EphyNode *favorites, double *score) EphyHistory *history; EphyNode *result = NULL; - embed_shell = ephy_shell_get_embed_shell (ephy_shell); + embed_shell = EPHY_EMBED_SHELL (ephy_shell); history = ephy_embed_shell_get_global_history (embed_shell); *score = DBL_MAX; @@ -399,7 +399,7 @@ ephy_setup_history_notifiers (EphyBookmarks *eb) EphyEmbedShell *embed_shell; EphyHistory *history; - embed_shell = ephy_shell_get_embed_shell (ephy_shell); + embed_shell = EPHY_EMBED_SHELL (ephy_shell); history = ephy_embed_shell_get_global_history (embed_shell); g_signal_connect (history, "visited", diff --git a/src/ephy-main.c b/src/ephy-main.c index 0a0093974..becc1d2e5 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -23,12 +23,13 @@ #include "ephy-shell.h" #include "ephy-automation.h" #include "ephy-window.h" +#include "ephy-file-helpers.h" #include "EphyAutomation.h" #include <libbonoboui.h> #include <libgnome/gnome-program.h> #include <libgnomeui/gnome-ui-init.h> -#include <libgnomeui/gnome-window-icon.h> +#include <gtk/gtkwindow.h> #include <libgnomevfs/gnome-vfs-init.h> #include <glade/glade-init.h> @@ -147,10 +148,11 @@ main (int argc, char *argv[]) glade_gnome_init (); - gnome_window_icon_set_default_from_file (PIXMAP_DIR "/ephy.png"); - ephy_shell_new (); + gtk_window_set_default_icon_from_file + (ephy_file ("epiphany.png"), NULL); + g_idle_add ((GSourceFunc) ephy_main_start, NULL); bonobo_main (); diff --git a/src/ephy-nautilus-view.c b/src/ephy-nautilus-view.c index 8af22ba66..c485721a5 100644 --- a/src/ephy-nautilus-view.c +++ b/src/ephy-nautilus-view.c @@ -174,8 +174,8 @@ ephy_nautilus_view_instance_init (EphyNautilusView *view) EphyNautilusViewPrivate *p = g_new0 (EphyNautilusViewPrivate, 1); view->priv = p; - view->priv->embed = ephy_embed_new (G_OBJECT (ephy_shell_get_embed_shell (ephy_shell))); - + view->priv->embed = ephy_embed_new (G_OBJECT (ephy_shell)); + g_object_ref (G_OBJECT (ephy_shell)); g_signal_connect (view->priv->embed, "ge_link_message", diff --git a/src/ephy-shell.c b/src/ephy-shell.c index d408a7652..491b01b5f 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -45,7 +45,6 @@ struct EphyShellPrivate { - EphyEmbedShell *embed_shell; Session *session; EphyAutocompletion *autocompletion; EphyBookmarks *bookmarks; @@ -102,9 +101,9 @@ ephy_shell_get_type (void) (GInstanceInitFunc) ephy_shell_init }; - ephy_shell_type = g_type_register_static (G_TYPE_OBJECT, - "EphyShell", - &our_info, 0); + ephy_shell_type = g_type_register_static (EPHY_EMBED_SHELL_IMPL, + "EphyShell", + &our_info, 0); } return ephy_shell_type; @@ -169,11 +168,7 @@ ephy_shell_init (EphyShell *gs) gs->priv->session = NULL; gs->priv->bookmarks = NULL; - gs->priv->embed_shell = ephy_embed_shell_new ("mozilla"); - - g_assert (gs->priv->embed_shell != NULL); - - g_signal_connect (G_OBJECT(embed_shell), + g_signal_connect (G_OBJECT (gs), "new_window_orphan", G_CALLBACK(ephy_shell_new_window_cb), NULL); @@ -195,9 +190,6 @@ ephy_shell_finalize (GObject *object) g_assert (ephy_shell == NULL); - g_return_if_fail (IS_EPHY_EMBED_SHELL (gs->priv->embed_shell)); - g_object_unref (G_OBJECT (gs->priv->embed_shell)); - if (gs->priv->session) { g_return_if_fail (IS_SESSION(gs->priv->session)); @@ -217,12 +209,12 @@ ephy_shell_finalize (GObject *object) g_object_unref (gs->priv->bookmarks); } - ephy_file_helpers_shutdown (); - ephy_node_system_shutdown (); + G_OBJECT_CLASS (parent_class)->finalize (object); g_free (gs->priv); - G_OBJECT_CLASS (parent_class)->finalize (object); + ephy_file_helpers_shutdown (); + ephy_node_system_shutdown (); #ifdef DEBUG_MARCO g_print ("Ephy shell finalized\n"); @@ -241,22 +233,6 @@ ephy_shell_new (void) return EPHY_SHELL (g_object_new (EPHY_SHELL_TYPE, NULL)); } -/** - * ephy_shell_get_embed_shell: - * @gs: a #EphyShell - * - * Returns the embed shell created by the #EphyShell - * - * Return value: the embed shell - **/ -EphyEmbedShell * -ephy_shell_get_embed_shell (EphyShell *gs) -{ - g_return_val_if_fail (IS_EPHY_SHELL (gs), NULL); - - return gs->priv->embed_shell; -} - static void ephy_init_services (EphyShell *gs) { @@ -312,7 +288,7 @@ build_homepage_url (EphyShell *gs, { /* get location of last page */ gh = ephy_embed_shell_get_global_history - (gs->priv->embed_shell); + (EPHY_EMBED_SHELL (gs)); last_page_url = ephy_history_get_last_page (gh); result = g_strdup (last_page_url); } @@ -495,7 +471,7 @@ ephy_shell_get_autocompletion (EphyShell *gs) NULL }; - EphyHistory *gh = ephy_embed_shell_get_global_history (gs->priv->embed_shell); + EphyHistory *gh = ephy_embed_shell_get_global_history (EPHY_EMBED_SHELL (gs)); EphyFilesystemAutocompletion *fa = ephy_filesystem_autocompletion_new (); p->autocompletion = ephy_autocompletion_new (); ephy_autocompletion_set_prefixes (p->autocompletion, prefixes); diff --git a/src/ephy-shell.h b/src/ephy-shell.h index 3590931f9..0acd107d1 100644 --- a/src/ephy-shell.h +++ b/src/ephy-shell.h @@ -67,21 +67,19 @@ typedef enum struct EphyShell { - GObject parent; + EphyEmbedShell parent; EphyShellPrivate *priv; }; struct EphyShellClass { - GObjectClass parent_class; + EphyEmbedShellClass parent_class; }; GType ephy_shell_get_type (void); EphyShell *ephy_shell_new (void); -EphyEmbedShell *ephy_shell_get_embed_shell (EphyShell *gs); - EphyWindow *ephy_shell_get_active_window (EphyShell *gs); EphyTab *ephy_shell_new_tab (EphyShell *shell, diff --git a/src/ephy-tab.c b/src/ephy-tab.c index b66beb2e7..5ad7090eb 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -194,7 +194,7 @@ ephy_tab_init (EphyTab *tab) tab->priv = g_new0 (EphyTabPrivate, 1); - shell = ephy_shell_get_embed_shell (ephy_shell); + shell = EPHY_EMBED_SHELL (ephy_shell); tab->priv->embed = ephy_embed_new (G_OBJECT(shell)); @@ -468,6 +468,7 @@ ephy_tab_location_cb (EphyEmbed *embed, EphyTab *tab) { ephy_window_update_control (tab->priv->window, LocationControl); ephy_window_update_control (tab->priv->window, NavControl); + ephy_window_update_control (tab->priv->window, FaviconControl); } } @@ -735,7 +736,7 @@ ephy_tab_visibility_cb (EphyEmbed *embed, gboolean visibility, { gtk_widget_hide (GTK_WIDGET(embed)); } - + ephy_tab_set_visibility (tab, visibility); window = ephy_tab_get_window (tab); diff --git a/src/ephy-window.c b/src/ephy-window.c index d014e4378..dcba93e42 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -451,10 +451,17 @@ setup_layout_menus (EphyWindow *window) } static void +favicon_cache_changed_cb (EphyFaviconCache *cache, char *url, EphyWindow *window) +{ + ephy_window_update_control (window, FaviconControl); +} + +static void ephy_window_init (EphyWindow *window) { BonoboUIComponent *ui_component; Session *session; + EphyFaviconCache *cache; session = ephy_shell_get_session (ephy_shell); @@ -466,6 +473,13 @@ ephy_window_init (EphyWindow *window) window->priv->closing = FALSE; window->priv->has_default_size = FALSE; + cache = ephy_embed_shell_get_favicon_cache (EPHY_EMBED_SHELL (ephy_shell)); + g_signal_connect_object (G_OBJECT (cache), + "changed", + G_CALLBACK (favicon_cache_changed_cb), + window, + 0); + /* Setup the window and connect verbs */ setup_bonobo_window (window, &ui_component); window->ui_component = G_OBJECT (ui_component); @@ -1066,6 +1080,21 @@ update_favorites_control (EphyWindow *window) static void update_favicon_control (EphyWindow *window) { + const char *location; + EphyFaviconCache *cache; + + cache = ephy_embed_shell_get_favicon_cache + (EPHY_EMBED_SHELL (ephy_shell)); + + location = ephy_tab_get_location (window->priv->active_tab); + if (location) + { + GdkPixbuf *pixbuf; + + pixbuf = ephy_favicon_cache_lookup_direct (cache, location); + gtk_window_set_icon (GTK_WINDOW (window), pixbuf); + } + toolbar_update_favicon (window->priv->toolbar); } diff --git a/src/general-prefs.c b/src/general-prefs.c index f9eecf4e6..d3d322054 100755 --- a/src/general-prefs.c +++ b/src/general-prefs.c @@ -218,7 +218,7 @@ create_default_charset_menu (GeneralPrefs *dialog) GtkWidget *optionmenu; char *value; - shell = ephy_shell_get_embed_shell (ephy_shell); + shell = EPHY_EMBED_SHELL (ephy_shell); ephy_embed_shell_get_charset_titles (shell, NULL, &l); menu = gtk_menu_new (); diff --git a/src/history-dialog.c b/src/history-dialog.c index ac9aa5449..3ac3be2c7 100755 --- a/src/history-dialog.c +++ b/src/history-dialog.c @@ -367,7 +367,7 @@ history_dialog_init (HistoryDialog *dialog) dialog->priv = g_new0 (HistoryDialogPrivate, 1); - ges = ephy_shell_get_embed_shell (ephy_shell); + ges = EPHY_EMBED_SHELL (ephy_shell); dialog->priv->gh = ephy_embed_shell_get_global_history (ges); g_return_if_fail (dialog->priv->gh != NULL); diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c index 380430911..3524d6495 100755 --- a/src/pdm-dialog.c +++ b/src/pdm-dialog.c @@ -427,18 +427,17 @@ static void pdm_dialog_cookie_remove (PdmActionInfo *info, GList *data) { - EphyEmbedShell *shell; - shell = ephy_shell_get_embed_shell (ephy_shell); - ephy_embed_shell_remove_cookies (shell, data); + ephy_embed_shell_remove_cookies + (EPHY_EMBED_SHELL (ephy_shell), data); } static void pdm_dialog_password_remove (PdmActionInfo *info, GList *data) { - EphyEmbedShell *shell; - shell = ephy_shell_get_embed_shell (ephy_shell); - ephy_embed_shell_remove_passwords (shell, data, PASSWORD_PASSWORD); + ephy_embed_shell_remove_passwords + (EPHY_EMBED_SHELL (ephy_shell), data, + PASSWORD_PASSWORD); } static void @@ -448,7 +447,7 @@ pdm_dialog_cookies_free (PdmActionInfo *info, EphyEmbedShell *shell; GList *l; - shell = ephy_shell_get_embed_shell (ephy_shell); + shell = EPHY_EMBED_SHELL (ephy_shell); l = data ? data : info->list; ephy_embed_shell_free_cookies (shell, l); } @@ -460,7 +459,7 @@ pdm_dialog_passwords_free (PdmActionInfo *info, EphyEmbedShell *shell; GList *l; - shell = ephy_shell_get_embed_shell (ephy_shell); + shell = EPHY_EMBED_SHELL (ephy_shell); l = data ? data : info->list; ephy_embed_shell_free_passwords (shell, l); } @@ -474,7 +473,7 @@ pdm_dialog_init (PdmDialog *dialog) GtkWidget *cookies_tv; GtkWidget *passwords_tv; - shell = ephy_shell_get_embed_shell (ephy_shell); + shell = EPHY_EMBED_SHELL (ephy_shell); dialog->priv = g_new0 (PdmDialogPrivate, 1); dialog->priv->cookies = NULL; diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 8f010420c..438cd900e 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -320,7 +320,7 @@ prefs_clear_memory_cache_button_clicked_cb (GtkWidget *button, { EphyEmbedShell *shell; - shell = ephy_shell_get_embed_shell (ephy_shell); + shell = EPHY_EMBED_SHELL (ephy_shell); ephy_embed_shell_clear_cache (shell, MEMORY_CACHE); } @@ -330,6 +330,6 @@ prefs_clear_disk_cache_button_clicked_cb (GtkWidget *button, { EphyEmbedShell *shell; - shell = ephy_shell_get_embed_shell (ephy_shell); + shell = EPHY_EMBED_SHELL (ephy_shell); ephy_embed_shell_clear_cache (shell, DISK_CACHE); } diff --git a/src/window-commands.c b/src/window-commands.c index c7d5ec16c..84fabab15 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -364,8 +364,7 @@ window_cmd_file_open (BonoboUIComponent *uic, EphyEmbedShell *embed_shell; gresult result; - embed_shell = ephy_shell_get_embed_shell (ephy_shell); - g_return_if_fail (embed_shell != NULL); + embed_shell = EPHY_EMBED_SHELL (ephy_shell); wmain = GTK_WIDGET (window); g_return_if_fail (wmain != NULL); |