Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-window.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2005-05-11 09:42:22 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-05-11 09:42:22 (GMT)
commit39d906d93b5e9e0929fec8d3ef322f9597adee78 (patch)
tree4d456abb8d9d7733540452276d35d4f7ffa8734e /shell/ev-window.c
parentf0f15671240dd6e99f22e91386bd384246f2d4cd (diff)
Use signals to notify action activation. Hopefully I did not break
2005-05-11 Marco Pesenti Gritti <mpg@redhat.com> * shell/ev-marshal.list: * shell/ev-page-action.c: (ev_page_action_widget_class_init), (activate_cb), (match_selected_cb), (activate_link_cb), (connect_proxy), (ev_page_action_class_init): * shell/ev-page-action.h: Use signals to notify action activation. Hopefully I did not break completion since I cant test... * shell/ev-window.c: (activate_link_cb), (activate_label_cb), (register_custom_actions): Connect to page selector actions and also grab focus on the view when activated.
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 2475de0..fc1f0ca 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -2437,6 +2437,25 @@ drag_data_received_cb (GtkWidget *widget, GdkDragContext *context,
}
static void
+activate_link_cb (EvPageAction *page_action, EvLink *link, EvWindow *window)
+{
+ g_return_if_fail (EV_IS_WINDOW (window));
+
+ ev_page_cache_set_link (window->priv->page_cache, link);
+ gtk_widget_grab_focus (window->priv->view);
+}
+
+static gboolean
+activate_label_cb (EvPageAction *page_action, char *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)
{
GtkAction *action;
@@ -2447,6 +2466,10 @@ register_custom_actions (EvWindow *window, GtkActionGroup *group)
"tooltip", _("Select Page"),
"visible_overflown", FALSE,
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);