diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-09-24 01:08:54 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-09-24 01:08:54 +0800 |
commit | 30930917e8ce020776e0096928aedfebe779bfd5 (patch) | |
tree | c888c0b43e0249264f098b3be4cbfbc876cceb25 /src/ephy-shell.c | |
parent | 2e1474156400d308faf8836801ee87607d9632d7 (diff) | |
download | gsoc2013-epiphany-30930917e8ce020776e0096928aedfebe779bfd5.tar gsoc2013-epiphany-30930917e8ce020776e0096928aedfebe779bfd5.tar.gz gsoc2013-epiphany-30930917e8ce020776e0096928aedfebe779bfd5.tar.bz2 gsoc2013-epiphany-30930917e8ce020776e0096928aedfebe779bfd5.tar.lz gsoc2013-epiphany-30930917e8ce020776e0096928aedfebe779bfd5.tar.xz gsoc2013-epiphany-30930917e8ce020776e0096928aedfebe779bfd5.tar.zst gsoc2013-epiphany-30930917e8ce020776e0096928aedfebe779bfd5.zip |
Refactor initialization/automation code. Now all the code used by the
2003-09-23 Marco Pesenti Gritti <marco@gnome.org>
* src/ephy-automation.c: (ephy_automation_factory_new):
* src/ephy-automation.h:
* src/ephy-main.c: (main), (ephy_main_start):
* src/ephy-shell.c: (ephy_shell_init), (ephy_shell_finalize):
Refactor initialization/automation code. Now all the code
used by the first instance is in ephy_shell, all the code
used by other instances is in ephy_main.
Unref the factory before quitting so we dont risk new
automation object are created and used with a dead shell.
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r-- | src/ephy-shell.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 2be34fdf6..b70435892 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -42,6 +42,7 @@ #include "downloader-view.h" #include "ephy-toolbars-model.h" #include "ephy-autocompletion.h" +#include "ephy-automation.h" #include <string.h> #include <libgnomeui/gnome-client.h> @@ -51,6 +52,9 @@ #include <gtk/gtkmain.h> #include <gtk/gtkmessagedialog.h> #include <dirent.h> +#include <libgnomevfs/gnome-vfs-init.h> +#include <libgnomeui/gnome-icon-theme.h> +#include <glade/glade-init.h> #ifdef ENABLE_NAUTILUS_VIEW @@ -65,6 +69,7 @@ struct EphyShellPrivate { + BonoboGenericFactory *automation_factory; Session *session; EphyAutocompletion *autocompletion; EphyBookmarks *bookmarks; @@ -197,6 +202,8 @@ ephy_shell_init (EphyShell *gs) { EphyEmbedSingle *single; EphyShell **ptr = &ephy_shell; + GnomeIconTheme *icon_theme; + char *file; gs->priv = EPHY_SHELL_GET_PRIVATE (gs); @@ -212,6 +219,8 @@ ephy_shell_init (EphyShell *gs) g_object_add_weak_pointer (G_OBJECT(ephy_shell), (gpointer *)ptr); + gnome_vfs_init (); + glade_gnome_init (); ephy_debug_init (); ephy_thread_helpers_init (); ephy_file_helpers_init (); @@ -247,6 +256,23 @@ ephy_shell_init (EphyShell *gs) } ephy_shell_load_plugins (gs); + + 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"); + } + + gs->priv->automation_factory = ephy_automation_factory_new (); } static void @@ -309,6 +335,12 @@ ephy_shell_finalize (GObject *object) ephy_state_save (); ephy_file_helpers_shutdown (); + gnome_vfs_shutdown (); + + if (gs->priv->automation_factory) + { + bonobo_object_unref (gs->priv->automation_factory); + } LOG ("Ephy shell finalized") |