Correzioni per installazione Setup -> SetCmpUp

git-svn-id: svn://10.65.10.50/branches/R_10_00@22682 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-07-02 13:03:23 +00:00
parent 05aa5970c9
commit eb8fef43a1
3 changed files with 908 additions and 881 deletions

View File

@ -327,12 +327,8 @@ bool TMenuitem::perform_program() const
return error_box("Password di servizio errata!\nAccesso negato."); return error_box("Password di servizio errata!\nAccesso negato.");
} }
if (_firm && main_app().get_firm() == 0) if (_firm && main_app().get_firm() <= 0)
{ ok = menu().set_firm(0);
// Forza ditta 1 in demo altrimenti chiedila all'utente
const int cd = dongle().demo() ? 1 : 0;
ok = menu().set_firm(cd);
}
if (ok) if (ok)
{ {
@ -608,7 +604,9 @@ bool TMenu::set_firm(long firm) const
{ {
TPointer_array codes; TPointer_array codes;
const int nditte = prefix().firms(codes); const int nditte = prefix().firms(codes);
if (nditte == 1) if (codes.empty())
return error_box(TR("Non esistono ditte selezionabili"));
if (nditte == 1 || dongle().demo())
firm = codes.get_long(0); firm = codes.get_long(0);
} }
return main_app().set_firm(firm); return main_app().set_firm(firm);
@ -623,7 +621,7 @@ bool TMenu::jumpto(TSubmenu* next)
{ {
if (next->query_firm()) if (next->query_firm())
{ {
if (!set_firm(dongle().demo() ? 1 : 0)) if (!set_firm(0))
next = NULL; next = NULL;
} }
if (next) if (next)

View File

@ -1303,7 +1303,7 @@ const TString& get_logo()
if (currlogo.blank()) if (currlogo.blank())
{ {
//se non trova il logo del producer usa il logo standard //se non trova il logo del producer usa il logo standard
currlogo = "menulogo.jpg"; currlogo = "sirio_logo.jpg";
} }
} }

View File

@ -339,8 +339,15 @@ void TBook_window::erode_antipa()
void TBook_window::set_logo(const char* logo) void TBook_window::set_logo(const char* logo)
{ {
_logo.load(logo); _logo.load(logo);
if (_logo.ok())
{
if (is_power_reseller(true)) if (is_power_reseller(true))
{ {
#ifdef DBG
const clock_t start = clock();
#endif
const short w = _logo.width(); const short w = _logo.width();
const short h = _logo.height(); const short h = _logo.height();
const short h2 = h/4; const short h2 = h/4;
@ -355,7 +362,8 @@ void TBook_window::set_logo(const char* logo)
short tw, th; xvt_image_get_dimensions(tile, &tw, &th); short tw, th; xvt_image_get_dimensions(tile, &tw, &th);
if (tw > 0 && th > 0) if (tw > 0 && th > 0)
{ {
RCT src; xvt_rect_set(&src, 0, 0, tw, th); // Elegante ma lento
/* RCT src; xvt_rect_set(&src, 0, 0, tw, th);
for (short y = 0; y < h2; y += th) for (short y = 0; y < h2; y += th)
{ {
for (short x = 0; x < w; x += tw) for (short x = 0; x < w; x += tw)
@ -364,9 +372,26 @@ void TBook_window::set_logo(const char* logo)
xvt_image_transfer(big, tile, &dst, &src); xvt_image_transfer(big, tile, &dst, &src);
} }
} }
*/
#ifdef DBG
// #pragma omp parallel for
#endif
// Bovino ma veloce
for (short y = 0; y < h2; y++)
{
for (short x = 0; x < w; x++)
{
const COLOR rgb = xvt_image_get_pixel(tile, x % tw, y % th);
xvt_image_set_pixel(big, x, y+h, rgb);
}
}
} }
} }
// Copia tutti i pixel non neri/grigi/bianchi
#ifdef DBG
#pragma omp parallel for
#endif
for (short y = 0; y < h2; y++) for (short y = 0; y < h2; y++)
{ {
const double weight = 0.5+double(y)/double(2*h2); const double weight = 0.5+double(y)/double(2*h2);
@ -383,20 +408,24 @@ void TBook_window::set_logo(const char* logo)
if (abs(r-g)>8 || abs(g-b)>8) // Non e' grigio, cioe' !(r==g && g==b) if (abs(r-g)>8 || abs(g-b)>8) // Non e' grigio, cioe' !(r==g && g==b)
{ {
const COLOR dst = xvt_image_get_pixel(big, x, y+h); const COLOR dst = xvt_image_get_pixel(big, x, y+h);
COLOR col = blend_colors(dst, src, weight); const COLOR col = blend_colors(dst, src, weight);
xvt_image_set_pixel(big, x, y+h, col); xvt_image_set_pixel(big, x, y+h, col);
} }
} }
} }
} }
#ifdef DBG
const clock_t tot = clock() - start;
#endif
_logo.set(big); _logo.set(big);
} }
else else
{ {
if (_logo.ok() && can_be_transparent(_logo)) if (can_be_transparent(_logo))
_logo.convert_transparent_color(NORMAL_BACK_COLOR); _logo.convert_transparent_color(NORMAL_BACK_COLOR);
} }
}
} }
void TBook_window::set_back(const TString& back) void TBook_window::set_back(const TString& back)