- if (value != page->priv->current_page)
- {
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin),
- page->priv->current_page);
+ entry = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "entry"));
+ update_entry (page_action, entry);
+}
+
+static void
+activate_cb (GtkWidget *entry, GtkAction *action)
+{
+ EvPageAction *page_action = EV_PAGE_ACTION (action);
+ const char *text;
+ char *endptr;
+ int page = -1;
+
+ text = gtk_entry_get_text (GTK_ENTRY (entry));
+ if (text) {
+ long value;
+
+ value = strtol (text, &endptr, 10);
+ if (endptr[0] == '\0') {
+ /* Page number is an integer */
+ page = MIN (G_MAXINT, value);
+ }
+ }
+
+ if (page > 0 && page <= page_action->priv->total_pages) {
+ g_signal_emit (action, signals[GOTO_PAGE_SIGNAL], 0, page);
+ } else {
+ update_entry (page_action, entry);