From: Carlos Garcia Campos Date: Sat, 1 Nov 2008 14:09:56 +0000 (+0000) Subject: Do not use popup dialogs to show error messages anymore, use the message X-Git-Tag: EVINCE_2_25_1~10 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=125b3ea4d310be1c0a32dae8a8778f5438f15758;p=evince.git Do not use popup dialogs to show error messages anymore, use the message 2008-11-01 Carlos Garcia Campos * shell/ev-window.c: (window_save_file_copy_ready_cb), (ev_window_print_finished), (ev_window_print_dialog_response_cb), (ev_window_preview_print_finished), (launch_action): Do not use popup dialogs to show error messages anymore, use the message area instead. svn path=/trunk/; revision=3246 --- diff --git a/ChangeLog b/ChangeLog index a22566f6..a3361ae1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-11-01 Carlos Garcia Campos + + * shell/ev-window.c: (window_save_file_copy_ready_cb), + (ev_window_print_finished), (ev_window_print_dialog_response_cb), + (ev_window_preview_print_finished), (launch_action): + + Do not use popup dialogs to show error messages anymore, use the + message area instead. + 2008-11-01 Carlos Garcia Campos * shell/ev-window.c: (ev_window_error_message), diff --git a/shell/ev-window.c b/shell/ev-window.c index d386b763..6e0c76eb 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -2032,7 +2032,6 @@ window_save_file_copy_ready_cb (GFile *src, GFile *dst) { EvWindow *window; - GtkWidget *dialog; gchar *name; GError *error = NULL; @@ -2041,22 +2040,12 @@ window_save_file_copy_ready_cb (GFile *src, return; } - window = g_object_get_data (G_OBJECT (dst), "ev-window"); + window = EV_WINDOW (g_object_get_data (G_OBJECT (dst), "ev-window")); name = g_file_get_basename (dst); - dialog = gtk_message_dialog_new (GTK_WINDOW (window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("The file could not be saved as “%s”."), - name); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - "%s", error->message); - g_signal_connect (dialog, "response", - G_CALLBACK (gtk_widget_destroy), - NULL); - gtk_widget_show (dialog); + ev_window_error_message (window, error, + _("The file could not be saved as “%s”."), + name); ev_tmp_file_unlink (src); - g_free (name); g_error_free (error); } @@ -2254,18 +2243,8 @@ ev_window_print_finished (GtkPrintJob *print_job, ev_window_clear_print_job (window); if (error) { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (GTK_WINDOW (window), - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Failed to print document")); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - "%s", error->message); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); + ev_window_error_message (window, error, + "%s", _("Failed to print document")); } else { /* If printed successfully, save print settings */ ev_application_set_print_settings (EV_APP, @@ -2418,17 +2397,8 @@ ev_window_print_dialog_response_cb (GtkDialog *dialog, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT); if (!gtk_printer_accepts_ps (window->priv->printer)) { - GtkWidget *msgdialog; - - msgdialog = gtk_message_dialog_new (GTK_WINDOW (dialog), - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Printing is not supported on this printer.")); - - gtk_dialog_run (GTK_DIALOG (msgdialog)); - gtk_widget_destroy (msgdialog); - + ev_window_error_message (window, NULL, "%s", + _("Printing is not supported on this printer.")); return FALSE; } @@ -3440,18 +3410,8 @@ ev_window_preview_print_finished (GtkPrintJob *print_job, GError *error) { if (error) { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (GTK_WINDOW (window), - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Failed to print document")); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - "%s", error->message); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); + ev_window_error_message (window, error, + "%s", _("Failed to print document")); } g_object_unref (print_job); @@ -4880,9 +4840,11 @@ launch_action (EvWindow *window, EvLinkAction *action) app_info = g_file_query_default_handler (file, NULL, &error); if (!app_info) { - /* FIXME: use ev_window_error_message */ - g_warning ("%s", error->message); + ev_window_error_message (window, error, + "%s", + _("Unable to launch external application.")); g_object_unref (file); + g_error_free (error); return; } @@ -4896,8 +4858,9 @@ launch_action (EvWindow *window, EvLinkAction *action) file_list.data = file; if (!g_app_info_launch (app_info, &file_list, context, &error)) { - /* FIXME: use ev_window_error_message */ - g_warning ("%s", error->message); + ev_window_error_message (window, error, + "%s", + _("Unable to launch external application.")); g_error_free (error); }