From 888f4a884c1fc6b58eb149c0f4614846270f0d41 Mon Sep 17 00:00:00 2001 From: angelo Date: Fri, 22 Sep 1995 10:53:44 +0000 Subject: [PATCH] Rif. mod. 95/37. Aggiunto metodo TApplication::extra_modules(). Ritorna una stringa contenente le autorizzazioni supplementari dei moduli. git-svn-id: svn://10.65.10.50/trunk@1878 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/applicat.cpp | 22 +++++++++++++++++----- include/applicat.h | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/include/applicat.cpp b/include/applicat.cpp index 4283db5a1..61cb35ed4 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -317,15 +317,27 @@ const char* TApplication::get_module_name() const for (int aut = 0; scanner.line() != ""; aut++) if (strncmp(scanner.token(), _name, 2) == 0) { ok = TRUE; break; } - const char* module = scanner.token().mid(3); + TString module(scanner.token().mid(3)); if (ok) ok = has_module(aut); + - if (!ok) + if (!ok) { - error_box("Il modulo '%s' non e' autorizzato", module); - module = ""; + TToken_string em(extra_modules()); + const int items = em.items(); + if (items != 0) + for (int j = 0; j < items; j++) + { + ok = has_module(em.get_int()); + if (!ok) + break; + } + if (!ok) + { + error_box("Il modulo '%s' non e' autorizzato", (const char*)module); + module = ""; + } } - return module; } diff --git a/include/applicat.h b/include/applicat.h index f58114c1e..4fb4f6a88 100755 --- a/include/applicat.h +++ b/include/applicat.h @@ -70,6 +70,7 @@ public: virtual bool ok() const { return _create_ok; } virtual void print(); virtual bool firm_change_enabled() const; + virtual const char * extra_modules() const {return "";} void stop_run(); // Forza chiusura applicazione