Patch level :10.0

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :rimesso in funzione il patch killer!


git-svn-id: svn://10.65.10.50/trunk@16480 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2008-04-08 10:48:21 +00:00
parent 14e048d343
commit 0c732000c3

View File

@ -1516,7 +1516,7 @@ bool TCreadischi_mask::why_handler(TMask_field& f, KEY k)
bool TCreadischi_mask::testpatch_handler(TMask_field& f, KEY k) bool TCreadischi_mask::testpatch_handler(TMask_field& f, KEY k)
{ {
if (k != K_SPACE) if (k != K_SPACE)
return TRUE; return true;
TMask& m = f.mask(); TMask& m = f.mask();
const TString& module = m.get(S_MODULE); const TString& module = m.get(S_MODULE);
@ -1533,14 +1533,16 @@ bool TCreadischi_mask::testpatch_handler(TMask_field& f, KEY k)
if (inifiles.items() > 0) if (inifiles.items() > 0)
{ {
TProgind pi(inifiles.items(), TR("Scansione archivi..."), FALSE, TRUE); TProgind pi(inifiles.items(), TR("Scansione archivi..."), true, true);
TAssoc_array files; TAssoc_array files;
TString_array para; TString_array para;
TToken_string tok; TToken_string tok;
FOR_EACH_ARRAY_ROW_BACK(inifiles, numf, filename) FOR_EACH_ARRAY_ROW_BACK(inifiles, numf, filename)
{ {
pi.addstatus(1); if (!pi.addstatus(1))
bool can_be_deleted = TRUE; break;
bool can_be_deleted = true;
TConfig ini(*filename, module); TConfig ini(*filename, module);
ini.list_paragraphs(para); ini.list_paragraphs(para);
FOR_EACH_ARRAY_ROW_BACK(para, nump, paraname) if (paraname->len() == 3) FOR_EACH_ARRAY_ROW_BACK(para, nump, paraname) if (paraname->len() == 3)
@ -1558,7 +1560,7 @@ bool TCreadischi_mask::testpatch_handler(TMask_field& f, KEY k)
if (!files.is_key(tok)) if (!files.is_key(tok))
{ {
files.add(tok); files.add(tok);
can_be_deleted = FALSE; can_be_deleted = false;
} }
} }
} }
@ -1566,7 +1568,7 @@ bool TCreadischi_mask::testpatch_handler(TMask_field& f, KEY k)
if (can_be_deleted) if (can_be_deleted)
filename->insert(" |", 0); filename->insert(" |", 0);
else else
inifiles.destroy(numf, TRUE); inifiles.destroy(numf, true);
} }
} }
@ -1576,27 +1578,37 @@ bool TCreadischi_mask::testpatch_handler(TMask_field& f, KEY k)
if (sheet.run() == K_ENTER) if (sheet.run() == K_ENTER)
{ {
const long tot = sheet.checked(); const long tot = sheet.checked();
if (tot > 0 && yesno_box(FR("Confermare la cancellazione di %ld file"), tot)) if (tot > 0 && yesno_box(FR("Confermare la cancellazione di %ld patches"), tot))
{ {
TWait_cursor hourglass; TWait_cursor hourglass;
for (long i = sheet.items()-1; i >= 0; i--) if (sheet.checked(i)) for (long i = sheet.items()-1; i >= 0; i--) if (sheet.checked(i))
{ {
for (int d = 1; d <= 9; d++) const TFilename ininame = sheet.row(i).get(1);
if (::remove(ininame) == 0)
{ {
TFilename name = sheet.row(i).get(1); TFilename name;
name.ext(""); name << d << ".zip"; for (int d = 1; d <= 9; d++)
if (::remove(name) != 0) {
{ name = ininame;
if (d == 1) name.ext(""); name << d << ".zip";
error_box(FR("Errore di cancellazione del file %s"), (const char*)name); if (::remove(name) != 0)
break; {
if (d == 1)
error_box(FR("Errore di cancellazione del file %s"), (const char*)name);
break;
}
} }
} }
else
{
error_box(FR("Errore di cancellazione del file %s"), (const char*)ininame);
break;
}
} }
} }
} }
return TRUE; return true;
} }
bool TCreadischi_mask::import_export_handler(TMask_field& f, KEY k) bool TCreadischi_mask::import_export_handler(TMask_field& f, KEY k)