aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-01-05 21:51:43 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-01-05 21:51:43 +0800
commitae767a6174e353acb3b1a850fdefdffebeec9817 (patch)
tree6a6cbf8bce7af4c04fabaae2ef4123c4a0fde7f3 /src
parenta3f1d414e8ae27d380fe224bdf4f0a9e9740285c (diff)
downloadgsoc2013-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.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/appearance-prefs.c5
-rw-r--r--src/bookmarks/ephy-bookmarks.c4
-rw-r--r--src/ephy-main.c8
-rw-r--r--src/ephy-nautilus-view.c4
-rw-r--r--src/ephy-shell.c42
-rw-r--r--src/ephy-shell.h6
-rw-r--r--src/ephy-tab.c5
-rw-r--r--src/ephy-window.c29
-rwxr-xr-xsrc/general-prefs.c2
-rwxr-xr-xsrc/history-dialog.c2
-rwxr-xr-xsrc/pdm-dialog.c17
-rw-r--r--src/prefs-dialog.c4
-rw-r--r--src/window-commands.c3
13 files changed, 66 insertions, 65 deletions
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);