[gnome-games/wip/exalm/ds-popover: 25/30] Handle quick switch manually
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/ds-popover: 25/30] Handle quick switch manually
- Date: Fri, 18 Jan 2019 20:19:13 +0000 (UTC)
commit d40e1abab51e96770882441a44fc3a59bfa89861
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Wed Jan 9 01:13:58 2019 +0500
Handle quick switch manually
.../data/org.gnome.Games.plugins.nintendo-ds.gschema.xml | 5 +++++
plugins/nintendo-ds/src/nintendo-ds-runner.vala | 14 +++++++++++---
2 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/plugins/nintendo-ds/data/org.gnome.Games.plugins.nintendo-ds.gschema.xml
b/plugins/nintendo-ds/data/org.gnome.Games.plugins.nintendo-ds.gschema.xml
index 8e170f63..230e5398 100644
--- a/plugins/nintendo-ds/data/org.gnome.Games.plugins.nintendo-ds.gschema.xml
+++ b/plugins/nintendo-ds/data/org.gnome.Games.plugins.nintendo-ds.gschema.xml
@@ -11,5 +11,10 @@
<summary>Screen layout</summary>
<description>Screen layout for Nintendo DS games. Allowed values are: “top/bottom”, “left/right”,
“right/left” and “quick switch”.</description>
</key>
+ <key name='view-bottom-screen' type="b">
+ <default>false</default>
+ <summary>View bottom screen</summary>
+ <description>Whether to view top or bottom screen in quick switch mode.</description>
+ </key>
</schema>
</schemalist>
diff --git a/plugins/nintendo-ds/src/nintendo-ds-runner.vala b/plugins/nintendo-ds/src/nintendo-ds-runner.vala
index 48dd4d39..dd433883 100644
--- a/plugins/nintendo-ds/src/nintendo-ds-runner.vala
+++ b/plugins/nintendo-ds/src/nintendo-ds-runner.vala
@@ -39,7 +39,7 @@ private class Games.NintendoDsRunner : Object, Runner {
}
private void on_changed (string key) {
- if (key == "screen-layout")
+ if (key == "screen-layout" || key == "view-bottom-screen")
update_screen_layout ();
}
@@ -51,10 +51,18 @@ private class Games.NintendoDsRunner : Object, Runner {
var option = core.get_option (SCREENS_LAYOUT_OPTION);
- var value = settings.get_string ("screen-layout");
+ var setting_value = settings.get_string ("screen-layout");
+
+ var option_value = setting_value;
+ if (setting_value == "quick switch") {
+ var bottom = settings.get_boolean ("view-bottom-screen");
+
+ option_value = bottom ? "bottom only" : "top only";
+ }
+
try {
- option.set_value (value);
+ option.set_value (option_value);
}
catch (Error e) {
critical (e.message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]