[gnome-contacts] app: Don't use lambda's for dialog.destroy()



commit 2d172d3a9b5136dee8fa0fc54dc184ae9a443ee0
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Fri Jun 5 17:42:33 2020 +0200

    app: Don't use lambda's for dialog.destroy()
    
    Just use `dialog.run()`

 src/contacts-app.vala | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index 909b6f5..b71f3a0 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -100,11 +100,9 @@ public class Contacts.App : Gtk.Application {
       var dialog = new Gtk.MessageDialog (this.window, Gtk.DialogFlags.DESTROY_WITH_PARENT,
                                           Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE,
                                           _("No contact with id %s found"), id);
-      dialog.set_title(_("Contact not found"));
-      dialog.show ();
-      dialog.response.connect ( (id) => {
-          dialog.destroy ();
-        });
+      dialog.set_title (_("Contact not found"));
+      dialog.run ();
+      dialog.destroy ();
     }
   }
 
@@ -182,11 +180,9 @@ public class Contacts.App : Gtk.Application {
       var dialog = new Gtk.MessageDialog (this.window, Gtk.DialogFlags.DESTROY_WITH_PARENT,
                                           Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE,
                                           _("No contact with email address %s found"), email_address);
-      dialog.set_title(_("Contact not found"));
-      dialog.show ();
-      dialog.response.connect ( (id) => {
-          dialog.destroy ();
-        });
+      dialog.set_title (_("Contact not found"));
+      dialog.run ();
+      dialog.destroy ();
     }
   }
 


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