Patch level : 10.0

Files correlati     : ba0 ba0400a.msk
Ricompilazione Demo : [ ]
Commento            :
0001514: 001865 - Presscolor - limite preferiti
Descrizione  si richiede di aumentare il numero dei programmi da inserire nei preferiti. Al momento il limite è 16


git-svn-id: svn://10.65.10.50/trunk@19865 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-01-04 14:01:36 +00:00
parent ee3b683a83
commit 5fcd4cbb75
5 changed files with 32 additions and 60 deletions

View File

@ -3,8 +3,6 @@
#include <controls.h> #include <controls.h>
#include <dongle.h> #include <dongle.h>
#include <execp.h> #include <execp.h>
#include <modaut.h>
#include <execp.h>
#include <recarray.h> #include <recarray.h>
#include <relation.h> #include <relation.h>
#include <progind.h> #include <progind.h>
@ -64,7 +62,7 @@ protected:
void test_temp(); void test_temp();
int do_level(); int do_level();
int do_tree(); // int do_tree(); // Deprecated
int do_explore(); int do_explore();
int do_outlook(); int do_outlook();
@ -865,12 +863,12 @@ int TMenu_application::do_level()
const int ampiezza = 51; const int ampiezza = 51;
const int margin = (mask.columns()-80) / 2; const int margin = (mask.columns()-80) / 2;
const int x = mask.columns() - ampiezza -margin; const int x = mask.columns() - ampiezza - margin;
int y = 1; int y = 1;
TString caption; 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]; const TMenuitem& item = curr[i];
caption = item.caption(); caption = item.caption();
@ -879,7 +877,9 @@ int TMenu_application::do_level()
mask.add_static(-1, 0, caption, x+4, y); mask.add_static(-1, 0, caption, x+4, y);
const short id = 100+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); mask.set_handler(id, menu_item_handler);
if (item.disabled()) if (item.disabled())
mask.disable(id); mask.disable(id);
@ -1476,7 +1476,7 @@ void TMenu_application::main_loop()
int m = 0; int m = 0;
switch (_tree_view) switch (_tree_view)
{ {
case 1: m = do_tree(); break; // case 1: m = do_tree(); break;
case 2: m = do_explore(); break; case 2: m = do_explore(); break;
case 3: m = do_outlook(); break; case 3: m = do_outlook(); break;
default: m = do_level(); break; default: m = do_level(); break;
@ -1841,8 +1841,9 @@ void TMenu_application::update_preferred()
return; return;
} }
const int prefs = min(_preferred.items(), 24);
int i; 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)); memcpy(pm, mi->child, 3*sizeof(MENU_ITEM));
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
@ -1852,7 +1853,7 @@ void TMenu_application::update_preferred()
xvt_res_free_menu_tree(mi->child); xvt_res_free_menu_tree(mi->child);
mi->child = pm; mi->child = pm;
for (i = -1; i < _preferred.items(); i++) for (i = -1; i < prefs; i++)
{ {
MENU_ITEM& m = pm[i+3]; MENU_ITEM& m = pm[i+3];
if (i >= 0) if (i >= 0)
@ -1943,7 +1944,8 @@ void TMenu_application::add_to_preferred()
if (_mask == NULL) // Succede durante il login! if (_mask == NULL) // Succede durante il login!
return; 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; TToken_string tok;
@ -1953,7 +1955,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 < 16) if (index >= 0 && index < max_pref)
{ {
_menu.select(index); _menu.select(index);
tok = _menu.curr_item().caption(); tok = _menu.curr_item().caption();
@ -2063,7 +2065,6 @@ void TMenu_application::manage_preferred()
TSheet_field& sf = m->sfield(F_PREF_SHEET); TSheet_field& sf = m->sfield(F_PREF_SHEET);
sf.rows_array() = _preferred; sf.rows_array() = _preferred;
sf.force_update(); sf.force_update();
if (m->run() == K_ENTER) if (m->run() == K_ENTER)
@ -2075,6 +2076,7 @@ void TMenu_application::manage_preferred()
delete m; delete m;
} }
/* Deprecated
int TMenu_application::do_tree() int TMenu_application::do_tree()
{ {
_menu.jumpto_root(); _menu.jumpto_root();
@ -2113,6 +2115,7 @@ int TMenu_application::do_tree()
return key == K_QUIT ? -2 : 0; return key == K_QUIT ? -2 : 0;
} }
*/
int TMenu_application::do_explore() int TMenu_application::do_explore()
{ {

View File

@ -2,10 +2,10 @@
#include <controls.h> #include <controls.h>
#include <diction.h> #include <diction.h>
#include <prefix.h> #include <prefix.h>
#include <statbar.h>
#include <toolfld.h> #include <toolfld.h>
#include <urldefid.h> #include <urldefid.h>
#include <utility.h> #include <utility.h>
#include <xvtility.h>
#include "ba0102.h" #include "ba0102.h"
@ -582,7 +582,7 @@ void TMenulist_window::draw_menu_caption()
caption = mi.caption(); caption = mi.caption();
} }
xvt_pane_set_title(win(), caption); xvt_pane_set_title(win(), caption);
statbar_set_title(TASK_WIN, caption); xvtil_statbar_set(caption);
} }
void TMenulist_window::update() void TMenulist_window::update()

