From: Nickolay V. Shmyrev Date: Sun, 28 Jan 2007 11:17:00 +0000 (+0000) Subject: Remove activate_link signal, not required. X-Git-Tag: EVINCE_0_7_2~65 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=cde4965a843c973534347ab2953c09b9e81ff216;p=evince.git Remove activate_link signal, not required. 2007-01-28 Nickolay V. Shmyrev * shell/ev-marshal.list: * shell/ev-page-action.c: (activate_cb), (ev_page_action_class_init): * shell/ev-page-action.h: * shell/ev-page-cache.c: (ev_page_cache_set_page_label): * shell/ev-window.c: Remove activate_link signal, not required. svn path=/trunk/; revision=2256 --- diff --git a/ChangeLog b/ChangeLog index 0fd8b824..582bc6d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-01-28 Nickolay V. Shmyrev + + * shell/ev-marshal.list: + * shell/ev-page-action.c: (activate_cb), + (ev_page_action_class_init): + * shell/ev-page-action.h: + * shell/ev-page-cache.c: (ev_page_cache_set_page_label): + * shell/ev-window.c: + + Remove activate_link signal, not required. + 2007-01-28 Nickolay V. Shmyrev * shell/ev-navigation-action.c: (build_menu): diff --git a/shell/ev-marshal.list b/shell/ev-marshal.list index 44b8bcbb..c2a026bf 100644 --- a/shell/ev-marshal.list +++ b/shell/ev-marshal.list @@ -1,4 +1,3 @@ VOID:NONE VOID:OBJECT,OBJECT VOID:ENUM,BOOLEAN -BOOLEAN:STRING diff --git a/shell/ev-page-action.c b/shell/ev-page-action.c index 7c28edc9..744729d7 100644 --- a/shell/ev-page-action.c +++ b/shell/ev-page-action.c @@ -48,7 +48,6 @@ static void ev_page_action_class_init (EvPageActionClass *class); enum { ACTIVATE_LINK, - ACTIVATE_LABEL, N_SIGNALS }; @@ -115,30 +114,22 @@ activate_cb (GtkWidget *entry, GtkAction *action) EvPageCache *page_cache; const char *text; gchar *page_label; - gint page_number; - gboolean changed; + + EvLinkDest *link_dest; + EvLinkAction *link_action; + EvLink *link; text = gtk_entry_get_text (GTK_ENTRY (entry)); page_cache = page->priv->page_cache; - g_signal_emit (action, signals[ACTIVATE_LABEL], 0, text, &changed); - - if (changed) - return; - /* Check whether it's a valid page number */ - page_number = atoi (text) - 1; - if (page_number >= 0 && - page_number < ev_page_cache_get_n_pages (page_cache)) { - page_label = ev_page_cache_get_page_label (page_cache, page_number); - gtk_entry_set_text (GTK_ENTRY (entry), page_label); - gtk_editable_set_position (GTK_EDITABLE (entry), -1); - - g_signal_emit (action, signals[ACTIVATE_LABEL], 0, page_label, &changed); - g_free (page_label); - - return; - } + link_dest = ev_link_dest_new_page_label (text); + link_action = ev_link_action_new_dest (link_dest); + link = ev_link_new (text, link_action); + + g_signal_emit (action, signals[ACTIVATE_LINK], 0, link); + + g_object_unref (link); /* rest the entry to the current page if we were unable to * change it */ @@ -382,14 +373,6 @@ ev_page_action_class_init (EvPageActionClass *class) g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); - signals[ACTIVATE_LABEL] = g_signal_new ("activate_label", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (EvPageActionClass, activate_label), - NULL, NULL, - ev_marshal_BOOLEAN__STRING, - G_TYPE_BOOLEAN, 1, - G_TYPE_STRING); g_object_class_install_property (object_class, PROP_PAGE_CACHE, diff --git a/shell/ev-page-action.h b/shell/ev-page-action.h index 2908d345..c9785c65 100644 --- a/shell/ev-page-action.h +++ b/shell/ev-page-action.h @@ -52,8 +52,6 @@ struct _EvPageActionClass void (* activate_link) (EvPageAction *page_action, EvLink *link); - gboolean (*activate_label) (EvPageAction *page_action, - const gchar *label); }; GType ev_page_action_get_type (void); diff --git a/shell/ev-page-cache.c b/shell/ev-page-cache.c index 7c192323..c1af7d22 100644 --- a/shell/ev-page-cache.c +++ b/shell/ev-page-cache.c @@ -353,8 +353,7 @@ ev_page_cache_set_page_label (EvPageCache *page_cache, /* convert from a page label to a page offset */ page --; if (page >= 0 && - page < page_cache->n_pages && - page_cache->page_labels[page] == NULL) { + page < page_cache->n_pages) { ev_page_cache_set_current_page (page_cache, page); return TRUE; } diff --git a/shell/ev-window.c b/shell/ev-window.c index 832ce459..f14bd31e 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -4030,16 +4030,6 @@ activate_link_cb (EvPageAction *page_action, EvLink *link, EvWindow *window) gtk_widget_grab_focus (window->priv->view); } -static gboolean -activate_label_cb (EvPageAction *page_action, const gchar *label, EvWindow *window) -{ - g_return_val_if_fail (EV_IS_WINDOW (window), FALSE); - - gtk_widget_grab_focus (window->priv->view); - - return ev_page_cache_set_page_label (window->priv->page_cache, label); -} - static void register_custom_actions (EvWindow *window, GtkActionGroup *group) { @@ -4053,8 +4043,6 @@ register_custom_actions (EvWindow *window, GtkActionGroup *group) NULL); g_signal_connect (action, "activate_link", G_CALLBACK (activate_link_cb), window); - g_signal_connect (action, "activate_label", - G_CALLBACK (activate_label_cb), window); gtk_action_group_add_action (group, action); g_object_unref (action);