~ubuntu-branches/ubuntu/precise/evince/precise-updates

« back to all changes in this revision

Viewing changes to shell/ev-window.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-02-07 14:04:54 UTC
  • mfrom: (1.1.72)
  • Revision ID: package-import@ubuntu.com-20120207140454-akr5g5z4y4qopea8
Tags: 3.3.5-0ubuntu1
* New upstream release.
  * Add --named-dest command line argument
  * Fix a crash when dropping an item to the toolbar (LP: #799255)
  * Fix page index argument when command is spawned
  * Use t1 font mapping files in dvi backend
  * Fix several memory leaks in comics backend

Show diffs side-by-side

added added

removed removed

Lines of Context:
368
368
 
369
369
static guint ev_window_n_copies = 0;
370
370
 
 
371
static gchar *nautilus_sendto = NULL;
 
372
 
371
373
G_DEFINE_TYPE (EvWindow, ev_window, GTK_TYPE_WINDOW)
372
374
 
373
375
static gdouble
458
460
        ev_window_set_action_sensitive (ev_window, "FilePrint", has_pages && ok_to_print);
459
461
        ev_window_set_action_sensitive (ev_window, "FileProperties", has_document && has_properties);
460
462
        ev_window_set_action_sensitive (ev_window, "FileOpenContainingFolder", has_document);
 
463
        ev_window_set_action_sensitive (ev_window, "FileSendTo", has_document);
461
464
 
462
465
        /* Edit menu */
463
466
        ev_window_set_action_sensitive (ev_window, "EditSelectAll", has_pages && can_get_text);
2926
2929
}
2927
2930
 
2928
2931
static void
 
2932
ev_window_cmd_send_to (GtkAction *action,
 
2933
                       EvWindow  *ev_window)
 
2934
{
 
2935
        GAppInfo   *app_info;
 
2936
        gchar      *command;
 
2937
        const char *uri;
 
2938
        GError     *error = NULL;
 
2939
 
 
2940
        uri = ev_window->priv->local_uri ? ev_window->priv->local_uri : ev_window->priv->uri;
 
2941
        command = g_strdup_printf ("%s %s", nautilus_sendto, uri);
 
2942
        app_info = g_app_info_create_from_commandline (command, NULL, 0, &error);
 
2943
        if (app_info) {
 
2944
                GdkAppLaunchContext *context;
 
2945
                GdkScreen           *screen;
 
2946
 
 
2947
                screen = gtk_window_get_screen (GTK_WINDOW (ev_window));
 
2948
                context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
 
2949
                gdk_app_launch_context_set_screen (context, screen);
 
2950
                gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
 
2951
                g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (context), &error);
 
2952
                g_object_unref (context);
 
2953
 
 
2954
                g_object_unref (app_info);
 
2955
        }
 
2956
        g_free (command);
 
2957
 
 
2958
        if (error) {
 
2959
                ev_window_error_message (ev_window, error, "%s",
 
2960
                                         _("Could not send current document"));
 
2961
                g_error_free (error);
 
2962
        }
 
2963
}
 
2964
 
 
2965
static void
2929
2966
ev_window_cmd_open_containing_folder (GtkAction *action, EvWindow *ev_window)
2930
2967
{
2931
2968
        GtkWidget *ev_window_widget;
5674
5711
        widget_class->window_state_event = ev_window_state_event;
5675
5712
        widget_class->drag_data_received = ev_window_drag_data_received;
5676
5713
 
 
5714
        nautilus_sendto = g_find_program_in_path ("nautilus-sendto");
 
5715
 
5677
5716
        g_type_class_add_private (g_object_class, sizeof (EvWindowPrivate));
5678
5717
}
5679
5718
 
5696
5735
        { "FileSaveAs", GTK_STOCK_SAVE_AS, N_("_Save a Copy…"), "<control>S",
5697
5736
          N_("Save a copy of the current document"),
5698
5737
          G_CALLBACK (ev_window_cmd_save_as) },
 
5738
        { "FileSendTo", EV_STOCK_SEND_TO, N_("Send _To..."), NULL,
 
5739
          N_("Send current document by mail, instant message..."),
 
5740
          G_CALLBACK (ev_window_cmd_send_to) },
5699
5741
        { "FileOpenContainingFolder", GTK_STOCK_DIRECTORY, N_("Open Containing _Folder"), NULL,
5700
5742
          N_("Show the folder which contains this file in the file manager"),
5701
5743
          G_CALLBACK (ev_window_cmd_open_containing_folder) },
6032
6074
        /*translators: this is the label for toolbar button*/
6033
6075
        g_object_set (action, "short_label", _("Open Folder"), NULL);
6034
6076
 
 
6077
        action = gtk_action_group_get_action (action_group, "FileSendTo");
 
6078
        /*translators: this is the label for toolbar button*/
 
6079
        g_object_set (action, "short_label", _("Send To"), NULL);
 
6080
        gtk_action_set_visible (action, nautilus_sendto != NULL);
 
6081
 
6035
6082
        action = gtk_action_group_get_action (action_group, "GoPreviousPage");
6036
6083
        g_object_set (action, "is-important", TRUE, NULL);
6037
6084
        /*translators: this is the label for toolbar button*/