View File

@ -4,13 +4,9 @@
#include <config.h> #include <config.h>
#include <controls.h> #include <controls.h>
#include <defmask.h> #include <defmask.h>
#include <diction.h>
#include <dongle.h> #include <dongle.h>
#include <execp.h> #include <execp.h>
#include <prefix.h>
#include <utility.h> #include <utility.h>
#include <xvtility.h>
#include <colors.h>
enum { DLG_TREE = 101, DLG_LOOK = 102, DLG_MAIN = 103 }; enum { DLG_TREE = 101, DLG_LOOK = 102, DLG_MAIN = 103 };

View File

@ -1,8 +1,8 @@
#include "ba0400a.h" #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 BEGIN
PROMPT 1 1 "" PROMPT 1 1 ""
ITEM "Descrizione@50" ITEM "Descrizione@50"
@ -23,7 +23,7 @@ END
ENDPAGE ENDPAGE
TOOLBAR "bottombar" 0 0 0 2 TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_OK 10 2 BUTTON DLG_OK 10 2
BEGIN BEGIN

View File

@ -1504,7 +1504,7 @@ void TInstaller_mask::install_selection()
const int oldpatch = row->get_int(C_CURRPATCH); const int oldpatch = row->get_int(C_CURRPATCH);
pi.set_text(format(FR("Installazione modulo '%s'"), (const char*)modesc)); 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); error_box(FR("Il modulo '%s' non ha una versione valida."), (const char*)modesc);
continue; 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 //metodo per controllare se la directory indicata contiene una installazione buona di campo
bool TInstaller_mask::is_program_dir(const TFilename& path) 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 //controlla l'esistenza di alcuni files chiave di campo
work_path.add("install.ini"); const char* const essential[] = {"install.ini", "campo.ini", "campo.aut", "ba0.exe", "xvaga.dll", NULL };
if (work_path.exist()) bool ok = true;
for (int i = 0; ok && essential[i]; i++)
{ {
work_path = path; TFilename work_path = path;
work_path.add("campo.ini"); work_path.add(essential[i]);
if (work_path.exist()) ok = 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!
}
}
}
} }
return ok; 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.. //in base al tipo di installazione che rileva decide se puo' effettuare aggiornamenti via web (un client..
//..non puo' fare aggiornamenti da web!!!) //..non puo' fare aggiornamenti da web!!!)
TToken_string installada; TToken_string installada;
installada.add(TR("Installa da disco")); installada.add(PR("Installa da disco"));
installada.add(TR("Installa da web ")); installada.add(PR("Installa da web "));
TRadio_field& rf = add_radio(F_TYPE, 0, "", 1, 0, 21, "0|1", installada); TRadio_field& rf = add_radio(F_TYPE, 0, "", 0, 0, 23, "0|1", installada);
*rf.message(0, true) = "DISABLE,207|ENABLE,201"; *rf.message(0, true) = "DISABLE,207|ENABLE,201";
*rf.message(1, true) = "DISABLE,201|ENABLE,207"; *rf.message(1, true) = "DISABLE,201|ENABLE,207";
add_string(F_PATH, 0, "", 23, 1, 256, "B", 56).set_selector('D', EMPTY_STRING); 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 path = ini.get("DiskPath");
TFilename webpath = ini.get("WebPath"); 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) if (_station_type == 3)
{ {
rf.disable(); rf.disable();
@ -1814,19 +1796,10 @@ TInstaller_mask::TInstaller_mask()
set_handler(F_UPDATE, update_handler); set_handler(F_UPDATE, update_handler);
set_handler(DLG_USER, tutti_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.. //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 //..di tipo test per impedire all'utonto di aggiornarsi da test prima di essere passato da release
if (webpath.empty() || webpath.find("test")) if (webpath.empty() || webpath.find("test"))
{ webpath = http_default_path();
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);
}
}
set(F_PATH, path); set(F_PATH, path);
set(F_WEB, webpath); set(F_WEB, webpath);