Possibilità di eseguire contemporaneamente più menu in diverse cartelle

git-svn-id: svn://10.65.10.50/branches/R_10_00@22930 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2014-05-14 08:20:53 +00:00
parent 80f65c95ef
commit a32fade891
9 changed files with 106 additions and 38 deletions

View File

@ -990,12 +990,9 @@ void TMenu_application::test_temp()
if (count > 0 && yesno_box(TR("Cancellare tutti i file temporanei in %s?"), dir.path()))
{
TProgind bar(count, TR("Cancellazione file temporanei"), true, true);
for (int i = count-1; i >= 0; i--)
TProgress_monitor bar(count, TR("Cancellazione file temporanei"));
for (int i = count-1; i >= 0 && bar.add_status(); i--)
{
bar.addstatus(1);
if (bar.iscancelled())
break;
const char* e = files.row(i);
::remove(e);
}
@ -1760,7 +1757,8 @@ bool TStudy_mask::is_valid_study(const char* path) const
{
TFilename n = path;
n.add("com/dir.gen");
return n.find(' ') < 0 && n.exist();
//return n.find(' ') < 0 && n.exist();
return n.find(' ') < 0 && xvt_fsys_access(n, 0x2) == 0; // NO blanks and write permission
}
void TStudy_mask::list_studies(TString_array& sht, bool firms_count) const

View File

@ -496,7 +496,8 @@ bool TSet_user_passwd::password_handler(TMask_field& f, KEY key)
if (ok)
{
const int minlen = ini_get_int(CONFIG_STUDIO, "Main", "MinPwdLen", 4);
int minlen = ini_get_int(CONFIG_STUDIO, "Main", "MinPwdLen", 4);
if (minlen > f.size()) minlen = f.size();
if (pwdlen < minlen)
{
TString msg; msg.format(TR("La password deve essere lunga almeno %d caratteri."), minlen);

View File

@ -250,7 +250,7 @@ void TInstall_ini::export_paragraph(const char* module, const char* summary, con
TAssoc_array& ass = list_variables(module);
TString newkey,tmps;
TToken_string item_value;
TString ;
FOR_EACH_ASSOC_STRING(ass, obj, key, str)
{
if (!remove_old && is_submodule && strncmp(key, "File", 4) == 0 )
@ -258,31 +258,36 @@ void TInstall_ini::export_paragraph(const char* module, const char* summary, con
// merging "File(X)" items...
item_value=str;
tmps=item_value.get(0);
int item_number=find_row(tmps, old_list);
const int item_number=find_row(tmps, old_list);
if (item_number>=0)
{
// file sostituito
TString old_smodule(old_list.row(item_number).get(2));
const TString old_smodule = old_list.row(item_number).get(2);
TAssoc_array& oldvars = sum.list_variables(old_smodule);
THash_object* obj;
THash_object* obj = NULL;
TToken_string oldvalue;
oldvars.restart();
do
{
obj=oldvars.get_hashobj();
oldvalue=((TString &)obj->obj());
obj = oldvars.get_hashobj();
if (obj == NULL)
break;
oldvalue = ((const TString &)obj->obj());
if (tmps == oldvalue.get(0))
break;
}
while (obj);
newkey = obj->key();
if (old_smodule!=module)
if (obj != NULL)
{
// devo cancellare il file dal vecchio sottomodulo
sum.set_paragraph(old_smodule);
sum.remove(newkey);
sum.set_paragraph(module);
}
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
{

View File

@ -125,6 +125,7 @@
#define DLG_REG 188
#define F_ISCRCAF 189
#define FLD_GD1_RAGSOCH 190
#define FLD_GD1_MAIL 191
#define FLD_GD1_VALUTA 192
#define CHK_IN_PRESELEN 195

View File

@ -35,7 +35,7 @@ BEGIN
FIELD LF_NDITTE->CODDITTA
FLAGS "RG"
KEY 1
USE LF_NDITTE KEY 1
USE LF_NDITTE
INPUT CODDITTA FLD_GD1_CODDITTA
DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale@50" RAGSOC
@ -182,9 +182,9 @@ BEGIN
WARNING "Attivita' assente"
END
GROUPBOX DLG_NULL 76 4
GROUPBOX DLG_NULL 76 5
BEGIN
PROMPT 0 12 "@bTelefoni"
PROMPT 0 12 "@bRecapiti telefonici e telematici"
END
STRING FLD_GD1_PTEL 10
@ -215,6 +215,14 @@ BEGIN
HELP "Numero telefonico del fax della ditta"
END
STRING FLD_GD1_MAIL 50
BEGIN
PROMPT 1 15 "E-Mail : "
FIELD LF_NDITTE->MAIL
HELP "Indirizzo e-mail della ditta"
END
STRING FLD_GD1_VALUTA 3
BEGIN
PROMPT 1 17 "Codice valuta di riferimento "

View File

@ -511,11 +511,31 @@ bool TReport_mask::get_rep_path(TFilename& path) const
xvt_fsys_mkdir(path);
path.add(name);
path.ext("rep");
if (!path.exist() && is_power_station())
bool found = path.exist();
if (!found)
{
TString80 fname = path.name_only(); fname.lower();
TFilename star = path.path(); star.add("*.rep");
TString_array reps;
list_files(star, reps);
double best = 0.8;
FOR_EACH_ARRAY_ROW(reps, r, row)
{
star = *row; star = star.name_only(); star.lower();
const double s = xvt_str_fuzzy_compare(star, fname);
if (s > best)
{
path = *row;
best = s;
found = true;
}
}
}
if (!found && is_power_station())
{
path = name;
path.ext("rep");
path.custom_path();
found = path.custom_path();
}
}
path.ext("rep");

View File

@ -155,22 +155,29 @@ void TKlarkKent_app::main_loop()
{
TString_array arr; // Lista dei reports
TAssoc_array vars; // Variabili utente
bool trans = false;
TString80 name, val;
for (int i = 2; i < argc(); i++)
{
const TFixed_string arg(argv(i));
const int uguale = arg.find('=');
if (uguale > 0)
{
TString16 name = arg.left(uguale); name.trim();
TString80 val = arg.mid(uguale+1); val.trim();
if (name.full() && val.full())
name = arg.left(uguale); name.trim();
val = arg.mid(uguale+1); val.trim();
if (name.full())
{
TVariant* var = NULL;
if (real::is_real(val))
var = new TVariant(real(val));
if (val.full())
{
if (real::is_real(val))
var = new TVariant(real(val));
else
var = new TVariant(val);
}
else
var = new TVariant(val);
var = new TVariant;
if (name[0] != '#')
name.insert("#");
vars.add(name, var);
@ -178,10 +185,37 @@ void TKlarkKent_app::main_loop()
}
else
{
TFilename rep = arg;
rep.ext("rep");
if (rep.custom_path())
arr.add(arg);
if (arg.starts_with("-i"))
{
trans = true;
TFilename ininame = arg.mid(2);
TConfig ini(ininame, "Vars");
TAssoc_array& inivars = ini.list_variables();
FOR_EACH_ASSOC_STRING(inivars, obj, key, str)
{
TVariant* var = NULL;
if (str && *str)
{
if (real::is_real(str))
var = new TVariant(real(str));
else
var = new TVariant(str);
}
else
var = new TVariant;
name = key;
if (name[0] != '#')
name.insert("#");
vars.add(name, var);
}
}
else
{
TFilename rep = arg;
rep.ext("rep");
if (rep.custom_path())
arr.add(arg);
}
}
}
@ -246,7 +280,7 @@ void TKlarkKent_app::main_loop()
pset->set_var(name, *(TVariant*)var, true);
}
const bool ok = book.add(*report);
if (ok && arr.items() == 1) // Controlla se e' pensabile ripetere la stampa
if (ok && !trans && arr.items() == 1) // Controlla se e' pensabile ripetere la stampa
{
TFilename msk = report_name;
msk.ext("msk");

View File

@ -1,3 +1,3 @@
9
1
%nditte|0|0|571|0|Ditte|#6||
%nditte|0|0|621|0|Ditte|#6||

View File

@ -1,5 +1,5 @@
9
55
56
CODDITTA|3|5|0|
TIPOA|1|1|0|
CODANAGR|3|5|0|
@ -9,6 +9,7 @@ PTEL|1|10|0|
TEL|1|30|0|
PFAX|1|10|0|
FAX|1|30|0|
MAIL|1|50|0|
NULC|2|3|0|
ARTIG|8|1|0|
NISCRAA|1|10|0|