Corretta e velocizzata cancellazione dei record.
git-svn-id: svn://10.65.10.50/trunk@5665 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
62d347f0a3
commit
2810135cc8
@ -58,34 +58,37 @@ bool TEdit_file::_browse(TCursor& cursor, const TFilename& name)
|
||||
cursor.freeze(TRUE);
|
||||
bool go = FALSE;
|
||||
bool first = FALSE;
|
||||
int j;
|
||||
for (j = 0, cursor = 0; j < sheet.items(); ++cursor, j++)
|
||||
long j;
|
||||
const long items = sheet.items();
|
||||
const long checked = sheet.checked();
|
||||
if (checked && yesno_box("Si desidera cancellare i %ld record indicati?", checked))
|
||||
{
|
||||
if (sheet.checked(j))
|
||||
begin_wait();
|
||||
for (j = 0, cursor = 0; j < items; j++)
|
||||
{
|
||||
if (!go && !first)
|
||||
go = yesno_box("Si desidera cancellare i %d record indicati?", sheet.checked());
|
||||
first = TRUE;
|
||||
|
||||
if (!pind)
|
||||
if (sheet.checked(j))
|
||||
{
|
||||
pind = new TProgind(sheet.checked(),"Attendere...", TRUE, TRUE, 32);
|
||||
pind->addstatus(1);
|
||||
if (!pind)
|
||||
{
|
||||
pind = new TProgind(sheet.checked(),"Attendere...", TRUE, TRUE, 32);
|
||||
pind->addstatus(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pind->iscancelled()) break;
|
||||
pind->addstatus(1);
|
||||
}
|
||||
|
||||
cursor = j;
|
||||
cursor.file().remove();
|
||||
sheet.uncheck(j);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pind->iscancelled()) break;
|
||||
pind->addstatus(1);
|
||||
}
|
||||
|
||||
if (go) cursor.file().remove();
|
||||
sheet.uncheck(j);
|
||||
}
|
||||
end_wait();
|
||||
}
|
||||
if (pind) delete pind;
|
||||
cursor.freeze(FALSE);
|
||||
|
||||
if (first)
|
||||
{
|
||||
if (cursor.items() > 0)
|
||||
sheet.select(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user