Patch level : 12.0 1214

Files correlati     : ba1.exe ba7.exe ba7100a.msk

Commento:
La conversione era lenta in partenza
Il postino diventa trasferimenti.
This commit is contained in:
Alessandro Bonazzi 2022-11-16 08:06:55 +01:00
parent af97e9bca7
commit 4de704b6dc
4 changed files with 29 additions and 53 deletions

View File

@ -326,7 +326,6 @@ bool TManutenzione_app::create() // initvar e arrmask
}
if (!::dongle().demo() && !set_firm())
return false;
convert_recdef();
}
_firm = atol(prefix().name());
@ -1125,52 +1124,6 @@ void TManutenzione_app::clean_recdef(const char * dir)
remove_files(mask, false);
}
void TManutenzione_app::convert_recdef(int firm)
{
TString pref = prefix().name();
const int curr_firm = prefix().get_codditta();
bool all_firms = firm < 0;
TString_array ditte;
int nditte = firm > 0 ? 1 : 0;
if (all_firms)
nditte = prefix().firms(ditte);
else
if (firm > 0)
ditte.add(format("%d", firm));
TFilename dir = firm2dir(0);
if (all_firms || firm == 0)
{
prefix().set("com");
dir.add("recdesc");
if (!dexist(dir))
make_dir(dir);
clean_recdef(dir);
dump_trc(dir);
}
for (int i = 0; i < ditte.items(); i++)
{
int firm = atoi((TString &)ditte[i]);
dir = firm2dir(firm);
if (dexist(dir))
{
set_firm(firm);
load_des();
dir.add("recdesc");
if (!dexist(dir))
make_dir(dir);
clean_recdef(dir);
dump_trc(dir);
}
}
if (curr_firm > 0)
set_firm(curr_firm);
else
prefix().set(pref);
}
void TManutenzione_app::convert_dir()
{
if (prefix().get_codditta() <= _history_firm)
@ -1323,7 +1276,7 @@ void TManutenzione_app::convert_dir()
const int firm = prefix().is_com() ? 0 : prefix().get_codditta();
convert_recdef(firm);
}
void TManutenzione_app::load_des()

View File

@ -135,7 +135,7 @@ protected:
bool try_to_recover(TSystemisamfile& f, int err);
void clean_recdef(const char * dir);
void convert_recdef(int firm = -1);
// void convert_recdef(int firm = -1);
void update();
void update_dir();
void recover();

View File

@ -1735,13 +1735,15 @@ TMailer_mask::~TMailer_mask()
// TMailer
///////////////////////////////////////////////////////////
const char* const appname = TR("Postino");
const char* const appname = TR("Trasferimenti");
class TMailer : public TSkeleton_application
{
bool _start_full_screen;
TString _profile;
protected:
virtual bool task_win_iconized() const { return !_start_full_screen && xvt_win_is_taskbar_visible(); }
virtual bool create();
virtual void main_loop();
};
@ -1750,15 +1752,25 @@ bool TMailer::create()
{
TString arg1 = main_app().argv(2);
TString arg2 = main_app().argv(3);
bool multiple_instances = arg1.starts_with("-f") || arg2.starts_with("-f");
TString arg3 = main_app().argv(4);
bool multiple_instances = arg1.starts_with("-f") || arg2.starts_with("-f") || arg3.starts_with("-f");
_start_full_screen = arg1.starts_with("-v") || arg2.starts_with("-v");
_start_full_screen = arg1.starts_with("-v") || arg2.starts_with("-v") || arg3.starts_with("-v");
if (!multiple_instances && xvt_vobj_get_attr(NULL_WIN, ATTR_APPL_ALREADY_RUNNING))
{
TString msg; msg.format(FR("%s già in esecuzione!"), appname);
xvt_dm_popup_error(msg);
return false;
}
if (arg1.starts_with("-p"))
_profile = arg1.mid(2);
else
if (arg2.starts_with("-p"))
_profile = arg2.mid(2);
else
if (arg3.starts_with("-p"))
_profile = arg3.mid(2);
return TSkeleton_application::create();
}
@ -1782,7 +1794,9 @@ void TMailer::main_loop()
TMailer_mask mm;
mm.run();
if (_profile.full())
mm.load_profile(_profile, "ADMIN");
mm.run();
xvt_trayicon_destroy(tray);
}

View File

@ -189,6 +189,15 @@ END
ENDPAGE
TOOLBAR "Toolbar" 0 -3 -1 -1
STRING DLG_PROFILE 50
BEGIN
PROMPT 1 0 "Profilo "
PSELECT
END
ENDPAGE
ENDMASK