summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/curses-ui/Makefile2
-rw-r--r--src/curses-ui/main.vala11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/curses-ui/Makefile b/src/curses-ui/Makefile
index 5d168ba..37aacc6 100644
--- a/src/curses-ui/Makefile
+++ b/src/curses-ui/Makefile
@@ -1,6 +1,6 @@
all: curses-ui
-curses-ui: clock.vala curses-ui.vala dialog.vala logo.vala main.vala message_box.vala numbers.vala status.vala ../audio/audio-interface.vala
+curses-ui: clock.vala curses-ui.vala dialog.vala logo.vala main.vala message_box.vala numbers.vala status.vala ../audio/audio-interface.vala ../scanner-session/scannersession-interface.vala
valac -o $@ --pkg curses -X -lncursesw --pkg posix --pkg gio-2.0 $^
clean:
diff --git a/src/curses-ui/main.vala b/src/curses-ui/main.vala
index b70ecbc..00ca9fb 100644
--- a/src/curses-ui/main.vala
+++ b/src/curses-ui/main.vala
@@ -15,6 +15,8 @@
public MainLoop loop;
public AudioPlayer audio;
+public ScannerSession scanner;
+public CursesUI ui;
private static void play(string file) {
try {
@@ -22,6 +24,10 @@ private static void play(string file) {
} catch(IOError e) { }
}
+public void msg_handler(MessageType type, string message) {
+ ui.log(message);
+}
+
public static int main(string[] args) {
/* handle unix signals */
@@ -30,11 +36,14 @@ public static int main(string[] args) {
try {
audio = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.AudioPlayer", "/io/mainframe/shopsystem/audio");
+ scanner = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.ScannerSession", "/io/mainframe/shopsystem/scanner_session");
} catch(IOError e) {
error("IOError: %s\n", e.message);
}
- var ui = new CursesUI();
+ ui = new CursesUI();
+
+ scanner.msg.connect(msg_handler);
ui.log("KtT Shop System has been started");
play("startup.ogg");