[gnome-games/wip/aplazas/konami-code: 2/2] ui: Show message when Konami Code is performed
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/konami-code: 2/2] ui: Show message when Konami Code is performed
- Date: Thu, 11 May 2017 18:07:37 +0000 (UTC)
commit 4feb3f30c58a04da2b361db9b79b43b48aec6f2d
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat Jul 23 08:43:51 2016 +0200
ui: Show message when Konami Code is performed
Show a message in the info box when the Konami Code is performed on the
collection view.
src/ui/application-window.vala | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index b533c10..4dbdcbe 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -34,6 +34,8 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
break;
}
+
+ konami_code.reset ();
}
get { return _ui_state; }
}
@@ -90,6 +92,8 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
private uint inhibit_cookie;
private Gtk.ApplicationInhibitFlags inhibit_flags;
+ private KonamiCode konami_code;
+
public ApplicationWindow (ListModel collection) {
collection_box.collection = collection;
}
@@ -121,6 +125,9 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
header_bar_fullscreen_binding = bind_property ("is-fullscreen", display_header_bar,
"is-fullscreen",
BindingFlags.BIDIRECTIONAL);
+ konami_code = new KonamiCode (this);
+ konami_code.code_performed.connect (on_konami_code_performed);
+
window_size_update_timeout = -1;
focus_out_timeout_id = -1;
inhibit_cookie = 0;
@@ -554,4 +561,10 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
display_header_bar.media_set = null;
display_box.header_bar.media_set = null;
}
+ private void on_konami_code_performed () {
+ if (ui_state != UiState.COLLECTION)
+ return;
+
+ message (KonamiCode.CODE_STRING);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]