diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2006-05-04 08:24:19 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2006-05-04 08:24:19 (GMT) |
commit | fdf6ceaeede339118ddc2d389ba60be8e3bae9c1 (patch) | |
tree | c9fd3fa8641dc887248dae7e75c3a2f4cdebce00 /shell/ev-view.c | |
parent | cbb0117c2cd79100c000ab0cb85ddde421478280 (diff) |
Add support for Named Action links
2006-05-03 Carlos Garcia Campos <carlosgc@gnome.org>
* backend/ev-link-action.[ch]:
* pdf/ev-poppler.cc: (ev_link_from_action):
* shell/ev-view-private.h:
* shell/ev-view.c: (ev_view_handle_link), (tip_from_action_named):
* shell/ev-window.c: (do_action_named), (view_external_link_cb):
Add support for Named Action links
Diffstat (limited to 'shell/ev-view.c')
-rw-r--r-- | shell/ev-view.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c index 0380e22..e3f07dc 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -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; } @@ -1327,6 +1328,28 @@ page_label_from_dest (EvView *view, EvLinkDest *dest) } 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 (_("Got to fisrt page")); + } else if (g_ascii_strcasecmp (name, "PrevPage") == 0) { + return g_strdup (_("Got to previuos page")); + } else if (g_ascii_strcasecmp (name, "NextPage") == 0) { + return g_strdup (_("Got to next page")); + } else if (g_ascii_strcasecmp (name, "LastPage") == 0) { + return g_strdup (_("Got to last page")); + } else if (g_ascii_strcasecmp (name, "GoToPage") == 0) { + return g_strdup (_("Got 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) { EvLinkAction *action; @@ -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); |