diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-04-19 00:43:54 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-04-19 00:43:54 +0800 |
commit | 4a4d612e4177cb4fc080324f60f57682c408b01a (patch) | |
tree | 538b3eae62f84392ea5aa50b29ffe59b2aae1095 | |
parent | 26d1ed1f62e1c3229729bb79673f1b424a4dd8d9 (diff) | |
download | gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.gz gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.bz2 gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.lz gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.xz gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.zst gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.zip |
Implement clear history. Put favicons near sites names.
2003-04-18 Marco Pesenti Gritti <marco@it.gnome.org>
* embed/ephy-history.c: (ephy_history_set_page_title),
(ephy_history_set_icon), (ephy_history_clear):
* embed/ephy-history.h:
* src/ephy-history-window.c: (cmd_clear), (provide_favicon),
(ephy_history_window_construct):
* src/ephy-tab.c: (ephy_tab_set_favicon):
Implement clear history. Put favicons near sites names.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | embed/ephy-history.c | 29 | ||||
-rw-r--r-- | embed/ephy-history.h | 7 | ||||
-rw-r--r-- | src/ephy-history-window.c | 24 | ||||
-rw-r--r-- | src/ephy-tab.c | 5 |
5 files changed, 71 insertions, 5 deletions
@@ -1,5 +1,16 @@ 2003-04-18 Marco Pesenti Gritti <marco@it.gnome.org> + * embed/ephy-history.c: (ephy_history_set_page_title), + (ephy_history_set_icon), (ephy_history_clear): + * embed/ephy-history.h: + * src/ephy-history-window.c: (cmd_clear), (provide_favicon), + (ephy_history_window_construct): + * src/ephy-tab.c: (ephy_tab_set_favicon): + + Implement clear history. Put favicons near sites names. + +2003-04-18 Marco Pesenti Gritti <marco@it.gnome.org> + * data/art/Makefile.am: Do not install two copies of epiphany.png diff --git a/embed/ephy-history.c b/embed/ephy-history.c index 3bb69db7f..51dd68936 100644 --- a/embed/ephy-history.c +++ b/embed/ephy-history.c @@ -758,11 +758,12 @@ ephy_history_set_page_title (EphyHistory *gh, const char *title) { EphyNode *node; - guint host_id; GValue value = { 0, }; LOG ("Set page title") + if (title == NULL || title[0] == '\0') return; + node = ephy_history_get_page (gh, url); if (!node) return; @@ -771,9 +772,28 @@ ephy_history_set_page_title (EphyHistory *gh, ephy_node_set_property (node, EPHY_NODE_PAGE_PROP_TITLE, &value); g_value_unset (&value); +} + +void +ephy_history_set_icon (EphyHistory *gh, + const char *url, + const char *icon) +{ + EphyNode *host; + + LOG ("Set host icon") - host_id = ephy_node_get_property_int - (node, EPHY_NODE_PAGE_PROP_HOST_ID); + host = g_hash_table_lookup (gh->priv->hosts_hash, url); + if (host) + { + GValue value = { 0, }; + + g_value_init (&value, G_TYPE_STRING); + g_value_set_string (&value, icon); + ephy_node_set_property + (host, EPHY_NODE_PAGE_PROP_ICON, &value); + g_value_unset (&value); + } } void @@ -786,7 +806,8 @@ ephy_history_clear (EphyHistory *gh) ephy_node_unref (node); } - while ((node = ephy_node_get_nth_child (gh->priv->hosts, 0)) != NULL) + /* The first node is All, dont unref it */ + while ((node = ephy_node_get_nth_child (gh->priv->hosts, 1)) != NULL) { ephy_node_unref (node); } diff --git a/embed/ephy-history.h b/embed/ephy-history.h index ccddbec67..4308e7adc 100644 --- a/embed/ephy-history.h +++ b/embed/ephy-history.h @@ -44,7 +44,8 @@ enum EPHY_NODE_PAGE_PROP_LAST_VISIT = 5, EPHY_NODE_PAGE_PROP_FIRST_VISIT = 6, EPHY_NODE_PAGE_PROP_HOST_ID = 7, - EPHY_NODE_PAGE_PROP_PRIORITY = 8 + EPHY_NODE_PAGE_PROP_PRIORITY = 8, + EPHY_NODE_PAGE_PROP_ICON = 9 }; struct EphyHistory @@ -86,6 +87,10 @@ void ephy_history_set_page_title (EphyHistory *gh, const char *ephy_history_get_last_page (EphyHistory *gh); +void ephy_history_set_icon (EphyHistory *gh, + const char *url, + const char *icon); + void ephy_history_remove (EphyHistory *gh, EphyNode *node); diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c index 34d8e19f6..2c2cd8ec8 100644 --- a/src/ephy-history-window.c +++ b/src/ephy-history-window.c @@ -127,6 +127,7 @@ static void cmd_clear (EggAction *action, EphyHistoryWindow *editor) { + ephy_history_clear (editor->priv->history); } static void @@ -510,6 +511,28 @@ menu_activate_cb (EphyNodeView *view, } static void +provide_favicon (EphyNode *node, GValue *value, gpointer user_data) +{ + EphyFaviconCache *cache; + const char *icon_location; + GdkPixbuf *pixbuf = NULL; + + cache = ephy_embed_shell_get_favicon_cache (EPHY_EMBED_SHELL (ephy_shell)); + icon_location = ephy_node_get_property_string + (node, EPHY_NODE_PAGE_PROP_ICON); + + LOG ("Get favicon for %s", icon_location ? icon_location : "None") + + if (icon_location) + { + pixbuf = ephy_favicon_cache_get (cache, icon_location); + } + + g_value_init (value, GDK_TYPE_PIXBUF); + g_value_set_object (value, pixbuf); +} + +static void ephy_history_window_construct (EphyHistoryWindow *editor) { GtkTreeViewColumn *col; @@ -587,6 +610,7 @@ ephy_history_window_construct (EphyHistoryWindow *editor) EPHY_NODE_PAGE_PROP_LOCATION); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (sites_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); + ephy_node_view_add_icon_column (EPHY_NODE_VIEW (sites_view), provide_favicon); ephy_node_view_add_column (EPHY_NODE_VIEW (sites_view), _("Sites"), G_TYPE_STRING, EPHY_NODE_PAGE_PROP_TITLE, diff --git a/src/ephy-tab.c b/src/ephy-tab.c index 52f668f7b..6f2848a33 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -449,6 +449,7 @@ ephy_tab_set_favicon (EphyTab *tab, { GtkWidget *nb; EphyBookmarks *eb; + EphyHistory *history; nb = ephy_window_get_notebook (tab->priv->window); ephy_notebook_set_page_icon (EPHY_NOTEBOOK (nb), @@ -458,8 +459,12 @@ ephy_tab_set_favicon (EphyTab *tab, if (tab->priv->favicon_url[0] != '\0') { eb = ephy_shell_get_bookmarks (ephy_shell); + history = ephy_embed_shell_get_global_history + (EPHY_EMBED_SHELL (ephy_shell)); ephy_bookmarks_set_icon (eb, tab->priv->location, tab->priv->favicon_url); + ephy_history_set_icon (history, tab->priv->location, + tab->priv->favicon_url); ephy_window_update_control (tab->priv->window, FaviconControl); } |