]> www.fi.muni.cz Git - evince.git/commitdiff
Remove activate_link signal, not required.
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>
Sun, 28 Jan 2007 11:17:00 +0000 (11:17 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sun, 28 Jan 2007 11:17:00 +0000 (11:17 +0000)
2007-01-28  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>

* 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

ChangeLog
shell/ev-marshal.list
shell/ev-page-action.c
shell/ev-page-action.h
shell/ev-page-cache.c
shell/ev-window.c

index 0fd8b82451281a49f474ec86479c35f2ac7858f9..582bc6d3c66ebf0d6c98f2446f9cfe73dcbaa950 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-01-28  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * 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  <nshmyrev@yandex.ru>
 
        * shell/ev-navigation-action.c: (build_menu):
index 44b8bcbb16f35319525ef1c26a387a36a37f91da..c2a026bf2dd58e05e4386f63aeef73611d36e0bb 100644 (file)
@@ -1,4 +1,3 @@
 VOID:NONE
 VOID:OBJECT,OBJECT
 VOID:ENUM,BOOLEAN
-BOOLEAN:STRING
index 7c28edc9a8c7ec9a4679b00208b46a41e5f83ed2..744729d789cacd03c24b0742c40a20e5d994e65c 100644 (file)
@@ -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,
index 2908d3456dd9d97c8f47a777f83e6007531c494a..c9785c655b30e974a85ad58ca42ea556ea690500 100644 (file)
@@ -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);
index 7c192323fe39e93c858fbc0aa97aec4b8e085a0d..c1af7d228efe52684030bd00aafeb9bde7af1fca 100644 (file)
@@ -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;
                }
index 832ce45963972a72ff0f1945e499fc50f5c2c975..f14bd31e920f897d79a22c11a0e94695e957faeb 100644 (file)
@@ -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);