diff --git a/src/ba/ba1600.cpp b/src/ba/ba1600.cpp index 7c921ed69..51a67e788 100755 --- a/src/ba/ba1600.cpp +++ b/src/ba/ba1600.cpp @@ -89,9 +89,20 @@ int TInstall_ini::build_list(const TString& module, TString_array& a, TAssoc_array& varlist = list_variables(paragraph); FOR_EACH_ASSOC_STRING(varlist, obj, key, str) - { + { + TString val(str); const bool is_file = strncmp(key, "File", 4) == 0; - tmp = str; // Nome e aggiornamento + const bool is_patch = strncmp(key, "Patch", 5) == 0; + + if (is_patch) + { + TString4 real_patch; + + real_patch << patch(module); + if (real_patch != val) + val = real_patch; + } + tmp = val; // Nome e aggiornamento // Quando creo il disco di aggiornamento salto tutti i file // che non hanno il flag di aggiornamento settato if (agg && is_file && tmp.get_char(1) != 'X') @@ -358,6 +369,12 @@ const TString& TInstall_ini::version(const char* module) return ver; } +void TInstall_ini::set_patch(const char* module, int patch) +{ + CHECK(module && *module > ' ', "Can't get version of NULL module"); + set("Patch", patch, module); +} + int TInstall_ini::patch(const char* module) { CHECK(module && *module > ' ', "Can't get version of NULL module"); @@ -1265,6 +1282,8 @@ bool TFascicolator_mask::patchl_handler(TMask_field& f, KEY k) TMask& m = f.mask(); TSheet_field& s = *m.get_sheet(); long last_patch = 0; + const TString4 module(s.row(s.selected()).get(1)); + FOR_EACH_SHEET_ROW(s, r, row) { const int p = row->get_int(3); @@ -1285,8 +1304,14 @@ bool TFascicolator_mask::patchl_handler(TMask_field& f, KEY k) } break; case K_TAB: - if (f.get_long() < last_patch) - warning_box(FR("Attenzione: l'ultima patch sarebbe la %ld"), last_patch); + { + if (f.get_long() < last_patch) + warning_box(FR("Attenzione: l'ultima patch sarebbe la %ld"), last_patch); + + TInstall_ini ini; + + ini.set_patch(module, f.get_long()); + } break; default: break; diff --git a/src/ba/ba1600.h b/src/ba/ba1600.h index 5ef0e0816..7ca965432 100755 --- a/src/ba/ba1600.h +++ b/src/ba/ba1600.h @@ -20,6 +20,7 @@ public: bool demo() { return get_bool("Demo", "Main"); } const TString& version(const char* module); + void set_patch(const char* module, int patch); int patch(const char* module); void version_info(const char* module, int& year, int& release, int& tag, int& patch);