diff options
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/ephy-bookmark-properties.c | 52 | ||||
-rw-r--r-- | src/bookmarks/ephy-new-bookmark.c | 11 |
2 files changed, 59 insertions, 4 deletions
diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c index 1c15bb464..4b70b2e6b 100644 --- a/src/bookmarks/ephy-bookmark-properties.c +++ b/src/bookmarks/ephy-bookmark-properties.c @@ -20,6 +20,7 @@ #include "ephy-bookmark-properties.h" #include "ephy-topics-selector.h" #include "ephy-debug.h" +#include "ephy-shell.h" #include <gtk/gtkstock.h> #include <gtk/gtkentry.h> @@ -217,9 +218,24 @@ update_entry (EphyBookmarkProperties *props, GtkWidget *entry, guint prop) } static void +update_window_title(EphyBookmarkProperties *editor) +{ + char *title; + const char *tmp; + + tmp = ephy_node_get_property_string (editor->priv->bookmark, + EPHY_NODE_BMK_PROP_TITLE); + title = g_strdup_printf (_("%s Properties"), tmp); + gtk_window_set_title (GTK_WINDOW (editor), title); + g_free (title); +} + + +static void title_entry_changed_cb (GtkWidget *entry, EphyBookmarkProperties *props) { update_entry (props, entry, EPHY_NODE_BMK_PROP_TITLE); + update_window_title(props); } static void @@ -229,6 +245,36 @@ location_entry_changed_cb (GtkWidget *entry, EphyBookmarkProperties *props) } static void +set_window_icon (EphyBookmarkProperties *editor) +{ + EphyFaviconCache *cache; + const char *icon_location; + GdkPixbuf *icon = NULL; + + cache = ephy_embed_shell_get_favicon_cache (EPHY_EMBED_SHELL (ephy_shell)); + icon_location = ephy_node_get_property_string + (editor->priv->bookmark, EPHY_NODE_BMK_PROP_ICON); + + LOG ("Get favicon for %s", icon_location ? icon_location : "None") + + if (icon_location) + { + icon = ephy_favicon_cache_get (cache, icon_location); + } + + else + { + icon = gtk_widget_render_icon (GTK_WIDGET (editor), + GTK_STOCK_PROPERTIES, + GTK_ICON_SIZE_MENU, + NULL); + } + + gtk_window_set_icon (GTK_WINDOW (editor), icon); + g_object_unref (icon); +} + +static void build_ui (EphyBookmarkProperties *editor) { GtkWidget *table, *label, *entry, *topics_selector; @@ -239,9 +285,9 @@ build_ui (EphyBookmarkProperties *editor) "response", G_CALLBACK (bookmark_properties_response_cb), editor); - - gtk_window_set_title (GTK_WINDOW (editor), - _("Bookmark properties")); + + update_window_title (editor); + set_window_icon (editor); gtk_dialog_set_has_separator (GTK_DIALOG (editor), FALSE); gtk_container_set_border_width (GTK_CONTAINER (editor), 6); diff --git a/src/bookmarks/ephy-new-bookmark.c b/src/bookmarks/ephy-new-bookmark.c index 7edf24d6c..ac5c68c3f 100644 --- a/src/bookmarks/ephy-new-bookmark.c +++ b/src/bookmarks/ephy-new-bookmark.c @@ -29,6 +29,7 @@ #include "ephy-new-bookmark.h" #include "ephy-topics-selector.h" #include "ephy-debug.h" +#include "ephy-stock-icons.h" static void ephy_new_bookmark_class_init (EphyNewBookmarkClass *klass); static void ephy_new_bookmark_init (EphyNewBookmark *editor); @@ -228,8 +229,16 @@ build_editing_table (EphyNewBookmark *editor) static void ephy_new_bookmark_construct (EphyNewBookmark *editor) { + GdkPixbuf *icon; + gtk_window_set_title (GTK_WINDOW (editor), - _("Add bookmark")); + _("New Bookmark")); + icon = gtk_widget_render_icon (GTK_WIDGET (editor), + EPHY_STOCK_BOOKMARK_PAGE, + GTK_ICON_SIZE_MENU, + NULL); + gtk_window_set_icon (GTK_WINDOW (editor), icon); + g_object_unref(icon); gtk_dialog_set_has_separator (GTK_DIALOG (editor), FALSE); gtk_container_set_border_width (GTK_CONTAINER (editor), 6); |