From 7f0ff5c6554d9165645af67a6b8a252de67ffa5c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 16 Sep 2008 11:16:04 +0000 Subject: [PATCH] * luci/applications: add p910nd printserver application, thanks Yanira! - closes #125 --- applications/luci-p910nd/Makefile | 2 ++ applications/luci-p910nd/ipkg/postinst | 4 +++ .../luci-p910nd/luasrc/controller/p910nd.lua | 28 ++++++++++++++++++ applications/luci-p910nd/luasrc/i18n/p910nd.de.lua | 4 +++ applications/luci-p910nd/luasrc/i18n/p910nd.de.xml | 10 +++++++ applications/luci-p910nd/luasrc/i18n/p910nd.en.lua | 4 +++ applications/luci-p910nd/luasrc/i18n/p910nd.en.xml | 10 +++++++ .../luci-p910nd/luasrc/model/cbi/p910nd.lua | 33 ++++++++++++++++++++++ .../luci-p910nd/root/etc/uci-defaults/luci-p910nd | 7 +++++ 9 files changed, 102 insertions(+) create mode 100644 applications/luci-p910nd/Makefile create mode 100644 applications/luci-p910nd/ipkg/postinst create mode 100644 applications/luci-p910nd/luasrc/controller/p910nd.lua create mode 100644 applications/luci-p910nd/luasrc/i18n/p910nd.de.lua create mode 100644 applications/luci-p910nd/luasrc/i18n/p910nd.de.xml create mode 100644 applications/luci-p910nd/luasrc/i18n/p910nd.en.lua create mode 100644 applications/luci-p910nd/luasrc/i18n/p910nd.en.xml create mode 100644 applications/luci-p910nd/luasrc/model/cbi/p910nd.lua create mode 100644 applications/luci-p910nd/root/etc/uci-defaults/luci-p910nd diff --git a/applications/luci-p910nd/Makefile b/applications/luci-p910nd/Makefile new file mode 100644 index 000000000..f7fac7740 --- /dev/null +++ b/applications/luci-p910nd/Makefile @@ -0,0 +1,2 @@ +include ../../build/config.mk +include ../../build/module.mk diff --git a/applications/luci-p910nd/ipkg/postinst b/applications/luci-p910nd/ipkg/postinst new file mode 100644 index 000000000..d16d5cc3d --- /dev/null +++ b/applications/luci-p910nd/ipkg/postinst @@ -0,0 +1,4 @@ +#!/bin/sh +[ -n "${IPKG_INSTROOT}" ] || { + ( . /etc/uci-defaults/luci-p910nd ) && rm -f /etc/uci-defaults/luci-p910nd +} diff --git a/applications/luci-p910nd/luasrc/controller/p910nd.lua b/applications/luci-p910nd/luasrc/controller/p910nd.lua new file mode 100644 index 000000000..8cc0e7197 --- /dev/null +++ b/applications/luci-p910nd/luasrc/controller/p910nd.lua @@ -0,0 +1,28 @@ +--[[ + +LuCI UVC Streamer +(c) 2008 Yanira + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +]]-- + +module("luci.controller.p910nd", package.seeall) + +function index() + require("luci.i18n") + luci.i18n.loadc("p910nd") + if not luci.fs.isfile("/etc/config/p910nd") then + return + end + + local page = entry({"admin", "services", "p910nd"}, cbi("p910nd"), luci.i18n.translate("p910nd", "Printer server"), 60) + page.i18n = "p910nd" + page.dependent = true +end diff --git a/applications/luci-p910nd/luasrc/i18n/p910nd.de.lua b/applications/luci-p910nd/luasrc/i18n/p910nd.de.lua new file mode 100644 index 000000000..7ca30087f --- /dev/null +++ b/applications/luci-p910nd/luasrc/i18n/p910nd.de.lua @@ -0,0 +1,4 @@ +bidirectional = 'Bidirektionaler Modus' +port_help = 'p910nd hoert auf Port 910+N. Z.B. 9100 fuer ersten Drucker' +p910nd = 'p910nd - Drucker server' +p910nd_desc = 'Bevor p910nd verwendet werden kann muessen Pakete fuer USB (kmod-usb-printer) und Parallelport (kmod-lp) Support installiert werden.' diff --git a/applications/luci-p910nd/luasrc/i18n/p910nd.de.xml b/applications/luci-p910nd/luasrc/i18n/p910nd.de.xml new file mode 100644 index 000000000..8ac06fff0 --- /dev/null +++ b/applications/luci-p910nd/luasrc/i18n/p910nd.de.xml @@ -0,0 +1,10 @@ + + + + +p910nd - Drucker server +Bevor p910nd verwendet werden kann muessen Pakete fuer USB (kmod-usb-printer) und Parallelport (kmod-lp) Support installiert werden. +Bidirektionaler Modus +p910nd hoert auf Port 910+N. Z.B. 9100 fuer ersten Drucker + + diff --git a/applications/luci-p910nd/luasrc/i18n/p910nd.en.lua b/applications/luci-p910nd/luasrc/i18n/p910nd.en.lua new file mode 100644 index 000000000..74c2f24a8 --- /dev/null +++ b/applications/luci-p910nd/luasrc/i18n/p910nd.en.lua @@ -0,0 +1,4 @@ +bidirectional = 'Bidirectional mode' +port_help = 'p910nd listens on port 910+N. E.g. 9100 for the first printer.' +p910nd = 'p910nd - Printer server' +p910nd_desc = 'First you have to install the packages to get support for USB (kmod-usb-printer) or parallel port (kmod-lp).' diff --git a/applications/luci-p910nd/luasrc/i18n/p910nd.en.xml b/applications/luci-p910nd/luasrc/i18n/p910nd.en.xml new file mode 100644 index 000000000..326730535 --- /dev/null +++ b/applications/luci-p910nd/luasrc/i18n/p910nd.en.xml @@ -0,0 +1,10 @@ + + + + +p910nd - Printer server +First you have to install the packages to get support for USB (kmod-usb-printer) or parallel port (kmod-lp). +Bidirectional mode +p910nd listens on port 910+N. E.g. 9100 for the first printer. + + diff --git a/applications/luci-p910nd/luasrc/model/cbi/p910nd.lua b/applications/luci-p910nd/luasrc/model/cbi/p910nd.lua new file mode 100644 index 000000000..21a596556 --- /dev/null +++ b/applications/luci-p910nd/luasrc/model/cbi/p910nd.lua @@ -0,0 +1,33 @@ +--[[ + +LuCI p910nd +(c) 2008 Yanira + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +]]-- + +local uci = luci.model.uci.cursor_state() + +m = Map("p910nd", translate("p910nd", "p910nd"), + translatef("p910nd_desc")) + +s = m:section(TypedSection, "p910nd", translate("settings", "settings")) +s.addremove = true +s.anonymous = true + +s:option(Flag, "enabled", translate("enabled")) + +s:option(Value, "device", translate("device", "Device")).rmempty = true + +s:option(Value, "port", translate("port"), translate("port_help")).rmempty = true + +s:option(Flag, "bidirectional", translate("bidirectional")) + +return m diff --git a/applications/luci-p910nd/root/etc/uci-defaults/luci-p910nd b/applications/luci-p910nd/root/etc/uci-defaults/luci-p910nd new file mode 100644 index 000000000..b37952e4d --- /dev/null +++ b/applications/luci-p910nd/root/etc/uci-defaults/luci-p910nd @@ -0,0 +1,7 @@ +#!/bin/sh + +uci batch <<-EOF + add ucitrack p910nd + set ucitrack.@p910nd[-1].init=p910nd + commit ucitrack +EOF -- 2.11.0