diff options
author | Holger Cremer <HolgerCremer@gmail.com> | 2018-08-27 19:38:11 +0200 |
---|---|---|
committer | Holger Cremer <HolgerCremer@gmail.com> | 2018-08-27 19:38:11 +0200 |
commit | 8f2ba2050ee78d0e4a47f1277c6bc4422d06170c (patch) | |
tree | c008d2878905e03df7a8bf8bd3330762cc2d8f43 /src/input-device/input-device.vala | |
parent | bb55e121576a5b5d225bfc68c5062f386cc32db9 (diff) | |
parent | 3fc3ea6c6df237dbdf48d14703118b747bf5d647 (diff) | |
download | serial-barcode-scanner-8f2ba2050ee78d0e4a47f1277c6bc4422d06170c.tar.bz2 |
Merge branch 'master' into better_inventory
Conflicts:
README
data/templates/products/entry.html
docker/Dockerfile
docker/init.sh
src/database/database.vala
src/database/db-interface.vala
src/pdf-stock/Makefile
src/pdf-stock/pdf-stock-interface.vala
src/pdf-stock/pdf-stock.vala
src/web/Makefile
src/web/main.vala
templates/menu.html
templates/products/index.html
Diffstat (limited to 'src/input-device/input-device.vala')
-rw-r--r-- | src/input-device/input-device.vala | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/input-device/input-device.vala b/src/input-device/input-device.vala index 6988c6d..1dba213 100644 --- a/src/input-device/input-device.vala +++ b/src/input-device/input-device.vala @@ -1,4 +1,5 @@ /* Copyright 2015, Sebastian Reichel <sre@ring0.de> + * Copyright 2017-2018, Johannes Rudolph <johannes.rudolph@gmx.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -23,7 +24,7 @@ public class Device { public Device(string device) { if (device == "ignore") { - stdout.printf("Ignoring InputDevice!\n"); + stdout.printf(_("Ignoring InputDevice!\n")); return; } try { @@ -36,10 +37,10 @@ public class Device { Posix.fcntl(fd, Posix.F_SETFL, flags | Posix.O_NONBLOCK); if(!(io_read.add_watch(IOCondition.IN | IOCondition.HUP, device_read) != 0)) { - error("Could not bind IOChannel"); + error(_("Could not bind IOChannel")); } } catch(FileError e) { - error("FileError: %s", e.message); + error(_("File Error: %s"), e.message); } } @@ -211,7 +212,7 @@ public class Device { char key = '\0'; if((cond & IOCondition.HUP) == IOCondition.HUP) - error("Lost device"); + error(_("Lost device")); do { int fd = source.unix_get_fd(); @@ -220,7 +221,7 @@ public class Device { /* short read */ if (s != sizeof(Linux.Input.Event)) { if(s > 0) - stdout.printf("short read!\n"); + stdout.printf(_("short read!\n")); return true; } @@ -245,7 +246,7 @@ public class Device { buffer += "%c".printf(key); } while(key != '\n'); - stdout.printf("barcode: %s\n", buffer); + stdout.printf(_("barcode: %s\n"), buffer); if(buffer.has_prefix("USER ") || buffer.has_prefix("STOCK") || buffer.has_prefix("AMOUNT ")) { if(!check_code39_checksum(buffer)) @@ -315,7 +316,7 @@ public class Device { /** * @param duration duration of the blink in 0.1 seconds */ - public void blink(uint duration) { + public void blink(uint duration) throws IOError, DBusError { /* not supported */ } } |