From 365bf905cf2e7f3c62c95e7426394bc025e893d2 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 26 Jan 2011 09:22:41 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : ba0.exe ba1.exe Ricompilazione Demo : [ ] Commento : ba0.exe Vietato aggiungere ai preveriti voci di primo livello del menu ba1.exe Consente anche di aggiornare e non solo inserire da file .txt git-svn-id: svn://10.65.10.50/branches/R_10_00@21513 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba0100.cpp | 12 ++++++++---- ba/ba0101.cpp | 25 ++++++++++--------------- ba/ba0103.cpp | 5 ++++- ba/ba1100.cpp | 6 +++++- ba/ba1100a.h | 1 + ba/ba1100c.uml | 13 ++++++++++--- ba/ba1800.cpp | 5 +---- ba/ba7100.cpp | 9 +++++++-- 8 files changed, 46 insertions(+), 30 deletions(-) diff --git a/ba/ba0100.cpp b/ba/ba0100.cpp index 6073073b8..120e3625f 100755 --- a/ba/ba0100.cpp +++ b/ba/ba0100.cpp @@ -2026,7 +2026,6 @@ void TMenu_application::load_preferences() TMenuitem::always_run_fullscreen(cfg.get_bool("AlwaysFullScreen")); _tree_view = cfg.get_int("TreeView", "Colors", -1, 3); - } void TMenu_application::save_preferences() @@ -2073,9 +2072,14 @@ void TMenu_application::add_to_preferred() { TTree_field& tf = tree_field(); tf.goto_selected(); - tf.tree()->get_description(tok); - TString id; tf.tree()->curr_id(id); - tok.add(id); + if (tf.tree()->has_father()) // Aggiunge solo nodi NON radice + { + tf.tree()->get_description(tok); + TString id; tf.tree()->curr_id(id); + tok.add(id); + } + else + error_box(TR("Non è possibile aggiungere voci di primo livello")); } break; } diff --git a/ba/ba0101.cpp b/ba/ba0101.cpp index e46af958c..2ccaaaf7a 100755 --- a/ba/ba0101.cpp +++ b/ba/ba0101.cpp @@ -485,25 +485,20 @@ bool TSubmenu::enabled() const if (_enabled < 0) { bool yes = _exist != 0; - if (yes) + if (yes && _modules.full() && _modules != "0" && _modules != "ba") { - if (_modules.full() && _modules != "0" && _modules != "ba") + yes = false; + bool is_good = false; + TToken_string& mod = (TToken_string&)_modules; + FOR_EACH_TOKEN(mod, cod) { - yes = false; - TToken_string& mod = (TToken_string&)_modules; - FOR_EACH_TOKEN(mod, cod) - { - if (_menu->has_module(cod)) - { - yes = true; - break; - } - } + is_good = _menu->has_module(cod); + if (is_good) + break; } - if (yes) + if (is_good) { - yes = false; - for (int i = items()-1; i >= 0 && !yes; i--) + for (int i = items()-1; i >= 0 && !yes; i--) { const TMenuitem& mi = item(i); yes = mi.enabled(); diff --git a/ba/ba0103.cpp b/ba/ba0103.cpp index 044bd0319..1565ce637 100755 --- a/ba/ba0103.cpp +++ b/ba/ba0103.cpp @@ -741,6 +741,8 @@ bool TOutlook_mask::on_field_event(TOperable_field& o, TField_event e, long joll } } } + if (e == fe_modify) // Permette l'aggiunta ai preferiti per i non NON radice + main_app().enable_menu_item(30005, _tree.has_father()); break; case DLG_LOOK: if (e == fe_modify) @@ -771,7 +773,8 @@ bool TOutlook_mask::on_field_event(TOperable_field& o, TField_event e, long joll } if (_picture.objptr(sel)) book_field().set_back(_picture.row(sel)); - main_app().enable_menu_item(30005, id.find("MENU_PREFERITI") < 0); + // Vieta l'aggiunta della radice ai preferiti + main_app().enable_menu_item(30005, false); } else if (e == fe_init) { diff --git a/ba/ba1100.cpp b/ba/ba1100.cpp index d3ea6917c..22f903b12 100755 --- a/ba/ba1100.cpp +++ b/ba/ba1100.cpp @@ -753,8 +753,12 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga) const char fd = *esc(m.get(FLD_FD)); const char rs = *esc(m.get(FLD_RS)); const bool indexed = !m.get_bool(FLD_WITHKEY); + const bool over = m.get_bool(FLD_UPDATE); ninp = m.get(FLD_INFILE); - f.load(ninp, fs, fd, rs, true, false, indexed); + if (over) + f.overwrite(ninp, fs, fd, rs, true); + else + f.load(ninp, fs, fd, rs, true, false, indexed); } } } diff --git a/ba/ba1100a.h b/ba/ba1100a.h index 6d9e1f711..a9a9dc865 100755 --- a/ba/ba1100a.h +++ b/ba/ba1100a.h @@ -28,6 +28,7 @@ #define FLD_WITHDEL 208 #define FLD_INFILE 301 +#define FLD_UPDATE 302 #define F_NOMEF 101 #define FLD_TIPO 102 diff --git a/ba/ba1100c.uml b/ba/ba1100c.uml index af103430c..a1cd2ce65 100755 --- a/ba/ba1100c.uml +++ b/ba/ba1100c.uml @@ -1,7 +1,7 @@ #include #include "ba1100a.h" -PAGE "Carico Archivio" -1 -1 70 13 +PAGE "Caricamento Archivio" -1 -1 70 13 STRING FLD_INFILE 50 BEGIN @@ -11,7 +11,7 @@ END BOOLEAN FLD_FIXLEN BEGIN - PROMPT 2 3 "Lunghezza fissa" + PROMPT 2 2 "Lunghezza fissa" HELP "Indicare se i record hanno lunghezza fissa" MESSAGE FALSE ENABLE,FLD_FS|ENABLE,FLD_FD|ENABLE,FLD_RS|"\0x7c",FLD_FS|"\0",FLD_FD|"\n",FLD_RS MESSAGE TRUE DISABLE,FLD_FS|DISABLE,FLD_FD|DISABLE,FLD_RS|"\0",FLD_FS|"\0",FLD_FD|"\n",FLD_RS @@ -19,7 +19,7 @@ END BOOLEAN FLD_WITHKEY BEGIN - PROMPT 24 3 "Indicizza solo alla fine del processo (Usare SOLO su file vuoti)" + PROMPT 2 3 "Indicizza solo alla fine del processo (Usare SOLO su file vuoti)" END STRING FLD_FS 5 @@ -43,6 +43,13 @@ BEGIN FLAGS "P" END +RADIOBUTTON FLD_UPDATE 1 36 +BEGIN + PROMPT 32 4 "@bOpzioni di aggiornamento" + ITEM " |Inserire solo nuovi record" + ITEM "X|Inserire o aggiornare record" +END + ENDPAGE TOOLBAR "topbar" 0 0 0 2 diff --git a/ba/ba1800.cpp b/ba/ba1800.cpp index 2e8d2fac4..5efdc1445 100755 --- a/ba/ba1800.cpp +++ b/ba/ba1800.cpp @@ -512,10 +512,7 @@ bool TWizard_mask::file_open(TFilename& fname) const xvt_fsys_get_dir(&dir); // Save dir FILE_SPEC fs; - fs.dir = dir; - strcpy(fs.type, fname.ext()); - strcpy(fs.name, fname); - strcpy(fs.creator, "WIZ"); + xvt_fsys_convert_str_to_fspec(fname, &fs); const bool good = xvt_dm_post_file_open(&fs, TR("Selezionare il file ...")) == FL_OK; xvt_fsys_set_dir(&dir); // Restore dir diff --git a/ba/ba7100.cpp b/ba/ba7100.cpp index 2b1c9b228..99641beb5 100755 --- a/ba/ba7100.cpp +++ b/ba/ba7100.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -787,9 +788,8 @@ bool TMailer_mask::file2app(const TString& file, TString& app) const const TString* run = (const TString*)_apps.objptr(file); if (run == NULL) { - TConfig d(CONFIG_DITTA, "ba7"); TString16 appname; appname << "Edit_" << file; - app = d.get(appname); + app = ini_get_string(CONFIG_DITTA, "ba7", appname); if (app.empty()) { if (isdigit(file[0])) @@ -808,6 +808,11 @@ bool TMailer_mask::file2app(const TString& file, TString& app) const { TTable table(file); ok = table.get_relapp(app); + } else + if (len >= 4 && file[0] == '&') + { + TModule_table tabmod(file); + ok = tabmod.get_relapp(app); } } }