Patch level : 10.0
Files correlati : ba1.exe Ricompilazione Demo : [ ] Commento : Migliorata gestione conversioni ed aggiornamenti git-svn-id: svn://10.65.10.50/trunk@17903 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5bd40db53b
commit
aaae86ef5c
@ -12,10 +12,6 @@
|
|||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
#include <user.h>
|
#include <user.h>
|
||||||
#include <nditte.h>
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
@ -63,7 +59,7 @@ protected:
|
|||||||
virtual void print();
|
virtual void print();
|
||||||
virtual void do_print(TPrinter & p, TRec_sheet & r);
|
virtual void do_print(TPrinter & p, TRec_sheet & r);
|
||||||
const char* dumpfilename(const FileDes& dep) const;
|
const char* dumpfilename(const FileDes& dep) const;
|
||||||
void load_des(const int maxfidr = 0);
|
void load_des();
|
||||||
void open_history();
|
void open_history();
|
||||||
void put_history(const char* firm);
|
void put_history(const char* firm);
|
||||||
void close_history();
|
void close_history();
|
||||||
@ -75,7 +71,6 @@ protected:
|
|||||||
void write_log(const char* line, const int severity = 0);
|
void write_log(const char* line, const int severity = 0);
|
||||||
void close_log();
|
void close_log();
|
||||||
|
|
||||||
|
|
||||||
bool moveable_file(int file) const;
|
bool moveable_file(int file) const;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -805,11 +800,9 @@ bool TManutenzione_app::recover(TSystemisamfile& f, int err)
|
|||||||
|
|
||||||
void TManutenzione_app::repair_file(int i)
|
void TManutenzione_app::repair_file(int i)
|
||||||
{
|
{
|
||||||
TDir d;
|
|
||||||
TString s(_MAX_PATH);
|
TString s(_MAX_PATH);
|
||||||
|
|
||||||
d.get(i, _nolock, _nordir, _sysdirop);
|
TDir d(i);
|
||||||
|
|
||||||
if (d.eod() == 0)
|
if (d.eod() == 0)
|
||||||
{
|
{
|
||||||
TFilename n(d.filename());
|
TFilename n(d.filename());
|
||||||
@ -1215,12 +1208,13 @@ void TManutenzione_app::convert_dir()
|
|||||||
s << atol (pref) << ".\n";
|
s << atol (pref) << ".\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
TProgind p(update_items ? update_items : 1, s, false, true);
|
TProgind p(update_items ? update_items : 1, s, is_power_station());
|
||||||
p.setstatus(1);
|
|
||||||
|
|
||||||
for (int i = LF_USER; i <= update_items; i++)
|
for (int i = LF_USER; i <= update_items; i++)
|
||||||
{
|
{
|
||||||
const TTrec & rs = (const TTrec &) _recs[i];
|
if (!p.addstatus(1))
|
||||||
|
break;
|
||||||
|
|
||||||
|
const TTrec& rs = (const TTrec&)_recs[i]; // Nuovo tracciato record
|
||||||
const TDir& ds = (const TDir&)_dirs[i];
|
const TDir& ds = (const TDir&)_dirs[i];
|
||||||
const long flags = ds.flags();
|
const long flags = ds.flags();
|
||||||
|
|
||||||
@ -1228,16 +1222,24 @@ void TManutenzione_app::convert_dir()
|
|||||||
{
|
{
|
||||||
if (flags >= 0L && flags < 10000L)
|
if (flags >= 0L && flags < 10000L)
|
||||||
{
|
{
|
||||||
TSystemisamfile f(i);
|
d.get(i, _nolock, _nordir, _sysdirop);
|
||||||
TString msg = s; msg << prefix().get_filename(i);
|
|
||||||
|
TString msg = s; msg << d.filename();
|
||||||
p.set_text(msg);
|
p.set_text(msg);
|
||||||
|
|
||||||
const int module = abs((int)ds.flags());
|
const int module = abs((int)ds.flags());
|
||||||
|
TSystemisamfile f(i);
|
||||||
int err = f.is_valid(true);
|
int err = f.is_valid(true);
|
||||||
if (err == -60 || err == -64)
|
switch (err)
|
||||||
|
{
|
||||||
|
case -64:
|
||||||
|
case -60:
|
||||||
err = NOERR; // verif.
|
err = NOERR; // verif.
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
d.get(i, _nolock, _nordir, _sysdirop);
|
|
||||||
if (i > LF_USER && err != NOERR && ((is_com && d.is_com()) || (!is_com && d.is_firm())))
|
if (i > LF_USER && err != NOERR && ((is_com && d.is_com()) || (!is_com && d.is_firm())))
|
||||||
{
|
{
|
||||||
if (err == _istrcerr || err == _isbadtrc)
|
if (err == _istrcerr || err == _isbadtrc)
|
||||||
@ -1250,7 +1252,6 @@ void TManutenzione_app::convert_dir()
|
|||||||
{
|
{
|
||||||
//si decide di proseguire anche se il file non può essere aperto ne tiene traccia nel log (nel caso di utonti..
|
//si decide di proseguire anche se il file non può essere aperto ne tiene traccia nel log (nel caso di utonti..
|
||||||
//..è sempre così, perchè go_on è sempre true)
|
//..è sempre così, perchè go_on è sempre true)
|
||||||
TString msg;
|
|
||||||
msg.format(TR("Il file %d non può essere aperto. Errore %d"), i, err);
|
msg.format(TR("Il file %d non può essere aperto. Errore %d"), i, err);
|
||||||
write_log(msg, 2);
|
write_log(msg, 2);
|
||||||
continue;
|
continue;
|
||||||
@ -1316,8 +1317,6 @@ void TManutenzione_app::convert_dir()
|
|||||||
d.put(i, _nordir, _sysdirop);
|
d.put(i, _nordir, _sysdirop);
|
||||||
r.put(i);
|
r.put(i);
|
||||||
} //else di if(ds.len()>0...
|
} //else di if(ds.len()>0...
|
||||||
p.addstatus(1);
|
|
||||||
|
|
||||||
} //for (int i = 2; i <= update_items...
|
} //for (int i = 2; i <= update_items...
|
||||||
|
|
||||||
d.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
d.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||||
@ -1326,7 +1325,7 @@ void TManutenzione_app::convert_dir()
|
|||||||
put_history(pref);
|
put_history(pref);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TManutenzione_app::load_des(const int maxfdir)
|
void TManutenzione_app::load_des()
|
||||||
{
|
{
|
||||||
TWait_cursor waiter;
|
TWait_cursor waiter;
|
||||||
const TString pref(prefix().name());
|
const TString pref(prefix().name());
|
||||||
@ -1405,11 +1404,13 @@ void TManutenzione_app::load_des(const int maxfdir)
|
|||||||
items = (int) d.eod();
|
items = (int) d.eod();
|
||||||
TString80 s;
|
TString80 s;
|
||||||
|
|
||||||
if (standard) s = TR("Caricamento descrizioni archivi standard");
|
if (standard)
|
||||||
|
s = TR("Caricamento descrizioni archivi standard");
|
||||||
else
|
else
|
||||||
|
{
|
||||||
if (prefix().is_com()) s << TR("Caricamento descrizioni archivi comuni");
|
if (prefix().is_com()) s << TR("Caricamento descrizioni archivi comuni");
|
||||||
else s << TR("Caricamento descrizioni archivi della ditta ") << atol (pref);
|
else s << TR("Caricamento descrizioni archivi della ditta ") << atol (pref);
|
||||||
|
}
|
||||||
TProgind p(items ? items : 1, s, false, true);
|
TProgind p(items ? items : 1, s, false, true);
|
||||||
|
|
||||||
p.setstatus(1);
|
p.setstatus(1);
|
||||||
@ -1436,7 +1437,6 @@ void TManutenzione_app::load_des(const int maxfdir)
|
|||||||
if (!fexist(descfname))
|
if (!fexist(descfname))
|
||||||
{
|
{
|
||||||
FILE* fd = fopen(descfname, "w");
|
FILE* fd = fopen(descfname, "w");
|
||||||
|
|
||||||
if (fd != NULL)
|
if (fd != NULL)
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
}
|
}
|
||||||
@ -1512,51 +1512,39 @@ void TManutenzione_app::update()
|
|||||||
|
|
||||||
do_events();
|
do_events();
|
||||||
|
|
||||||
TDir d;
|
|
||||||
d.get(LF_DIR,_nolock, _nordir, _sysdirop);
|
|
||||||
const int maxfdir = d.items();
|
|
||||||
prefix().set("");
|
prefix().set("");
|
||||||
load_des(maxfdir);
|
load_des();
|
||||||
prefix().set_codditta(0L);
|
prefix().set_codditta(0L);
|
||||||
|
|
||||||
open_log();
|
open_log();
|
||||||
write_log(TR("Conversione Dati comuni"));
|
write_log(TR("Conversione Dati comuni"));
|
||||||
write_log("");
|
write_log("");
|
||||||
|
|
||||||
|
TPointer_array ditte; // Evita di aprire LF_NDITTE
|
||||||
|
const int nditte = prefix().firms(ditte);
|
||||||
|
TProgind p(nditte+1, TR("Conversione archivi ditte."), is_power_station());
|
||||||
|
|
||||||
|
p.addstatus(1);
|
||||||
update_dir();
|
update_dir();
|
||||||
convert_dir();
|
convert_dir();
|
||||||
|
|
||||||
TSystemisamfile ditte(LF_NDITTE);
|
for (int i = 0; i < nditte; i++)
|
||||||
ditte.open();
|
|
||||||
|
|
||||||
const int nditte = ditte.items();
|
|
||||||
if (nditte)
|
|
||||||
{
|
{
|
||||||
TProgind p(nditte, TR("Conversione archivi ditte."), false, true);
|
|
||||||
TString mxs;
|
|
||||||
for (int err = ditte.first(); err == NOERR; err = ditte.next())
|
|
||||||
{
|
|
||||||
const TRecnotype rec = ditte.recno();
|
|
||||||
const long codditta = ditte.get_long(NDT_CODDITTA);
|
|
||||||
mxs.cut(0) << TR("Conversione Ditta") << ' ' << codditta << ' ' << ditte.get(NDT_RAGSOC);
|
|
||||||
if (!p.addstatus(1))
|
if (!p.addstatus(1))
|
||||||
break;
|
break;
|
||||||
|
const long codditta = ditte.get_long(i);
|
||||||
|
TString mxs; mxs << TR("Conversione Ditta") << ' ' << codditta;
|
||||||
p.set_text(mxs);
|
p.set_text(mxs);
|
||||||
if (codditta > _history_firm && prefix().exist(codditta))
|
if (codditta > _history_firm && prefix().exist(codditta) && set_firm(codditta))
|
||||||
{
|
{
|
||||||
ditte.close();
|
|
||||||
set_firm(codditta);
|
|
||||||
write_log("");
|
write_log("");
|
||||||
write_log(mxs);
|
write_log(mxs);
|
||||||
write_log("");
|
write_log("");
|
||||||
update_dir();
|
update_dir();
|
||||||
convert_dir();
|
convert_dir();
|
||||||
ditte.open();
|
|
||||||
}
|
}
|
||||||
ditte.readat(rec);
|
|
||||||
}
|
|
||||||
ditte.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//chiude il log di conversione
|
//chiude il log di conversione
|
||||||
close_log();
|
close_log();
|
||||||
|
|
||||||
|
188
ba/ba1300.cpp
188
ba/ba1300.cpp
@ -5,44 +5,68 @@
|
|||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
|
#include <statbar.h>
|
||||||
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
#include "ba1.h"
|
#include "ba1.h"
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TSel_sheet
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TSel_sheet : public TArray_sheet
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TSel_sheet();
|
||||||
|
};
|
||||||
|
|
||||||
|
TSel_sheet::TSel_sheet()
|
||||||
|
: TArray_sheet(-1, -1, -4, -4, TR("Selezione files"),
|
||||||
|
HR("@1|N.@5|Nome@20|EOD@7|EOX@7|Lunghezza|Descrizione@43|Flags@7"), 0x8)
|
||||||
|
{
|
||||||
|
if (is_power_station())
|
||||||
|
add_button(DLG_EDIT, PR("Salva TXT"), K_SAVE, BMP_ARCHIVE);
|
||||||
|
add_button(-1, "", 0, 1); // Separatore
|
||||||
|
add_button(DLG_INFO, TR("Info"), K_F2, BMP_INFO);
|
||||||
|
add_button(DLG_HELP, TR("Help"), K_F1, BMP_HELP);
|
||||||
|
xvt_toolbar_set_last_tool(toolbar(), DLG_QUIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TPackFiles_application
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class TPackFiles_application : public TSkeleton_application
|
class TPackFiles_application : public TSkeleton_application
|
||||||
{
|
{
|
||||||
TArray_sheet * _selsheet;
|
TSel_sheet* _selsheet;
|
||||||
long _firm;
|
long _firm;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
virtual bool create () ;
|
virtual bool create () ;
|
||||||
virtual bool destroy();
|
virtual bool destroy();
|
||||||
virtual bool extended_firm() const { return TRUE; }
|
virtual bool extended_firm() const { return true; }
|
||||||
|
|
||||||
|
public:
|
||||||
void build_sheet();
|
void build_sheet();
|
||||||
void search_blanks(TSystemisamfile& f);
|
void search_blanks(TSystemisamfile& f);
|
||||||
public:
|
void pack_all();
|
||||||
|
void save_all();
|
||||||
|
|
||||||
TPackFiles_application() : _selsheet(NULL), _firm(0) {}
|
TPackFiles_application() : _selsheet(NULL), _firm(0) {}
|
||||||
~TPackFiles_application() {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TPackFiles_application::create() // initvar e arrmask
|
bool TPackFiles_application::create() // initvar e arrmask
|
||||||
|
|
||||||
{
|
{
|
||||||
_firm = get_firm();
|
_firm = get_firm();
|
||||||
if (!set_firm())
|
if (!set_firm())
|
||||||
return FALSE;
|
return false;
|
||||||
const bool is_prassi = user() == ::dongle().administrator();
|
_selsheet = new TSel_sheet;
|
||||||
_selsheet = new TArray_sheet(-1, -1, -4, -4, TR("Selezione files"),
|
|
||||||
is_prassi ?
|
|
||||||
HR("@1|N.@5|Nome@20|EOD@7|EOX@7|Lung. |Descrizione@43|Flags@7") :
|
|
||||||
HR("N.@5|Nome@20|EOD@7|EOX@7|Lung. |Descrizione@43|Flags@7"),
|
|
||||||
is_prassi ? 0 : 0x10);
|
|
||||||
return TSkeleton_application::create();
|
return TSkeleton_application::create();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPackFiles_application::destroy()
|
bool TPackFiles_application::destroy()
|
||||||
|
|
||||||
{
|
{
|
||||||
if (_firm) set_firm(_firm);
|
if (_firm) set_firm(_firm);
|
||||||
if (_selsheet != NULL) delete _selsheet;
|
if (_selsheet != NULL) delete _selsheet;
|
||||||
@ -52,17 +76,14 @@ bool TPackFiles_application::destroy()
|
|||||||
void TPackFiles_application::build_sheet()
|
void TPackFiles_application::build_sheet()
|
||||||
{
|
{
|
||||||
_selsheet->destroy();
|
_selsheet->destroy();
|
||||||
TDir cdir;
|
TDir cdir(LF_DIR);
|
||||||
cdir.get(LF_DIR,_nolock,_nordir,_sysdirop);
|
|
||||||
const bool is_prassi = user() == ::dongle().administrator();
|
|
||||||
const int nitems = (int)cdir.eod();
|
const int nitems = (int)cdir.eod();
|
||||||
for (int i = 0; i < nitems; i++) // fill sheet
|
TToken_string riga;
|
||||||
|
for (int i = LF_USER; i <= nitems; i++) // fill sheet
|
||||||
{
|
{
|
||||||
TToken_string riga(128);
|
cdir.get(i, _nolock, _nordir, _sysdirop);
|
||||||
cdir.get(i+1,_nolock,_nordir,_sysdirop);
|
riga = " ";
|
||||||
if (is_prassi)
|
riga.add(i);
|
||||||
riga.add("");
|
|
||||||
riga.add(i+1);
|
|
||||||
riga.add(cdir.name());
|
riga.add(cdir.name());
|
||||||
riga.add(cdir.eod());
|
riga.add(cdir.eod());
|
||||||
riga.add(cdir.eox());
|
riga.add(cdir.eox());
|
||||||
@ -76,68 +97,51 @@ void TPackFiles_application::build_sheet()
|
|||||||
void TPackFiles_application::search_blanks(TSystemisamfile& f)
|
void TPackFiles_application::search_blanks(TSystemisamfile& f)
|
||||||
{
|
{
|
||||||
// Scorre il file corrente per record cancellando eventuali record vuoti/blank
|
// Scorre il file corrente per record cancellando eventuali record vuoti/blank
|
||||||
|
if (f.open(_excllock, true))
|
||||||
f.open(_excllock, TRUE);
|
{
|
||||||
const long records = f.items();
|
const long records = f.items();
|
||||||
TString k;
|
TString k;
|
||||||
|
TRectype& curr = f.curr();
|
||||||
for (long i = 0; f.status() == NOERR && i < records; i++)
|
for (long i = 0; f.status() == NOERR && i < records; i++)
|
||||||
{
|
{
|
||||||
f.readat(i + 1); // Legge per numero di record, evitando falli di indice...
|
f.readat(i + 1); // Legge per numero di record, evitando falli di indice...
|
||||||
k = f.curr().key(); // Chiave 1; non puo' essere vuota (anche perche' no si puo' scrivere un record vuoto)
|
k = curr.key(); // Chiave 1; non puo' essere vuota (anche perche' no si puo' scrivere un record vuoto)
|
||||||
if (f.curr().empty() || k.trim().empty()) // Teoricamente ce ne sarebbe uno solo...
|
if (curr.empty() || k.blank()) // Teoricamente ce ne sarebbe uno solo...
|
||||||
{ // ma se l'indice e' rovinato possono esserci piu' records vuoti
|
{ // ma se l'indice e' rovinato possono esserci piu' records vuoti
|
||||||
f.curr().discard(); // che vanno cmq eliminati; le pack() successive completano l'opera.
|
curr.discard(); // che vanno cmq eliminati; le pack() successive completano l'opera.
|
||||||
f.rewriteat(i + 1);
|
f.rewriteat(i + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TPackFiles_application::main_loop()
|
void TPackFiles_application::pack_all()
|
||||||
{
|
{
|
||||||
KEY tasto = K_ENTER;
|
TProgind p(_selsheet->checked(), TR("Compattazione in corso..."), true, true);
|
||||||
while (tasto != K_ESC)
|
FOR_EACH_CHECKED_ROW(*_selsheet, k, row)
|
||||||
{
|
{
|
||||||
build_sheet();
|
if (!p.addstatus(1))
|
||||||
tasto = _selsheet->run();
|
|
||||||
switch(tasto)
|
|
||||||
{
|
|
||||||
case K_ENTER:
|
|
||||||
if (_selsheet->checked()>0)
|
|
||||||
{
|
|
||||||
int status;
|
|
||||||
const long items = _selsheet->items();
|
|
||||||
bool retry,present;
|
|
||||||
TFilename f_name,d_name;
|
|
||||||
TString cmd;
|
|
||||||
TDir d;
|
|
||||||
TDir ds;
|
|
||||||
TProgind p(items, TR("Compattazione in corso..."), TRUE, TRUE );
|
|
||||||
for (long i = 2; i<=items; i++) // Skip LF_DIR
|
|
||||||
{
|
|
||||||
p.setstatus(i);
|
|
||||||
if (p.iscancelled())
|
|
||||||
break;
|
break;
|
||||||
if (!_selsheet->checked(i-1))
|
const int i = row->get_int(1);
|
||||||
continue;
|
TDir d(i);
|
||||||
d.get(i);
|
|
||||||
if (d.len() == 0)
|
if (d.len() == 0)
|
||||||
continue; // Skip files with flags over 10000
|
continue; // Skip files with flags over 10000
|
||||||
const TString pref(prefix().name());
|
const TString pref(prefix().name());
|
||||||
prefix().set("");
|
prefix().set("");
|
||||||
ds.get(i);
|
const TDir ds(i);
|
||||||
prefix().set(pref);
|
prefix().set(pref);
|
||||||
const long flags = ds.flags();
|
const long flags = ds.flags();
|
||||||
// const int module = abs((int)flags); non piu usato verificare
|
|
||||||
if (flags >= 10000L)
|
if (flags >= 10000L)
|
||||||
continue; // Skip files with flags over 10000
|
continue; // Skip files with flags over 10000
|
||||||
TSystemisamfile f(i);
|
|
||||||
|
|
||||||
f_name = d.name();
|
TFilename f_name = d.filename();
|
||||||
f_name.ext("dbf");
|
f_name.ext("dbf");
|
||||||
retry = FALSE;
|
p.set_text(f_name);
|
||||||
present = f_name.exist();
|
bool retry = FALSE;
|
||||||
|
const bool present = f_name.exist();
|
||||||
|
int status = NOERR;
|
||||||
|
TSystemisamfile f(i);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
status = NOERR;
|
status = NOERR;
|
||||||
@ -163,8 +167,7 @@ void TPackFiles_application::main_loop()
|
|||||||
yesno_box(FR("Rilevato l'errore %d cercando di compattare il file %s. Si desidera scaricarlo e ricaricarlo?"),status,(const char*)f_name))
|
yesno_box(FR("Rilevato l'errore %d cercando di compattare il file %s. Si desidera scaricarlo e ricaricarlo?"),status,(const char*)f_name))
|
||||||
{
|
{
|
||||||
// Dump the file, Zap it and Reload it.
|
// Dump the file, Zap it and Reload it.
|
||||||
d_name = "";
|
TFilename d_name; d_name.temp("fdump");
|
||||||
d_name.temp("fdump");
|
|
||||||
if (f.dump(d_name,0) == NOERR) // Dump
|
if (f.dump(d_name,0) == NOERR) // Dump
|
||||||
{
|
{
|
||||||
// Zap
|
// Zap
|
||||||
@ -175,7 +178,7 @@ void TPackFiles_application::main_loop()
|
|||||||
d.put(i, is_com ? _comdir : _nordir);
|
d.put(i, is_com ? _comdir : _nordir);
|
||||||
if (f.pack() == NOERR)
|
if (f.pack() == NOERR)
|
||||||
if (f.load(d_name) == NOERR) // Reload
|
if (f.load(d_name) == NOERR) // Reload
|
||||||
remove_file(d_name);
|
d_name.fremove();
|
||||||
else
|
else
|
||||||
error_box(FR("Impossibile ricaricare %s. Errore %d"),(const char*) d_name, f.status());
|
error_box(FR("Impossibile ricaricare %s. Errore %d"),(const char*) d_name, f.status());
|
||||||
else
|
else
|
||||||
@ -186,9 +189,70 @@ void TPackFiles_application::main_loop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TPackFiles_application::save_all()
|
||||||
|
{
|
||||||
|
TFilename cartella; cartella.tempdir();
|
||||||
|
TString8 firm; firm.format("%05ldA", get_firm());
|
||||||
|
cartella.add(firm);
|
||||||
|
if (!cartella.exist())
|
||||||
|
xvt_fsys_mkdir(cartella);
|
||||||
|
|
||||||
|
DIRECTORY dir; xvt_fsys_convert_str_to_dir(cartella, &dir);
|
||||||
|
xvt_fsys_save_dir();
|
||||||
|
xvt_fsys_set_dir(&dir);
|
||||||
|
const int ret = xvt_dm_post_dir_sel(&dir);
|
||||||
|
xvt_fsys_restore_dir();
|
||||||
|
|
||||||
|
if (ret == FL_OK)
|
||||||
|
{
|
||||||
|
xvt_fsys_convert_dir_to_str(&dir, cartella.get_buffer(), cartella.size());
|
||||||
|
if (!cartella.ends_with(firm))
|
||||||
|
cartella.add(firm);
|
||||||
|
xvt_fsys_mkdir(cartella);
|
||||||
|
|
||||||
|
TProgind p(_selsheet->checked(), TR("Salvataggio in corso..."), true, true);
|
||||||
|
FOR_EACH_CHECKED_ROW(*_selsheet, k, row)
|
||||||
|
{
|
||||||
|
if (!p.addstatus(1))
|
||||||
|
break;
|
||||||
|
const TIsam_handle logic = row->get_int(1);
|
||||||
|
const TDir d(logic);
|
||||||
|
if (d.len() > 0)
|
||||||
|
{
|
||||||
|
TSystemisamfile f(logic);
|
||||||
|
if (f.is_valid(false) == NOERR)
|
||||||
|
{
|
||||||
|
TFilename fname = cartella;
|
||||||
|
TString16 name; row->get(2, name); name.ltrim(1);
|
||||||
|
fname.add(name);
|
||||||
|
fname.ext("txt");
|
||||||
|
f.dump(fname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TPackFiles_application::main_loop()
|
||||||
|
{
|
||||||
|
KEY tasto = K_ENTER;
|
||||||
|
while (tasto != K_ESC)
|
||||||
|
{
|
||||||
|
build_sheet();
|
||||||
|
tasto = _selsheet->run();
|
||||||
|
switch(tasto)
|
||||||
|
{
|
||||||
|
case K_ENTER:
|
||||||
|
if (_selsheet->one_checked())
|
||||||
|
pack_all();
|
||||||
else
|
else
|
||||||
warning_box(TR("Nessun file selezionato"));
|
warning_box(TR("Nessun file selezionato"));
|
||||||
break;
|
break;
|
||||||
|
case K_SAVE:
|
||||||
|
if (_selsheet->one_checked())
|
||||||
|
save_all();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -458,7 +458,7 @@ bool TInstaller_mask::autoload()
|
|||||||
for (int i = modules.last(); i >= 0; i--)
|
for (int i = modules.last(); i >= 0; i--)
|
||||||
{
|
{
|
||||||
TString& str = modules.row(i);
|
TString& str = modules.row(i);
|
||||||
if (str.match("??????A.INI") || str.match("??????a.ini"))
|
if (str.match("??????A.INI", true))
|
||||||
{
|
{
|
||||||
TFilename remote = http_path;
|
TFilename remote = http_path;
|
||||||
remote << str;
|
remote << str;
|
||||||
|
@ -74,7 +74,7 @@ bool TFile_selector::on_field_event(TOperable_field& o, TField_event e, long jol
|
|||||||
}
|
}
|
||||||
|
|
||||||
TLocalisamfile f(nfile);
|
TLocalisamfile f(nfile);
|
||||||
const RecDes& rd = *f.curr().rec_des();
|
const RecDes& rd = f.curr().rec_des();
|
||||||
TToken_string codes, items;
|
TToken_string codes, items;
|
||||||
for (i = 1; i <= rd.NKeys; i++)
|
for (i = 1; i <= rd.NKeys; i++)
|
||||||
{
|
{
|
||||||
@ -93,7 +93,7 @@ bool TFile_selector::on_field_event(TOperable_field& o, TField_event e, long jol
|
|||||||
if (nfile >= LF_USER && nkey > 0)
|
if (nfile >= LF_USER && nkey > 0)
|
||||||
{
|
{
|
||||||
TLocalisamfile f(nfile);
|
TLocalisamfile f(nfile);
|
||||||
const RecDes& rd = *f.curr().rec_des();
|
const RecDes& rd = f.curr().rec_des();
|
||||||
const KeyDes& kd = rd.Ky[nkey-1];
|
const KeyDes& kd = rd.Ky[nkey-1];
|
||||||
TToken_string str("", '+');
|
TToken_string str("", '+');
|
||||||
for (int i = 0; i < kd.NkFields; i++)
|
for (int i = 0; i < kd.NkFields; i++)
|
||||||
@ -436,8 +436,7 @@ TRecord_selector::TRecord_selector(const TFile_selector& fm) : TAutomask("ba7300
|
|||||||
_relation = new TRelation(logicnum);
|
_relation = new TRelation(logicnum);
|
||||||
_cursor = new TCursor(_relation, "", nkey+1);
|
_cursor = new TCursor(_relation, "", nkey+1);
|
||||||
|
|
||||||
const RecDes& rd = *_relation->curr().rec_des();
|
const RecDes& rd = _relation->curr().rec_des();
|
||||||
|
|
||||||
const KeyDes& kd = rd.Ky[nkey];
|
const KeyDes& kd = rd.Ky[nkey];
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
@ -508,7 +507,7 @@ void TMail_flood_app::fill_key(const TRectype& curr, TConfig& ini) const
|
|||||||
ini.set_paragraph(para);
|
ini.set_paragraph(para);
|
||||||
ini.remove_all();
|
ini.remove_all();
|
||||||
|
|
||||||
const RecDes& rd = *curr.rec_des();
|
const RecDes& rd = curr.rec_des();
|
||||||
const KeyDes& kd = rd.Ky[0];
|
const KeyDes& kd = rd.Ky[0];
|
||||||
for (int i = 0; i < kd.NkFields; i++)
|
for (int i = 0; i < kd.NkFields; i++)
|
||||||
{
|
{
|
||||||
@ -570,7 +569,7 @@ void TMail_flood_app::fill_rows(const TRectype& parent, int logicnum, TConfig& i
|
|||||||
|
|
||||||
TString16 numfield;
|
TString16 numfield;
|
||||||
|
|
||||||
const RecDes& rd = *rec.rec_des();
|
const RecDes& rd = rec.rec_des();
|
||||||
const KeyDes& kd = rd.Ky[0];
|
const KeyDes& kd = rd.Ky[0];
|
||||||
for (int i = 0; i < kd.NkFields; i++)
|
for (int i = 0; i < kd.NkFields; i++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user