[gnome-games] runner: Add 'can-quit-safely' prop
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] runner: Add 'can-quit-safely' prop
- Date: Fri, 25 Mar 2016 12:53:11 +0000 (UTC)
commit 0ec51d9187840d035d91838566e7c1abee750f59
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sun Mar 6 19:29:30 2016 +0100
runner: Add 'can-quit-safely' prop
This will be used in a subsequent commit to check if we can quit a game
safely.
plugins/steam/src/steam-runner.vala | 4 ++++
src/command/command-runner.vala | 4 ++++
src/core/runner.vala | 1 +
src/dummy/dummy-runner.vala | 4 ++++
src/retro/retro-runner.vala | 4 ++++
5 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/plugins/steam/src/steam-runner.vala b/plugins/steam/src/steam-runner.vala
index da4aff9..e0d523d 100644
--- a/plugins/steam/src/steam-runner.vala
+++ b/plugins/steam/src/steam-runner.vala
@@ -1,6 +1,10 @@
// This file is part of GNOME Games. License: GPLv3
private class Games.SteamRunner : Object, Runner {
+ public bool can_quit_safely {
+ get { return true; }
+ }
+
public bool can_resume {
get { return false; }
}
diff --git a/src/command/command-runner.vala b/src/command/command-runner.vala
index c68bf92..15fc398 100644
--- a/src/command/command-runner.vala
+++ b/src/command/command-runner.vala
@@ -1,6 +1,10 @@
// This file is part of GNOME Games. License: GPLv3
public class Games.CommandRunner : Object, Runner {
+ public bool can_quit_safely {
+ get { return true; }
+ }
+
public bool can_resume {
get { return false; }
}
diff --git a/src/core/runner.vala b/src/core/runner.vala
index c6f2de9..258a07d 100644
--- a/src/core/runner.vala
+++ b/src/core/runner.vala
@@ -3,6 +3,7 @@
public interface Games.Runner : Object {
public signal void stopped ();
+ public abstract bool can_quit_safely { get; }
public abstract bool can_resume { get; }
public abstract void check_is_valid () throws Error;
diff --git a/src/dummy/dummy-runner.vala b/src/dummy/dummy-runner.vala
index ba82971..a3ef3e3 100644
--- a/src/dummy/dummy-runner.vala
+++ b/src/dummy/dummy-runner.vala
@@ -1,6 +1,10 @@
// This file is part of GNOME Games. License: GPLv3
private class Games.DummyRunner : Object, Runner {
+ public bool can_quit_safely {
+ get { return true; }
+ }
+
public bool can_resume {
get { return false; }
}
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 0c87340..b04edf1 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -1,6 +1,10 @@
// This file is part of GNOME Games. License: GPLv3
public class Games.RetroRunner : Object, Runner {
+ public bool can_quit_safely {
+ get { return core_supports_snapshotting || !should_save; }
+ }
+
public bool can_resume {
get {
if (!core_supports_snapshotting)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]