[gtk+/wip/tingping/remove-dialog-run: 4/6] gtkmountoperation: Remove gtk_dialog_run() usage



commit 14c45dbf107033941fa82eeb16fe0724fd2fc91e
Author: Patrick Griffis <tingping tingping se>
Date:   Fri Jun 2 15:37:32 2017 -0400

    gtkmountoperation: Remove gtk_dialog_run() usage

 gtk/gtkmountoperation.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 2f5189d..da4c159 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -1250,7 +1250,6 @@ on_end_process_activated (GtkMenuItem *item,
   if (!_gtk_mount_operation_kill_process (pid_to_kill, &error))
     {
       GtkWidget *dialog;
-      gint response;
 
       /* Use GTK_DIALOG_DESTROY_WITH_PARENT here since the parent dialog can be
        * indeed be destroyed via the GMountOperation::abort signal... for example,
@@ -1266,16 +1265,8 @@ on_end_process_activated (GtkMenuItem *item,
                                                 "%s",
                                                 error->message);
 
+      g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
       gtk_widget_show (dialog);
-      response = gtk_dialog_run (GTK_DIALOG (dialog));
-
-      /* GTK_RESPONSE_NONE means the dialog were programmatically destroy, e.g. that
-       * GTK_DIALOG_DESTROY_WITH_PARENT kicked in - so it would trigger a warning to
-       * destroy the dialog in that case
-       */
-      if (response != GTK_RESPONSE_NONE)
-        gtk_widget_destroy (dialog);
-
       g_error_free (error);
     }
 


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