Patch level : 314
Files correlati : ba2.exe ba2200.msk ba6100a.msk ba6300a.msk Ricompilazione Demo : [ ] Commento : 0001336: Backup Se nel campo directory imposto una directory che non esiste (con l'intenzione quindi di fargliela creare la pgm stesso) la procedura và in errore. Aggiunte toolbar moderne. git-svn-id: svn://10.65.10.50/trunk@18920 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
0e580e607f
commit
7164ce314e
@ -82,7 +82,7 @@ bool TArchive_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
|||||||
case F_DITTA:
|
case F_DITTA:
|
||||||
if (e == fe_modify || e == fe_init)
|
if (e == fe_modify || e == fe_init)
|
||||||
{
|
{
|
||||||
set(F_RAGSOC, (o.get() != "") ? TR("Tutte le ditte") : TR("Nessuna ditta"));
|
set(F_RAGSOC, !o.empty() ? TR("Tutte le ditte") : TR("Nessuna ditta"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_CODDITTA:
|
case F_CODDITTA:
|
||||||
@ -102,7 +102,7 @@ bool TArchive_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -111,7 +111,7 @@ bool TArchive_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
|||||||
|
|
||||||
bool TArchive_app::create()
|
bool TArchive_app::create()
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
|
|
||||||
TIsamfile utenti(LF_USER);
|
TIsamfile utenti(LF_USER);
|
||||||
utenti.open(_excllock);
|
utenti.open(_excllock);
|
||||||
@ -177,9 +177,12 @@ void TArchive_app::add_file(const TFilename& name)
|
|||||||
|
|
||||||
bool TArchive_app::split_file(const TFilename& archive, unsigned long max_chunk)
|
bool TArchive_app::split_file(const TFilename& archive, unsigned long max_chunk)
|
||||||
{
|
{
|
||||||
|
bool ok = true;
|
||||||
TFilename output(archive);
|
TFilename output(archive);
|
||||||
output.ext("z00");
|
output.ext("z00");
|
||||||
|
|
||||||
|
if (max_chunk > 0 && max_chunk < LONG_MAX) // Devo davvero suddividere archive?
|
||||||
|
{
|
||||||
int disk = 0;
|
int disk = 0;
|
||||||
unsigned long scritti = 0;
|
unsigned long scritti = 0;
|
||||||
|
|
||||||
@ -193,7 +196,7 @@ bool TArchive_app::split_file(const TFilename& archive, unsigned long max_chunk)
|
|||||||
TString buf(BUFSIZE);
|
TString buf(BUFSIZE);
|
||||||
char* buffer = buf.get_buffer();
|
char* buffer = buf.get_buffer();
|
||||||
|
|
||||||
bool ok = TRUE;
|
ok = true;
|
||||||
while (ok)
|
while (ok)
|
||||||
{
|
{
|
||||||
const size_t letti = fread(buffer, 1, BUFSIZE, i);
|
const size_t letti = fread(buffer, 1, BUFSIZE, i);
|
||||||
@ -216,6 +219,17 @@ bool TArchive_app::split_file(const TFilename& archive, unsigned long max_chunk)
|
|||||||
}
|
}
|
||||||
fclose(i);
|
fclose(i);
|
||||||
fclose(o);
|
fclose(o);
|
||||||
|
|
||||||
|
archive.fremove();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (output.exist())
|
||||||
|
output.fremove();
|
||||||
|
ok = ::rename(archive, output) == 0; // Basta rinominarlo
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ok)
|
||||||
add_file(output);
|
add_file(output);
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
@ -227,21 +241,20 @@ bool TArchive_app::zip_dir(const TFilename& name, unsigned long max_chunk)
|
|||||||
tmp.add(name.name());
|
tmp.add(name.name());
|
||||||
tmp.ext("zip");
|
tmp.ext("zip");
|
||||||
|
|
||||||
TFilename filenames = name; filenames.add("*.*");
|
bool ok = false;
|
||||||
|
|
||||||
|
if (name.full())
|
||||||
|
{
|
||||||
|
TFilename filenames = name; filenames.add("*.*");
|
||||||
TString msg;
|
TString msg;
|
||||||
msg << TR("Creazione del file temporaneo ") << tmp << "...";
|
msg << TR("Creazione del file temporaneo ") << tmp << "...";
|
||||||
|
TIndwin waitw(100, msg, false, false);
|
||||||
TIndwin waitw(100,msg,FALSE,FALSE);
|
ok = aga_zip(filenames, tmp);
|
||||||
TWait_cursor hourglass;
|
|
||||||
|
|
||||||
bool ok = aga_zip(filenames, tmp);
|
|
||||||
if (ok && tmp.exist())
|
|
||||||
{
|
|
||||||
ok = split_file(tmp, max_chunk);
|
|
||||||
remove(tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ok && tmp.exist())
|
||||||
|
ok = split_file(tmp, max_chunk);
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,7 +266,7 @@ bool TArchive_app::can_save_as(const TFilename& src, const TFilename& dst) const
|
|||||||
return xvt_fsys_test_disk_free_space(dst.left(3), s) != 0;
|
return xvt_fsys_test_disk_free_space(dst.left(3), s) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TArchive_app::save_zip_files(const TFilename& floppy_path, const TString& desc, unsigned long max_chunk)
|
bool TArchive_app::save_zip_files(const TFilename& floppy_path, const TString& desc, unsigned long max_chunk)
|
||||||
{
|
{
|
||||||
// Assegna un disco di destinazione a tutti i files
|
// Assegna un disco di destinazione a tutti i files
|
||||||
int disk = 1;
|
int disk = 1;
|
||||||
@ -282,13 +295,18 @@ void TArchive_app::save_zip_files(const TFilename& floppy_path, const TString& d
|
|||||||
ok = yesno_box(FR("Controllare che il primo disco sia nel drive %c:\n%s"), floppy_path[0], msg);
|
ok = yesno_box(FR("Controllare che il primo disco sia nel drive %c:\n%s"), floppy_path[0], msg);
|
||||||
else
|
else
|
||||||
ok = yesno_box(FR("Preparare %d dischetti vuoti e controllare che il primo sia nel drive %c:\n%s"), disk, floppy_path[0], msg);
|
ok = yesno_box(FR("Preparare %d dischetti vuoti e controllare che il primo sia nel drive %c:\n%s"), disk, floppy_path[0], msg);
|
||||||
if (!ok)
|
}
|
||||||
return;
|
else
|
||||||
|
{
|
||||||
|
if (!xvt_fsys_mkdir(floppy_path))
|
||||||
|
ok = error_box(FR("Impossibile creare la cartella %s"), (const char*)floppy_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
const TDate oggi(TODAY);
|
const TDate oggi(TODAY);
|
||||||
TFilename name; name = floppy_path; name.add("backup.ini");
|
TFilename name; name = floppy_path; name.add("backup.ini");
|
||||||
remove(name);
|
name.fremove();
|
||||||
TConfig ini(name, "Main");
|
TConfig ini(name, "Main");
|
||||||
ini.set("Date", oggi.string());
|
ini.set("Date", oggi.string());
|
||||||
ini.set("Description", desc);
|
ini.set("Description", desc);
|
||||||
@ -326,26 +344,21 @@ void TArchive_app::save_zip_files(const TFilename& floppy_path, const TString& d
|
|||||||
while(!can_save_as(fi._name, dest))
|
while(!can_save_as(fi._name, dest))
|
||||||
{
|
{
|
||||||
if (!yesno_box(FR("Sul disco %d non c'e' spazio sufficiente per il file %s\nSi desidera sostituire il disco e ritentare?"), curr_disk, (const char*)dest))
|
if (!yesno_box(FR("Sul disco %d non c'e' spazio sufficiente per il file %s\nSi desidera sostituire il disco e ritentare?"), curr_disk, (const char*)dest))
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
fcopy(fi._name, dest);
|
fcopy(fi._name, dest);
|
||||||
remove(fi._name);
|
fi._name.fremove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
void TArchive_app::backup(int mode, long firm, const TFilename& floppy_path, const TString& desc)
|
void TArchive_app::backup(int mode, long firm, const TFilename& floppy_path, const TString& desc)
|
||||||
{
|
{
|
||||||
TPointer_array ditte;
|
TPointer_array ditte;
|
||||||
if (firm == 0)
|
if (firm == 0)
|
||||||
{
|
prefix().firms(ditte);
|
||||||
TLocalisamfile nditte(LF_NDITTE);
|
|
||||||
for (int err = nditte.first(); err == NOERR; err = nditte.next())
|
|
||||||
{
|
|
||||||
const long f = nditte.get_long(NDT_CODDITTA);
|
|
||||||
if (prefix().test(f))
|
|
||||||
ditte.add_long(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
ditte.add_long(firm);
|
ditte.add_long(firm);
|
||||||
|
|
||||||
@ -362,7 +375,7 @@ void TArchive_app::backup(int mode, long firm, const TFilename& floppy_path, con
|
|||||||
|
|
||||||
_zip_list.destroy();
|
_zip_list.destroy();
|
||||||
|
|
||||||
bool ok = TRUE;
|
bool ok = true;
|
||||||
|
|
||||||
TFilename name;
|
TFilename name;
|
||||||
if (ok && (mode & 0x1))
|
if (ok && (mode & 0x1))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "ba2200.h"
|
#include "ba2200.h"
|
||||||
|
|
||||||
PAGE "Salvataggio / Ripristino archivi" -1 -1 72 10
|
PAGE "Salvataggio / Ripristino archivi" -1 -1 72 8
|
||||||
|
|
||||||
LIST F_FLOPPY 1 3
|
LIST F_FLOPPY 1 3
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -62,20 +62,26 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON F_ALL 10 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT 58 4 "~Tutti"
|
|
||||||
MESSAGE "X",F_DITTA|"X",F_COM|"X",F_CONFIG|"X",F_770|"X",F_CUSTOM|"",F_CODDITTA
|
|
||||||
END
|
|
||||||
|
|
||||||
STRING F_DESCR 50
|
STRING F_DESCR 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 7 "Descrizione "
|
PROMPT 1 7 "Descrizione "
|
||||||
END
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
TOOLBAR "topbar" 0 0 0 2
|
||||||
|
|
||||||
|
BUTTON F_ALL 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 58 4 "~Tutti"
|
||||||
|
MESSAGE "X",F_DITTA|"X",F_COM|"X",F_CONFIG|"X",F_770|"X",F_CUSTOM|"",F_CODDITTA
|
||||||
|
PICTURE TOOL_MULTISEL
|
||||||
|
END
|
||||||
|
|
||||||
BUTTON F_SALVA 15 2
|
BUTTON F_SALVA 15 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -13 -1 "~Salvataggio"
|
PROMPT -13 -1 "~Salvataggio"
|
||||||
|
PICTURE TOOL_SAVEREC
|
||||||
MESSAGE EXIT,K_SAVE
|
MESSAGE EXIT,K_SAVE
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -83,13 +89,10 @@ BUTTON F_RIPR 15 2
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -23 -1 "~Ripristino"
|
PROMPT -23 -1 "~Ripristino"
|
||||||
MESSAGE EXIT,K_INS
|
MESSAGE EXIT,K_INS
|
||||||
|
PICTURE TOOL_IMPORT
|
||||||
END
|
END
|
||||||
|
|
||||||
|
#include <helpbar.h>
|
||||||
BUTTON DLG_QUIT 15 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT -33 -1 ""
|
|
||||||
END
|
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ protected:
|
|||||||
void restore(int mode, long firm, const TFilename& floppy_path);
|
void restore(int mode, long firm, const TFilename& floppy_path);
|
||||||
|
|
||||||
void add_file(const TFilename& name);
|
void add_file(const TFilename& name);
|
||||||
void save_zip_files(const TFilename& floppy_path, const TString& desc, unsigned long max_chunk);
|
bool save_zip_files(const TFilename& floppy_path, const TString& desc, unsigned long max_chunk);
|
||||||
void load_zip_files(const TFilename& floppy_path);
|
void load_zip_files(const TFilename& floppy_path);
|
||||||
|
|
||||||
bool can_save_as(const TFilename& src, const TFilename& dst) const;
|
bool can_save_as(const TFilename& src, const TFilename& dst) const;
|
||||||
|
@ -5,28 +5,28 @@ TOOLBAR "Toolbar" 0 0 0 2
|
|||||||
BUTTON BUT_BA6_ELENCO 10 2
|
BUTTON BUT_BA6_ELENCO 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 14 "~Elenco"
|
PROMPT 4 14 "~Elenco"
|
||||||
PICTURE BMP_PRINTELENCO
|
PICTURE TOOL_PRINTELENCO
|
||||||
MESSAGE EXIT,BUT_BA6_ELENCO
|
MESSAGE EXIT,BUT_BA6_ELENCO
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON BUT_BA6_SCHEDE 10 2
|
BUTTON BUT_BA6_SCHEDE 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 16 14 "~Schede"
|
PROMPT 16 14 "~Schede"
|
||||||
PICTURE BMP_PRINTSCHEDE
|
PICTURE TOOL_PRINTSCHEDE
|
||||||
MESSAGE EXIT,BUT_BA6_SCHEDE
|
MESSAGE EXIT,BUT_BA6_SCHEDE
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON BUT_BA6_ETICHETTE 10 2
|
BUTTON BUT_BA6_ETICHETTE 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 40 14 "E~tichette"
|
PROMPT 40 14 "E~tichette"
|
||||||
PICTURE BMP_PRINTETICH
|
PICTURE TOOL_PRINTETICH
|
||||||
MESSAGE EXIT,BUT_BA6_ETICHETTE
|
MESSAGE EXIT,BUT_BA6_ETICHETTE
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON BUT_BA6_RUBRICHE 10 2
|
BUTTON BUT_BA6_RUBRICHE 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 28 14 "~Rubriche"
|
PROMPT 28 14 "~Rubriche"
|
||||||
PICTURE BMP_PRINTRUBRICA
|
PICTURE TOOL_PRINTRUBRICA
|
||||||
MESSAGE EXIT,BUT_BA6_RUBRICHE
|
MESSAGE EXIT,BUT_BA6_RUBRICHE
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -39,28 +39,28 @@ END
|
|||||||
BUTTON DLG_SETPRINT 2 2
|
BUTTON DLG_SETPRINT 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Imposta"
|
PROMPT 1 1 "Imposta"
|
||||||
PICTURE BMP_SETPRINT
|
PICTURE TOOL_SETPRINT
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_INFO 2 2
|
BUTTON DLG_INFO 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 1 "Info"
|
PROMPT 2 1 "Info"
|
||||||
MESSAGE EXIT,K_F2
|
MESSAGE EXIT,K_F2
|
||||||
PICTURE BMP_INFO
|
PICTURE TOOL_INFO
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_HELP 2 2
|
BUTTON DLG_HELP 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 3 1 "Help"
|
PROMPT 3 1 "Help"
|
||||||
MESSAGE EXIT,K_F1
|
MESSAGE EXIT,K_F1
|
||||||
PICTURE BMP_HELP
|
PICTURE TOOL_HELP
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_QUIT 2 2
|
BUTTON DLG_QUIT 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 5 1 "Fine"
|
PROMPT 5 1 "Fine"
|
||||||
MESSAGE EXIT,K_QUIT
|
MESSAGE EXIT,K_QUIT
|
||||||
PICTURE BMP_QUIT
|
PICTURE TOOL_QUIT
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "ba6200.h"
|
#include "ba6200.h"
|
||||||
|
|
||||||
TOOLBAR "topbar" 0 0 0 2
|
TOOLBAR "topbar" 0 0 0 2
|
||||||
#include "printbar.h"
|
#include <printbar.h>
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Stampa comuni" -1 -1 67 16
|
PAGE "Stampa comuni" -1 -1 67 16
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <relation.h>
|
|
||||||
#include <reprint.h>
|
#include <reprint.h>
|
||||||
|
|
||||||
#include "ba6300a.h"
|
#include "ba6300a.h"
|
||||||
|
@ -5,29 +5,20 @@ TOOLBAR "" 0 0 0 2
|
|||||||
BUTTON DLG_NEWREC 10 2
|
BUTTON DLG_NEWREC 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -14 -11 "Nuovo"
|
PROMPT -14 -11 "Nuovo"
|
||||||
PICTURE BMP_NEWREC
|
PICTURE TOOL_NEWREC
|
||||||
PICTURE BMP_NEWRECDN
|
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_EDIT 10 2
|
BUTTON DLG_EDIT 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -24 -11 "Modifica"
|
PROMPT -24 -11 "Modifica"
|
||||||
PICTURE BMP_EDIT
|
PICTURE TOOL_EDIT
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_PRINT 10 2
|
#include <printbar.h>
|
||||||
BEGIN
|
|
||||||
PROMPT -34 -11 "Stampa"
|
|
||||||
END
|
|
||||||
|
|
||||||
BUTTON DLG_QUIT 10 2
|
|
||||||
BEGIN
|
|
||||||
PROMPT -44 -11 ""
|
|
||||||
END
|
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Definizione Stampe Anagrafiche" 0 2 0 0
|
PAGE "Stampe Anagrafiche" 0 2 0 0
|
||||||
GROUPBOX DLG_NULL 76 11
|
GROUPBOX DLG_NULL 76 11
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "@bSelezione"
|
PROMPT 1 1 "@bSelezione"
|
||||||
@ -227,7 +218,7 @@ BEGIN
|
|||||||
MESSAGE ENABLE,F_PERSREP
|
MESSAGE ENABLE,F_PERSREP
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_PERSREP 255 43
|
STRING F_PERSREP 260 43
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 19 "Report personalizzato "
|
PROMPT 2 19 "Report personalizzato "
|
||||||
END
|
END
|
||||||
|
Loading…
x
Reference in New Issue
Block a user