+ EvDocument *document = g_object_new (PDF_TYPE_DOCUMENT, NULL);
+ GError *error = NULL;
+
+ if (ev_document_load (document, uri, &error)) {
+ if (ev_window->priv->document)
+ g_object_unref (ev_window->priv->document);
+ ev_window->priv->document = document;
+
+ } else {
+ GtkWidget *dialog;
+
+ g_object_unref (document);
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (ev_window),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ _("Unable to open document"));
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ "%s", error->message);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ g_error_free (error);
+ }
+