[five-or-more/arnaudb/gtk3: 5/24] Revert "Adapt to Dialog API."
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [five-or-more/arnaudb/gtk3: 5/24] Revert "Adapt to Dialog API."
- Date: Thu, 22 Oct 2020 15:32:54 +0000 (UTC)
commit 473d2cdaab3c6d6afb011068e55b97dbe0fa3527
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Thu Oct 22 17:27:24 2020 +0200
Revert "Adapt to Dialog API."
This reverts commit b394d3352a209bf31baf0941ad1c13b398e317de.
src/window.vala | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index 4c2d5ac..10a318a 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -241,12 +241,11 @@ private class GameWindow : ApplicationWindow
if (!settings.set_string (FiveOrMoreApp.KEY_BACKGROUND_COLOR, color.to_string ()))
warning ("Failed to set color: %s", color.to_string ());
});
- dialog.response.connect ((_dialog, response) => {
- _dialog.destroy ();
- if (response != ResponseType.OK)
- settings.set_string (FiveOrMoreApp.KEY_BACKGROUND_COLOR, old_color_string);
- });
- dialog.present ();
+ var result = dialog.run ();
+ dialog.destroy ();
+ if (result == ResponseType.OK)
+ return;
+ settings.set_string (FiveOrMoreApp.KEY_BACKGROUND_COLOR, old_color_string);
}
private inline void reset_background ()
@@ -300,13 +299,10 @@ private class GameWindow : ApplicationWindow
/* Translators: button of a dialog that appears when the user starts a new game while the score
is not null; the other answer is "_Cancel" */
_("_Restart"), ResponseType.OK);
- restart_game_dialog.response.connect ((_restart_game_dialog, response) => {
- _restart_game_dialog.destroy ();
- if (response == ResponseType.OK)
- game.new_game (size);
- });
- restart_game_dialog.present ();
- return;
+ var result = restart_game_dialog.run ();
+ restart_game_dialog.destroy ();
+ if (result != ResponseType.OK)
+ return;
}
game.new_game (size);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]