[gnome-games] application: Add quit()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] application: Add quit()
- Date: Fri, 25 Mar 2016 12:53:47 +0000 (UTC)
commit 0c42d47387d8a99aad9735a7d6409836eed7a5e1
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sun Mar 6 19:43:18 2016 +0100
application: Add quit()
Check if we can quit the game when trying to quit the application.
Fixes #259
src/ui/application.vala | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 0a44adc..65ca8ee 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -22,7 +22,7 @@ private class Games.Application : Gtk.Application {
}
}
- private Gtk.Window window;
+ private ApplicationWindow window;
public Application () {
Object (application_id: "org.gnome.Games",
@@ -158,6 +158,13 @@ private class Games.Application : Gtk.Application {
dialog.present ();
}
+ private void quit () {
+ if (window != null && !window.quit_game ())
+ return;
+
+ base.quit ();
+ }
+
private static Gtk.CssProvider load_css (string css) {
var provider = new Gtk.CssProvider ();
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]