[yelp] [yelp-location-entry] Add bookmark when icon clicked
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp] [yelp-location-entry] Add bookmark when icon clicked
- Date: Tue, 10 Aug 2010 19:59:00 +0000 (UTC)
commit 345267427dd2111a9e4d88ae6a40670bd658a60f
Author: Shaun McCance <shaunm gnome org>
Date: Tue Aug 10 15:57:22 2010 -0400
[yelp-location-entry] Add bookmark when icon clicked
libyelp/yelp-location-entry.c | 18 +++++++++++++++++-
src/yelp-window.c | 12 ------------
2 files changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/libyelp/yelp-location-entry.c b/libyelp/yelp-location-entry.c
index a61ed8d..1c28883 100644
--- a/libyelp/yelp-location-entry.c
+++ b/libyelp/yelp-location-entry.c
@@ -617,7 +617,23 @@ location_entry_search_activated (YelpLocationEntry *entry)
static void
location_entry_bookmark_clicked (YelpLocationEntry *entry)
{
- printf ("FIXME: bookmark_clicked\n");
+ YelpUri *uri;
+ gchar *doc_uri, *page_id, *icon, *title;
+ YelpLocationEntryPrivate *priv = GET_PRIV (entry);
+
+ g_object_get (priv->view,
+ "yelp-uri", &uri,
+ "page-id", &page_id,
+ "page-icon", &icon,
+ "page-title", &title,
+ NULL);
+ doc_uri = yelp_uri_get_document_uri (uri);
+ yelp_bookmarks_add_bookmark (priv->bookmarks, doc_uri, page_id, icon, title);
+ g_free (doc_uri);
+ g_free (page_id);
+ g_free (icon);
+ g_free (title);
+ g_object_unref (uri);
}
static void
diff --git a/src/yelp-window.c b/src/yelp-window.c
index a977e9b..042277a 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -107,8 +107,6 @@ static gboolean find_entry_key_press (GtkEntry *entry,
static void find_entry_changed (GtkEntry *entry,
YelpWindow *window);
-static void entry_bookmark_clicked (YelpLocationEntry *entry,
- YelpWindow *window);
static gboolean entry_focus_in (GtkEntry *entry,
GdkEventFocus *event,
YelpWindow *window);
@@ -524,9 +522,6 @@ window_construct (YelpWindow *window)
g_signal_connect (priv->entry, "focus-out-event",
G_CALLBACK (entry_focus_out), window);
- g_signal_connect (priv->entry, "bookmark-clicked",
- G_CALLBACK (entry_bookmark_clicked), window);
-
priv->align_location = g_object_ref_sink (gtk_alignment_new (0.0, 0.5, 1.0, 0.0));
gtk_box_pack_start (GTK_BOX (priv->hbox),
GTK_WIDGET (priv->align_location),
@@ -1350,13 +1345,6 @@ find_entry_changed (GtkEntry *entry,
g_free (text);
}
-static void
-entry_bookmark_clicked (YelpLocationEntry *entry,
- YelpWindow *window)
-{
- window_add_bookmark (NULL, window);
-}
-
static gboolean
entry_color_animate (YelpWindow *window)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]