From 8adba3b2918898a3685a2e8f844aa1dc05cbc9ee Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 3 Feb 2009 12:16:05 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:10.0?= =?UTF-8?q?=20226=20Files=20correlati=20=20=20=20=20:ba0=20ba1=20Ricompila?= =?UTF-8?q?zione=20Demo=20:=20[=20]=20Commento=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20:=200001131:=20inst=20ptf=20210=20Descrizione=20=20se?= =?UTF-8?q?=20si=20aggiorna=20una=20versione=20di=20campo,=20alla=20fine?= =?UTF-8?q?=20della=20conversione,=20quando=20si=20preme=20il=20tasto=20fi?= =?UTF-8?q?ne=20viene=20visualizzato=20'=20si=20=C3=A8=20verificato=20un?= =?UTF-8?q?=20errore=20in=20ba1.exe.=20L'applicazione=20verr=C3=A0=20chius?= =?UTF-8?q?a.=20Il=20problema=20non=20si=20verifica=20in=20caso=20di=20nuo?= =?UTF-8?q?va=20installazione.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/trunk@18190 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba1100.cpp | 52 +++++++++++++++++++++++++++++---------------------- ba/ba1103.cpp | 33 ++++++++++++++++---------------- 2 files changed, 46 insertions(+), 39 deletions(-) diff --git a/ba/ba1100.cpp b/ba/ba1100.cpp index 679d18a02..64f9db9ea 100755 --- a/ba/ba1100.cpp +++ b/ba/ba1100.cpp @@ -52,6 +52,9 @@ protected: void delete_riga(long); virtual bool extended_firm() const { return true; } + bool set_converting(); + bool reset_converting(); + bool recover(TSystemisamfile& f, int err); void update(); void update_dir(); @@ -1437,12 +1440,11 @@ void TManutenzione_app::load_des() } } -void TManutenzione_app::update() +bool TManutenzione_app::set_converting() { TIsamfile utenti(LF_USER); utenti.open(_excllock); -#ifndef DBG bool ok = false; while (!ok) { @@ -1461,13 +1463,14 @@ void TManutenzione_app::update() message.add(TR("Qualora uno degli utenti elencati non fosse effettivamente connesso, ")); message.add(TR("effettuare una sua connessione e disconnessione immediata per sbloccarlo")); message.add(utonti); - error_box(message); + if (is_power_station()) + ok = yesno_box(message); + else + error_box(message); break; } } -#else - bool ok = true; -#endif + // Scrive CONVERTING solo dopo aver testato che non ci sia nessuno connesso if (ok) { @@ -1482,6 +1485,26 @@ void TManutenzione_app::update() } utenti.close(); + return ok; +} + +bool TManutenzione_app::reset_converting() +{ + TLocalisamfile utenti(LF_USER); + // Azzera la scritta converting + utenti.put(USR_USERNAME, ::dongle().administrator()); + bool ok = utenti.read(_isequal, _lock) == NOERR; + if (ok) + { + utenti.zero(USR_AUTSTR); + ok = utenti.rewrite() == NOERR; + } + return ok; +} + +void TManutenzione_app::update() +{ + bool ok = set_converting(); if (!ok) return; @@ -1532,22 +1555,7 @@ void TManutenzione_app::update() else prefix().set(pref); load_des(); - ok = false; - while (!ok) - { - utenti.open(_excllock); - ok = utenti.ok(); - do_events(); - } - - // Azzera la scritta converting - utenti.put(USR_USERNAME, ::dongle().administrator()); - if (utenti.read() == NOERR) - { - utenti.zero(USR_AUTSTR); - utenti.rewrite(); - } - utenti.close(); + reset_converting(); close_history(); send_campo_xml(); // Spedisce situazione via ftp diff --git a/ba/ba1103.cpp b/ba/ba1103.cpp index d76138749..3816c3862 100755 --- a/ba/ba1103.cpp +++ b/ba/ba1103.cpp @@ -216,27 +216,26 @@ bool save_campo_xml() // Aggiorna il file xml coi dati di installazione e lo spedisce qua bool send_campo_xml() -{ - TWait_cursor waiter; - bool ok = false; +{ + bool ok = is_power_station(); -#ifdef NDEBUG - if (dongle().number() || !is_power_station()) // Non salvare attivazioni di prova interne -#endif - - if (save_campo_xml()) + if (!ok) // Non salvare attivazioni di prova interne { - if (xvt_net_get_status() & 0x7) + TWait_cursor waiter; + if (save_campo_xml()) { - TSocketClient aga; - CONNID id = aga.QueryConnection("21", "www.aga.it"); - if (id > 0) + if (xvt_net_get_status() & 0x7) { - TFilename local, remote; - build_xml_filename(local, false); - build_xml_filename(remote, true); - ok = aga.FtpSendFile(id, remote, local, "attivazioni", "viagra"); - aga.RemoveConnection(id); + TSocketClient aga; + CONNID id = aga.QueryConnection("21", "www.aga.it"); + if (id > 0) + { + TFilename local, remote; + build_xml_filename(local, false); + build_xml_filename(remote, true); + ok = aga.FtpSendFile(id, remote, local, "attivazioni", "viagra"); + aga.RemoveConnection(id); + } } } }