[yelp] [yelp-window] Make sure bookmark actions have the right title when switching docs
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp] [yelp-window] Make sure bookmark actions have the right title when switching docs
- Date: Wed, 2 Jun 2010 22:55:39 +0000 (UTC)
commit f6e059c1f443ac6f5c0793e5bf9a73b612975f2f
Author: Shaun McCance <shaunm gnome org>
Date: Wed Jun 2 11:45:32 2010 -0500
[yelp-window] Make sure bookmark actions have the right title when switching docs
src/yelp-window.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/yelp-window.c b/src/yelp-window.c
index a434c81..fdffdbf 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -924,7 +924,17 @@ window_set_bookmarks (YelpWindow *window,
gchar *action_id = g_strconcat ("LoadBookmark-", entry->page_id, NULL);
bookmark = gtk_action_group_get_action (priv->bookmark_actions, action_id);
- if (bookmark == NULL) {
+ if (bookmark) {
+ /* The action might have been set by a different document using
+ * the same page ID. We can just reuse the action, since it's
+ * just a page ID relative to the current URI, but we need to
+ * reset the title and icon.
+ */
+ g_object_set (bookmark,
+ "label", entry->title,
+ "icon-name", entry->icon,
+ NULL);
+ } else {
bookmark = gtk_action_new (action_id, entry->title, NULL, NULL);
g_signal_connect (bookmark, "activate",
G_CALLBACK (window_load_bookmark), window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]