X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-page-action.c;h=2eed3763f13b01b731f08613ad9f1a32156d5c1a;hb=5112457d6c321bde178c3577eb37bd0ee62bc209;hp=57b9bfceb886b3a1002c753b51ba083fbc0c8977;hpb=d58f069362465e0bd50814853b86ab5341beba79;p=evince.git diff --git a/shell/ev-page-action.c b/shell/ev-page-action.c index 57b9bfce..2eed3763 100644 --- a/shell/ev-page-action.c +++ b/shell/ev-page-action.c @@ -132,7 +132,7 @@ update_pages_label (EvPageActionWidget *proxy, gint n_pages; n_pages = page_cache ? ev_page_cache_get_n_pages (page_cache) : 0; - if (ev_page_cache_has_nonnumeric_page_labels (page_cache)) { + if (page_cache && ev_page_cache_has_nonnumeric_page_labels (page_cache)) { label_text = g_strdup_printf (_("(%d of %d)"), page + 1, n_pages); } else { label_text = g_strdup_printf (_("of %d"), n_pages); @@ -429,6 +429,8 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) g_signal_connect_object (action, "notify::page-cache", G_CALLBACK (update_page_cache), proxy, 0); + update_page_cache (EV_PAGE_ACTION (action), NULL, + EV_PAGE_ACTION_WIDGET (proxy)); /* We only go through this whole rigmarole if we can set * GtkEntryCompletion::popup-set-width, which appeared in * GTK+-2.7.0 */ @@ -534,6 +536,20 @@ ev_page_action_set_model (EvPageAction *page_action, NULL); } +void +ev_page_action_grab_focus (EvPageAction *page_action) +{ + GSList *proxies; + + proxies = gtk_action_get_proxies (GTK_ACTION (page_action)); + for (; proxies != NULL; proxies = proxies->next) { + EvPageActionWidget *proxy; + + proxy = EV_PAGE_ACTION_WIDGET (proxies->data); + gtk_widget_grab_focus (proxy->entry); + } +} + static void ev_page_action_init (EvPageAction *page) {