Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Riportata la verione 98.01.04 sul main trunk


git-svn-id: svn://10.65.10.50/trunk@6984 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1998-08-25 17:46:29 +00:00
parent 6ba68de641
commit 4b004eff90
26 changed files with 2340 additions and 1386 deletions

View File

@ -327,10 +327,10 @@ const char* TColor_mask::cid2name(short cid) const
COLOR TColor_mask::cid2color(short cid) const
{
COLOR color[] = { COLOR_DKCYAN, COLOR_CYAN, COLOR_GRAY,
COLOR color[] = { COLOR_LTGRAY, COLOR_WHITE, COLOR_GRAY,
COLOR_BLACK, COLOR_WHITE,
COLOR_BLACK, COLOR_CYAN,
COLOR_GRAY, COLOR_DKCYAN,
COLOR_BLACK, COLOR_YELLOW,
COLOR_DKGRAY, COLOR_LTGRAY,
COLOR_LTGRAY, COLOR_WHITE, COLOR_GRAY};
const int i = cid - 101;
@ -1395,6 +1395,8 @@ bool TMenu_application::create()
#ifndef _DEMO_
if (!check_user())
return FALSE;
#else
enable_menu_item(M_FONT);
#endif
set_perms();

View File

@ -54,7 +54,7 @@ protected:
virtual void print();
virtual void do_print(TPrinter & p, TRec_sheet & r);
const char* dumpfilename(const FileDes& dep) const;
void load_des();
void load_des(const int maxfidr = 0);
void open_history();
void put_history(const char* firm);
void close_history();
@ -625,8 +625,9 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
}
switch (tasto)
{
case K_F5:
{
case K_F5:
if (logicnum > 1)
{
TSystemisamfile f(logicnum);
f.packfile();
f.packindex();
@ -645,57 +646,57 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
packapp.run(FALSE,FALSE);
}
#endif
}
break;
case K_F6:
{
_rec = new TRec_sheet(logicnum, _mask->get(F_TAB));
_rec->edit();
delete _rec;
_rec = NULL;
}
break;
case K_F7:
{
TMask m("ba1100b");
TFilename nout(dumpfilename(dep));
m.set(FLD_OUTFILE, nout);
if (m.run() == K_ENTER)
{
nout = m.get(FLD_OUTFILE);
if (nout.not_empty())
{
TSystemisamfile f(logicnum);
const char fs = *esc(m.get(FLD_FS));
const char fd = *esc(m.get(FLD_FD));
const char rs = *esc(m.get(FLD_RS));
const bool withdel = m.get_bool(FLD_WITHDEL);
const int keyno = m.get_int(FLD_KEYNO);
f.dump(nout, keyno, fs, fd, rs, withdel);
}
}
}
break;
case K_F8:
{
TMask m("ba1100c");
TFilename ninp(dumpfilename(dep));
m.set(FLD_INFILE, ninp);
if (m.run() == K_ENTER)
{
TSystemisamfile f(logicnum);
char fs = *esc(m.get(FLD_FS));
char fd = *esc(m.get(FLD_FD));
char rs = *esc(m.get(FLD_RS));
ninp = m.get(FLD_INFILE);
f.load(ninp, fs, fd, rs);
}
}
break;
default:
break;
break;
case K_F6:
{
_rec = new TRec_sheet(logicnum, _mask->get(F_TAB));
_rec->edit();
delete _rec;
_rec = NULL;
}
break;
case K_F7:
{
TMask m("ba1100b");
TFilename nout(dumpfilename(dep));
m.set(FLD_OUTFILE, nout);
if (m.run() == K_ENTER)
{
nout = m.get(FLD_OUTFILE);
if (nout.not_empty())
{
TSystemisamfile f(logicnum);
const char fs = *esc(m.get(FLD_FS));
const char fd = *esc(m.get(FLD_FD));
const char rs = *esc(m.get(FLD_RS));
const bool withdel = m.get_bool(FLD_WITHDEL);
const int keyno = m.get_int(FLD_KEYNO);
f.dump(nout, keyno, fs, fd, rs, withdel);
}
}
}
break;
case K_F8:
{
TMask m("ba1100c");
TFilename ninp(dumpfilename(dep));
m.set(FLD_INFILE, ninp);
if (m.run() == K_ENTER)
{
TSystemisamfile f(logicnum);
char fs = *esc(m.get(FLD_FS));
char fd = *esc(m.get(FLD_FD));
char rs = *esc(m.get(FLD_RS));
ninp = m.get(FLD_INFILE);
f.load(ninp, fs, fd, rs);
}
}
break;
default:
break;
}
}
default:
@ -1027,7 +1028,7 @@ void TManutenzione_app::convert_dir()
TProgind p(update_items ? update_items : 1, s, FALSE, TRUE, 70);
p.setstatus(1);
for (int i = 2; i <= update_items; i++)
for (int i = 2; i <= update_items; i++)
{
p.addstatus(1);
// prefix().set("");
@ -1131,7 +1132,7 @@ void TManutenzione_app::convert_dir()
put_history(pref);
}
void TManutenzione_app::load_des()
void TManutenzione_app::load_des(const int maxfdir)
{
const TString pref(prefix().name());
@ -1206,7 +1207,7 @@ void TManutenzione_app::load_des()
/*
// Aggiorna il numero di files presenti in totale nel direttorio
if (last_newln > items) // rialloca openf altrimenti la TPrefix::closeall() provoca un grazioso errore in applicazione
if (last_newln > maxfdir) // rialloca openf altrimenti la TPrefix::closeall() provoca un grazioso errore in applicazione
{
isfdptr *newopenf = new isfdptr[last_newln];
for (int i = 0; i<last_newln; i++)
@ -1328,8 +1329,11 @@ void TManutenzione_app::update()
do_events();
begin_wait();
TDir d;
d.get(LF_DIR,_nolock, _nordir,_sysdirop);
const int maxfdir = d.items();
prefix().set("");
load_des();
load_des(maxfdir);
prefix().set_codditta(0L);
/* if (prefix().filelevel() <= 199502L)
{

View File

@ -256,6 +256,7 @@ protected:
static bool change_assist_handler(TMask_field&, KEY key);
static bool assist_handler(TMask_field& fld, KEY key);
static bool print_handler(TMask_field& fld, KEY key);
static bool printlist_handler(TMask_field& fld, KEY key);
static bool aggiorna_listino_handler(TMask_field& fld, KEY key);
static bool modifica_listino_handler(TMask_field& fld, KEY key);
static bool aga_handler(TMask_field& fld, KEY key);
@ -266,6 +267,7 @@ protected:
protected:
void print_request();
void print_answer();
void print_listino();
public:
virtual void print();
@ -727,6 +729,14 @@ bool TAttivazione_moduli::print_handler(TMask_field& fld, KEY key)
return TRUE;
}
bool TAttivazione_moduli::printlist_handler(TMask_field& fld, KEY key)
{
if (key == K_SPACE)
app().print_listino();
return TRUE;
}
bool TAttivazione_moduli::aga_handler(TMask_field& fld, KEY key)
{
if (key == K_SPACE)
@ -996,7 +1006,12 @@ bool TAttivazione_moduli::aggiorna_listino_handler(TMask_field& fld, KEY key)
}
}
if (ok)
ok = ini.update_prices(name);
{
if (ok = ini.update_prices(name))
message_box("Listino aggiornato");
else
message_box("Listino già aggiornato");
}
}
return ok;
}
@ -1135,7 +1150,6 @@ void TAttivazione_moduli::print_answer()
if (found == 0)
{
printer().open();
form.update_serno(_msk->get(F_SN));
}
str.format("%3d", ++found);
@ -1189,6 +1203,74 @@ void TAttivazione_moduli::print_answer()
}
void TAttivazione_moduli::print_listino()
{
TRequest_form form("ba1500a");
TForm_item& num = form.find_field('B', odd_page, 101);
TForm_item& descr = form.find_field('B', odd_page, 102);
TForm_item& codice = form.find_field('B', odd_page, 103);
TForm_item& price = form.find_field('B', odd_page, 104);
TForm_item& manut = form.find_field('B', odd_page, 105);
TInstall_ini ini;
ini.write_protect();
const bool special = _wanted_assist > ::dongle().year_assist() || _wanted_users != 0;
const word users = max(_wanted_users, ::dongle().max_users());
TWait_cursor hourglass;
TSheet_field& sheet = _msk->sfield(F_MODULI);
{
int found = 0;
TString str;
real full, assist;
FOR_EACH_SHEET_ROW(sheet, r, row)
{
const int module = row->get_int(2) ;
const bool active = ::dongle().active(module);
str = _im->get_name(module);
ini.prices(str, users, full, assist, FALSE);
if (!full.is_zero() || ! assist.is_zero())
{
if (found++ == 0)
{
printer().open();
form.find_field('H',odd_page,1).set("LISTINO");
num.set("");
str.format("Numero utenti: %u", users );
descr.set(str);
form.print(-1);
}
price.set(full.string());
manut.set(assist.string());
str.format("%3d", found);
num.set(str);
str = row->get(0);
descr.set(str);
str = "";
codice.set(str);
form.print(-1);
}
}
if (found)
{
form.print_footer();
printer().close();
}
}
}
void TAttivazione_moduli::print()
{
if (::dongle().type() == _user_dongle)
@ -1214,6 +1296,7 @@ bool TAttivazione_moduli::create()
_msk->set_handler(F_CHANGEUSERS, change_users_handler);
_msk->set_handler(F_CHANGEASSIST, change_assist_handler);
_msk->set_handler(F_PRINT, print_handler);
_msk->set_handler(F_PRINTLIST, printlist_handler);
_msk->set_handler(F_AGGLISTINO, aggiorna_listino_handler);
if (::dongle().type() == _aga_dongle)
{

View File

@ -19,6 +19,7 @@
#define F_AGA 219
#define F_AGGLISTINO 220
#define F_MODLISTINO 221
#define F_PRINTLIST 222
#define F_NOMEMOD 101
#define F_ENABLE 102

View File

@ -84,6 +84,11 @@ BEGID
PROMPT 1 3 "Aggiorna listino"
END
BUTTON F_PRINTLIST 18 1
BEGIN
PROMPT 22 3 "Stampa Listino"
END
BUTTON F_MODLISTINO 18
BEGID
PROMPT 1 4 "Modifica listino"

View File

@ -14,15 +14,50 @@
#include "ba1600.h"
#include "ba1600a.h"
int find(const TString& name, TString_array & rows) ;
///////////////////////////////////////////////////////////
// Configurazione per installazione
///////////////////////////////////////////////////////////
class TCreazione_dischi : public TSkeleton_application
{
protected:
virtual bool use_files() const { return FALSE; }
virtual void main_loop();
public:
virtual bool modify_mode() { return FALSE;}
};
class TFascicolator : public TCreazione_dischi
{
protected:
virtual bool use_files() const { return FALSE; }
virtual void main_loop();
public:
virtual bool modify_mode() { return TRUE;}
};
class TFconv_ini : public TConfig
{
public:
void export_module(const char* module, const char* summary);
TFconv_ini(const char* path = "fconv.ini") : TConfig(path) { }
virtual ~TFconv_ini() { }
};
// costruisce la lista del modulo e dei suoi sottomoduli interni
int TInstall_ini::build_list(const TString& module, TString_array& a,
const char* sommario, bool agg)
{
CHECKS(module.len() >= 2 || module[0]=='_', "Bad module ", (const char*)module);
TConfig* sum = NULL;
if (sommario && *sommario)
sum = new TConfig(sommario, module);
@ -92,26 +127,106 @@ int TInstall_ini::build_complete_list(const TString& module, TString_array& a,
return a.items();
}
void TInstall_ini::export_paragraph(const char* module, const char* summary)
void TInstall_ini::export_paragraph(const char* module, const char* summary,const bool remove_old)
{
CHECK(module && *module > ' ', "Can't export NULL module");
CHECK(summary && *summary > ' ', "Can't export to NULL .ini");
TConfig sum(summary, module);
sum.remove_all();
TInstall_ini sum(summary, module);
TString_array old_list;
int last_file_num=0;
const bool is_submodule=(module[2]!='\0');
const int submodule=(module[2]-'0');
char main_module[3]={0,0,0};
strncpy(main_module, module,2);
if (remove_old || !is_submodule )
{
// substitute...
sum.remove_all();
} else {
// merge...
sum.build_list(main_module, old_list);
sum.set_paragraph(module);
last_file_num=old_list.items();
}
TAssoc_array& ass = list_variables(module);
TString newkey,tmps;
TToken_string item_value;
TString ;
FOR_EACH_ASSOC_STRING(ass, obj, key, str)
sum.set(key, str);
{
if (!remove_old && is_submodule && strncmp(key, "File", 4)==0 )
{
// merging "File(X)" items...
item_value=str;
tmps=item_value.get(0);
int item_number=find(tmps, old_list);
if (item_number>=0)
{
// file sostituito
TString old_smodule(old_list.row(item_number).get(2));
TAssoc_array& oldvars = sum.list_variables(old_smodule);
THash_object* obj;
TToken_string oldvalue;
oldvars.restart();
do {
obj=oldvars.get_hashobj();
oldvalue=((TString &)obj->obj());
if (tmps == oldvalue.get(0))
break;
} while (obj);
newkey=obj->key();
if (old_smodule!=module)
{
// devo cancellare il file dal vecchio sottomodulo
sum.set_paragraph(old_smodule);
sum.remove(newkey);
sum.set_paragraph(module);
}
} else {
// nuovo file
newkey = "File";
newkey << '(' << last_file_num++ << ')';
}
sum.set(newkey, str);
} else {
sum.set(key, str);
}
}
}
void TInstall_ini::export_module_paragraphs(const char* module, const char* summary)
void TInstall_ini::export_module_paragraphs(const char* module, const char* summary, const bool remove_old)
{
// esporta le info di composizione del modulo
TString mod;
for (int sub = -1; sub <= 9; sub++)
{
mod = module;
if (sub >= 0) mod << sub;
if (set_paragraph(mod))
export_paragraph(mod, summary);
export_paragraph(mod, summary,remove_old);
}
if (remove_old)
{
// esporta le info di conversione
TFilename path;
TInstall_ini inst(summary);
if (inst.name()==inst.default_name())
{
path = inst.name().path();
path.add(module); path << "fconv.ini";
TFconv_ini fconv(path);
fconv.export_module(module, "fconv.ini");
}
else
{
TFconv_ini fconv; //
path = inst.name().path();
path.add(module); path << "fconv.ini";
fconv.export_module(module, path);
}
}
}
@ -170,7 +285,6 @@ bool TInstall_ini::update_prices(const char* from)
const TDate from_date(from_ini.get("Listino","Main"));
if (from_date < curr_date)
return FALSE;
set("Listino", from_date);
TString_array modules;
@ -190,7 +304,7 @@ bool TInstall_ini::update_prices(const char* from)
}
void TInstall_ini::prices(const char* module, word users,
real& full, real& assist)
real& full, real& assist, bool correct_ass)
{
real last_pac, last_ass;
full = assist = 0.0;
@ -206,7 +320,7 @@ void TInstall_ini::prices(const char* module, word users,
if (last_ass < 50000.0)
last_ass *= 1000.0;
const int mese = TDate(TODAY).month();
last_ass = last_ass * (12-mese) / 12;
last_ass = last_ass * (correct_ass ? (12-mese) / 12 : 1);
last_ass.round(-3);
}
full += last_pac;
@ -218,15 +332,6 @@ void TInstall_ini::prices(const char* module, word users,
// TFconv_ini
///////////////////////////////////////////////////////////
class TFconv_ini : public TConfig
{
public:
void export_module(const char* module, const char* summary);
TFconv_ini(const char* path = "fconv.ini") : TConfig(path) { }
virtual ~TFconv_ini() { }
};
void TFconv_ini::export_module(const char* module, const char* summary)
{
TScanner scanner("prassi.aut");
@ -301,29 +406,16 @@ protected:
static bool link_handler(TMask_field& f, KEY k);
static bool deselect_handler(TMask_field& f, KEY k);
bool find(const TString& name) const;
bool kill_missing(const char* name, bool update);
public:
void load(const TString& module);
void save();
TMod_composition_msk();
TMod_composition_msk(const bool modify_mode=FALSE);
virtual ~TMod_composition_msk() { }
};
// Cerca un file nello sheet principale
bool TMod_composition_msk::find(const TString& name) const
{
TSheet_field& sf = sfield(F_SHEET);
FOR_EACH_SHEET_ROW_BACK(sf, r, row)
{
if (name.compare(row->get(0), -1, TRUE) == 0)
break;
}
return r >= 0;
}
// Toglie il file dallo sheet dei mancanti
bool TMod_composition_msk::kill_missing(const char* name, bool update)
{
@ -359,6 +451,7 @@ bool TMod_composition_msk::sheet_notify(TSheet_field& sf, int r, KEY key)
if (items > 0)
{
TMod_composition_msk& msk = (TMod_composition_msk&)sf.mask();
TString_array & rows=msk.sfield(F_SHEET).rows_array();
TString16 module = sf.row(r).get(2);
if (module.len() < 3)
@ -379,7 +472,7 @@ bool TMod_composition_msk::sheet_notify(TSheet_field& sf, int r, KEY key)
msk.kill_missing(file, FALSE);
if (!msk.find(file))
if (::find(file,rows)>=0)
{
TToken_string& row = sf.row(found ? -1 : r);
row = file;
@ -668,20 +761,27 @@ void TMod_composition_msk::save()
}
TMod_composition_msk::TMod_composition_msk()
TMod_composition_msk::TMod_composition_msk(const bool modify_mode)
: TMask("ba1600b")
{
set_handler(F_DESELECT, deselect_handler);
TSheet_field& s = sfield(F_SHEET);
s.set_notify(sheet_notify);
s.sheet_mask().set_handler(S_FILE, file_handler);
s.sheet_mask().set_handler(DLG_EDIT, edit_handler);
TSheet_field& miss = sfield(F_MISSING);
miss.set_notify(missing_notify);
miss.disable(); // Read-only sheet
miss.sheet_mask().set_handler(100, link_handler);
set_handler(F_DESELECT, deselect_handler);
if (modify_mode)
{
s.set_notify(sheet_notify);
s.sheet_mask().set_handler(S_FILE, file_handler);
s.sheet_mask().set_handler(DLG_EDIT, edit_handler);
miss.disable(); // Read-only sheet
miss.set_notify(missing_notify);
miss.sheet_mask().set_handler(100, link_handler);
} else {
s.disable(); // Read-only sheet
//hide(DLG_OK);
// hide(F_DESELECT);
//hide(DLG_CANCEL);
miss.hide();
}
}
///////////////////////////////////////////////////////////
@ -704,37 +804,60 @@ public:
// Maschera principale
///////////////////////////////////////////////////////////
class TFascicolator_mask : public TMask
class TCreadischi_mask : public TMask
{
protected:
static bool confirm_handler(TMask_field& f, KEY k);
static bool list_handler(TMask_field& f, KEY k);
static bool save_handler(TMask_field& f, KEY k);
static bool confirm_handler(TMask_field& f, KEY k);
static bool creazip_handler(TMask_field& f, KEY k);
static bool modules_notify(TSheet_field& f, int row, KEY k);
static bool import_export_handler(TMask_field& f, KEY k);
static bool modules_notify(TSheet_field& f, int row, KEY k);
bool zip_file(const char* archive, const char* file) const;
int split_file(const TFilename& file, long size) const;
bool move_file(const TFilename& file, const char* dir) const;
bool zip_module(const TString& module, bool agg, int patch_level) const;
const TFilename& build_export_path(TFilename& path) const;
virtual const TFilename& build_export_path(TFilename& path) const;
virtual bool zip_file(const char* archive, const char* file) const;
virtual int split_file(const TFilename& file, long size) const;
virtual bool move_file(const TFilename& file, const char* dir) const;
virtual bool zip_module(const TString& module, bool agg, int patch_level) const;
virtual bool set_version_info(const TFilename& filename,
TInstall_ini& ini, const char* module) const;
virtual bool show_all_modules() {return FALSE;}
public:
virtual void save();
virtual void load();
TCreadischi_mask();
virtual ~TCreadischi_mask() { }
};
class TFascicolator_mask : public TCreadischi_mask
{
long find_signature(const TFilename& filename, const char* signature) const;
bool set_version_info(const TFilename& filename,
protected:
static bool list_handler(TMask_field& f, KEY k);
static bool confirm_handler(TMask_field& f, KEY k);
static bool patchl_handler(TMask_field& f, KEY k);
// fuinzioni per la "firma" del file con il numero di release
virtual bool set_version_info(const TFilename& filename,
TInstall_ini& ini, const char* module) const;
virtual bool show_all_modules() {return TRUE;}
public:
void load();
void save();
virtual void save();
TFascicolator_mask();
virtual ~TFascicolator_mask() { }
};
bool TFascicolator_mask::modules_notify(TSheet_field& f, int row, KEY k)
bool TCreadischi_mask::modules_notify(TSheet_field& f, int row, KEY k)
{
bool ok = TRUE;
if (k == K_INS || k == K_DEL)
@ -861,17 +984,35 @@ bool TFascicolator_mask::patchl_handler(TMask_field& f, KEY k)
}
bool TCreadischi_mask::list_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
TModule_mask& m = (TModule_mask&)f.mask();
const TString& module = m.get(S_MODULE);
if (module.not_empty())
{
TMod_composition_msk mm;
mm.load(module);
if (mm.run() == K_ENTER)
mm.save();
}
}
return TRUE;
}
bool TFascicolator_mask::list_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
TModule_mask& m = (TModule_mask&)f.mask();
const TString& module = m.get(S_MODULE);
const int patchlev = m.get_int(S_PATCHLEVEL);
if (module.not_empty())
{
TMod_composition_msk mm;
TMod_composition_msk mm(TRUE);
mm.load(module);
if (mm.run() == K_ENTER)
mm.save();
@ -882,6 +1023,15 @@ bool TFascicolator_mask::list_handler(TMask_field& f, KEY k)
return TRUE;
}
bool TCreadischi_mask::confirm_handler(TMask_field& f, KEY k)
{
return TRUE;
}
bool TFascicolator_mask::confirm_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
@ -914,7 +1064,7 @@ bool TFascicolator_mask::confirm_handler(TMask_field& f, KEY k)
if (patchlevel>0 && m.check_needed())
{
// controlla le consistenze tra patch di moduli diversi intrinsecamente correlati
TMod_composition_msk mc;
TMod_composition_msk mc;
mc.load(module);
m.check_patchlevels(mc);
}
@ -923,22 +1073,30 @@ bool TFascicolator_mask::confirm_handler(TMask_field& f, KEY k)
}
bool TFascicolator_mask::save_handler(TMask_field& f, KEY k)
bool TCreadischi_mask::creazip_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
confirm_handler(f, K_SPACE);
TMask& m = f.mask();
const TString& module = m.get(S_MODULE);
const bool agg = f.dlg() == S_SAVEAGG;
TFascicolator_mask& fm = (TFascicolator_mask&)m.get_sheet()->mask();
fm.zip_module(module, agg, m.get_int(S_PATCHLEVEL));
const bool agg = f.dlg() == S_CREATEPATCH;
TCreadischi_mask& fm = (TCreadischi_mask&)m.get_sheet()->mask();
if (fm.zip_module(module, agg, m.get_int(S_PATCHLEVEL)))
{
// creazione XXfconv.ini (esporta le info di conversione )
TFilename fconv_path;
TFconv_ini fconv; //
fconv_path = fm.get(F_DISKPATH);
fconv_path.add(module); fconv_path << "fconv.ini";
fconv.export_module(module, fconv_path);
}
}
return TRUE;
}
bool TFascicolator_mask::import_export_handler(TMask_field& f, KEY k)
bool TCreadischi_mask::import_export_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
@ -946,7 +1104,7 @@ bool TFascicolator_mask::import_export_handler(TMask_field& f, KEY k)
const TMask& m = f.mask();
const TString& module = m.get(S_MODULE);
const TFascicolator_mask& fm = (const TFascicolator_mask&)m.get_sheet()->mask();
const TCreadischi_mask& fm = (const TCreadischi_mask&)m.get_sheet()->mask();
TFilename path = module;
fm.build_export_path(path);
@ -974,29 +1132,29 @@ bool TFascicolator_mask::import_export_handler(TMask_field& f, KEY k)
if (is_export)
{
TInstall_ini inst;
inst.export_module_paragraphs(module, path);
inst.export_module_paragraphs(module, path,TRUE);
TFconv_ini fconv;
/*TFconv_ini fconv;
path = path.path();
path.add(module); path << "fconv.ini";
fconv.export_module(module, path);
fconv.export_module(module, path);*/
}
else
{
TInstall_ini ini(path);
ini.export_module_paragraphs(module, ini.default_name());
ini.export_module_paragraphs(module, ini.default_name(),TRUE);
path = path.path();
/*path = path.path();
path.add(module); path << "fconv.ini";
TFconv_ini fconv(path);
fconv.export_module(module, "fconv.ini");
fconv.export_module(module, "fconv.ini");*/
}
}
}
return TRUE;
}
const TFilename& TFascicolator_mask::build_export_path(TFilename& path) const
const TFilename& TCreadischi_mask::build_export_path(TFilename& path) const
{
CHECK(path.not_empty(), "Please, specify the module");
const TString module(path);
@ -1019,7 +1177,7 @@ const TFilename& TFascicolator_mask::build_export_path(TFilename& path) const
return path;
}
void TFascicolator_mask::load()
void TCreadischi_mask::load()
{
TWait_cursor hourglass;
TSheet_field& s = sfield(F_SHEET);
@ -1036,10 +1194,13 @@ void TFascicolator_mask::load()
FOR_EACH_ARRAY_ROW(modules, m, riga)
{
const TString& module = *riga;
if (module[0] == '_' || module.len() == 2)
ini.set_paragraph(module);
tmp = ini.get("Versione");
if (module[0] == '_' || // linea di descrizione area
(module.len() == 2 && // linea di modulo principale
(!tmp.blank() || show_all_modules())))
{
TToken_string& row = s.row(-1);
ini.set_paragraph(module);
row = ini.get("Descrizione");
if (module[0] == '_')
@ -1049,39 +1210,49 @@ void TFascicolator_mask::load()
else
{
row.add(module);
tmp = ini.get("Versione");
row.add(tmp);
row.add(tmp); // versione
tmp = ini.get("Patch");
row.add(tmp);
tmp = ini.get("Data");
row.add(tmp);
tmp = ini.get("Moduli");
row.add(tmp);
tmp = ini.get("PreProcess");
row.add(tmp);
tmp = ini.get("PostProcess");
row.add(tmp);
}
}
}
}
}
void TFascicolator_mask::save()
void TCreadischi_mask::save()
{
TSheet_field& s = sfield(F_SHEET);
TProgind pi(s.items(), "Salvataggio in corso...", FALSE, TRUE);
TInstall_ini ini;
ini.set("DiskSize", get(F_DISKSIZE));
ini.set("DiskPath", get(F_DISKPATH));
}
void TFascicolator_mask::save()
{
TSheet_field& s = sfield(F_SHEET);
TCreadischi_mask::save();
TProgind pi(s.items(), "Salvataggio in corso...", FALSE, TRUE);
TInstall_ini ini;
TString tmp;
FOR_EACH_SHEET_ROW_BACK(s, r, row)
{
@ -1116,7 +1287,7 @@ void TFascicolator_mask::save()
}
}
bool TFascicolator_mask::zip_file(const char* archive, const char* listfile) const
bool TCreadischi_mask::zip_file(const char* archive, const char* listfile) const
{
TString msg;
msg << "Creazione del file " << archive << "...";
@ -1131,7 +1302,7 @@ bool TFascicolator_mask::zip_file(const char* archive, const char* listfile) con
return err == 0;
}
bool TFascicolator_mask::move_file(const TFilename& file, const char* dir) const
bool TCreadischi_mask::move_file(const TFilename& file, const char* dir) const
{
TFilename dest(dir);
dest.add(file.name());
@ -1175,7 +1346,7 @@ bool TFascicolator_mask::move_file(const TFilename& file, const char* dir) const
return write_ok;
}
int TFascicolator_mask::split_file(const TFilename& archive, long size) const
int TCreadischi_mask::split_file(const TFilename& archive, long size) const
{
TWait_cursor hourglass;
@ -1267,6 +1438,12 @@ long TFascicolator_mask::find_signature(const TFilename& filename, const char* s
return found ? position : -1;
}
bool TCreadischi_mask::set_version_info(const TFilename& filename,
TInstall_ini& ini, const char* module) const
{
return TRUE;
}
bool TFascicolator_mask::set_version_info(const TFilename& filename,
TInstall_ini& ini, const char* module) const
{
@ -1300,7 +1477,7 @@ bool TFascicolator_mask::set_version_info(const TFilename& filename,
return ok;
}
bool TFascicolator_mask::zip_module(const TString& main_module, bool agg, int patch_level) const
bool TCreadischi_mask::zip_module(const TString& main_module, bool agg, int patch_level) const
{
TString_array arr;
TInstall_ini ini;
@ -1323,6 +1500,8 @@ bool TFascicolator_mask::zip_module(const TString& main_module, bool agg, int pa
return error_box("Nessun file da compattare");
}
// *****************
// creazione ZIP
TFilename archivio(sommario);
archivio.ext("zip"); // Nome del file archivio completo
@ -1405,7 +1584,7 @@ bool TFascicolator_mask::zip_module(const TString& main_module, bool agg, int pa
// Memorizza il numero dei dischetti nel sommario
ini.set("Dischi", disks, main_module); // Aggiorna install.ini
ini.export_paragraph(main_module, sommario); // Aggiorna sommario
ini.export_paragraph(main_module, sommario,TRUE); // Aggiorna sommario
const bool floppy = ::os_is_removable_drive(path);
@ -1444,33 +1623,53 @@ bool TFascicolator_mask::zip_module(const TString& main_module, bool agg, int pa
return TRUE;
}
TFascicolator_mask::TFascicolator_mask()
TCreadischi_mask::TCreadischi_mask()
: TMask("ba1600a")
{
TSheet_field& s = sfield(F_SHEET);
s.set_notify(modules_notify);
TMask& m = s.sheet_mask();
m.set_handler(DLG_OK, confirm_handler);
m.set_handler(S_LIST, list_handler);
m.set_handler(S_SAVE, save_handler);
m.set_handler(S_SAVEAGG, save_handler);
m.set_handler(S_IMPORT, import_export_handler);
m.set_handler(S_CREATEZIP, creazip_handler);
m.set_handler(S_CREATEPATCH, creazip_handler);
m.hide(S_IMPORT);
m.set_handler(S_EXPORT, import_export_handler);
s.enable_column(S_MODULE,FALSE);
s.enable_column(S_VERSION,FALSE);
s.enable_column(S_PATCHLEVEL,FALSE);
s.enable_column(S_EXTERN,FALSE);
s.enable_column(S_PREPROCESS,FALSE);
s.enable_column(S_POSTPROCESS,FALSE);
}
TFascicolator_mask::TFascicolator_mask()
: TCreadischi_mask()
{
TSheet_field& s = sfield(F_SHEET);
s.set_notify(TCreadischi_mask::modules_notify);
TMask& m = s.sheet_mask();
m.set_handler(DLG_OK, confirm_handler);
m.set_handler(S_LIST, list_handler);
m.set_handler(S_PATCHLEVEL, patchl_handler);
m.show(S_IMPORT);
m.set_handler(S_IMPORT, import_export_handler);
s.enable_column(S_MODULE,TRUE);
s.enable_column(S_VERSION,TRUE);
s.enable_column(S_PATCHLEVEL,TRUE);
s.enable_column(S_EXTERN,TRUE);
s.enable_column(S_PREPROCESS,TRUE);
s.enable_column(S_POSTPROCESS,TRUE);
}
///////////////////////////////////////////////////////////
// Programma principale
///////////////////////////////////////////////////////////
class TFascicolator : public TSkeleton_application
{
protected:
virtual bool use_files() const { return FALSE; }
virtual void main_loop();
};
void TFascicolator::main_loop()
{
TFascicolator_mask m;
@ -1485,9 +1684,49 @@ void TFascicolator::main_loop()
while (key != K_ENTER && key != K_QUIT);
}
void TCreazione_dischi::main_loop()
{
TCreadischi_mask m;
m.load();
int key;
do
{
key=m.run();
if (key == K_ENTER)
m.save();
}
while (key != K_ENTER && key != K_QUIT);
}
// Cerca un file nell'array di colonne e ne restituisce il numero del sottomodulo
// -1 se
int find(const TString& name, TString_array & rows)
{
for(int r=rows.items()-1; r >=0 ; r-- )
{
if (name.compare(rows.row(r).get(0), -1, TRUE) == 0)
break;
}
return r;
}
int ba1600(int argc, char* argv[])
{
TFascicolator app;
app.run(argc, argv, "Megascicolator");
if (user() == "PRASSI")
{
if (argc>2 && strcmp(argv[1],"GODMODE"))
{
TFascicolator app;
app.run(argc, argv, "Megascicolator");
} else {
TCreazione_dischi app;
app.run(argc, argv, "Creazione dischetti");
}
} else
error_box("L'utente %s non e' abilitato all'esecuzione di questo programma", (const char*)user());
return 0;
}

View File

@ -13,8 +13,8 @@ public:
int build_complete_list(const TString& m, TString_array& a,
const char* s = NULL, bool agg = FALSE);
void export_paragraph(const char* module, const char* summary);
void export_module_paragraphs(const char* module, const char* summary);
void export_paragraph(const char* module, const char* summary,const bool remove);
void export_module_paragraphs(const char* module, const char* summary,const bool remove);
bool demo() { return get_bool("Demo", "Main"); }
const TString& version(const char* module);
@ -22,12 +22,13 @@ public:
void version_info(const char* module,
int& year, int& release, int& tag, int& patch);
bool update_prices(const char* src_ini);
void prices(const char* module, word users, real& full, real& manut);
void prices(const char* module, word users, real& full, real& manut, bool correct_ass=TRUE);
static const char* default_name() { return "install.ini"; }
TInstall_ini() : TConfig("install.ini", "Main") { }
TInstall_ini(const char* path) : TConfig(path, "Main") { }
TInstall_ini(const char* path, const char * paragraph) : TConfig(path, paragraph) { }
virtual ~TInstall_ini() { }
};

View File

@ -18,8 +18,8 @@
#define S_POSTPROCESS 108
#define S_LIST 100
#define S_SAVE 151
#define S_SAVEAGG 152
#define S_CREATEZIP 151
#define S_CREATEPATCH 152
#define S_IMPORT 153
#define S_EXPORT 154

View File

@ -65,31 +65,37 @@ END
STRING S_VERSION 8
BEGIN
PROMPT 1 2 "Versione "
FLAGS "D"
END
STRING S_PATCHLEVEL 3
BEGIN
PROMPT 20 2 "Patch "
FLAGS "D"
END
DATE S_DATE
BEGIN
PROMPT 31 2 "Rilascio "
// FLAGS "D"
END
STRING S_EXTERN 50 40
BEGIN
PROMPT 1 3 "Esterni "
FLAGS "D"
END
STRING S_PREPROCESS 50 33
BEGIN
PROMPT 1 4 "Pre-processing "
FLAGS "D"
END
STRING S_POSTPROCESS 50 33
BEGIN
PROMPT 1 5 "Post-processing "
FLAGS "D"
END
BUTTON DLG_CANCEL 14 2
@ -102,32 +108,33 @@ BEGIN
PROMPT -22 -1 ""
END
BUTTON S_LIST 14 2
BUTTON S_CREATEZIP 20 2
BEGIN
PROMPT -13 -5 "Lista file"
PROMPT -12 -5 "Crea &Versione"
END
BUTTON S_SAVE 14 2
BUTTON S_CREATEPATCH 20 2
BEGIN
PROMPT -23 -5 "&Versione"
PROMPT -22 -5 "Crea &Aggiornamento"
END
BUTTON S_SAVEAGG 14 2
BUTTON S_LIST 14 1
BEGIN
PROMPT -23 -3 "&Aggiornamento"
PROMPT -13 -4 "Lista file"
END
BUTTON S_IMPORT 14 2
BUTTON S_IMPORT 14 1
BEGIN
PROMPT -33 -5 "&Importa"
PROMPT -23 -4 "&Importa lista"
END
BUTTON S_EXPORT 14 2
BUTTON S_EXPORT 14 1
BEGIN
PROMPT -33 -3 "&Esporta"
PROMPT -33 -4 "&Esporta lista"
END
ENDPAGE
ENDMASK

View File

@ -9,7 +9,7 @@ END
BUTTON F_DESELECT 24 2
BEGIN
PROMPT -11 -11 "Annulla aggiornamento"
PROMPT -23 -11 "Annulla aggiornamento"
END
BUTTON DLG_CANCEL 10 2

View File

@ -7,7 +7,7 @@
#include <progind.h>
#include <sheet.h>
#include <utility.h>
#include <prefix.h>
#include "ba1.h"
#include "ba1500.h"
@ -25,40 +25,59 @@
#define C_CURRDATAREL 8
#define C_ISPATCH 9
const char* const http_default_path = "/aga/campo/";
#ifdef _DEMO_
const char* const http_default_path = "/aga/eurodemo/zipdemo/";
#else
const char* const http_default_path = "/aga/euro/zip/";
#endif
HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2)
{
TString16 ver1(v1), ver2(v2);
TString16 ver1(v1), ver2(v2);
ver1.trim();
if (ver1.len() == 4)
if (ver1.len() == 4)
ver1.insert((v1[0] == '9') ? "19" : "20", 0);
ver2.trim();
if (ver2.len() == 4)
if (ver2.len() == 4)
ver2.insert((v2[0] == '9') ? "19" : "20", 0);
int res = ver1.compare(ver2, -1, TRUE);
if (res == 0)
res = p1 - p2;
return res;
}
HIDDEN word version2year(const char* v)
{
{
TString16 ver(v);
if (ver.len() == 4)
if (ver.len() == 4)
ver.insert((v[0] == '9') ? "19" : "20", 0);
ver.cut(4);
ver.cut(4);
return atoi(ver);
}
bool is_internet_path(const TString& addr)
{
if (addr.compare("www.", 4, TRUE) == 0)
return TRUE;
if (addr.compare("http:", 5, TRUE) == 0)
return TRUE;
int a1, a2, a3, a4;
if (sscanf(addr, "%d.%d.%d.%d", &a1, &a2, &a3, &a4) == 4)
return TRUE;
return FALSE;
}
///////////////////////////////////////////////////////////
// Maschera principale
///////////////////////////////////////////////////////////
class TInstaller_mask : public TArray_sheet
{
{
static TInstaller_mask* _curr_mask;
word _year_assist;
bool _installed; // Flag per verificare se almeno un modulo e' stato installato
@ -72,6 +91,7 @@ protected:
static bool path_handler(TMask_field& fld, KEY key);
static bool sheet_notify(TSheet_field& s, int r, KEY k);
static bool install_handler(TMask_field& fld, KEY key);
static bool update_handler(TMask_field& f, KEY k);
bool add_module(TConfig& ini, const TString& module, bool patch, int pos=-1);
bool add_header(TConfig& ini, const TString& module, bool patch);
@ -84,6 +104,7 @@ protected:
bool can_install(const char* module, TInstall_ini& ini);
void install_selection();
bool install_patches(const TString& module, const TString& lastrelease, int lastpatch);
KEY askdisk(TString & path, TFilename & cmdline, int d, int dischi, const char * modulo);
bool do_process(TToken_string& commands) const;
bool pre_process(TInstall_ini& ini, const char* module) const;
@ -106,7 +127,7 @@ bool TInstaller_mask::add_module(TConfig& ini, const TString& module, bool patch
ini.write_protect();
bool ok = ini.set_paragraph(module);
if (ok)
{
{
TToken_string row;
row = " "; // Not selected
row.add(ini.get("Descrizione"));
@ -129,7 +150,7 @@ bool TInstaller_mask::add_header(TConfig& ini, const TString& module, bool patch
ini.write_protect();
bool ok = ini.set_paragraph(module);
if (ok)
{
{
TToken_string row;
row = " "; // Not selected
row.add(ini.get("Descrizione"));
@ -143,9 +164,9 @@ static int compare_modules(const TObject** o1, const TObject** o2)
{
TToken_string& ts1 = *(TToken_string*)(*o1);
TToken_string& ts2 = *(TToken_string*)(*o2);
int res = 0;
for (int i = 2; i < 5 && res == 0; i++)
for (int i = 2; i < 5 && res == 0; i++)
{
TString16 s1 = ts1.get(i);
const char* s2 = ts2.get(i);
@ -163,11 +184,11 @@ int TInstaller_mask::sort_modules()
// vecchio codice per bubblare
for (int r = 0; r < tot; r++)
{
{
const bool patch = row(r).get_char(C_ISPATCH) > ' ';
const char* mod = row(r).get(C_CODE);
if (patch)
{
{
TString16 dis=mod;
const int patchlevel = row(r).get_int(C_PATCH);
// pop the patch line up to the module one
@ -190,15 +211,15 @@ int TInstaller_mask::sort_modules()
void TInstaller_mask::update_version()
{
TInstall_ini ini;
TString_array& array = rows_array();
FOR_EACH_ARRAY_ROW_BACK(array, m, row)
{
{
if (*row->get(C_CODE) != ' ')
{
const TString16 module = row->get(C_CODE);
ini.set_paragraph(module);
const TString16 newver = row->get(C_RELEASE);
const TString16 oldver = ini.get("Versione");
row->add(oldver, C_CURRRELEASE);
@ -227,7 +248,7 @@ bool is_internet_path(const TString& addr)
// Cerca nel percorso specificato sulla maschera tutti i possibili files .ini
// utilizzabili per un'installazione e li inserisce nello spreadsheet
bool TInstaller_mask::autoload()
{
{
TString_array& mask_rows = rows_array();
TFilename path = get(F_PATH);
@ -292,10 +313,20 @@ bool TInstaller_mask::autoload()
return error_box("Specificare un percorso valido");
TWait_cursor hourglass;
// !?!?!? modifica per correggere il bug di libreria su _parked dei TSheet:
// !?!?!? (uso della stringa _park e dell'indice _parked )
// !?!?!? rimuovere appena si è corretto l'errore
for (short pisellone =0; pisellone<100; pisellone++)
add("");
// !?!?! fine modifica
destroy();
force_update();
TString_array modules;
ininame=path;
ininame.add(TInstall_ini::default_name());
TString_array modules;
if (fexist(ininame))
{
TInstall_ini ini(ininame);
@ -320,7 +351,7 @@ bool TInstaller_mask::autoload()
ininame.add("??inst.ini");
list_files(ininame, modules);
FOR_EACH_ARRAY_ROW(modules, m, row)
{
{
TString& ininame = *row;
ininame.lower();
const int pos = ininame.find("inst.ini");
@ -370,13 +401,14 @@ bool TInstaller_mask::autoload()
modules.sort(); // sort to have patches in patchlevel order
FOR_EACH_ARRAY_ROW(modules, am, arow)
{
{
TString& ininame = *arow;
ininame.lower();
const int pos = ininame.find("a.ini");
CHECKS(pos >= 6, "Invalid installation configuration: ", (const char*)ininame);
const TString16 module = ininame.mid(pos-6, 2);
TConfig ini(ininame, module);
TConfig ini(ininame, module);
ini.write_protect();
const int patchlevel = ini.get_int("Patch");
const int maxrows=int(items());
bool found=FALSE;
@ -395,7 +427,7 @@ bool TInstaller_mask::autoload()
else
add_module(ini, module, TRUE);
}
const bool ok = sort_modules() > 0;
if (ok)
update_version();
@ -407,7 +439,7 @@ bool TInstaller_mask::autoload()
}
bool TInstaller_mask::do_process(TToken_string& commands) const
{
{
bool ok = TRUE;
TFilename cmd;
for (const char* c = commands.get(0); c && ok; c = commands.get())
@ -424,7 +456,7 @@ bool TInstaller_mask::do_process(TToken_string& commands) const
}
bool TInstaller_mask::pre_process(TInstall_ini& ini, const char* module) const
{
{
TAuto_token_string commands(ini.get("PreProcess", module));
bool ok = do_process(commands);
return ok;
@ -453,18 +485,18 @@ bool TInstaller_mask::can_install(const char* module, TInstall_ini& ini)
const word year = version2year(version);
if (year < 1997)
return error_box("Il modulo '%s' non ha una versione valida.", module);
#ifndef _DEMO_
if (year > _year_assist)
return error_box("Per installare la versione %s del modulo '%s'\n"
"occorre il contratto di assistenza per l'anno %d.",
(const char*)version, module, year);
#endif
TAuto_token_string altri(ini.get("Moduli", module));
if (stricmp(module, "ba") != 0 && altri.get_pos("ba") < 0)
altri.add("ba"); // La base e' obbligatoria per tutti
bool ok = TRUE;
TString submodule;
for (const char* mod = altri.get(0); mod && ok; mod = altri.get())
@ -473,19 +505,19 @@ bool TInstaller_mask::can_install(const char* module, TInstall_ini& ini)
if (submodule.len() == 2)
{
if (curini.get("Versione", submodule).empty())
{
{
TString msg;
msg << "L'installazione del modulo '" << module
<< "'\nrichiede la presenza del modulo '" << submodule
<< "':\nSi desidera procedere alla sua installazione?";
ok = yesno_box(msg);
ok = yesno_box(msg);
if (ok)
ok = install(submodule, 0);
}
}
}
return ok;
}
}
return ok;
}
// sposta il file dal direttorio temporaneo a quello passato come destinazione
@ -494,7 +526,7 @@ bool TInstaller_mask::can_install(const char* module, TInstall_ini& ini)
// todir: direttorio destinazione (si assume che esista già)
bool TInstaller_mask::move_file(const TFilename& from, const TFilename& file, const char* todir) const
{
TFilename dest(todir);
dest.add(file.mid(from.len()+1));
if (!fexist(dest.path()))
@ -508,11 +540,11 @@ bool TInstaller_mask::move_file(const TFilename& from, const TFilename& file, co
if (!fexist(subdir) )
// build destination directory
make_dir(subdir);
}
}
}
}
const long filesize = fsize(file);
bool space_ok = FALSE;
while (!space_ok)
{
@ -548,20 +580,20 @@ bool TInstaller_mask::move_file(const TFilename& from, const TFilename& file, co
do
{
write_ok = ::fcopy(file, dest);
if (write_ok)
::remove(file);
if (write_ok)
::remove(file);
else
user_retry = yesno_box("Errore di copia del file %s.\nSi desidera ritentare?",
(const char*)file);
} while (!write_ok && user_retry);
return write_ok;
}
bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool update) const
{
{
bool ok = TRUE;
TFilename src; src.tempdir();
const TFilename tempdir(src);
const TString& dst = get(F_CURPATH);
@ -578,7 +610,7 @@ bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool
if (!move_ok)
ok = update = FALSE;
}
if (!update)
if (!update)
::remove(src);
}
@ -588,6 +620,39 @@ bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool
return ok;
}
KEY TInstaller_mask::askdisk(TString & path, TFilename & cmdline, int d, int dischi, const char * modulo)
{
TMask retry_mask("Inserimento dischi",1,80,10);
retry_mask.add_static((F_PATH==101 ? 102:101),0,
format("Inserire il disco %d di %d del modulo'%s' nell' unità indicata", d, dischi, modulo)
,2,2);
retry_mask.add_static(F_PATH+3,0,"oppure indicare un percorso diverso",2,3);
retry_mask.add_string(F_PATH,0,"",2,5,48);
retry_mask.add_button(DLG_OK,0,"Riprova",-12,7,9,2);
retry_mask.add_button(DLG_QUIT,0,"",-22,7,9,2);
retry_mask.set(F_PATH,path);
KEY k;
do {
if ((k=retry_mask.run())==K_QUIT )
break;
if (!retry_mask.get(F_PATH).blank())
{
if (fexist(retry_mask.get(F_PATH)))
{
TString16 tmpname(cmdline.name() );
cmdline= path = retry_mask.get(F_PATH);
cmdline.add(tmpname);
break;
}
else
error_box("Il percorso indicato non e' valido");
}
} while (TRUE);
return k;
}
bool TInstaller_mask::install(const TString& module, int patchlevel)
{
TInstall_ini* ini = NULL;
@ -621,12 +686,13 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
path.add("www");
}
const bool is_a_patch=(patchlevel > 0);
TFilename ininame = path;
ininame.add(module);
if (patchlevel > 0)
if (is_a_patch)
{
TString16 name;
TString16 name;
name.format("%04da.ini", patchlevel);
ininame << name;
}
@ -647,8 +713,10 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
lastpatch=ini->get_int("Patch",module);
lastrelease=ini->get("Versione",module);
if (!can_install(module, *ini))
{
delete ini;
return FALSE;
}
const int dischi = ini->get_int("Dischi", module);
ok = dischi > 0;
if (!ok)
@ -659,7 +727,11 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
{
if (patchlevel==0)
ok = pre_process(*ini, module);
if (!ok) return FALSE;
if (!ok)
{
delete ini;
return FALSE;
}
}
TString msg;
@ -670,15 +742,15 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
TProgind pi(dischi, msg, FALSE, TRUE);
TFilename tempdir; tempdir.tempdir();
TFilename cmdline;
for (int d = 1; d <= dischi && ok; d++)
{
cmdline = path;
cmdline.add(module);
cmdline.add(module);
if (patchlevel > 0)
{
TString16 name;
TString16 name;
name.format("%04da", patchlevel);
cmdline << name;
}
@ -692,21 +764,17 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
remote.insert(http_path, 0);
http_get(http_server, remote, cmdline);
}
ok = cmdline.exist();
while (!ok)
{
message_box("Inserire il disco %d di %d del modulo\n'%s'",
d, dischi, (const char*)ini->get("Descrizione"));
ok = cmdline.exist();
if (askdisk(path,cmdline,d,dischi,(const char*)ini->get("Descrizione"))==K_QUIT)
break;
ok = fexist(cmdline);
if (!ok)
{
if (!yesno_box("Impossibile trovare %s\nSi desidera riprovare?",
(const char*)cmdline))
break;
}
message_box("Impossibile trovare %s\n",(const char*)cmdline);
}
if (ok)
{
const long required = fsize(cmdline) * (dischi-d+1) * 4;
@ -717,116 +785,140 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
"Si desidera continuare ugualmente?");
}
}
if (ok)
{
{
TWait_cursor hourglass;
cmdline.insert("unzip.pif -o ", 0);
cmdline << " -d " << tempdir;
TExternal_app app(cmdline);
ok = app.run(FALSE, FALSE, FALSE, FALSE) == 0;
pi.addstatus(1);
}
}
if (ok)
{
msg.cut(0);
msg << "Aggiornamento del modulo '" << module << "' in corso...";
pi.set_text(msg);
ok = move_module(module, *ini, TRUE);
TAuto_token_string altri(ini->get("Moduli", module));
FOR_EACH_TOKEN(altri, mod)
{
const TString16 submod = mod;
if (submod.len() > 2) // sposta sottomoduli esterni
{
bool upd = ok;
if (ok)
{
TInstall_ini curini;
const TString16 curver = curini.version(submod);
const int curpatch = curini.patch(submod);
const TString16 reqver = ini->version(submod);
const int reqpatch = ini->patch(submod);
int distance = compare_version(reqver, reqpatch, curver, curpatch);
upd = distance > 0;
}
ok &= move_module(submod, *ini, upd);
if (upd && ok)
ini->export_paragraph(submod, ini->default_name());
}
}
}
if (ok)
{
if (ok) ini->export_paragraph(module, ini->default_name());
}
}
else
{
// non c'e' il .ini del modulo ma un unico "install.ini"
ininame = path;
ininame.add(TInstall_ini::default_name());
ok = fexist(ininame);
// ***************
// trasferimento
if (ok)
{
ini = new TInstall_ini(ininame);
ini->write_protect();
lastpatch=ini->get_int("Patch",module);
lastrelease=ini->get("Versione",module);
if (!can_install(module, *ini))
return FALSE;
TString_array list;
const int files = ini->build_complete_list(module, list);
if (files > 0)
{
if (patchlevel==0)
ok = pre_process(*ini, module);
if (ok)
// si assicura che sia leggibile il .ini del primo disco
do {
cmdline = path;
cmdline.add(ininame.name());
ok = fexist(cmdline);
if (!ok)
{
TProgind pi(files, "Copia in corso...", FALSE, TRUE);
TFilename src, dst;
for (int f = 0; f < files && ok; f++)
if (askdisk(path,cmdline,1,dischi,(const char*)ini->get("Descrizione"))==K_QUIT)
break;
ok = fexist(cmdline);
if (!ok)
message_box("Impossibile trovare %s\n",(const char*)cmdline);
else
{
pi.addstatus(1);
dst = list.row(f).get(0);
src = path;
src.add(dst);
ok = fcopy(src, dst);
delete ini;
ini = new TInstall_ini (cmdline);
}
}
} while (!ok);
if (ok)
{
msg.cut(0);
msg << "Aggiornamento del modulo '" << module << "' in corso...";
pi.set_text(msg);
ok = move_module(module, *ini, TRUE);
if (ok)
TAuto_token_string altri(ini->get("Moduli", module));
FOR_EACH_TOKEN(altri, mod)
{
if (ok) ini->export_module_paragraphs(module, ini->default_name());
}
}
}
}
const TString16 submod = mod;
if (submod.len() > 2) // sposta sottomoduli esterni
{
bool upd = ok;
if (ok)
{
TInstall_ini curini;
const TString16 curver = curini.version(submod);
const int curpatch = curini.patch(submod);
const TString16 reqver = ini->version(submod);
const int reqpatch = ini->patch(submod);
int distance = compare_version(reqver, reqpatch, curver, curpatch);
upd = distance > 0;
}
ok &= move_module(submod, *ini, upd);
if (upd && ok) // marca sull'install.ini di destinazione l'avvenuta installazione del sottomodulo "esterno"
ini->export_paragraph(submod, ini->default_name(),!is_a_patch);
}
}
}
}
if (ok) // marca sull'install.ini di destinazione l'avvenuta installazione del modulo
ini->export_module_paragraphs(module, ini->default_name(),!is_a_patch);
} // installazione da directory con zip
else
if (!is_a_patch)
{
//
// non c'e' il .ini del modulo ma un unico "install.ini"
// (installazione da directory con eseguibili)
ininame = path;
ininame.add(TInstall_ini::default_name());
ok = fexist(ininame);
if (ok)
{
TInstall_ini ini(ininame);
ini.write_protect();
lastpatch=ini.get_int("Patch",module);
lastrelease=ini.get("Versione",module);
if (!can_install(module, ini))
return FALSE;
TString_array list;
const int files = ini.build_complete_list(module, list);
if (files > 0)
{
if (patchlevel==0)
ok = pre_process(ini, module);
if (ok)
{
TProgind pi(files, "Copia in corso...", FALSE, TRUE);
TFilename src, dst;
for (int f = 0; f < files && ok; f++)
{
pi.addstatus(1);
dst = list.row(f).get(0);
src = path;
src.add(dst);
ok = fcopy(src, dst);
}
}
if (ok) // marca sull'install.ini di destinazione l'avvenuta installazione del modulo
ini.export_module_paragraphs(module, ini.default_name(),TRUE);
} // controllo esistenza lista di file non vuota per questo modulo
} // controllo esistenza install.ini
} // fine installazione da directory con eseguibili
if (ok)
{
{
{
{
TInstall_ini ini;
ini.set("DiskPath", get(F_PATH));
ini.set("Data", TDate(TODAY), module);
ini.update_prices(ininame);
}
// Non togliere le parentesi graffe soprastanti per permettere l'aggiornamento fisico del .ini (CON LA CHIAMATA DEL DISTRUTTORE)
update_version();
update_version();
}
if (patchlevel == 0) // Se installo un modulo pricipale ...
if (ok && patchlevel == 0) // Se installo un modulo pricipale ...
{
// ... installo DOPO tutte le patches successive
install_patches(module, lastrelease, lastpatch);
ok &= post_process(*ini, module);
TInstall_ini ini;
ok &= post_process(ini, module);
}
return ok;
@ -837,7 +929,7 @@ bool TInstaller_mask::install_patches(const TString& module, const TString& last
{
bool ok = FALSE;
TString_array modules;
TFilename ininame = get(F_PATH);
TFilename ininame = get(F_PATH);
if (is_internet_path(ininame))
{
ininame.tempdir();
@ -850,7 +942,7 @@ bool TInstaller_mask::install_patches(const TString& module, const TString& last
list_files(ininame, modules);
modules.sort(); // sort by patch number
FOR_EACH_ARRAY_ROW(modules, am, arow)
{
{
TString& ininame = *arow;
ininame.lower();
const int pos = ininame.find("a.ini");
@ -866,8 +958,18 @@ bool TInstaller_mask::install_patches(const TString& module, const TString& last
return ok;
}
bool TInstaller_mask::update_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
TInstaller_mask& m = (TInstaller_mask&)f.mask();
m.autoload();
}
return TRUE;
}
bool TInstaller_mask::path_handler(TMask_field& fld, KEY key)
{
{
bool ok = TRUE;
if (key == K_TAB && fld.focusdirty())
{
@ -894,7 +996,7 @@ void TInstaller_mask::install_selection()
FOR_EACH_ARRAY_ROW(arr, r, row) if (checked(r))
{
const TString newver = row->get(C_RELEASE);
if (newver.blank())
{
check(r, FALSE);
@ -905,18 +1007,19 @@ void TInstaller_mask::install_selection()
const int newpatch = row->get_int(C_PATCH);
const TString oldver = row->get(C_CURRRELEASE);
const int oldpatch = row->get_int(C_CURRPATCH);
if (version2year(newver) < 1997)
{
error_box("Il modulo '%s' non ha una versione valida.", (const char*)modulo);
continue;
}
bool ok = TRUE;
bool is_patch = row->get_char(C_ISPATCH) > ' ';
const int cmp = compare_version(oldver, oldpatch, newver, newpatch);
if (cmp == 0)
ok = noyes_box("Si desidera reinstallare la versione %s.%d del modulo '%s' ?", (const char*)newver, newpatch, (const char*)modulo);
if (cmp > 0)
if (!is_patch && cmp > 0)
{
TString256 msg;
msg.format("Si desidera ritornare alla versione %s.%d del modulo '%s' ?\n"
@ -931,26 +1034,30 @@ void TInstaller_mask::install_selection()
// installo le patch solo se esiste già un modulo installato della stessa versione
if (!oldver.blank() )
if (oldver != newver)
ok =error_box("Impossibile installare le patch della versione %s \nperché il modulo '%s' installato ha versione %s ",(const char *)newver,(const char *)modulo,(const char *)oldver);
ok =error_box("Il modulo '%s' installato ha versione %s:\nimpossibile installare le patch della versione %s",(const char *)modulo,(const char *)oldver,(const char *)newver);
} else
ok =FALSE;//error_box("Impossibile installare le patch perche' il modulo '%s' non e' installato",(const char *)modulo);
}
if (ok)
{
{
if (!is_patch)
{
if (newver == oldver && newpatch != oldpatch &&
!noyes_box("Si desidera reinstallare l'intero modulo?\n"
"Rispondendo NO verranno installate le sole patch"))
!noyes_box("Si desidera reinstallare l'intero modulo?\n"
"Rispondendo NO verranno installate le sole patch"))
{
is_patch = TRUE;
}
is_patch = TRUE;
}
}
if (is_patch)
{
ok = install_patches(modulo, oldver, oldpatch); // installa tutte le patch
ok = install_patches(modulo, oldver, oldpatch); // installa tutte le patch
if (!ok)
ok = install(modulo, newpatch); // re-installa l'ultima per sicurezza ()
if (!ok)
message_box("Impossibile installare le patch del modulo '%s'",(const char *)modulo);
}
else
{
@ -961,22 +1068,22 @@ void TInstaller_mask::install_selection()
if (ok)
_installed = TRUE; // Setta il flag di almeno un modulo installato
if (ok)
check(r, FALSE);
}
check(r,FALSE); // uncheck
check(r, FALSE);
}
check(r,FALSE); // uncheck
}
}
bool TInstaller_mask::install_handler(TMask_field& fld, KEY key)
{
{
if (key == K_SPACE)
{
{
if (_curr_mask->items() == 1)
_curr_mask->check(0);
if (_curr_mask->one_checked())
_curr_mask->install_selection();
else
error_box("Selezionare uno piu' moduli da installare.");
error_box("Selezionare uno piu' moduli da installare.");
}
return TRUE;
}
@ -984,7 +1091,7 @@ bool TInstaller_mask::install_handler(TMask_field& fld, KEY key)
bool TInstaller_mask::tutti_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
{
TSheet& s = (TSheet&)f.mask();
if (s.check_enabled())
{
@ -993,7 +1100,7 @@ bool TInstaller_mask::tutti_handler(TMask_field& f, KEY k)
else
{
for (long i = s.items()-1; i >=0; i--)
{
{
TToken_string r = s.row(i);
const TString16 newver = r.get(C_RELEASE);
const int newpatch = r.get_int(C_PATCH);
@ -1018,47 +1125,49 @@ bool TInstaller_mask::update_handler(TMask_field& f, KEY k)
}
bool TInstaller_mask::on_key(KEY key)
{
{
bool ok = TRUE;
switch(key)
switch (key)
{
case K_F7: autoload(); break;
case K_F8: field(DLG_USER).on_hit(); break;
default : ok = TArray_sheet::on_key(key); break;
case K_F7: autoload(); break;
case K_F8: field(DLG_USER).on_hit(); break;
default : ok = TArray_sheet::on_key(key); break;
}
return ok;
return ok;
}
TInstaller_mask::TInstaller_mask()
: TArray_sheet(0, 0, 0, 0, "Installazione",
"@1|Modulo@30|Cod.|Versione da\ninstallare@11|Livello\nPatch@8|Data\nRilascio@10|Versione\nInstallata@10|Livello\nPatch@8|Data\nInstallazione@13|Aggiornamento",
: TArray_sheet(0, 0, 0, 0, "Installazione",
"@1|Modulo@30|Cod.|Versione da\ninstallare@11|Livello\nPatch@8|Data\nRilascio@10|Versione\nInstallata@10|Livello\nPatch@8|Data\nInstallazione@13|Aggiornamento",
0x18, 3)
{
{
_curr_mask = this;
_installed = FALSE;
add_string(F_PATH, 0, "Installa da ", 1, 1, 50);
add_string(F_CURPATH, 0, "Installa in ", 1, 2, 50, "D");
add_button(F_UPDATE, "Lista", '\0');
add_button(F_UPDATE, "Aggiorna", '\0');
add_button(F_INSTALL, "Installa", '\0'); // NON mettere 'I'
set_handler(F_PATH, path_handler);
set_handler(F_INSTALL, install_handler);
set_handler(DLG_USER, tutti_handler);
set_handler(F_UPDATE, update_handler);
set_handler(DLG_USER, tutti_handler);
TDongle dongle; dongle.login(); dongle.logout();
_year_assist = dongle.year_assist();
TInstall_ini ini;
TFilename path = ini.get("DiskPath");
set(F_PATH, path);
const bool floppy = ::os_is_removable_drive(path);
const char lettera = toupper(path[0]);
const bool floppy = (path.len() > 1) && path[1] == ':' &&
GetDriveType(lettera - 'A') == DRIVE_REMOVABLE;
if (path.not_empty() && !floppy && !is_internet_path(path))
autoload();
DIRECTORY dir;
DIRECTORY dir;
xvt_fsys_get_dir(&dir);
xvt_fsys_convert_dir_to_str(&dir, path.get_buffer(), path.size());
set(F_CURPATH, path);
@ -1074,7 +1183,7 @@ TInstaller_mask::~TInstaller_mask()
///////////////////////////////////////////////////////////
class TInstaller : public TSkeleton_application
{
{
protected:
virtual bool use_files() const { return FALSE; }
virtual void main_loop();
@ -1093,8 +1202,12 @@ void TInstaller::main_loop()
}
int ba1700(int argc, char* argv[])
{
TInstaller app;
app.run(argc, argv, "Installer");
{
if (user() == "PRASSI")
{
TInstaller app;
app.run(argc, argv, "Installer");
} else
error_box("L'utente %s non e' abilitato all'esecuzione di questo programma", (const char*)user());
return 0;
}

View File

@ -1,9 +1,9 @@
[ba]
Data = 08-05-1998
Data = 03-08-1998
Descrizione = Base
Dischi = 1
Moduli =
Patch = 22
Patch = 132
PostProcess =
PreProcess =
Prezzo(1) = 500,175
@ -23,7 +23,7 @@ File(4) = ba04.bmp
File(5) = ba05.bmp
File(6) = ba06.bmp
File(7) = baprassi.men
Patch = 22
Patch = 132
Versione = 19980103
[ba1]
@ -97,117 +97,119 @@ File(74) = bagn002.msk
File(75) = bagn004.msk
File(76) = bagn005.msk
File(77) = bagn006.msk
File(78) = bainst.exe|X
File(79) = bainst01.msk|X
File(80) = bainst02.msk|X
File(81) = bainst03.msk|X
File(82) = bainst04.msk|X
File(83) = bainst05.msk|X
File(84) = bastais.msk
File(85) = bastban.msk
File(86) = bastclr.msk
File(87) = bastcpg.msk
File(88) = bastcrs.msk
File(89) = bastitl.msk
File(90) = bastiva.msk
File(91) = bastlng.msk
File(92) = bastois.msk
File(93) = baststa.msk
File(94) = baststt.msk
File(95) = bastucc.msk
File(96) = bastucs.msk
File(97) = bastues.msk
File(98) = bastuid.msk
File(99) = bastuiv.msk
File(100) = basture.msk
File(101) = bastuue.msk
File(102) = bastval.msk
File(103) = batbais.msk
File(104) = batbais.rpt
File(105) = batbban.msk
File(106) = batbban.rpt
File(107) = batbclr.msk
File(108) = batbclr.rpt
File(109) = batbcpg.msk
File(110) = batbcpg.rpt
File(111) = batbcrs.msk
File(112) = batbcrs.rpt
File(113) = batbitl.msk
File(114) = batbitl.rpt
File(115) = batbiva.msk
File(116) = batbiva.rpt
File(117) = batblng.msk
File(118) = batblng.rpt
File(119) = batbois.msk
File(120) = batbois.rpt
File(121) = batbrgi.msk
File(122) = batbsta.msk
File(123) = batbsta.rpt
File(124) = batbstt.msk
File(125) = batbstt.rpt
File(126) = batbucc.msk
File(127) = batbucc.rpt
File(128) = batbucs.msk
File(129) = batbucs.rpt
File(130) = batbues.msk
File(131) = batbues.rpt
File(132) = batbuid.msk
File(133) = batbuid.rpt
File(134) = batbuiv.msk
File(135) = batbuiv.rpt
File(136) = batbure.msk
File(137) = batbure.rpt
File(138) = batbuue.msk
File(139) = batbuue.rpt
File(140) = batbval.msk
File(141) = batbval.rpt
File(142) = fconv.ini
File(143) = prassi.aut
File(144) = prassi.hlp
File(145) = prassice.men
File(146) = prassid.ini
File(147) = prassis.ini
File(148) = unzip.pif
File(149) = unzip32.exe
File(150) = zip.pif
File(151) = zip386.bat
File(152) = zip386.exe
Patch = 22
File(78) = bainst.exe
File(79) = bainst01.msk
File(80) = bainst02.msk
File(81) = bainst03.msk
File(82) = bainst04.msk
File(83) = bainst05.msk
File(84) = bainst06.msk
File(85) = bastais.msk
File(86) = bastban.msk
File(87) = bastclr.msk
File(88) = bastcpg.msk
File(89) = bastcrs.msk
File(90) = bastitl.msk
File(91) = bastiva.msk
File(92) = bastlng.msk
File(93) = bastois.msk
File(94) = baststa.msk
File(95) = baststt.msk
File(96) = bastucc.msk
File(97) = bastucs.msk
File(98) = bastues.msk
File(99) = bastuid.msk
File(100) = bastuiv.msk
File(101) = basture.msk
File(102) = bastuue.msk
File(103) = bastval.msk
File(104) = batbais.msk
File(105) = batbais.rpt
File(106) = batbban.msk
File(107) = batbban.rpt
File(108) = batbclr.msk
File(109) = batbclr.rpt
File(110) = batbcpg.msk
File(111) = batbcpg.rpt
File(112) = batbcrs.msk
File(113) = batbcrs.rpt
File(114) = batbitl.msk
File(115) = batbitl.rpt
File(116) = batbiva.msk
File(117) = batbiva.rpt
File(118) = batblng.msk
File(119) = batblng.rpt
File(120) = batbois.msk
File(121) = batbois.rpt
File(122) = batbrgi.msk
File(123) = batbsta.msk
File(124) = batbsta.rpt
File(125) = batbstt.msk
File(126) = batbstt.rpt
File(127) = batbucc.msk
File(128) = batbucc.rpt
File(129) = batbucs.msk
File(130) = batbucs.rpt
File(131) = batbues.msk
File(132) = batbues.rpt
File(133) = batbuid.msk
File(134) = batbuid.rpt
File(135) = batbuiv.msk
File(136) = batbuiv.rpt
File(137) = batbure.msk
File(138) = batbure.rpt
File(139) = batbuue.msk
File(140) = batbuue.rpt
File(141) = batbval.msk
File(142) = batbval.rpt
File(143) = fconv.ini
File(144) = prassi.aut
File(145) = prassi.hlp
File(146) = prassice.men
File(147) = prassid.ini
File(148) = prassis.ini
File(149) = unzip.pif
File(150) = unzip32.exe
File(151) = zip.pif
File(152) = zip386.bat
File(153) = zip386.exe
Patch = 132
Versione = 19980103
[ba2]
File(153) = recdesc\f10.dir
File(154) = recdesc\f10.trr
File(155) = recdesc\f105.dir
File(156) = recdesc\f105.trr
File(157) = recdesc\f11.dir
File(158) = recdesc\f11.trr
File(159) = recdesc\f12.dir
File(160) = recdesc\f12.trr
File(161) = recdesc\f13.dir
File(162) = recdesc\f13.trr
File(163) = recdesc\f15.dir
File(164) = recdesc\f15.trr
File(165) = recdesc\f2.dir
File(166) = recdesc\f2.trr
File(167) = recdesc\f3.dir
File(168) = recdesc\f3.trr
File(169) = recdesc\f4.dir
File(170) = recdesc\f4.trr
File(171) = recdesc\f5.dir
File(172) = recdesc\f5.trr
File(173) = recdesc\f50.dir
File(174) = recdesc\f50.trr
File(175) = recdesc\f54.dir
File(176) = recdesc\f54.trr
File(177) = recdesc\f6.dir
File(178) = recdesc\f6.trr
File(179) = recdesc\f7.dir
File(180) = recdesc\f7.trr
File(181) = recdesc\f8.dir
File(182) = recdesc\f8.trr
File(183) = recdesc\f9.dir
File(184) = recdesc\f9.trr
Patch = 22
File(154) = recdesc\f10.dir
File(155) = recdesc\f10.trr
File(156) = recdesc\f105.dir
File(157) = recdesc\f105.trr
File(158) = recdesc\f11.dir
File(159) = recdesc\f11.trr
File(160) = recdesc\f12.dir
File(161) = recdesc\f12.trr
File(162) = recdesc\f13.dir
File(163) = recdesc\f13.trr
File(164) = recdesc\f15.dir
File(165) = recdesc\f15.trr
File(166) = recdesc\f2.dir
File(167) = recdesc\f2.trr
File(168) = recdesc\f3.dir
File(169) = recdesc\f3.trr
File(170) = recdesc\f4.dir
File(171) = recdesc\f4.trr
File(172) = recdesc\f5.dir
File(173) = recdesc\f5.trr
File(174) = recdesc\f50.dir
File(175) = recdesc\f50.trr
File(176) = recdesc\f54.dir
File(177) = recdesc\f54.trr
File(178) = recdesc\f6.dir
File(179) = recdesc\f6.trr
File(180) = recdesc\f7.dir
File(181) = recdesc\f7.trr
File(182) = recdesc\f8.dir
File(183) = recdesc\f8.trr
File(184) = recdesc\f9.dir
File(185) = recdesc\f9.trr
File(186) = recdesc\level.dir
Patch = 132
Versione = 19980103

1
ba/bainst03.h Executable file
View File

@ -0,0 +1 @@
#include "bainst.h"

View File

@ -1,5 +1,3 @@
#include "bainst.h"
#define F_USAMENUAVIS 101
#define F_LOADTAB 102
#define G_PREINST 1
#define G_POSTINST 2
#define G_DITTA 3

View File

@ -1,4 +1,2 @@
#include "bainst.h"
#define F_LOADTAB 101
#define G_PREINST 1
#define G_POSTINST 2
#define G_DITTA 3

58
ba/bainst06.cpp Executable file
View File

@ -0,0 +1,58 @@
#include <applicat.h>
#include <mask.h>
#include <config.h>
#include <utility.h>
#include <execp.h>
#include "bainst06.h"
class TInstall_MG : public TSkeleton_application
{
TMask * _m;
protected:
virtual void main_loop() ;
virtual bool install_firm() ; // setta i dati ditta
virtual bool install_com() ; // setta i dati comuni
public:
virtual ~TInstall_MG () {}
};
// setta i dati ditta
bool TInstall_MG ::install_firm()
{
// ciclo su ogni ditta
return TRUE;
}
bool TInstall_MG ::install_com()
{
bool ok=TRUE;
if (_m->get_bool(F_LOADTAB))
{
TExternal_app rice("bacnv 1 4 mgtab.txt");
ok &= (rice.run()==0);
}
return ok;
}
void TInstall_MG::main_loop()
{
TConfig ini("install.ini","mg");
const bool primainst=ini.get("Versione").blank();
_m = new TMask ("bainst06.msk");
if (primainst)
_m->set(F_LOADTAB,"X");
if (_m->run()!=K_QUIT)
{
install_firm();
install_com();
}
}
int bainst06(int argc, char** argv)
{
TInstall_MG app;
app.run(argc, argv, "Installazione Magazzino");
return 0;
}

2
ba/bainst06.h Executable file
View File

@ -0,0 +1,2 @@
#include "bainst.h"
#define F_LOADTAB 101

23
ba/bainst06.uml Executable file
View File

@ -0,0 +1,23 @@
#include "bainst06.h"
TOOLBAR "" 0 20 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT -11 -1 "~Conferma"
MESSAGE EXIT,K_ENTER
PICTURE BMP_OK
END
ENDPAGE
PAGE "Installazione MG" -1 -1 78 8
// GROUP 1 = PRE-INSTALLATION
// GROUP 2 = POST-INSTALLATION
BOOL F_LOADTAB
BEGIN
PROMPT 2 4 "Carica le tabelle con le causali"
END
ENDPAGE
ENDMASK

View File

@ -94,7 +94,8 @@ Item_02 = "Compatta tutti i files", "ba1 -2", ""
Item_03 = "Utenti", "ba1 -3", ""
Item_04 = "Attivazione moduli", "ba1 -4", ""
Item_05 = "Installazione moduli", "ba1 -6", ""
Item_06 = "Backup", "ba2 -1", ""
Item_06 = "Creazione dischi di installazione", "ba1 -5", ""
Item_07 = "Backup", "ba2 -1", ""
[PRASSI_019]
Caption = "Comunicazione"

View File

@ -1,3 +1,3 @@
3
1
%tabgen|0|0|885|0|Tabelle di studio|50||
%tabgen|0|0|895|0|Tabelle di studio|50||

View File

@ -1,5 +1,5 @@
3
63
65
COD|1|3|0|
CODTAB|1|25|0|
S0|1|70|0|
@ -12,6 +12,8 @@ S6|1|5|0|
S7|1|5|0|
S8|1|5|0|
S9|1|5|0|
S10|1|5|0|
S11|1|5|0|
I0|3|7|0|
I1|3|7|0|
I2|3|7|0|

View File

@ -1,3 +1,3 @@
4
1
%tabcom|0|0|885|0|Tabelle comuni|1500||
%tabcom|0|0|895|0|Tabelle comuni|1500||

View File

@ -1,5 +1,5 @@
4
63
65
COD|1|3|0|
CODTAB|1|25|0|
S0|1|70|0|
@ -12,6 +12,8 @@ S6|1|5|0|
S7|1|5|0|
S8|1|5|0|
S9|1|5|0|
S10|1|5|0|
S11|1|5|0|
I0|3|7|0|
I1|3|7|0|
I2|3|7|0|

View File

@ -1,3 +1,3 @@
5
0
$tab|0|0|885|0|Tabelle ditta|400||
$tab|0|0|895|0|Tabelle ditta|400||

View File

@ -1,5 +1,5 @@
5
63
65
COD|1|3|0|
CODTAB|1|25|0|
S0|1|70|0|
@ -12,6 +12,8 @@ S6|1|5|0|
S7|1|5|0|
S8|1|5|0|
S9|1|5|0|
S10|1|5|0|
S11|1|5|0|
I0|3|7|0|
I1|3|7|0|
I2|3|7|0|

File diff suppressed because it is too large Load Diff