Patch level : 10.0
Files correlati : ba0.exe ba1.exe ba7.exe Ricompilazione Demo : [ ] Commento : Bloccata la possibilità di eseguire contemporaneamente i programmi di manutenzione git-svn-id: svn://10.65.10.50/branches/R_10_00@21935 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
700b85cae9
commit
fce0d51d36
@ -1358,16 +1358,9 @@ bool TMenu_application::test_programs()
|
||||
{
|
||||
TToken_string dangerous;
|
||||
int update_needed = 0;
|
||||
bool is_client = false;
|
||||
const bool is_client = ini_get_int(CONFIG_INSTALL, "Main", "Type") == 3;
|
||||
bool sy_needed = false;
|
||||
|
||||
//parentesi necessaria per richiudere subito il .ini!
|
||||
{
|
||||
TConfig prawin(CONFIG_INSTALL, "Main");
|
||||
const int type = prawin.get_int("Type");
|
||||
is_client = type == 3 || prawin.get_bool("TestPrograms");
|
||||
}
|
||||
|
||||
TString msg = TR("I seguenti moduli devono essere aggiornati prima dell'utilizzo:\n");
|
||||
if (is_client)
|
||||
{
|
||||
@ -1471,6 +1464,27 @@ bool TMenu_application::test_programs()
|
||||
} //(if(update_needed>0...
|
||||
} //if(is_client..
|
||||
|
||||
TString16 module;
|
||||
TDate expires;
|
||||
Tdninst dninst;
|
||||
if (dninst.find_expiring(30, module, expires))
|
||||
{
|
||||
TString msg;
|
||||
msg = TR("L'abilitazione ");
|
||||
if (module == "*")
|
||||
msg << TR(" di ") << dongle().product();
|
||||
else
|
||||
{
|
||||
if (module.len() == 2)
|
||||
msg << TR(" del modulo ") << module;
|
||||
else
|
||||
msg << TR(" del programma ") << module;
|
||||
}
|
||||
msg << TR(" scadrà il ") << expires << TR(":\nsi consiglia di contattare ")
|
||||
<< dongle().reseller() << '.';
|
||||
xvt_dm_popup_warning(msg);
|
||||
}
|
||||
|
||||
_menu.set_dangerous_modules(dangerous);
|
||||
return true;
|
||||
}
|
||||
@ -1765,7 +1779,7 @@ bool TStudy_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
SLIST dirs = xvt_fsys_list_files(DIR_TYPE, str, true);
|
||||
|
||||
TFilename dirgen;
|
||||
TArray_sheet sht(-1, -1, 78, 20, TR("Scelta studio"), HR("Studio@72|Ditte"));
|
||||
TArray_sheet sht(-1, -1, 78, 20, TR("Scelta studio"), HR("Studio@70|Ditte"));
|
||||
for (SLIST_ELT e = xvt_slist_get_first(dirs); e; e = xvt_slist_get_next(dirs, e))
|
||||
{
|
||||
const char* f = xvt_slist_get(dirs, e, NULL);
|
||||
@ -2040,8 +2054,9 @@ void TMenu_application::load_preferences()
|
||||
}
|
||||
update_preferred();
|
||||
|
||||
TMenuitem::always_run_fullscreen(cfg.get_bool("AlwaysFullScreen"));
|
||||
_tree_view = cfg.get_int("TreeView", "Colors", -1, 3);
|
||||
cfg.set_paragraph("Colors");
|
||||
TMenuitem::always_run_fullscreen(cfg.get_bool("RunModal"));
|
||||
_tree_view = cfg.get_int("TreeView", NULL, -1, 3);
|
||||
}
|
||||
|
||||
void TMenu_application::save_preferences()
|
||||
@ -2327,6 +2342,9 @@ bool TMenu_application::menu(MENU_TAG mt)
|
||||
|
||||
int ba0100(int argc, char** argv)
|
||||
{
|
||||
if (xvt_vobj_get_attr(NULL_WIN, ATTR_APPL_ALREADY_RUNNING))
|
||||
return error_box(TR("Il menu principale è già in esecuzione!"));
|
||||
|
||||
TApplication::check_parameters(argc, argv);
|
||||
|
||||
TString& u = user();
|
||||
|
@ -368,6 +368,10 @@ bool TManutenzione_app::create() // initvar e arrmask
|
||||
_mask->enable(-1); // Abilita campi privilegiati del gruppo 1
|
||||
}
|
||||
enable_menu_item(M_FILE_PRINT);
|
||||
|
||||
if (xvt_vobj_get_attr(NULL_WIN, ATTR_APPL_ALREADY_RUNNING))
|
||||
return error_box(TR("Il programma di manutenzione è già in esecuzione!"));
|
||||
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
@ -771,26 +775,31 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
|
||||
|
||||
void TManutenzione_app::delete_riga (long riga_sel)
|
||||
{
|
||||
const int logicnum = int(riga_sel) + 1;
|
||||
const int num_files = (int)_browse->items();
|
||||
TTrec r;
|
||||
|
||||
/* shift di uno in avanti degli elementi del direttorio partendo dall'ultimo */
|
||||
for (int i = logicnum + 1; i <= num_files; i++)
|
||||
const int logicnum = int(riga_sel) + 1;
|
||||
if (riga_sel == num_files-1 && yesno_box(FR("Si conferma l'eliminazione del file %d"), logicnum))
|
||||
{
|
||||
_browse->dir().get (i, _nolock, _nordir, _sysdirop);
|
||||
_browse->dir().put (i - 1, _nordir, _sysdirop);
|
||||
_browse->rec().get (i);
|
||||
_browse->rec().put (i - 1);
|
||||
}
|
||||
/* shift di uno in avanti degli elementi del direttorio partendo dall'ultimo */
|
||||
for (int i = logicnum + 1; i <= num_files; i++)
|
||||
{
|
||||
_browse->dir().get (i, _nolock, _nordir, _sysdirop);
|
||||
_browse->dir().put (i - 1, _nordir, _sysdirop);
|
||||
_browse->rec().get (i);
|
||||
_browse->rec().put (i - 1);
|
||||
}
|
||||
|
||||
_browse->dir().get(LF_DIR);
|
||||
r.zero();
|
||||
r.put(_browse->dir().eod());
|
||||
_browse->dir().set_eod(_browse->dir().eod()-1);
|
||||
_browse->set_items(_browse->dir().eod());
|
||||
_browse->dir().put(LF_DIR);
|
||||
_browse->force_update();
|
||||
_browse->dir().get(LF_DIR);
|
||||
|
||||
TTrec r;
|
||||
r.zero();
|
||||
r.put(_browse->dir().eod());
|
||||
_browse->dir().set_eod(_browse->dir().eod()-1);
|
||||
_browse->set_items(_browse->dir().eod());
|
||||
_browse->dir().put(LF_DIR);
|
||||
_browse->force_update();
|
||||
}
|
||||
else
|
||||
error_box(FR("Eliminazione del file %d non effettuata"), logicnum);
|
||||
}
|
||||
|
||||
bool TManutenzione_app::recover(TSystemisamfile& f, int err)
|
||||
|
@ -425,18 +425,23 @@ bool TAttivazione_moduli::burn_dongle()
|
||||
bool TAttivazione_moduli::maxuser_handler(TMask_field& fld, KEY key)
|
||||
{
|
||||
bool ok = true;
|
||||
if (key == K_TAB && fld.focusdirty())
|
||||
if (key == K_TAB && !fld.empty())
|
||||
{
|
||||
const int utenti = atoi(fld.get());
|
||||
if (utenti > 0 && utenti < 10000)
|
||||
if (utenti > 0 && utenti < 1000)
|
||||
{
|
||||
TString8 str1, str2;
|
||||
app().garble_users(utenti, str1, str2);
|
||||
fld.mask().set(102, str1);
|
||||
fld.mask().set(103, str2);
|
||||
}
|
||||
else
|
||||
ok = fld.error_box(TR("Numero di utenti errato"));
|
||||
}
|
||||
if (key == K_ENTER)
|
||||
{
|
||||
const int utenti = atoi(fld.get());
|
||||
if (utenti <= 0 || utenti >= 1000)
|
||||
ok = fld.error_box(TR("Numero di utenti errato"));
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -444,20 +449,23 @@ bool TAttivazione_moduli::change_users_handler(TMask_field& fld, KEY key)
|
||||
{
|
||||
if (key == K_SPACE)
|
||||
{
|
||||
TMask m(TR("Utenti"), 1, 20, 4);
|
||||
m.add_button_tool(DLG_OK, "", TOOL_OK);
|
||||
m.add_button_tool(DLG_CANCEL, "", TOOL_CANCEL);
|
||||
TMask m(TR("Utenti"), 1, 26, 7);
|
||||
m.add_number(101, 0, PR("Utenti "), 1, 1, 4, "U");
|
||||
m.add_string(102, 0, PR("Codice "), 1, 2, 8, "U");
|
||||
m.add_string(102, 0, PR("Codice "), 1, 2, 8, "DU");
|
||||
|
||||
TDongle& dongle = ::dongle();
|
||||
if (dongle.type() == _user_dongle)
|
||||
{
|
||||
m.set(101, dongle.max_users());
|
||||
m.enable(102);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.set_handler(101, maxuser_handler);
|
||||
m.disable(102);
|
||||
m.add_string(103, 0, PR("WebCod "), 1, 3, 8, "DU");
|
||||
}
|
||||
m.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
|
||||
m.add_button(DLG_CANCEL, 0, "", -22, -1, 10, 2);
|
||||
|
||||
if (m.run() == K_ENTER)
|
||||
{
|
||||
@ -496,13 +504,13 @@ bool TAttivazione_moduli::change_users_handler(TMask_field& fld, KEY key)
|
||||
return true;
|
||||
}
|
||||
|
||||
#define YEAR_MIN 2007
|
||||
#define YEAR_MIN 2091
|
||||
#define YEAR_MAX 2777
|
||||
|
||||
bool TAttivazione_moduli::assist_handler(TMask_field& fld, KEY key)
|
||||
{
|
||||
bool ok = true;
|
||||
if (key == K_TAB && fld.focusdirty())
|
||||
if (key == K_TAB && !fld.empty())
|
||||
{
|
||||
const int year = atoi(fld.get());
|
||||
if (year >= YEAR_MIN && year <= YEAR_MAX)
|
||||
@ -510,10 +518,15 @@ bool TAttivazione_moduli::assist_handler(TMask_field& fld, KEY key)
|
||||
TString16 str1, str2;
|
||||
app().garble_year(year, str1, str2);
|
||||
fld.mask().set(102, str1);
|
||||
fld.mask().set(103, str2);
|
||||
}
|
||||
else
|
||||
ok = fld.error_box(TR("Anno errato"));
|
||||
}
|
||||
if (key == K_ENTER)
|
||||
{
|
||||
const int year = atoi(fld.get());
|
||||
if (year < YEAR_MIN || year > YEAR_MAX)
|
||||
ok = fld.error_box(TR("Anno di assitenza errato"));
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -521,20 +534,23 @@ bool TAttivazione_moduli::change_assist_handler(TMask_field& fld, KEY key)
|
||||
{
|
||||
if (key == K_SPACE)
|
||||
{
|
||||
TMask m(TR("Assistenza"), 1, 20, 4);
|
||||
m.add_button_tool(DLG_OK, "", TOOL_OK);
|
||||
m.add_button_tool(DLG_CANCEL, "", TOOL_CANCEL);
|
||||
TMask m(TR("Assistenza"), 1, 26, 7);
|
||||
m.add_number(101, 0, PR("Anno "), 1, 1, 4, "U");
|
||||
m.add_string(102, 0, PR("Codice "), 1, 2, 8, "U");
|
||||
m.add_string(102, 0, PR("Codice "), 1, 2, 8, "DU");
|
||||
|
||||
TDongle& dongle = ::dongle();
|
||||
if (dongle.type() == _user_dongle)
|
||||
{
|
||||
m.set(101, dongle.year_assist());
|
||||
m.enable(102);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.add_string(103, 0, PR("WebCod "), 1, 3, 8, "DU");
|
||||
m.set_handler(101, assist_handler);
|
||||
m.disable(102);
|
||||
}
|
||||
m.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
|
||||
m.add_button(DLG_CANCEL, 0, "", -22, -1, 10, 2);
|
||||
|
||||
if (m.run() == K_ENTER)
|
||||
{
|
||||
@ -590,8 +606,7 @@ bool TAttivazione_moduli::aga_handler(TMask_field& fld, KEY key)
|
||||
mask.add_string(103, 0, PR("Distributore "), 1, 3, 60);
|
||||
mask.add_string(104, 0, PR("Amministratore "), 1, 4, 16, "U");
|
||||
mask.add_string(105, 0, PR("Password "), 1, 5, 16, "*");
|
||||
|
||||
mask.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
|
||||
mask.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
|
||||
mask.add_button(DLG_CANCEL, 0, "", -22, -1, 10, 2);
|
||||
|
||||
//nuovo modo di gettare il producer da oem.ini
|
||||
|
@ -41,8 +41,7 @@ bool update_dninst(bool force)
|
||||
//legge dal diskpath di install.ini la directory da cui aggiornarsi;se il dninst.zip di tale..
|
||||
//..directory e' piu' nuovo di quello in locale -> lo copia in locale
|
||||
const TFilename local_name = "setup/dninst.zip";
|
||||
TConfig ini("install.ini", "Main");
|
||||
TFilename remote_name = ini.get("DiskPath");
|
||||
TFilename remote_name = ini_get_string(CONFIG_GENERAL, "Main", "DiskPath");
|
||||
remote_name.add(local_name);
|
||||
if (remote_name.exist())
|
||||
{
|
||||
@ -81,32 +80,16 @@ bool update_assistance_year()
|
||||
//...validi dentro il dninst.zip
|
||||
if (dninst_year > donkey.year_assist())
|
||||
{
|
||||
// Cerca il numero di serie e gli "eventuali" moduli da disattivare
|
||||
TToken_string to_be_killed;
|
||||
if (dninst.find_killed(to_be_killed))
|
||||
// Cerca il numero di serie
|
||||
if (dninst.find_serno())
|
||||
{
|
||||
donkey.set_year_assist(dninst_year);
|
||||
FOR_EACH_TOKEN(to_be_killed, mod) if (strlen(mod) == 2)
|
||||
{
|
||||
const word aut = donkey.module_name2code(mod);
|
||||
if (aut > BAAUT && aut < ENDAUT)
|
||||
{
|
||||
donkey.deactivate(aut);
|
||||
if (remote)
|
||||
rpc_DongleModuleActivate(aut, false);
|
||||
}
|
||||
}
|
||||
|
||||
bool done = false;
|
||||
if (remote)
|
||||
done = rpc_DongleYearActivate(dninst_year);
|
||||
else
|
||||
done = donkey.burn();
|
||||
|
||||
if (done)
|
||||
return true; // Complimenti, la chiavetta e' presente nella lista ed e' stato aggiornata l'assistenza
|
||||
else
|
||||
return show_error(TR("Errore di aggiornamento della chiave di protezione"));
|
||||
done = donkey.burn();
|
||||
return done || show_error(TR("Errore di aggiornamento della chiave di protezione"));
|
||||
} //if(sn==serno...
|
||||
else
|
||||
{
|
||||
@ -114,15 +97,11 @@ bool update_assistance_year()
|
||||
show_error(TR("Il numero di serie di questa postazione non è presente sul database"));
|
||||
}
|
||||
}
|
||||
else //if(ass_year>dongle...
|
||||
else
|
||||
{
|
||||
//Se l'anno di assistenza sulla chiave e' maggiore di quello sul dninst segnala l'incongruenza e poi?
|
||||
if (dninst_year < donkey.year_assist())
|
||||
show_error(TR("L'anno di assistenza sul database e' inferiore a quello registrato sulla chiave di protezione"));
|
||||
//Se l'anno di assistenza coincide con quello sulla chiave -> la chiave ha gia' l'assistenza...
|
||||
//...corretta abilitata e puo' proseguire l'aggiornamento
|
||||
else
|
||||
return true; //ok, sei abilitato a proseguire!
|
||||
// Se l'anno di assistenza sulla chiave e' maggiore o uguale a quello sul dninst
|
||||
// la chiave ha gia' l'assistenza corretta abilitata e puo' proseguire l'aggiornamento
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1487,7 +1487,7 @@ void TInstaller_mask::install_selection()
|
||||
}
|
||||
}
|
||||
|
||||
TProgind pi(nModules, "Installazione", true, true);
|
||||
TProgind pi(nModules, TR("Installazione"), true, true);
|
||||
|
||||
//deve poter tener conto del "No Tutti" in caso di installazione da area release
|
||||
bool no_to_all = false;
|
||||
|
@ -1568,10 +1568,18 @@ const char* const appname = TR("Postino");
|
||||
|
||||
class TMailer : public TSkeleton_application
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual void main_loop();
|
||||
};
|
||||
|
||||
bool TMailer::create()
|
||||
{
|
||||
if (xvt_vobj_get_attr(NULL_WIN, ATTR_APPL_ALREADY_RUNNING))
|
||||
return error_box(FR("Il programma %s è già in esecuzione!"), appname);
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
void TMailer::main_loop()
|
||||
{
|
||||
WINDOW tray = xvt_trayicon_create(TASK_WIN, 0, appname);
|
||||
|
Loading…
x
Reference in New Issue
Block a user