Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2008-11-01 14:09:56 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2008-11-01 14:09:56 (GMT)
commit125b3ea4d310be1c0a32dae8a8778f5438f15758 (patch)
tree23a497f2e80c9fdf324d2c01395672e570f7671b
parent48a0bd5006c898d8fc4f014509592974539169f0 (diff)
Do not use popup dialogs to show error messages anymore, use the message
2008-11-01 Carlos Garcia Campos <carlosgc@gnome.org> * 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
-rw-r--r--ChangeLog9
-rw-r--r--shell/ev-window.c71
2 files changed, 26 insertions, 54 deletions
diff --git a/ChangeLog b/ChangeLog
index a22566f..a3361ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2008-11-01 Carlos Garcia Campos <carlosgc@gnome.org>
+ * 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 <carlosgc@gnome.org>
+
* shell/ev-window.c: (ev_window_error_message),
(ev_window_warning_message), (ev_window_set_document),
(ev_window_load_job_cb), (ev_window_load_remote_failed),
diff --git a/shell/ev-window.c b/shell/ev-window.c
index d386b76..6e0c76e 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);
}