[gnome-sudoku/arnaudb/wip/gtk4: 42/43] Adapt to Dialog API.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sudoku/arnaudb/wip/gtk4: 42/43] Adapt to Dialog API.
- Date: Wed, 5 Aug 2020 17:41:00 +0000 (UTC)
commit bf895ac8375de6545b427d51e0da23839ee508c8
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 71580a7..4647c50 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -298,8 +298,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
{
@@ -592,11 +591,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 f708f25..21c1334 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]