[gnome-disk-utility/udisks2-port] Don't show error dialogs if polkit auth dialog was dismissed



commit 309cfa2a822820c4f2462e6725ba5bd600990a7d
Author: David Zeuthen <davidz redhat com>
Date:   Fri Mar 18 15:23:35 2011 -0400

    Don't show error dialogs if polkit auth dialog was dismissed
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 src/palimpsest/gduwindow.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index a7e15aa..f0f8149 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -1141,6 +1141,13 @@ gdu_window_show_error (GduWindow   *window,
   GtkWidget *dialog;
   GError *error;
 
+  /* Never show an error if it's because the user dismissed the
+   * authentication dialog himself
+   */
+  if (orig_error->domain == UDISKS_ERROR &&
+      orig_error->code == UDISKS_ERROR_NOT_AUTHORIZED_DISMISSED)
+    goto no_dialog;
+
   error = g_error_copy (orig_error);
   if (g_dbus_error_is_remote_error (error))
     g_dbus_error_strip_remote_error (error);
@@ -1157,6 +1164,9 @@ gdu_window_show_error (GduWindow   *window,
   g_error_free (error);
   gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_destroy (dialog);
+
+ no_dialog:
+  ;
 }
 
 /* ---------------------------------------------------------------------------------------------------- */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]