Patch level : 01.00 1370
Files correlati : ba0.exe ba0100m.msk Commento: Corretta la selezione per conto nella stampa mastrini analitica
This commit is contained in:
parent
182663090e
commit
868298b802
@ -22,6 +22,7 @@
|
|||||||
#include "ba0100.h"
|
#include "ba0100.h"
|
||||||
|
|
||||||
#include "ba0100a.h"
|
#include "ba0100a.h"
|
||||||
|
#include "ba0100m.h"
|
||||||
#include "ba0400a.h"
|
#include "ba0400a.h"
|
||||||
|
|
||||||
#define MEN_FILE "bamenu.men"
|
#define MEN_FILE "bamenu.men"
|
||||||
@ -104,6 +105,7 @@ public:
|
|||||||
TMenu& main_menu() { return _menu; }
|
TMenu& main_menu() { return _menu; }
|
||||||
|
|
||||||
TMenu_application(const char* name);
|
TMenu_application(const char* name);
|
||||||
|
virtual ~TMenu_application() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline TMenu_application& app()
|
inline TMenu_application& app()
|
||||||
@ -160,7 +162,7 @@ void TPicture_mask::update()
|
|||||||
img.right = but.left; img.top = lgo.bottom;
|
img.right = but.left; img.top = lgo.bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_logo != NULL)
|
if (_logo != nullptr)
|
||||||
{
|
{
|
||||||
xvt_rect_inflate(&lgo, -CHARX, -CHARX);
|
xvt_rect_inflate(&lgo, -CHARX, -CHARX);
|
||||||
_logo->draw(win(), lgo, 'C', 'T', '-');
|
_logo->draw(win(), lgo, 'C', 'T', '-');
|
||||||
@ -201,7 +203,7 @@ void TPicture_mask::set_current(const TSubmenu& sm)
|
|||||||
|
|
||||||
TPicture_mask::TPicture_mask(const char* name, int dx, int dy,
|
TPicture_mask::TPicture_mask(const char* name, int dx, int dy,
|
||||||
const TSubmenu& submenu, int x, int y)
|
const TSubmenu& submenu, int x, int y)
|
||||||
: TMask(name, 1, dx, dy, x, y), _submenu(NULL), _logo(NULL)
|
: TMask(name, 1, dx, dy, x, y), _submenu(nullptr), _logo(nullptr)
|
||||||
{
|
{
|
||||||
set_current(submenu);
|
set_current(submenu);
|
||||||
|
|
||||||
@ -215,16 +217,12 @@ TPicture_mask::TPicture_mask(const char* name, int dx, int dy,
|
|||||||
_logo->convert_transparent_color(MASK_BACK_COLOR);
|
_logo->convert_transparent_color(MASK_BACK_COLOR);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
safe_delete(_logo);
|
||||||
delete _logo;
|
|
||||||
_logo = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TPicture_mask::~TPicture_mask()
|
TPicture_mask::~TPicture_mask()
|
||||||
{
|
{
|
||||||
if (_logo != NULL)
|
safe_delete(_logo);
|
||||||
delete _logo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -503,28 +501,29 @@ bool TColor_mask::apply_theme()
|
|||||||
{
|
{
|
||||||
const TList_field& fl = lfield(211);
|
const TList_field& fl = lfield(211);
|
||||||
TToken_string values = fl.get_values();
|
TToken_string values = fl.get_values();
|
||||||
|
|
||||||
TString name = values.get(theme);
|
TString name = values.get(theme);
|
||||||
|
|
||||||
TFilename thini; find_themes_ini(thini);
|
TFilename thini; find_themes_ini(thini);
|
||||||
TConfig def_themes(thini, name);
|
TConfig def_themes(thini, name);
|
||||||
TAssoc_array& def_colors = def_themes.list_variables();
|
TAssoc_array& def_colors = def_themes.list_variables();
|
||||||
|
|
||||||
name.insert("Theme_");
|
name.insert("Theme_");
|
||||||
|
|
||||||
TConfig usr_themes(CONFIG_GUI, name);
|
TConfig usr_themes(CONFIG_GUI, name);
|
||||||
TAssoc_array& usr_colors = usr_themes.list_variables();
|
TAssoc_array& usr_colors = usr_themes.list_variables();
|
||||||
|
|
||||||
TAssoc_array& colors = usr_colors.empty() ? def_colors : usr_colors;
|
TAssoc_array& colors = usr_colors.empty() ? def_colors : usr_colors;
|
||||||
|
|
||||||
if (!colors.empty())
|
if (!colors.empty())
|
||||||
{
|
{
|
||||||
_color = colors;
|
_color = colors;
|
||||||
FOR_EACH_MASK_FIELD((*this), i, f)
|
FOR_EACH_MASK_FIELD((*this), i, f)
|
||||||
{
|
{
|
||||||
const TFieldref* fr = f->field();
|
const TFieldref* fr = f->field();
|
||||||
if (fr != NULL)
|
|
||||||
|
if (fr != nullptr)
|
||||||
{
|
{
|
||||||
const TString* val = (const TString*)_color.objptr(fr->name());
|
const TString* val = (const TString*)_color.objptr(fr->name());
|
||||||
if (val != NULL)
|
|
||||||
|
if (val != nullptr)
|
||||||
f->set(*val);
|
f->set(*val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -675,7 +674,7 @@ bool TColor_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
|||||||
xvt_font_deserialize(fontid, fd);
|
xvt_font_deserialize(fontid, fd);
|
||||||
else
|
else
|
||||||
xvt_font_copy(fontid, xvtil_default_font(), XVT_FA_ALL);
|
xvt_font_copy(fontid, xvtil_default_font(), XVT_FA_ALL);
|
||||||
if (xvt_dm_post_font_sel(win(), fontid, NULL, 0))
|
if (xvt_dm_post_font_sel(win(), fontid, nullptr, 0))
|
||||||
{
|
{
|
||||||
xvt_font_serialize(fontid, fd.get_buffer(), fd.size());
|
xvt_font_serialize(fontid, fd.get_buffer(), fd.size());
|
||||||
set_font_desc(fd);
|
set_font_desc(fd);
|
||||||
@ -725,8 +724,9 @@ void TColor_mask::options2mask()
|
|||||||
{
|
{
|
||||||
TProp_field& pf = options_field();
|
TProp_field& pf = options_field();
|
||||||
pf.freeze(true);
|
pf.freeze(true);
|
||||||
FOR_EACH_ASSOC_STRING(_color, obj, key, str) if (pf.has_property(key))
|
FOR_EACH_ASSOC_STRING(_color, obj, key, str)
|
||||||
pf.set_property(key, str);
|
if (pf.has_property(key))
|
||||||
|
pf.set_property(key, str);
|
||||||
pf.freeze(false);
|
pf.freeze(false);
|
||||||
|
|
||||||
set(216, _color.get_int("TreeView"));
|
set(216, _color.get_int("TreeView"));
|
||||||
@ -808,7 +808,8 @@ COLOR TColor_mask::get_color_entry(const char* name) const
|
|||||||
void TColor_mask::set_color_entry(const char* name, COLOR col)
|
void TColor_mask::set_color_entry(const char* name, COLOR col)
|
||||||
{
|
{
|
||||||
TString* s = (TString*)_color.objptr(name);
|
TString* s = (TString*)_color.objptr(name);
|
||||||
if (s == NULL)
|
|
||||||
|
if (s == nullptr)
|
||||||
{
|
{
|
||||||
s = new TString(15);
|
s = new TString(15);
|
||||||
_color.add(name, s);
|
_color.add(name, s);
|
||||||
@ -912,7 +913,8 @@ int TMenu_application::do_level()
|
|||||||
const int bwidth = 20;
|
const int bwidth = 20;
|
||||||
|
|
||||||
TPicture_mask mask(curr.caption(), 0, 0, curr, 0, 0);
|
TPicture_mask mask(curr.caption(), 0, 0, curr, 0, 0);
|
||||||
CHECK(_mask == NULL, "Two masks are better than one?");
|
|
||||||
|
CHECK(_mask == nullptr, "Two masks are better than one?");
|
||||||
_mask = &mask;
|
_mask = &mask;
|
||||||
|
|
||||||
const int ampiezza = 51;
|
const int ampiezza = 51;
|
||||||
@ -938,17 +940,17 @@ int TMenu_application::do_level()
|
|||||||
if (item.disabled())
|
if (item.disabled())
|
||||||
mask.disable(id);
|
mask.disable(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mask.add_static(DLG_NULL, 0, PR("Cerca"), x, -4);
|
mask.add_static(DLG_NULL, 0, PR("Cerca"), x, -4);
|
||||||
|
|
||||||
TEdit_field& ef = mask.add_string(DLG_USER, 0, "", x, -3, 50, "", ampiezza - 2);
|
TEdit_field& ef = mask.add_string(DLG_USER, 0, "", x, -3, 50, "", ampiezza - 2);
|
||||||
|
|
||||||
ef.set_handler(menu_find_handler);
|
ef.set_handler(menu_find_handler);
|
||||||
|
|
||||||
const int bottone = ampiezza / 3;
|
const int bottone = ampiezza / 3;
|
||||||
const int spazio = (ampiezza - bottone * 2) / 3;
|
const int spazio = (ampiezza - bottone * 2) / 3;
|
||||||
|
const bool top = _menu.at_top();
|
||||||
|
|
||||||
const bool top = _menu.at_top();
|
|
||||||
mask.add_button(DLG_QUIT, 0, PR("Fine"), x + spazio, -1, bottone, 2);
|
mask.add_button(DLG_QUIT, 0, PR("Fine"), x + spazio, -1, bottone, 2);
|
||||||
if (!top)
|
if (!top)
|
||||||
mask.add_button(DLG_CANCEL, 0, PR("Menu precedente"), x + spazio * 2 + bottone, -1, bottone, 2);
|
mask.add_button(DLG_CANCEL, 0, PR("Menu precedente"), x + spazio * 2 + bottone, -1, bottone, 2);
|
||||||
@ -976,10 +978,8 @@ int TMenu_application::do_level()
|
|||||||
m = _menu.selected() + 1; // Sempre > 0
|
m = _menu.selected() + 1; // Sempre > 0
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Azzero solo ora altrimenti il menu normale crede di non poter fare il cambio ditta
|
// Azzero solo ora altrimenti il menu normale crede di non poter fare il cambio ditta
|
||||||
_mask = NULL;
|
_mask = nullptr;
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -987,6 +987,7 @@ int TMenu_application::do_level()
|
|||||||
void TMenu_application::test_temp()
|
void TMenu_application::test_temp()
|
||||||
{
|
{
|
||||||
TFilename dir; dir.tempdir(); // Directory temporanea
|
TFilename dir; dir.tempdir(); // Directory temporanea
|
||||||
|
|
||||||
if (count_files(dir, true) > 20 && yesno_box(FR("Cancellare tutti i file temporanei in %s?"), (const char*)dir))
|
if (count_files(dir, true) > 20 && yesno_box(FR("Cancellare tutti i file temporanei in %s?"), (const char*)dir))
|
||||||
remove_files(dir, true);
|
remove_files(dir, true);
|
||||||
}
|
}
|
||||||
@ -1050,6 +1051,7 @@ bool TMenu_application::ask_user_password(TString& utente)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TMask m("ba0100a");
|
TMask m("ba0100a");
|
||||||
|
|
||||||
m.set_handler(user_mask_handler);
|
m.set_handler(user_mask_handler);
|
||||||
|
|
||||||
if (is_power_station())
|
if (is_power_station())
|
||||||
@ -1167,6 +1169,7 @@ int TMenu_application::get_user_status(const char* usr) const
|
|||||||
if (test_users_file())
|
if (test_users_file())
|
||||||
{
|
{
|
||||||
TLocalisamfile utonti(LF_USER);
|
TLocalisamfile utonti(LF_USER);
|
||||||
|
|
||||||
utonti.put(USR_USERNAME, usr);
|
utonti.put(USR_USERNAME, usr);
|
||||||
status = utonti.read() == NOERR;
|
status = utonti.read() == NOERR;
|
||||||
if (status)
|
if (status)
|
||||||
@ -1191,6 +1194,7 @@ bool TMenu_application::set_user_status(const char* usr, int status) const
|
|||||||
CHECK(usr && *usr, "Utente nullo");
|
CHECK(usr && *usr, "Utente nullo");
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
||||||
if (test_users_file())
|
if (test_users_file())
|
||||||
{
|
{
|
||||||
TLocalisamfile utonti(LF_USER);
|
TLocalisamfile utonti(LF_USER);
|
||||||
@ -1267,11 +1271,10 @@ bool TMenu_application::check_user()
|
|||||||
set_perms(); // Aggiorna permessi utente
|
set_perms(); // Aggiorna permessi utente
|
||||||
customize_colors(); // Aggiorna set di colori
|
customize_colors(); // Aggiorna set di colori
|
||||||
reload_images(); // Ritrasparentizza immagini e abilitazioni alberi
|
reload_images(); // Ritrasparentizza immagini e abilitazioni alberi
|
||||||
xvt_dwin_invalidate_rect(TASK_WIN, NULL); // Ridisegna sfondo
|
xvt_dwin_invalidate_rect(TASK_WIN, nullptr); // Ridisegna sfondo
|
||||||
load_preferences(); // Aggiorna menu preferiti
|
load_preferences(); // Aggiorna menu preferiti
|
||||||
test_temp(); // Cancella file temporanei
|
test_temp(); // Cancella file temporanei
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1364,8 +1367,9 @@ bool TMenu_application::test_programs()
|
|||||||
TProgind pi(3, TR("Controllo aggiornamento programmi"), false, true);
|
TProgind pi(3, TR("Controllo aggiornamento programmi"), false, true);
|
||||||
|
|
||||||
TConfig remote_install(remote_name, "Main");
|
TConfig remote_install(remote_name, "Main");
|
||||||
remote_install.write_protect();
|
|
||||||
|
|
||||||
|
remote_install.write_protect();
|
||||||
|
|
||||||
TAssoc_array my_modules, his_modules;
|
TAssoc_array my_modules, his_modules;
|
||||||
pi.addstatus(1);
|
pi.addstatus(1);
|
||||||
install.for_each_paragraph(get_module_version, &my_modules);
|
install.for_each_paragraph(get_module_version, &my_modules);
|
||||||
@ -1391,11 +1395,11 @@ bool TMenu_application::test_programs()
|
|||||||
//const TString4 code = dongle().module_code2name(module);
|
//const TString4 code = dongle().module_code2name(module);
|
||||||
TToken_string* mytok = (TToken_string*)my_modules.objptr(code);
|
TToken_string* mytok = (TToken_string*)my_modules.objptr(code);
|
||||||
TToken_string* histok = (TToken_string*)his_modules.objptr(code);
|
TToken_string* histok = (TToken_string*)his_modules.objptr(code);
|
||||||
|
|
||||||
const TString16 v1 = mytok ? mytok->get(0) : "";
|
const TString16 v1 = mytok ? mytok->get(0) : "";
|
||||||
const int p1 = mytok ? mytok->get_int() : 0;
|
const int p1 = mytok ? mytok->get_int() : 0;
|
||||||
const TString16 v2 = histok ? histok->get(0) : "";
|
const TString16 v2 = histok ? histok->get(0) : "";
|
||||||
const int p2 = histok ? histok->get_int() : 0;
|
const int p2 = histok ? histok->get_int() : 0;
|
||||||
|
|
||||||
if (!v1.blank() && compare_version(v1, p1, v2, p2) < 0)
|
if (!v1.blank() && compare_version(v1, p1, v2, p2) < 0)
|
||||||
{
|
{
|
||||||
// Non disabilitare mai il modulo base! Se non funzionasse qualcosa (vedi anno di assistenza)...
|
// Non disabilitare mai il modulo base! Se non funzionasse qualcosa (vedi anno di assistenza)...
|
||||||
@ -1455,7 +1459,7 @@ bool TMenu_application::test_programs()
|
|||||||
} //(if(update_needed>0...
|
} //(if(update_needed>0...
|
||||||
} //if(is_client..
|
} //if(is_client..
|
||||||
|
|
||||||
TString16 module;
|
TString module;
|
||||||
TDate expires;
|
TDate expires;
|
||||||
Tdninst dninst;
|
Tdninst dninst;
|
||||||
if (dninst.find_expiring(30, module, expires))
|
if (dninst.find_expiring(30, module, expires))
|
||||||
@ -1683,9 +1687,8 @@ bool TMenu_application::choose_colors()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Provoca chiusura forzata del menu
|
// Provoca chiusura forzata del menu
|
||||||
if (update_needed && _mask != NULL)
|
if (update_needed && _mask != nullptr)
|
||||||
_mask->stop_run(CTLR);
|
_mask->stop_run(CTLR);
|
||||||
|
|
||||||
enable_options_menu(true);
|
enable_options_menu(true);
|
||||||
return key == K_ENTER;
|
return key == K_ENTER;
|
||||||
}
|
}
|
||||||
@ -1836,11 +1839,13 @@ void TStudy_mask::list_studies(TString_array& sht, bool firms_count) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
str.add("*");
|
str.add("*");
|
||||||
|
|
||||||
SLIST dirs = xvt_fsys_list_files(DIR_TYPE, str, true);
|
SLIST dirs = xvt_fsys_list_files(DIR_TYPE, str, true);
|
||||||
|
|
||||||
for (SLIST_ELT e = xvt_slist_get_first(dirs); e; e = xvt_slist_get_next(dirs, e))
|
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);
|
const char* f = xvt_slist_get(dirs, e, nullptr);
|
||||||
|
|
||||||
if (is_valid_study(f))
|
if (is_valid_study(f))
|
||||||
{
|
{
|
||||||
if (firms_count)
|
if (firms_count)
|
||||||
@ -1848,6 +1853,7 @@ void TStudy_mask::list_studies(TString_array& sht, bool firms_count) const
|
|||||||
str = f; str.add("?????A");
|
str = f; str.add("?????A");
|
||||||
SLIST firms = xvt_fsys_list_files(DIR_TYPE, str, true);
|
SLIST firms = xvt_fsys_list_files(DIR_TYPE, str, true);
|
||||||
const int nf = xvt_slist_count(firms);
|
const int nf = xvt_slist_count(firms);
|
||||||
|
|
||||||
xvt_slist_destroy(firms);
|
xvt_slist_destroy(firms);
|
||||||
if (nf > 0)
|
if (nf > 0)
|
||||||
{
|
{
|
||||||
@ -1964,7 +1970,7 @@ long TMenu_application::handler(WINDOW win, EVENT* ep)
|
|||||||
{
|
{
|
||||||
long ret = TApplication::handler(win, ep);
|
long ret = TApplication::handler(win, ep);
|
||||||
|
|
||||||
if (_mask != NULL)
|
if (_mask != nullptr)
|
||||||
{
|
{
|
||||||
switch (ep->type)
|
switch (ep->type)
|
||||||
{
|
{
|
||||||
@ -2117,9 +2123,11 @@ void TMenu_application::update_preferred()
|
|||||||
void TMenu_application::update_preferred_tree()
|
void TMenu_application::update_preferred_tree()
|
||||||
{
|
{
|
||||||
TSubmenu* pref = _menu.find("MENU_PREFERITI");
|
TSubmenu* pref = _menu.find("MENU_PREFERITI");
|
||||||
if (pref != NULL)
|
|
||||||
|
if (pref != nullptr)
|
||||||
{
|
{
|
||||||
TToken_string node(16, '.');
|
TToken_string node(16, '.');
|
||||||
|
|
||||||
pref->destroy_items();
|
pref->destroy_items();
|
||||||
FOR_EACH_ARRAY_ROW(_preferred, i, row)
|
FOR_EACH_ARRAY_ROW(_preferred, i, row)
|
||||||
{
|
{
|
||||||
@ -2131,16 +2139,18 @@ void TMenu_application::update_preferred_tree()
|
|||||||
{
|
{
|
||||||
const char* sub = node.get(0);
|
const char* sub = node.get(0);
|
||||||
TSubmenu* sm = _menu.find(sub);
|
TSubmenu* sm = _menu.find(sub);
|
||||||
if (sm != NULL)
|
|
||||||
|
if (sm != nullptr)
|
||||||
{
|
{
|
||||||
const int num = node.get_int(1);
|
const int num = node.get_int(1);
|
||||||
|
|
||||||
if (num >= 0 && num < sm->items())
|
if (num >= 0 && num < sm->items())
|
||||||
pref->add(new TMenuitem(sm->item(num)));
|
pref->add(new TMenuitem(sm->item(num)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_tree_view >= 3 && _mask != NULL)
|
if (_tree_view >= 3 && _mask != nullptr)
|
||||||
{
|
{
|
||||||
FOR_EACH_MASK_FIELD(*_mask, i, f)
|
FOR_EACH_MASK_FIELD(*_mask, i, f)
|
||||||
{
|
{
|
||||||
@ -2158,11 +2168,12 @@ void TMenu_application::update_preferred_tree()
|
|||||||
void TMenu_application::load_preferences()
|
void TMenu_application::load_preferences()
|
||||||
{
|
{
|
||||||
TConfig cfg(CONFIG_GUI, "ba0");
|
TConfig cfg(CONFIG_GUI, "ba0");
|
||||||
|
|
||||||
_preferred.destroy();
|
_preferred.destroy();
|
||||||
TToken_string row;
|
TToken_string row;
|
||||||
for (int i = 0; ; i++)
|
for (int i = 0; ; i++)
|
||||||
{
|
{
|
||||||
row = cfg.get("Preferred", NULL, i);
|
row = cfg.get("Preferred", "", i);
|
||||||
if (row.empty_items())
|
if (row.empty_items())
|
||||||
break;
|
break;
|
||||||
_preferred.add(row);
|
_preferred.add(row);
|
||||||
@ -2170,25 +2181,29 @@ void TMenu_application::load_preferences()
|
|||||||
update_preferred();
|
update_preferred();
|
||||||
|
|
||||||
cfg.set_paragraph("Colors");
|
cfg.set_paragraph("Colors");
|
||||||
|
|
||||||
TMenuitem::always_run_fullscreen(cfg.get_bool("RunModal"));
|
TMenuitem::always_run_fullscreen(cfg.get_bool("RunModal"));
|
||||||
_tree_view = cfg.get_int("TreeView", NULL, -1, 3);
|
|
||||||
|
_tree_view = cfg.get_int("TreeView", nullptr, -1, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenu_application::save_preferences()
|
void TMenu_application::save_preferences()
|
||||||
{
|
{
|
||||||
TConfig cfg(CONFIG_GUI, "ba0");
|
TConfig cfg(CONFIG_GUI, "ba0");
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < _preferred.items(); i++)
|
for (i = 0; i < _preferred.items(); i++)
|
||||||
cfg.set("Preferred", _preferred.row(i), NULL, true, i);
|
cfg.set("Preferred", _preferred.row(i), nullptr, true, i);
|
||||||
cfg.set("Preferred", "", NULL, true, i);
|
cfg.set("Preferred", "", nullptr, true, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenu_application::add_to_preferred()
|
void TMenu_application::add_to_preferred()
|
||||||
{
|
{
|
||||||
if (_mask == NULL) // Succede durante il login!
|
if (_mask == nullptr) // Succede durante il login!
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int max_pref = 32; // Massimo numero di preferiti
|
const int max_pref = 32; // Massimo numero di preferiti
|
||||||
|
|
||||||
if (_preferred.items() < max_pref)
|
if (_preferred.items() < max_pref)
|
||||||
{
|
{
|
||||||
TToken_string tok;
|
TToken_string tok;
|
||||||
@ -2199,6 +2214,7 @@ void TMenu_application::add_to_preferred()
|
|||||||
{
|
{
|
||||||
const TMask_field& butt = _mask->focus_field();
|
const TMask_field& butt = _mask->focus_field();
|
||||||
const int index = butt.dlg() - 101;
|
const int index = butt.dlg() - 101;
|
||||||
|
|
||||||
if (index >= 0 && index < max_pref)
|
if (index >= 0 && index < max_pref)
|
||||||
{
|
{
|
||||||
_menu.select(index);
|
_menu.select(index);
|
||||||
@ -2328,14 +2344,33 @@ void TMenu_application::manage_preferred()
|
|||||||
void TMenu_application::manage_mail()
|
void TMenu_application::manage_mail()
|
||||||
{
|
{
|
||||||
TMask m("ba0100m");
|
TMask m("ba0100m");
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
m.set_handler(106, check_from_field_mail);
|
m.set_handler(106, check_from_field_mail);
|
||||||
TConfig cfg(CONFIG_USER, "Mail");
|
TConfig cfg(CONFIG_USER, "Mail");
|
||||||
FOR_EACH_MASK_FIELD(m, i, f) if (f->field())
|
FOR_EACH_MASK_FIELD(m, i, f) if (f->field())
|
||||||
f->set(f->field()->read(cfg, "Mail"));
|
f->set(f->field()->read(cfg, "Mail"));
|
||||||
if (m.run() == K_ENTER)
|
while (m.run() == K_ENTER)
|
||||||
{
|
{
|
||||||
FOR_EACH_MASK_FIELD(m, i, f) if (f->field())
|
const TString & order2 = m.get(F_EMAIL2);
|
||||||
f->field()->write(cfg, "Mail", f->get());
|
|
||||||
|
ok = true;
|
||||||
|
if (order2.full() && (order2 == m.get(F_EMAIL1) || order2 == m.get(F_EMAIL3)))
|
||||||
|
ok = error_box("L'email 2 è già stata specificata");
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
const TString & order3 = m.get(F_EMAIL3);
|
||||||
|
|
||||||
|
if (order3.full() && (order3 == m.get(F_EMAIL1) || order3 == m.get(F_EMAIL2)))
|
||||||
|
ok = error_box("L'email 3 è già stata specificata");
|
||||||
|
}
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
FOR_EACH_MASK_FIELD(m, i, f) if (f->field())
|
||||||
|
f->field()->write(cfg, "Mail", f->get());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2346,7 +2381,7 @@ int TMenu_application::do_tree()
|
|||||||
_menu.jumpto_root();
|
_menu.jumpto_root();
|
||||||
const TSubmenu& curr = _menu.current();
|
const TSubmenu& curr = _menu.current();
|
||||||
TPicture_mask mask(curr.caption(), 0, 0, curr, 0, 0);
|
TPicture_mask mask(curr.caption(), 0, 0, curr, 0, 0);
|
||||||
CHECK(_mask == NULL, "Two masks are better than one?");
|
CHECK(_mask == nullptr, "Two masks are better than one?");
|
||||||
_mask = &mask;
|
_mask = &mask;
|
||||||
|
|
||||||
const int margin = (mask.columns()-80) / 2;
|
const int margin = (mask.columns()-80) / 2;
|
||||||
@ -2375,7 +2410,7 @@ int TMenu_application::do_tree()
|
|||||||
|
|
||||||
mask.first_focus(DLG_TREE);
|
mask.first_focus(DLG_TREE);
|
||||||
KEY key = mask.run();
|
KEY key = mask.run();
|
||||||
_mask = NULL;
|
_mask = nullptr;
|
||||||
|
|
||||||
return key == K_QUIT ? -2 : 0;
|
return key == K_QUIT ? -2 : 0;
|
||||||
}
|
}
|
||||||
@ -2383,46 +2418,50 @@ int TMenu_application::do_tree()
|
|||||||
|
|
||||||
int TMenu_application::do_explore()
|
int TMenu_application::do_explore()
|
||||||
{
|
{
|
||||||
CHECK(_mask == NULL, "Two masks are better than one?");
|
CHECK(_mask == nullptr, "Two masks are better than one?");
|
||||||
_menu.jumpto_root();
|
_menu.jumpto_root();
|
||||||
|
|
||||||
TExplorer_mask mask(_menu);
|
TExplorer_mask mask(_menu);
|
||||||
|
|
||||||
_mask = &mask;
|
_mask = &mask;
|
||||||
|
|
||||||
KEY key = mask.run();
|
KEY key = mask.run();
|
||||||
_mask = NULL;
|
|
||||||
|
|
||||||
|
_mask = nullptr;
|
||||||
return key == K_QUIT ? -2 : 0;
|
return key == K_QUIT ? -2 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TMenu_application::do_outlook()
|
int TMenu_application::do_outlook()
|
||||||
{
|
{
|
||||||
CHECK(_mask == NULL, "Two masks are better than one?");
|
CHECK(_mask == nullptr, "Two masks are better than one?");
|
||||||
|
|
||||||
TOutlook_mask mask(_menu);
|
TOutlook_mask mask(_menu);
|
||||||
|
|
||||||
_mask = &mask;
|
_mask = &mask;
|
||||||
|
|
||||||
KEY key = mask.run();
|
KEY key = mask.run();
|
||||||
|
|
||||||
_mask = NULL;
|
_mask = nullptr;
|
||||||
|
|
||||||
return key == K_QUIT ? -2 : 0;
|
return key == K_QUIT ? -2 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TMenu_application::do_metro()
|
int TMenu_application::do_metro()
|
||||||
{
|
{
|
||||||
CHECK(_mask == NULL, "Two masks are better than one?");
|
CHECK(_mask == nullptr, "Two masks are better than one?");
|
||||||
|
|
||||||
TMetro_mask mask(_menu);
|
TMetro_mask mask(_menu);
|
||||||
|
|
||||||
_mask = &mask;
|
_mask = &mask;
|
||||||
|
|
||||||
KEY key = mask.run();
|
KEY key = mask.run();
|
||||||
|
|
||||||
_mask = NULL;
|
_mask = nullptr;
|
||||||
|
|
||||||
return key == K_QUIT ? -2 : 0;
|
return key == K_QUIT ? -2 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMenu_application::firm_change_enabled() const
|
bool TMenu_application::firm_change_enabled() const
|
||||||
{
|
{
|
||||||
bool yes = _mask != NULL || _tree_view == 0; // Impedisci il cambio ditta durante il login
|
bool yes = _mask != nullptr || _tree_view == 0; // Impedisci il cambio ditta durante il login
|
||||||
if (yes)
|
if (yes)
|
||||||
yes &= _options_menu_enabled;
|
yes &= _options_menu_enabled;
|
||||||
return yes;
|
return yes;
|
||||||
@ -2456,6 +2495,7 @@ bool TMenu_application::menu(MENU_TAG mt)
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
const int index = mt - MENU_ITEM_ID(50);
|
const int index = mt - MENU_ITEM_ID(50);
|
||||||
TToken_string node(_preferred.row(index).get(1), '/');
|
TToken_string node(_preferred.row(index).get(1), '/');
|
||||||
|
|
||||||
if (_tree_view != 0)
|
if (_tree_view != 0)
|
||||||
{
|
{
|
||||||
TMenu_tree& met = *(TMenu_tree*)tree_field().tree();
|
TMenu_tree& met = *(TMenu_tree*)tree_field().tree();
|
||||||
@ -2488,7 +2528,7 @@ bool TMenu_application::menu(MENU_TAG mt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TMenu_application::TMenu_application(const char* name)
|
TMenu_application::TMenu_application(const char* name)
|
||||||
: _menuname(name), _mask(NULL), _tree_view(3)
|
: _menuname(name), _mask(nullptr), _tree_view(3)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
int ba0100(int argc, char** argv)
|
int ba0100(int argc, char** argv)
|
||||||
|
@ -6,4 +6,7 @@
|
|||||||
#define F_FROM 106
|
#define F_FROM 106
|
||||||
#define F_RETRY 107
|
#define F_RETRY 107
|
||||||
#define F_FIRM 108
|
#define F_FIRM 108
|
||||||
#define F_CCN 109
|
#define F_CCN 109
|
||||||
|
#define F_EMAIL1 110
|
||||||
|
#define F_EMAIL2 111
|
||||||
|
#define F_EMAIL3 112
|
@ -1,6 +1,6 @@
|
|||||||
#include "ba0100m.h"
|
#include "ba0100m.h"
|
||||||
|
|
||||||
PAGE "Configurazione E-Mail utente" -1 -1 63 14
|
PAGE "Configurazione E-Mail utente" -1 -1 63 19
|
||||||
|
|
||||||
STRING F_SERVER 260 50
|
STRING F_SERVER 260 50
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -60,7 +60,7 @@ END
|
|||||||
|
|
||||||
LIST F_RETRY 1
|
LIST F_RETRY 1
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 21 9 "Tentativi di trasmissione "
|
PROMPT 1 9 "Tentativi di trasmissione "
|
||||||
ITEM "1|1"
|
ITEM "1|1"
|
||||||
ITEM "2|2"
|
ITEM "2|2"
|
||||||
ITEM "3|3"
|
ITEM "3|3"
|
||||||
@ -69,9 +69,43 @@ BEGIN
|
|||||||
FIELD Retry
|
FIELD Retry
|
||||||
END
|
END
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 25 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 10 10 "Ordine email"
|
||||||
|
END
|
||||||
|
|
||||||
|
LISTBOX F_EMAIL1 1 9
|
||||||
|
BEGIN
|
||||||
|
PROMPT 11 11 "1a email "
|
||||||
|
ITEM "D|Documenti"
|
||||||
|
ITEM "P|PEC"
|
||||||
|
ITEM "N|Normale"
|
||||||
|
FIELD Email(1)
|
||||||
|
END
|
||||||
|
|
||||||
|
LISTBOX F_EMAIL2 1 9
|
||||||
|
BEGIN
|
||||||
|
PROMPT 11 12 "2a email "
|
||||||
|
ITEM "|Nessuna"
|
||||||
|
ITEM "D|Documenti"
|
||||||
|
ITEM "P|PEC"
|
||||||
|
ITEM "N|Normale"
|
||||||
|
FIELD Email(2)
|
||||||
|
END
|
||||||
|
|
||||||
|
LISTBOX F_EMAIL3 1 9
|
||||||
|
BEGIN
|
||||||
|
PROMPT 11 13 "3a email "
|
||||||
|
ITEM "|Nessuna"
|
||||||
|
ITEM "D|Documenti"
|
||||||
|
ITEM "P|PEC"
|
||||||
|
ITEM "N|Normale"
|
||||||
|
FIELD Email(3)
|
||||||
|
END
|
||||||
|
|
||||||
MEMO F_FIRM 60 4
|
MEMO F_FIRM 60 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 10 "Saluti / Firma"
|
PROMPT 1 15 "Saluti / Firma"
|
||||||
FIELD Signature
|
FIELD Signature
|
||||||
END
|
END
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user