]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-view.c
Updated Translation
[evince.git] / shell / ev-view.c
index 0380e226f4aab36719cfc1d41730fd5bec2f6ef6..524a8d0b0a418c2b25b4144ef285d6d1422bc104 100644 (file)
@@ -438,7 +438,7 @@ view_update_range_and_current_page (EvView *view)
                GdkRectangle current_area, unused, page_area;
                GtkBorder border;
                gboolean found = FALSE;
-               gint area_max, area;
+               gint area_max = -1, area;
                int i;
 
                if (!(view->vadjustment && view->hadjustment))
@@ -1289,6 +1289,7 @@ ev_view_handle_link (EvView *view, EvLink *link)
                case EV_LINK_ACTION_TYPE_GOTO_REMOTE:
                case EV_LINK_ACTION_TYPE_EXTERNAL_URI:
                case EV_LINK_ACTION_TYPE_LAUNCH:
+               case EV_LINK_ACTION_TYPE_NAMED:
                        g_signal_emit (view, signals[SIGNAL_EXTERNAL_LINK], 0, action);
                        break;
        }
@@ -1326,6 +1327,28 @@ page_label_from_dest (EvView *view, EvLinkDest *dest)
        return msg;
 }
 
+static char *
+tip_from_action_named (EvLinkAction *action)
+{
+       const gchar *name = ev_link_action_get_name (action);
+       
+       if (g_ascii_strcasecmp (name, "FirstPage") == 0) {
+               return g_strdup (_("Go to first page"));
+       } else if (g_ascii_strcasecmp (name, "PrevPage") == 0) {
+               return g_strdup (_("Go to previous page"));
+       } else if (g_ascii_strcasecmp (name, "NextPage") == 0) {
+               return g_strdup (_("Go to next page"));
+       } else if (g_ascii_strcasecmp (name, "LastPage") == 0) {
+               return g_strdup (_("Go to last page"));
+       } else if (g_ascii_strcasecmp (name, "GoToPage") == 0) {
+               return g_strdup (_("Go to page"));
+       } else if (g_ascii_strcasecmp (name, "Find") == 0) {
+               return g_strdup (_("Find"));
+       }
+       
+       return NULL;
+}
+
 static char *
 tip_from_link (EvView *view, EvLink *link)
 {
@@ -1367,6 +1390,9 @@ tip_from_link (EvView *view, EvLink *link)
                        msg = g_strdup_printf (_("Launch %s"),
                                               ev_link_action_get_filename (action));
                        break;
+               case EV_LINK_ACTION_TYPE_NAMED:
+                       msg = tip_from_action_named (action);
+                       break;
                default:
                        if (title)
                                msg = g_strdup (title);
@@ -4098,6 +4124,9 @@ ev_view_next_page (EvView *view)
        int page;
 
        g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
+       
+       if (!view->page_cache)
+               return FALSE;
 
        page = ev_page_cache_get_current_page (view->page_cache);
 
@@ -4124,6 +4153,9 @@ ev_view_previous_page (EvView *view)
 
        g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
 
+       if (!view->page_cache)
+               return FALSE;
+
        page = ev_page_cache_get_current_page (view->page_cache);
 
        if (view->dual_page && !view->presentation)