diff --git a/ba/ba0100.cpp b/ba/ba0100.cpp index e64ea9b6f..b62f44acc 100755 --- a/ba/ba0100.cpp +++ b/ba/ba0100.cpp @@ -1476,21 +1476,27 @@ bool TMenu_application::test_programs() bool TMenu_application::user_create() { - disable_menu_item(M_FILE_PRINT); // Questa voce di menu non serve per ora + disable_menu_item(M_FILE_PRINT); // Questa voce di menu non serve per ora + disable_menu_item(M_FILE_PREVIEW); // Figuriamoci questa if (dongle().type() == _no_dongle) - warning_box(TR("ATTENZIONE\nQuesto programma è in versione dimostrativa.\n" - "Esso funzionera' per circa due ore al giorno con un numero limitato di registrazioni.")); - - if (!check_user()) - return false; - - if (!TApplication::test_assistance_year()) { - TExternal_app app("ba1 -4"); - app.run(); - } - + if (!yesno_box(TR("ATTENZIONE\nQuesto programma è in versione dimostrativa.\n" + "Esso funzionera' con alcune limitazioni sulle registrazioni.\n" + "Si desidera proseguire?"))) + return false; + } + else + { + if (!TApplication::test_assistance_year()) + { + TExternal_app app("ba1 -4"); + app.run(); + } + if (!check_user()) + return false; + } + if (!test_programs()) return false; diff --git a/ba/ba0101.cpp b/ba/ba0101.cpp index 399ab07a1..215a947f7 100755 --- a/ba/ba0101.cpp +++ b/ba/ba0101.cpp @@ -281,11 +281,12 @@ bool TMenuitem::perform_submenu() const return ok; } +// Alcuni programmi devono essere eseguiti singolarmente: ba1, ba2, cg6 bool TMenuitem::run_modal() const { bool yes = true; if (submenu().menu().mask_mode() == 3) - yes = _action.match("ba[12] -*", true); + yes = _action.match("ba[12] -*", true) || _action.starts_with("cg6", true); return yes; } @@ -324,10 +325,9 @@ bool TMenuitem::perform_program() const if (_firm && main_app().get_firm() == 0) { - if (dongle().demo()) - ok = menu().set_firm(1); // Forza la ditta 1 - else - ok = menu().set_firm(0); // Chiede la ditta all'utente + // Forza ditta 1 in demo altrimenti chiedila all'utente + const int cd = dongle().demo() ? 1 : 0; + ok = menu().set_firm(cd); } if (ok) diff --git a/ba/ba1103.cpp b/ba/ba1103.cpp index d04cd40af..a2fa14024 100755 --- a/ba/ba1103.cpp +++ b/ba/ba1103.cpp @@ -70,11 +70,11 @@ static void build_xml_filename(TFilename& name, bool remote) xvt_sys_get_host_name(host, sizeof(host)); name << host; name.replace(' ', '_'); - } - if (remote) - { - const TDate oggi(TODAY); - name << '_' << oggi.date2ansi(); + if (remote) + { + const TDate oggi(TODAY); + name << '_' << oggi.date2ansi(); + } } name.ext("xml"); } @@ -140,6 +140,16 @@ static int is_active_firm(long codditta) return 0; } +static TXmlItem& set_attr(TXmlItem& root, const char* name, const char* value) +{ + TXmlItem& c = find_or_create_child(root, "attr"); + c.SetAttr("Name", name); + + TString str = value; str.trim(); + c.SetAttr("Value", str); + return c; +} + // Salva o aggiorna il file xml coi dati di installazione bool save_campo_xml() { @@ -150,15 +160,16 @@ bool save_campo_xml() root.SetTag("Campo"); TXmlItem& system = find_or_create_child(root, "system"); - char host[_MAX_PATH]; - xvt_sys_get_host_name(host, sizeof(host)); - system.SetAttr("Host", host); - xvt_sys_get_user_name(host, sizeof(host)); - system.SetAttr("User", host); - time_t t; time(&t); - system.SetAttr("Time", ctime(&t)); - xvt_sys_get_version(host, NULL, sizeof(host)); - system.SetAttr("O.S.", host); + + TFilename str; + xvt_sys_get_host_name(str.get_buffer(), str.size()); + set_attr(system, "Host", str); + xvt_sys_get_user_name(str.get_buffer(), str.size()); + set_attr(system, "User", str); + time_t t; time(&t); str = ctime(&t); + set_attr(system, "Time", str); + xvt_sys_get_version(str.get_buffer(), NULL, str.size()); + set_attr(system, "O.S.", str); TXmlItem& study = find_or_create_child(root, "study", true); TArray ditte; TPrefix::firms(ditte); @@ -179,9 +190,8 @@ bool save_campo_xml() } } - xvt_sys_get_host_name(host, sizeof(host)); - study.SetAttr("DataPath", firm2dir(-1)); - study.SetAttr("ExePath", main_app().argv(0)); + set_attr(study, "DataPath", firm2dir(-1)); + set_attr(study, "ExePath", main_app().argv(0)); const TDongle& d = dongle(); TXmlItem& chiavetta = find_or_create_child(root, "dongle", true); @@ -193,10 +203,8 @@ bool save_campo_xml() { case _dongle_hardlock: chiavetta.SetAttr("Model", "Hardlock"); break; case _dongle_eutron : chiavetta.SetAttr("Model", "Eutron"); break; - case _dongle_network : - chiavetta.SetAttr("Model", "Network server"); - xvt_sys_get_profile_string(NULL, "Server", "Dongle", "", host, sizeof(host)); - chiavetta.SetAttr("Server", host); + case _dongle_network : chiavetta.SetAttr("Model", "Network server"); + chiavetta.SetAttr("Server", d.server_name()); break; default: chiavetta.SetAttr("Model", "Unknown"); break; } @@ -225,7 +233,7 @@ bool send_campo_xml() { TWait_cursor waiter; bool ok = save_campo_xml(); - if (ok && (xvt_net_get_status() & 0x4) && !is_power_station()) + if (ok && (xvt_net_get_status() & 0x4) != 0) { TSocketClient aga; CONNID id = aga.QueryConnection("21", "www.aga.it"); diff --git a/ba/ba1500.cpp b/ba/ba1500.cpp index 3e1f12b2b..806a75635 100755 --- a/ba/ba1500.cpp +++ b/ba/ba1500.cpp @@ -929,12 +929,18 @@ bool TAttivazione_moduli::test_assistance_year() const bool TAttivazione_moduli::create() { - bool ok = ::dongle().login(true); + TDongle& d = dongle(); + bool ok = d.login(true); if (!ok) return false; - if (::dongle().hardware() == _dongle_network) - return error_box(TR("Questo programma non puo' funzionare mentre e' in funzione il server di autorizzazioni")); + if (d.hardware() == _dongle_network) + { + if (is_power_station()) + warning_box(TR("Non è consigliabile usare questo programma mentre e' in funzione il server di autorizzazioni")); + else + return error_box(TR("Questo programma non puo' funzionare mentre e' in funzione il server di autorizzazioni")); + } ok = TApplication::test_assistance_year(); if (!ok) diff --git a/ba/ba1700.cpp b/ba/ba1700.cpp index 2ee7cc37a..09946dc62 100755 --- a/ba/ba1700.cpp +++ b/ba/ba1700.cpp @@ -32,21 +32,7 @@ // Metodi di utility /////////////////////////////////////////////////////// HIDDEN const TString& http_default_path() -{ - //nuovo modo di gettare il producer da oem.ini - TConfig oemini(CONFIG_OEM, "MAIN"); - const int oem = oemini.get_int("OEM", NULL, -1, -1); - TString& tmp = get_tmp_string(); - if (oem >= 0) - { - TString8 para; para << "OEM_" << oem; - tmp = oemini.get("Web", para); - } - if (tmp.blank()) - tmp = "www.aga.it/release100/"; - - return tmp; -} +{ return get_oem_info("Web", "www.aga.it/release100/");} HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2) { diff --git a/ba/ba3700.cpp b/ba/ba3700.cpp index 2a96f7eec..3d345e579 100755 --- a/ba/ba3700.cpp +++ b/ba/ba3700.cpp @@ -81,7 +81,7 @@ bool TCond_pag_app::user_create() _interv_rate = 30; _pag = NULL; _msk = new TMask("ba3700a"); - _cs = &((TSheet_field&)_msk->field(F_SHEET_RPG)); + _cs = &_msk->sfield(F_SHEET_RPG)); _cs->set_notify(sheet_action); _msk->set_handler (F_INT_RATE , intervallo_rate);