[gnome-sudoku/arnaudb/wip/gtk4: 41/47] Adapt to Dialog API.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sudoku/arnaudb/wip/gtk4: 41/47] Adapt to Dialog API.
- Date: Wed, 23 Sep 2020 16:36:39 +0000 (UTC)
commit 388a9568cfe92960fc90d92b67fe54bd2d50acb4
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed Aug 5 19:29:19 2020 +0200
Adapt to Dialog API.
src/gnome-sudoku.vala | 9 +++++----
src/sudoku-printer.vala | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index 6eb11fd..ac22c09 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -301,8 +301,7 @@ 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.present ();
}
else
{
@@ -593,11 +592,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.close_request.connect (() => {
this.print_action.set_enabled (main_stack.get_visible_child_name () == "frame");
this.print_multiple_action.set_enabled (true);
+
+ return /* do your usual stuff */ false;
});
- print_dialog.run ();
+ print_dialog.present ();
}
private void help_cb ()
diff --git a/src/sudoku-printer.vala b/src/sudoku-printer.vala
index 7b5fcbf..7795ef4 100644
--- a/src/sudoku-printer.vala
+++ b/src/sudoku-printer.vala
@@ -44,7 +44,7 @@ public class SudokuPrinter : GLib.Object {
new MessageDialog (window, DialogFlags.MODAL,
MessageType.ERROR, ButtonsType.CLOSE,
/* Error message if printing fails */
- "%s\n%s".printf (_("Error printing file:"), e.message)).run ();
+ "%s\n%s".printf (_("Error printing file:"), e.message)).present ();
}
return PrintOperationResult.ERROR;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]