</menubar>
<popup name="DocumentPopup" action="PopupAction">
+ <menuitem name="OpenLink" action="OpenLink"/>
+ <menuitem name="CopyLinkAddress" action="CopyLinkAddress"/>
+ <menuitem name="GoLink" action="GoLink"/>
+ <separator/>
<menuitem name="GoPreviousPage" action="GoPreviousPage"/>
<menuitem name="GoNextPage" action="GoNextPage"/>
<menuitem name="ViewReload" action="ViewReload"/>
<menuitem name="EditSelectAllPopup" action="EditSelectAll"/>
</popup>
- <popup name="ExternalLinkPopup" action="PopupAction">
- <menuitem name="OpenLink" action="OpenLink"/>
- <menuitem name="CopyLinkAddress" action="CopyLinkAddress"/>
- </popup>
-
<accelerator name="PageDownAccel" action="PageDown"/>
<accelerator name="PageUpAccel" action="PageUp"/>
<accelerator name="GoBackwardFastAccel" action="GoBackwardFast"/>
/* Popup link */
GtkWidget *popup;
- GtkWidget *link_popup;
EvLink *link;
/* Document */
EvWindow *ev_window)
{
GtkWidget *popup;
+ gboolean show_external = FALSE;
+ gboolean show_internal = FALSE;
+ GtkAction *action;
if (ev_window->priv->link)
g_object_unref (ev_window->priv->link);
else
ev_window->priv->link = NULL;
- if (ev_window->priv->link &&
- (ev_link_get_link_type (ev_window->priv->link) == EV_LINK_TYPE_EXTERNAL_URI)) {
- popup = ev_window->priv->link_popup;
- } else {
- popup = ev_window->priv->popup;
- }
+ popup = ev_window->priv->popup;
+
+ if (ev_window->priv->link)
+ switch (ev_link_get_link_type (ev_window->priv->link)) {
+ case EV_LINK_TYPE_PAGE:
+ case EV_LINK_TYPE_PAGE_FIT:
+ case EV_LINK_TYPE_PAGE_FITH:
+ case EV_LINK_TYPE_PAGE_FITV:
+ case EV_LINK_TYPE_PAGE_FITR:
+ case EV_LINK_TYPE_PAGE_XYZ:
+ show_internal = TRUE;
+ break;
+ case EV_LINK_TYPE_EXTERNAL_URI:
+ case EV_LINK_TYPE_LAUNCH:
+ show_external = TRUE;
+ break;
+ default:
+ break;
+ }
+
+ action = gtk_action_group_get_action (ev_window->priv->popups_action_group,
+ "OpenLink");
+ gtk_action_set_visible (action, show_external);
+
+ action = gtk_action_group_get_action (ev_window->priv->popups_action_group,
+ "CopyLinkAddress");
+ gtk_action_set_visible (action, show_external);
+
+ action = gtk_action_group_get_action (ev_window->priv->popups_action_group,
+ "GoLink");
+ gtk_action_set_visible (action, show_internal);
gtk_menu_popup (GTK_MENU (popup), NULL, NULL,
NULL, NULL,
/* Links */
{ "OpenLink", GTK_STOCK_OPEN, N_("_Open Link"), NULL,
NULL, G_CALLBACK (ev_popup_cmd_open_link) },
+ { "GoLink", GTK_STOCK_GO_FORWARD, N_("_Go To"), NULL,
+ NULL, G_CALLBACK (ev_popup_cmd_open_link) },
{ "CopyLinkAddress", NULL, N_("_Copy Link Address"), NULL,
NULL,
G_CALLBACK (ev_popup_cmd_copy_link_address) },
static void
ev_popup_cmd_open_link (GtkAction *action, EvWindow *window)
{
- launch_external_uri (window, window->priv->link);
+ ev_view_goto_link (EV_VIEW (window->priv->view), window->priv->link);
}
static void
ev_window);
/* Popups */
- ev_window->priv->link_popup = gtk_ui_manager_get_widget (ev_window->priv->ui_manager,
- "/ExternalLinkPopup");
ev_window->priv->popup = gtk_ui_manager_get_widget (ev_window->priv->ui_manager,
"/DocumentPopup");
ev_window->priv->link = NULL;