From 8e60fa48a8535da9eaa34ef35b5040c2eb68fc3b Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Thu, 28 Jun 2018 21:35:23 +0200 Subject: all: I18N support This adds I18N support using standard gettext system together with an initial German translation. This can be used to search locales in some directory: Intl.bindtextdomain("shopsystem", "/home/sre/src/serial-barcode-scanner"); And this can be used to switch language at runtime: Intl.setlocale(LocaleCategory.ALL, ""); --- src/web/template.vala | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/web/template.vala') diff --git a/src/web/template.vala b/src/web/template.vala index b5265d8..f5c6d75 100644 --- a/src/web/template.vala +++ b/src/web/template.vala @@ -37,28 +37,28 @@ public class WebTemplate { uint8[] basis, menu, template, auth; if(!b.query_exists()) - throw new TemplateError.NOT_FOUND(templatedir+"base.html not found!"); + throw new TemplateError.NOT_FOUND(_("%s not found!").printf(templatedir+"base.html")); if(!m.query_exists()) - throw new TemplateError.NOT_FOUND(templatedir+"menu.html not found!"); + throw new TemplateError.NOT_FOUND(_("%s not found!").printf(templatedir+"menu.html")); if(!fauth.query_exists()) - throw new TemplateError.NOT_FOUND(fauth.get_path()+" not found!"); + throw new TemplateError.NOT_FOUND(_("%s not found!").printf(fauth.get_path())); if(!f.query_exists()) - throw new TemplateError.NOT_FOUND(templatedir+file+" not found!"); + throw new TemplateError.NOT_FOUND(_("%s not found!").printf(templatedir+file)); try { if(!b.load_contents(null, out basis, null)) - throw new TemplateError.NOT_LOADABLE(templatedir+"base.html could not be loaded!"); + throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(templatedir+"base.html")); if(!m.load_contents(null, out menu, null)) - throw new TemplateError.NOT_LOADABLE(templatedir+"menu.html could not be loaded!"); + throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(templatedir+"menu.html")); if(!fauth.load_contents(null, out auth, null)) - throw new TemplateError.NOT_LOADABLE(fauth.get_path()+" could not be loaded!"); + throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(fauth.get_path())); if(!f.load_contents(null, out template, null)) - throw new TemplateError.NOT_LOADABLE(templatedir+file+" could not be loaded!"); + throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(templatedir+file)); } catch(Error e) { - throw new TemplateError.NOT_LOADABLE("could not load templates!"); + throw new TemplateError.NOT_LOADABLE(_("could not load templates!")); } this.template = ((string) basis).replace("{{{NAVBAR}}}", ((string) menu)); @@ -75,13 +75,13 @@ public class WebTemplate { uint8[] template; if(!f.query_exists()) - throw new TemplateError.NOT_FOUND(templatedir+file+" not found!"); + throw new TemplateError.NOT_FOUND(_("%s not found!").printf(templatedir+file)); try { if(!f.load_contents(null, out template, null)) - throw new TemplateError.NOT_LOADABLE(templatedir+file+" could not be loaded!"); + throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(templatedir+file)); } catch(Error e) { - throw new TemplateError.NOT_LOADABLE("could not load templates!"); + throw new TemplateError.NOT_LOADABLE(_("could not load templates!")); } this.template = (string) template; -- cgit v1.2.3 From d6cc1e7da591f784bddecce19e12097de88d0fe8 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Mon, 16 Jul 2018 00:32:57 +0200 Subject: fix templatedir --- src/audio/audio.vala | 26 +++++++++++++++++--------- src/invoice/invoice.vala | 6 +++--- src/pdf-invoice/pdf-invoice.vala | 8 ++++---- src/web/template.vala | 32 ++++++++++++++++++-------------- 4 files changed, 42 insertions(+), 30 deletions(-) (limited to 'src/web/template.vala') diff --git a/src/audio/audio.vala b/src/audio/audio.vala index 679e5c7..0d969e2 100644 --- a/src/audio/audio.vala +++ b/src/audio/audio.vala @@ -34,12 +34,18 @@ public class AudioPlayerImplementation { this.path = path; var alsa = Gst.ElementFactory.make("alsasink", "alsa"); - if (alsa == null) - throw new GLib.IOError.FAILED(_("Cannot find alsa GStreamer plugin")); + if (alsa == null) { + var msg = _("Cannot find alsa GStreamer plugin"); + stderr.printf(msg); + throw new GLib.IOError.FAILED(msg); + } p = Gst.ElementFactory.make("playbin", "player"); - if (p == null) - throw new GLib.IOError.FAILED(_("Cannot find playbin2 GStreamer plugin")); + if (p == null) { + var msg = _("Cannot find playbin2 GStreamer plugin"); + stderr.printf(msg); + throw new GLib.IOError.FAILED(msg); + } p.set("audio-sink", alsa); p.get_bus().add_watch(Priority.DEFAULT, bus_callback); @@ -47,7 +53,8 @@ public class AudioPlayerImplementation { public void play_system(string file) throws IOError, DBusError { p.set_state(Gst.State.NULL); - p.uri = "file://" + path + "system/" + file; + p.uri = "file://" + Path.build_filename(path, "system", file); + stdout.printf("Play: %s\n", p.uri); p.set_state(Gst.State.PLAYING); } @@ -77,17 +84,18 @@ public class AudioPlayerImplementation { } public string get_random_user_theme() throws IOError, DBusError { - return get_random_file(path + "user/"); + return get_random_file(Path.build_filename(path, "user")); } public string[] get_user_themes() throws IOError, DBusError { - return get_files(path + "user/"); + return get_files(Path.build_filename(path, "user")); } public void play_user(string theme, string type) throws IOError, DBusError { p.set_state(Gst.State.NULL); - var file = get_random_file(path + "user/" + theme+ "/" + type); - p.uri = "file://" + path + "user/" + theme+ "/" + type + "/" + file; + var file = get_random_file(Path.build_filename(path, "user", theme, type)); + p.uri = "file://" + Path.build_filename(path, "user", theme, type, file); + stdout.printf("Play: %s\n", p.uri); p.set_state(Gst.State.PLAYING); } } diff --git a/src/invoice/invoice.vala b/src/invoice/invoice.vala index 1321071..e83f4bf 100644 --- a/src/invoice/invoice.vala +++ b/src/invoice/invoice.vala @@ -248,7 +248,7 @@ public class InvoiceImplementation { string text; try { - FileUtils.get_contents(datadir + "/treasurer.mail.txt", out text); + FileUtils.get_contents(Path.build_filename(datadir, "/treasurer.mail.txt"), out text); } catch(GLib.FileError e) { throw new IOError.FAILED(_("Could not open invoice template: %s"), e.message); } @@ -315,7 +315,7 @@ public class InvoiceImplementation { throw new IOError.FAILED(_("Unknown MessageType")); try { - FileUtils.get_contents(datadir + "/" + filename, out text); + FileUtils.get_contents(Path.build_filename(datadir, filename), out text); } catch(GLib.FileError e) { throw new IOError.FAILED(_("Could not open invoice template: %s"), e.message); } @@ -334,7 +334,7 @@ public class InvoiceImplementation { vattextfilename = (type == MessageType.HTML) ? "vat.html" : "vat.txt"; try { - FileUtils.get_contents(datadir + "/" + vattextfilename, out vattext); + FileUtils.get_contents(Path.build_filename(datadir, vattextfilename), out vattext); } catch(GLib.FileError e) { throw new IOError.FAILED(_("Could not open VAT template: %s"), e.message); } diff --git a/src/pdf-invoice/pdf-invoice.vala b/src/pdf-invoice/pdf-invoice.vala index b41817d..d3177c9 100644 --- a/src/pdf-invoice/pdf-invoice.vala +++ b/src/pdf-invoice/pdf-invoice.vala @@ -86,14 +86,14 @@ public class InvoicePDF { ctx.save(); ctx.translate(-20, 818); ctx.scale(1.42, 1.42); - render_svg(ctx, datadir + "/footer-line.svg"); + render_svg(ctx, Path.build_filename(datadir, "footer-line.svg")); ctx.restore(); } private void draw_logo(Cairo.Context ctx) { ctx.save(); ctx.translate(366,25); - render_svg(ctx, datadir + "/logo.svg"); + render_svg(ctx, Path.build_filename(datadir, "logo.svg")); ctx.restore(); } @@ -362,7 +362,7 @@ public class InvoicePDF { /* load text template */ try { var text = ""; - FileUtils.get_contents(datadir + "/pdf-template.txt", out text); + FileUtils.get_contents(Path.build_filename(datadir, "pdf-template.txt"), out text); text = text.replace("{{{ADDRESS}}}", address); text = text.replace("{{{LASTNAME}}}", invoice_recipient.lastname); text = text.replace("{{{SUM}}}", @"$sum"); @@ -374,7 +374,7 @@ public class InvoicePDF { string vattext; try { - FileUtils.get_contents(datadir + "/" + "vat.txt", out vattext); + FileUtils.get_contents(Path.build_filename(datadir, "vat.txt"), out vattext); } catch(GLib.FileError e) { throw new IOError.FAILED(_("Could not open VAT template: %s"), e.message); } diff --git a/src/web/template.vala b/src/web/template.vala index f5c6d75..4dcda38 100644 --- a/src/web/template.vala +++ b/src/web/template.vala @@ -24,39 +24,42 @@ public class WebTemplate { public uint8[] data { get { return template.data; } } public WebTemplate(string file, WebSession login) throws TemplateError { - var b = File.new_for_path(templatedir+"base.html"); - var m = File.new_for_path(templatedir+"menu.html"); - var f = File.new_for_path(templatedir+file); + var bf = Path.build_filename(templatedir, "base.html"); + var b = File.new_for_path(bf); + var mf = Path.build_filename(templatedir, "menu.html"); + var m = File.new_for_path(mf); + var ff = Path.build_filename(templatedir, file); + var f = File.new_for_path(ff); File fauth; if(login.logged_in) - fauth = File.new_for_path(templatedir+"menu_logout.html"); + fauth = File.new_for_path(Path.build_filename(templatedir, "menu_logout.html")); else - fauth = File.new_for_path(templatedir+"menu_login.html"); + fauth = File.new_for_path(Path.build_filename(templatedir, "menu_login.html")); uint8[] basis, menu, template, auth; if(!b.query_exists()) - throw new TemplateError.NOT_FOUND(_("%s not found!").printf(templatedir+"base.html")); + throw new TemplateError.NOT_FOUND(_("%s not found!").printf(bf)); if(!m.query_exists()) - throw new TemplateError.NOT_FOUND(_("%s not found!").printf(templatedir+"menu.html")); + throw new TemplateError.NOT_FOUND(_("%s not found!").printf(mf)); if(!fauth.query_exists()) throw new TemplateError.NOT_FOUND(_("%s not found!").printf(fauth.get_path())); if(!f.query_exists()) - throw new TemplateError.NOT_FOUND(_("%s not found!").printf(templatedir+file)); + throw new TemplateError.NOT_FOUND(_("%s not found!").printf(ff)); try { if(!b.load_contents(null, out basis, null)) - throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(templatedir+"base.html")); + throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(bf)); if(!m.load_contents(null, out menu, null)) - throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(templatedir+"menu.html")); + throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(mf)); if(!fauth.load_contents(null, out auth, null)) throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(fauth.get_path())); if(!f.load_contents(null, out template, null)) - throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(templatedir+file)); + throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(ff)); } catch(Error e) { throw new TemplateError.NOT_LOADABLE(_("could not load templates!")); } @@ -71,15 +74,16 @@ public class WebTemplate { } public WebTemplate.DATA(string file) throws TemplateError { - var f = File.new_for_path(templatedir+file); + var ff = Path.build_filename(templatedir, file); + var f = File.new_for_path(ff); uint8[] template; if(!f.query_exists()) - throw new TemplateError.NOT_FOUND(_("%s not found!").printf(templatedir+file)); + throw new TemplateError.NOT_FOUND(_("%s not found!").printf(ff)); try { if(!f.load_contents(null, out template, null)) - throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(templatedir+file)); + throw new TemplateError.NOT_LOADABLE(_("%s could not be loaded!").printf(ff)); } catch(Error e) { throw new TemplateError.NOT_LOADABLE(_("could not load templates!")); } -- cgit v1.2.3 From 867fb84ffacbb02e44e2b6a511e61612dd2af3b1 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Tue, 17 Jul 2018 20:59:04 +0200 Subject: web: fix shortname --- src/web/main.vala | 30 +++++++++++++++++++++++------- src/web/template.vala | 1 + src/web/web.vala | 35 ----------------------------------- 3 files changed, 24 insertions(+), 42 deletions(-) (limited to 'src/web/template.vala') diff --git a/src/web/main.vala b/src/web/main.vala index 2043df0..761bba9 100644 --- a/src/web/main.vala +++ b/src/web/main.vala @@ -19,6 +19,7 @@ public PGP pgp; public Config cfg; public AudioPlayer audio; string templatedir; +string? shortname; public static int main(string[] args) { Intl.setlocale(LocaleCategory.ALL, ""); @@ -37,13 +38,6 @@ public static int main(string[] args) { var datapath = cfg.get_string("GENERAL", "datapath"); templatedir = Path.build_filename(datapath, "templates"); port = cfg.get_integer("WEB", "port"); - - try { - certificate = cfg.get_string("WEB", "cert"); - privatekey = cfg.get_string("WEB", "key"); - } catch(KeyFileError e) { - warning(_("KeyFile Error: %s\n"), e.message); - } } catch(IOError e) { error(_("IO Error: %s\n"), e.message); } catch(KeyFileError e) { @@ -52,6 +46,28 @@ public static int main(string[] args) { error(_("DBus Error: %s\n"), e.message); } + try { + certificate = cfg.get_string("WEB", "cert"); + privatekey = cfg.get_string("WEB", "key"); + } catch(KeyFileError e) { + warning(_("KeyFile Error: %s\n"), e.message); + } catch(IOError e) { + error(_("IO Error: %s\n"), e.message); + } catch(DBusError e) { + error(_("DBus Error: %s\n"), e.message); + } + + try { + shortname = cfg.get_string("GENERAL", "shortname"); + } catch(KeyFileError e) { + shortname = ""; + warning(_("KeyFile Error: %s\n"), e.message); + } catch(IOError e) { + error(_("IO Error: %s\n"), e.message); + } catch(DBusError e) { + error(_("DBus Error: %s\n"), e.message); + } + stdout.printf(_("Web Server Port: %u\n"), port); stdout.printf(_("TLS certificate: %s\n"), certificate); stdout.printf(_("TLS private key: %s\n"), privatekey); diff --git a/src/web/template.vala b/src/web/template.vala index 4dcda38..009ebcf 100644 --- a/src/web/template.vala +++ b/src/web/template.vala @@ -65,6 +65,7 @@ public class WebTemplate { } this.template = ((string) basis).replace("{{{NAVBAR}}}", ((string) menu)); + this.template = this.template.replace("{{{SHORTNAME}}}", shortname); this.template = this.template.replace("{{{AUTH}}}", ((string) auth)); this.template = this.template.replace("{{{CONTENT}}}", ((string) template)); this.template = this.template.replace("{{{USERNAME}}}", login.name); diff --git a/src/web/web.vala b/src/web/web.vala index 5f82cec..8934763 100644 --- a/src/web/web.vala +++ b/src/web/web.vala @@ -16,8 +16,6 @@ public class WebServer { private Soup.Server srv; - private string longname; - private string shortname; void handler_default(Soup.Server server, Soup.Message msg, string path, GLib.HashTable? query, Soup.ClientContext client) { try { @@ -46,7 +44,6 @@ public class WebServer { l.logout(); var t = new WebTemplate("logout.html", l); t.replace("TITLE", shortname + " Shop System"); - t.replace("SHORTNAME", shortname); t.menu_set_active("home"); msg.set_response("text/html", Soup.MemoryUse.COPY, t.data); msg.set_status(200); @@ -106,7 +103,6 @@ public class WebServer { var t = new WebTemplate("users/index.html", session); t.replace("TITLE", shortname + " Shop System: User"); - t.replace("SHORTNAME", shortname); t.menu_set_active("users"); var data = ""; foreach(var m in db.get_member_ids()) { @@ -143,7 +139,6 @@ public class WebServer { var t = new WebTemplate("users/import-pgp.html", session); t.replace("TITLE", shortname + " Shop System: PGP Key Import"); - t.replace("SHORTNAME", shortname); t.menu_set_active("users"); Soup.Buffer filedata; @@ -198,7 +193,6 @@ public class WebServer { } var t = new WebTemplate("users/import.html", session); t.replace("TITLE", shortname + " Shop System: User Import"); - t.replace("SHORTNAME", shortname); t.menu_set_active("users"); Soup.Buffer filedata; @@ -348,7 +342,6 @@ public class WebServer { } var t = new WebTemplate("users/entry.html", session); t.replace("TITLE", shortname + " Shop System: User Info %llu".printf(id)); - t.replace("SHORTNAME", shortname); t.menu_set_active("users"); var userinfo = db.get_user_info(id); @@ -456,7 +449,6 @@ public class WebServer { } var t = new WebTemplate("users/invoice.html", l); t.replace("TITLE", shortname + " Shop System: User Invoice %llu".printf(id)); - t.replace("SHORTNAME", shortname); t.menu_set_active("users"); /* years, in which something has been purchased by the user */ @@ -581,7 +573,6 @@ public class WebServer { var l = new WebSession(server, msg, path, query, client); var t = new WebTemplate("products/index.html", l); t.replace("TITLE", shortname + " Shop System: Product List"); - t.replace("SHORTNAME", shortname); t.menu_set_active("products"); string table = ""; @@ -621,7 +612,6 @@ public class WebServer { var l = new WebSession(server, msg, path, query, client); var t = new WebTemplate("products/bestbefore.html", l); t.replace("TITLE", shortname + " Shop System: Best Before List"); - t.replace("SHORTNAME", shortname); t.menu_set_active("products"); string table = ""; @@ -681,7 +671,6 @@ public class WebServer { var l = new WebSession(server, msg, path, query, client); var t = new WebTemplate("products/entry.html", l); t.replace("TITLE", shortname + " Shop System: Product %llu".printf(id)); - t.replace("SHORTNAME", shortname); t.menu_set_active("products"); /* ean */ @@ -764,7 +753,6 @@ public class WebServer { var session = new WebSession(server, msg, path, query, client); var template = new WebTemplate("products/new.html", session); template.replace("TITLE", shortname + " Shop System: New Product"); - template.replace("SHORTNAME", shortname); template.menu_set_active("products"); if(!session.superuser && !session.auth_products) { @@ -823,7 +811,6 @@ public class WebServer { var template = new WebTemplate("products/restock.html", session); template.replace("TITLE", shortname + " Shop System: Restock Product %llu".printf(id)); - template.replace("SHORTNAME", shortname); template.replace("NAME", db.get_product_name(id)); template.menu_set_active("products"); @@ -925,7 +912,6 @@ public class WebServer { var l = new WebSession(server, msg, path, query, client); var t = new WebTemplate("aliases/index.html", l); t.replace("TITLE", shortname + " Shop System: Alias List"); - t.replace("SHORTNAME", shortname); t.menu_set_active("aliases"); string table = ""; @@ -960,7 +946,6 @@ public class WebServer { var session = new WebSession(server, msg, path, query, client); var template = new WebTemplate("aliases/new.html", session); template.replace("TITLE", shortname + " Shop System: New Alias"); - template.replace("SHORTNAME", shortname); template.menu_set_active("aliases"); if(!session.superuser && !session.auth_products) { @@ -1011,7 +996,6 @@ public class WebServer { var l = new WebSession(server, msg, path, query, client); var t = new WebTemplate("stats/index.html", l); t.replace("TITLE", shortname + " Shop System: Statistics"); - t.replace("SHORTNAME", shortname); t.menu_set_active("stats"); var stats = db.get_stats_info(); @@ -1044,7 +1028,6 @@ public class WebServer { var t = new WebTemplate("stats/stock.html", l); string data = db.get_stats_stock().json; t.replace("DATA", data); - t.replace("SHORTNAME", shortname); t.replace("TITLE", shortname + " Shop System: Statistics: Stock"); t.menu_set_active("stats"); msg.set_response("text/html", Soup.MemoryUse.COPY, t.data); @@ -1061,7 +1044,6 @@ public class WebServer { var t = new WebTemplate("stats/profit_per_day.html", l); string data = db.get_stats_profit_per_day().json; t.replace("DATA", data); - t.replace("SHORTNAME", shortname); t.replace("TITLE", shortname + " Shop System: Statistics: Profit"); t.menu_set_active("stats"); msg.set_response("text/html", Soup.MemoryUse.COPY, t.data); @@ -1078,7 +1060,6 @@ public class WebServer { var t = new WebTemplate("stats/profit_per_weekday.html", l); string data = db.get_stats_profit_per_weekday().json; t.replace("DATA", data); - t.replace("SHORTNAME", shortname); t.replace("TITLE", shortname + " Shop System: Statistics: Profit/Weekday"); t.menu_set_active("stats"); msg.set_response("text/html", Soup.MemoryUse.COPY, t.data); @@ -1095,7 +1076,6 @@ public class WebServer { var t = new WebTemplate("stats/profit_per_product.html", l); string data = db.get_stats_profit_per_products().json; t.replace("DATA", data); - t.replace("SHORTNAME", shortname); t.replace("TITLE", shortname + " Shop System: Statistics: Profit/Product"); t.menu_set_active("stats"); msg.set_response("text/html", Soup.MemoryUse.COPY, t.data); @@ -1228,7 +1208,6 @@ public class WebServer { var session = new WebSession(server, msg, path, query, client); var template = new WebTemplate("errors/todo.html", session); template.replace("TITLE", shortname + " Shop System: ToDo"); - template.replace("SHORTNAME", shortname); template.menu_set_active(""); msg.set_response("text/html", Soup.MemoryUse.COPY, template.data); msg.set_status(200); @@ -1276,7 +1255,6 @@ public class WebServer { } template.replace("TITLE", shortname + " Shop System: Cashbox"); - template.replace("SHORTNAME", shortname); template.replace("CASHBOX_STATUS", status); template.replace("CASHBOX_HISTORY", hist); template.menu_set_active("cashbox"); @@ -1305,7 +1283,6 @@ public class WebServer { var template = new WebTemplate("cashbox/add.html", session); template.replace("TITLE", shortname + " Shop System: Cashbox Balance"); - template.replace("SHORTNAME", shortname); template.menu_set_active("cashbox"); bool error = false; @@ -1380,7 +1357,6 @@ public class WebServer { var session = new WebSession(server, msg, path, query, client); var template = new WebTemplate("cashbox/selection.html", session); template.replace("TITLE", shortname + " Shop System: Cashbox Detail"); - template.replace("SHORTNAME", shortname); template.menu_set_active("cashbox"); msg.set_response("text/html", Soup.MemoryUse.COPY, template.data); msg.set_status(200); @@ -1454,7 +1430,6 @@ public class WebServer { var template = new WebTemplate("cashbox/detail.html", session); template.replace("TITLE", shortname + " Shop System: Cashbox Detail"); template.menu_set_active("cashbox"); - template.replace("SHORTNAME", shortname); template.replace("DATE", start.format("%B %Y")); template.replace("DEBIT", debit.to_string()); template.replace("LOSS", loss.to_string()); @@ -1480,16 +1455,6 @@ public class WebServer { } public WebServer(uint port = 8080, TlsCertificate? cert = null) throws Error { - /* get configuration */ - Config config = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config"); - try { - longname = config.get_string("GENERAL", "longname"); - shortname = config.get_string("GENERAL", "shortname"); - } catch(KeyFileError e) { - longname = "Logname Missing in Config"; - shortname = "Shortname Missing in Config"; - } - srv = new Soup.Server("tls-certificate", cert); Soup.ServerListenOptions options = 0; -- cgit v1.2.3