]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-window.c
Move view drag and drop stuff to ev-view.
[evince.git] / shell / ev-window.c
index 9eac43f9b0f7862260b8781a9a406cd408145d5e..ec979874bdba626c640959973a1e75d2e7f18358 100644 (file)
@@ -188,11 +188,6 @@ struct _EvWindowPrivate {
 #endif
 };
 
-static const GtkTargetEntry ev_drop_types[] = {
-       { "text/uri-list", 0, 0 }
-};
-
-
 #define EV_WINDOW_GET_PRIVATE(object) \
        (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_WINDOW, EvWindowPrivate))
 
@@ -3864,35 +3859,6 @@ static const GtkActionEntry attachment_popup_entries [] = {
          NULL, G_CALLBACK (ev_attachment_popup_cmd_save_attachment_as) },
 };
 
-static void
-drag_data_received_cb (GtkWidget *widget, GdkDragContext *context,
-                      gint x, gint y, GtkSelectionData *selection_data,
-                      guint info, guint time, gpointer gdata)
-{
-       GList  *uri_list = NULL;
-       GSList *uris = NULL;
-       gchar  *uri;
-
-       uri_list = gnome_vfs_uri_list_parse ((gchar *) selection_data->data);
-
-       if (uri_list) {
-               while (uri_list) {
-                       uri = gnome_vfs_uri_to_string (uri_list->data, GNOME_VFS_URI_HIDE_NONE);
-                       uris = g_slist_append (uris, (gpointer) uri);
-                       
-                       uri_list = g_list_next (uri_list);
-               }
-
-               gnome_vfs_uri_list_free (uri_list);
-               
-               ev_application_open_uri_list (EV_APP, uris,
-                                             gtk_widget_get_screen (widget),
-                                             0);
-               
-               g_slist_free (uris);
-       }
-}
-
 static void
 activate_link_cb (EvPageAction *page_action, EvLink *link, EvWindow *window)
 {
@@ -4148,14 +4114,7 @@ launch_action (EvWindow *window, EvLinkAction *action)
 static void
 launch_external_uri (EvWindow *window, EvLinkAction *action)
 {
-       const char *uri;
-       char *escaped;
-
-       uri = ev_link_action_get_uri (action);
-       escaped = gnome_vfs_escape_host_and_path_string (uri);
-
-       gnome_vfs_url_show (escaped);
-       g_free (escaped);
+       gnome_vfs_url_show (ev_link_action_get_uri (action));
 }
 
 static void
@@ -4676,19 +4635,7 @@ ev_window_init (EvWindow *ev_window)
        /* Give focus to the document view */
        gtk_widget_grab_focus (ev_window->priv->view);
 
-       /* Drag and Drop */
-       gtk_drag_dest_unset (GTK_WIDGET (ev_window->priv->view));
-       gtk_drag_dest_set (GTK_WIDGET (ev_window->priv->view),
-                          GTK_DEST_DEFAULT_ALL,
-                          ev_drop_types,
-                          sizeof (ev_drop_types) / sizeof (ev_drop_types[0]),
-                          GDK_ACTION_COPY);
-       g_signal_connect_swapped (G_OBJECT (ev_window->priv->view), "drag-data-received",
-                                 G_CALLBACK (drag_data_received_cb),
-                                 ev_window);
-
        /* Set it user interface params */
-
        ev_window_setup_recent (ev_window);
 
        setup_chrome_from_metadata (ev_window);