Patch level : 10.0

Files correlati     : ba0.exe
Ricompilazione Demo : [ ]
Commento            :
Reso impossibile utilizzo di piu' istanze di cg6


git-svn-id: svn://10.65.10.50/trunk@20286 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-03-29 14:36:06 +00:00
parent 90e78afb05
commit 3dde4ba1f6
6 changed files with 64 additions and 58 deletions

View File

@ -1476,19 +1476,25 @@ bool TMenu_application::test_programs()
bool TMenu_application::user_create() 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) 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"); if (!yesno_box(TR("ATTENZIONE\nQuesto programma è in versione dimostrativa.\n"
app.run(); "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()) if (!test_programs())

View File

@ -281,11 +281,12 @@ bool TMenuitem::perform_submenu() const
return ok; return ok;
} }
// Alcuni programmi devono essere eseguiti singolarmente: ba1, ba2, cg6
bool TMenuitem::run_modal() const bool TMenuitem::run_modal() const
{ {
bool yes = true; bool yes = true;
if (submenu().menu().mask_mode() == 3) 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; return yes;
} }
@ -324,10 +325,9 @@ bool TMenuitem::perform_program() const
if (_firm && main_app().get_firm() == 0) if (_firm && main_app().get_firm() == 0)
{ {
if (dongle().demo()) // Forza ditta 1 in demo altrimenti chiedila all'utente
ok = menu().set_firm(1); // Forza la ditta 1 const int cd = dongle().demo() ? 1 : 0;
else ok = menu().set_firm(cd);
ok = menu().set_firm(0); // Chiede la ditta all'utente
} }
if (ok) if (ok)

View File

@ -70,11 +70,11 @@ static void build_xml_filename(TFilename& name, bool remote)
xvt_sys_get_host_name(host, sizeof(host)); xvt_sys_get_host_name(host, sizeof(host));
name << host; name << host;
name.replace(' ', '_'); name.replace(' ', '_');
} if (remote)
if (remote) {
{ const TDate oggi(TODAY);
const TDate oggi(TODAY); name << '_' << oggi.date2ansi();
name << '_' << oggi.date2ansi(); }
} }
name.ext("xml"); name.ext("xml");
} }
@ -140,6 +140,16 @@ static int is_active_firm(long codditta)
return 0; 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 // Salva o aggiorna il file xml coi dati di installazione
bool save_campo_xml() bool save_campo_xml()
{ {
@ -150,15 +160,16 @@ bool save_campo_xml()
root.SetTag("Campo"); root.SetTag("Campo");
TXmlItem& system = find_or_create_child(root, "system"); TXmlItem& system = find_or_create_child(root, "system");
char host[_MAX_PATH];
xvt_sys_get_host_name(host, sizeof(host)); TFilename str;
system.SetAttr("Host", host); xvt_sys_get_host_name(str.get_buffer(), str.size());
xvt_sys_get_user_name(host, sizeof(host)); set_attr(system, "Host", str);
system.SetAttr("User", host); xvt_sys_get_user_name(str.get_buffer(), str.size());
time_t t; time(&t); set_attr(system, "User", str);
system.SetAttr("Time", ctime(&t)); time_t t; time(&t); str = ctime(&t);
xvt_sys_get_version(host, NULL, sizeof(host)); set_attr(system, "Time", str);
system.SetAttr("O.S.", host); 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); TXmlItem& study = find_or_create_child(root, "study", true);
TArray ditte; TPrefix::firms(ditte); TArray ditte; TPrefix::firms(ditte);
@ -179,9 +190,8 @@ bool save_campo_xml()
} }
} }
xvt_sys_get_host_name(host, sizeof(host)); set_attr(study, "DataPath", firm2dir(-1));
study.SetAttr("DataPath", firm2dir(-1)); set_attr(study, "ExePath", main_app().argv(0));
study.SetAttr("ExePath", main_app().argv(0));
const TDongle& d = dongle(); const TDongle& d = dongle();
TXmlItem& chiavetta = find_or_create_child(root, "dongle", true); 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_hardlock: chiavetta.SetAttr("Model", "Hardlock"); break;
case _dongle_eutron : chiavetta.SetAttr("Model", "Eutron"); break; case _dongle_eutron : chiavetta.SetAttr("Model", "Eutron"); break;
case _dongle_network : case _dongle_network : chiavetta.SetAttr("Model", "Network server");
chiavetta.SetAttr("Model", "Network server"); chiavetta.SetAttr("Server", d.server_name());
xvt_sys_get_profile_string(NULL, "Server", "Dongle", "", host, sizeof(host));
chiavetta.SetAttr("Server", host);
break; break;
default: chiavetta.SetAttr("Model", "Unknown"); break; default: chiavetta.SetAttr("Model", "Unknown"); break;
} }
@ -225,7 +233,7 @@ bool send_campo_xml()
{ {
TWait_cursor waiter; TWait_cursor waiter;
bool ok = save_campo_xml(); 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; TSocketClient aga;
CONNID id = aga.QueryConnection("21", "www.aga.it"); CONNID id = aga.QueryConnection("21", "www.aga.it");

View File

@ -929,12 +929,18 @@ bool TAttivazione_moduli::test_assistance_year() const
bool TAttivazione_moduli::create() bool TAttivazione_moduli::create()
{ {
bool ok = ::dongle().login(true); TDongle& d = dongle();
bool ok = d.login(true);
if (!ok) if (!ok)
return false; return false;
if (::dongle().hardware() == _dongle_network) if (d.hardware() == _dongle_network)
return error_box(TR("Questo programma non puo' funzionare mentre e' in funzione il server di autorizzazioni")); {
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(); ok = TApplication::test_assistance_year();
if (!ok) if (!ok)

View File

@ -32,21 +32,7 @@
// Metodi di utility // Metodi di utility
/////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
HIDDEN const TString& http_default_path() HIDDEN const TString& http_default_path()
{ { return get_oem_info("Web", "www.aga.it/release100/");}
//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;
}
HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2) HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2)
{ {

View File

@ -81,7 +81,7 @@ bool TCond_pag_app::user_create()
_interv_rate = 30; _interv_rate = 30;
_pag = NULL; _pag = NULL;
_msk = new TMask("ba3700a"); _msk = new TMask("ba3700a");
_cs = &((TSheet_field&)_msk->field(F_SHEET_RPG)); _cs = &_msk->sfield(F_SHEET_RPG));
_cs->set_notify(sheet_action); _cs->set_notify(sheet_action);
_msk->set_handler (F_INT_RATE , intervallo_rate); _msk->set_handler (F_INT_RATE , intervallo_rate);