[gnome-sudoku/mcatanzaro/composite-templates: 2/2] Remove use of gtk_dialog_run()




commit 107af0e324bf36a7b8cfba6d9f3dd88eac6433c2
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Dec 26 14:03:39 2020 -0600

    Remove use of gtk_dialog_run()
    
    This function is gone in GTK 4.

 src/gnome-sudoku.vala | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index 5b0ed27d..bba966c8 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -225,8 +225,8 @@ public class Sudoku : Gtk.Application
             var error_str = "%s\n%s".printf(_("The puzzle you have entered is not a valid Sudoku."), 
_("Please enter a valid puzzle."));
             var dialog = new MessageDialog (window, DialogFlags.MODAL, MessageType.ERROR, ButtonsType.OK, 
error_str);
 
-            dialog.run ();
-            dialog.destroy ();
+            dialog.response.connect (() => dialog.destroy ());
+            dialog.show ();
         }
         else
         {
@@ -451,11 +451,13 @@ public class Sudoku : Gtk.Application
         print_action.set_enabled (false);
         print_multiple_action.set_enabled (false);
         var print_dialog = new PrintDialog (saver, window);
-        print_dialog.destroy.connect (() => {
+        print_dialog.response.connect (() => {
             this.print_action.set_enabled (window.is_board_visible ());
             this.print_multiple_action.set_enabled (true);
+            // Do not destroy the PrintDialog. It will take some time to
+            // generate puzzles, then destroy itself when finished.
         });
-        print_dialog.run ();
+        print_dialog.show ();
     }
 
     private void help_cb ()


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