From 5fcd4cbb75b41ac0b0742c78425658f5581e6bcc Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 4 Jan 2010 14:01:36 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2010.?= =?UTF-8?q?0=20Files=20correlati=20=20=20=20=20:=20ba0=20ba0400a.msk=20Ric?= =?UTF-8?q?ompilazione=20Demo=20:=20[=20]=20Commento=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20:=200001514:=20001865=20-=20Presscolor=20-=20lim?= =?UTF-8?q?ite=20preferiti=20Descrizione=20=20si=20richiede=20di=20aumenta?= =?UTF-8?q?re=20il=20numero=20dei=20programmi=20da=20inserire=20nei=20pref?= =?UTF-8?q?eriti.=20Al=20momento=20il=20limite=20=C3=A8=2016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/trunk@19865 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba0100.cpp | 27 ++++++++++++++------------ ba/ba0102.cpp | 4 ++-- ba/ba0103.cpp | 4 ---- ba/ba0400a.uml | 6 +++--- ba/ba1700.cpp | 51 ++++++++++++-------------------------------------- 5 files changed, 32 insertions(+), 60 deletions(-) diff --git a/ba/ba0100.cpp b/ba/ba0100.cpp index 8e5b2b05d..5afd8194c 100755 --- a/ba/ba0100.cpp +++ b/ba/ba0100.cpp @@ -3,8 +3,6 @@ #include #include #include -#include -#include #include #include #include @@ -64,7 +62,7 @@ protected: void test_temp(); int do_level(); - int do_tree(); + // int do_tree(); // Deprecated int do_explore(); int do_outlook(); @@ -865,12 +863,12 @@ int TMenu_application::do_level() const int ampiezza = 51; const int margin = (mask.columns()-80) / 2; - const int x = mask.columns() - ampiezza -margin; + const int x = mask.columns() - ampiezza - margin; int y = 1; TString caption; - for (int i = 0; i < curr.items(); i++, y++) + for (int i = 0; i < curr.items() && i < 16; i++, y++) { const TMenuitem& item = curr[i]; caption = item.caption(); @@ -879,7 +877,9 @@ int TMenu_application::do_level() mask.add_static(-1, 0, caption, x+4, y); const short id = 100+y; - mask.add_button(id, 0, "", x, y, 1, 1, "", BMP_STOPREC); + const int bmp = item.is_submenu() ? BMP_DIRDN: BMP_STOPREC; + mask.add_button(id, 0, "", x, y, 1, 1, "", bmp); + mask.set_handler(id, menu_item_handler); if (item.disabled()) mask.disable(id); @@ -1476,7 +1476,7 @@ void TMenu_application::main_loop() int m = 0; switch (_tree_view) { - case 1: m = do_tree(); break; + // case 1: m = do_tree(); break; case 2: m = do_explore(); break; case 3: m = do_outlook(); break; default: m = do_level(); break; @@ -1841,8 +1841,9 @@ void TMenu_application::update_preferred() return; } + const int prefs = min(_preferred.items(), 24); int i; - MENU_ITEM* pm = (MENU_ITEM*)xvt_mem_zalloc((_preferred.items()+4)*sizeof(MENU_ITEM)); + MENU_ITEM* pm = (MENU_ITEM*)xvt_mem_zalloc((prefs+4)*sizeof(MENU_ITEM)); memcpy(pm, mi->child, 3*sizeof(MENU_ITEM)); for (i = 0; i < 2; i++) { @@ -1852,7 +1853,7 @@ void TMenu_application::update_preferred() xvt_res_free_menu_tree(mi->child); mi->child = pm; - for (i = -1; i < _preferred.items(); i++) + for (i = -1; i < prefs; i++) { MENU_ITEM& m = pm[i+3]; if (i >= 0) @@ -1943,7 +1944,8 @@ void TMenu_application::add_to_preferred() if (_mask == NULL) // Succede durante il login! return; - if (_preferred.items() < 16) // Massimo numero di preferiti + const int max_pref = 32; // Massimo numero di preferiti + if (_preferred.items() < max_pref) { TToken_string tok; @@ -1953,7 +1955,7 @@ void TMenu_application::add_to_preferred() { const TMask_field& butt = _mask->focus_field(); const int index = butt.dlg() - 101; - if (index >= 0 && index < 16) + if (index >= 0 && index < max_pref) { _menu.select(index); tok = _menu.curr_item().caption(); @@ -2063,7 +2065,6 @@ void TMenu_application::manage_preferred() TSheet_field& sf = m->sfield(F_PREF_SHEET); sf.rows_array() = _preferred; - sf.force_update(); if (m->run() == K_ENTER) @@ -2075,6 +2076,7 @@ void TMenu_application::manage_preferred() delete m; } +/* Deprecated int TMenu_application::do_tree() { _menu.jumpto_root(); @@ -2113,6 +2115,7 @@ int TMenu_application::do_tree() return key == K_QUIT ? -2 : 0; } +*/ int TMenu_application::do_explore() { diff --git a/ba/ba0102.cpp b/ba/ba0102.cpp index 35b228516..cb70e240d 100755 --- a/ba/ba0102.cpp +++ b/ba/ba0102.cpp @@ -2,10 +2,10 @@ #include #include #include -#include #include #include #include +#include #include "ba0102.h" @@ -582,7 +582,7 @@ void TMenulist_window::draw_menu_caption() caption = mi.caption(); } xvt_pane_set_title(win(), caption); - statbar_set_title(TASK_WIN, caption); + xvtil_statbar_set(caption); } void TMenulist_window::update() diff --git a/ba/ba0103.cpp b/ba/ba0103.cpp index 3f0425d50..07e0dcbfd 100755 --- a/ba/ba0103.cpp +++ b/ba/ba0103.cpp @@ -4,13 +4,9 @@ #include #include #include -#include #include #include -#include #include -#include -#include enum { DLG_TREE = 101, DLG_LOOK = 102, DLG_MAIN = 103 }; diff --git a/ba/ba0400a.uml b/ba/ba0400a.uml index d6871373e..d400e256b 100755 --- a/ba/ba0400a.uml +++ b/ba/ba0400a.uml @@ -1,8 +1,8 @@ #include "ba0400a.h" -PAGE "Preferiti" -1 -1 70 16 +PAGE "Preferiti" -1 -1 78 16 -SPREADSHEET F_PREF_SHEET 63 -3 +SPREADSHEET F_PREF_SHEET 70 BEGIN PROMPT 1 1 "" ITEM "Descrizione@50" @@ -23,7 +23,7 @@ END ENDPAGE -TOOLBAR "bottombar" 0 0 0 2 +TOOLBAR "topbar" 0 0 0 2 BUTTON DLG_OK 10 2 BEGIN diff --git a/ba/ba1700.cpp b/ba/ba1700.cpp index 14148c037..9444c4f79 100755 --- a/ba/ba1700.cpp +++ b/ba/ba1700.cpp @@ -1504,7 +1504,7 @@ void TInstaller_mask::install_selection() const int oldpatch = row->get_int(C_CURRPATCH); pi.set_text(format(FR("Installazione modulo '%s'"), (const char*)modesc)); - if (version2year(newver) < 2008) + if (version2year(newver) < 2009) { error_box(FR("Il modulo '%s' non ha una versione valida."), (const char*)modesc); continue; @@ -1732,32 +1732,14 @@ bool TInstaller_mask::on_key(KEY key) //metodo per controllare se la directory indicata contiene una installazione buona di campo bool TInstaller_mask::is_program_dir(const TFilename& path) { - bool ok = false; - TFilename work_path = path; - //controlla l'esistenza di alcuni files chiave di campo - work_path.add("install.ini"); - if (work_path.exist()) + const char* const essential[] = {"install.ini", "campo.ini", "campo.aut", "ba0.exe", "xvaga.dll", NULL }; + bool ok = true; + for (int i = 0; ok && essential[i]; i++) { - work_path = path; - work_path.add("campo.ini"); - if (work_path.exist()) - { - work_path = path; - work_path.add("campo.aut"); - if (work_path.exist()) - { - work_path = path; - work_path.add("ba0.exe"); - if (work_path.exist()) - { - work_path = path; - work_path.add("xvaga.dll"); - if (work_path.exist()) - ok = true; //minchia che diffidente! - } - } - } + TFilename work_path = path; + work_path.add(essential[i]); + ok = work_path.exist(); } return ok; } @@ -1782,9 +1764,9 @@ TInstaller_mask::TInstaller_mask() //in base al tipo di installazione che rileva decide se puo' effettuare aggiornamenti via web (un client.. //..non puo' fare aggiornamenti da web!!!) TToken_string installada; - installada.add(TR("Installa da disco")); - installada.add(TR("Installa da web ")); - TRadio_field& rf = add_radio(F_TYPE, 0, "", 1, 0, 21, "0|1", installada); + installada.add(PR("Installa da disco")); + installada.add(PR("Installa da web ")); + TRadio_field& rf = add_radio(F_TYPE, 0, "", 0, 0, 23, "0|1", installada); *rf.message(0, true) = "DISABLE,207|ENABLE,201"; *rf.message(1, true) = "DISABLE,201|ENABLE,207"; add_string(F_PATH, 0, "", 23, 1, 256, "B", 56).set_selector('D', EMPTY_STRING); @@ -1796,7 +1778,7 @@ TInstaller_mask::TInstaller_mask() TFilename path = ini.get("DiskPath"); TFilename webpath = ini.get("WebPath"); - //un client non puo' scegliere a caso da dove aggiornarsi!Solo dal suo server! + //un client non puo' scegliere a caso da dove aggiornarsi! Solo dal suo server! if (_station_type == 3) { rf.disable(); @@ -1814,19 +1796,10 @@ TInstaller_mask::TInstaller_mask() set_handler(F_UPDATE, update_handler); set_handler(DLG_USER, tutti_handler); - //se il webpath è vuoto o di test, propone quello in oem.ini; non ammette che possa essere proposto un path.. //..di tipo test per impedire all'utonto di aggiornarsi da test prima di essere passato da release if (webpath.empty() || webpath.find("test")) - { - TConfig oemini(CONFIG_OEM, "MAIN"); - const int oem = oemini.get_int("OEM", NULL, -1, -1); - if (oem >= 0) - { - TString8 para; para << "OEM_" << oem; - webpath = oemini.get("Web", para); - } - } + webpath = http_default_path(); set(F_PATH, path); set(F_WEB, webpath);