Patch level : 2.0 614

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Correzioni necessarie per scelta font migliorata.


git-svn-id: svn://10.65.10.50/trunk@11528 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-10-23 15:16:11 +00:00
parent 7ae55987ec
commit b9fd8878cc
5 changed files with 16 additions and 38 deletions

View File

@ -458,23 +458,6 @@ long TApplication::handler(WINDOW win, EVENT* ep)
return 0L;
}
const TString & TApplication::god_string(const char* keyword) const
{
if (_god_vars== NULL)
((TApplication *)this)->_god_vars = new TAssoc_array;
TString* s = (TString*)_god_vars->objptr(keyword);
if (s == NULL)
{
TConfig c(CONFIG_GODMODE);
s = new TString(c.get(keyword));
_god_vars->add(keyword, s);
}
return *s;
}
void TApplication::stop_run()
{
if (_savefirm)
@ -617,9 +600,6 @@ void TApplication::set_perms()
_user_aut.set(0, TRUE); // Attiva la BASE
TString& utente = user();
if (utente.empty() && god_mode("AdminForever"))
utente = ::dongle().administrator();
if (utente.not_empty())
{
if (utente == ::dongle().administrator())

View File

@ -142,12 +142,6 @@ public:
virtual bool check_autorization() const
{return TRUE;}
// @cmember Ritorna la stringa di attivazione del modo speciale per la funzione <p keyword>
const TString & god_string(const char * keyword = "GODMODE") const;
// @cmember Verifica l'attivazione del modo speciale per la funzione <p keyword>
bool god_mode(const char * keyword = "GODMODE") const { return god_string(keyword).not_empty(); }
// @cmember Forza la chiusura dell'applicazione
void stop_run();

View File

@ -734,8 +734,16 @@ TConfig::TConfig(int which_config, const char* paragraph)
break;
case CONFIG_GUI:
{
TFilename gui = "gui.ini";
if (gui.custom_path()) // I colori sono qui, scavalca utente
TFilename gui = CGetCampoIni();
gui.rtrim(9);
gui << "gui.ini";
bool ok = gui.exist();
if (!ok)
{
gui = "gui.ini";
ok = gui.custom_path();
}
if (ok) // I colori sono qui, scavalca utente
{
_file = gui;
break;
@ -768,12 +776,6 @@ TConfig::TConfig(int which_config, const char* paragraph)
case CONFIG_INSTALL:
_file = CGetCampoIni();
break;
case CONFIG_GODMODE:
_file = "gm.ini";
_file.custom_path();
if (paragraph == NULL || *paragraph == '\0')
paragraph = "GODMODE";
break;
default:
NFCHECK("Chi usa questo strano .ini?");
break;

View File

@ -24,8 +24,6 @@ class TConfig;
#define CONFIG_STAMPE 6
// file parametri GUI (nel senso di Graphic User Interface)
#define CONFIG_GUI 7
// file parametri godmode
#define CONFIG_GODMODE 8
// Callback per for_each_paragraph
typedef int (*CONFIG_CALLBACK)(TConfig& cfg, void* jolly);

View File

@ -70,6 +70,9 @@ void TPrinter_setup_mask::fill_font_list()
TList_field& lst = (TList_field&)field(MSK_FONT);
lst.replace_items(fn, fn);
// Controlla se il font c'e' ancora
if (fn.get_pos(_font) < 0)
_font = fn.get(0);
set(MSK_FONT, _font, 0x1);
}
@ -102,6 +105,7 @@ void TPrinter_setup_mask::fill_size_list()
const TString8 old_size = lst.get();
lst.replace_items(pn1, pn1);
lst.set(old_size);
lst.enable(pn1.items() > 1);
}
bool TPrinter_setup_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
@ -1209,7 +1213,7 @@ void TPrinter::read_configuration(
}
}
if (iniptr == NULL)
iniptr = new TConfig(CONFIG_USER, "Printer");
iniptr = new TConfig(CONFIG_GUI, "Printer");
const int what = iniptr->get_int("Type", NULL, -1, 4); // Tipo stampante
_prname = iniptr->get("Name", NULL, -1, _defPrinter); // Nome stampante corrente
@ -1303,7 +1307,7 @@ void TPrinter::save_configuration()
TWait_cursor hourglass;
CHECK(_config.not_empty(), "Invalid printer config");
TConfig prini(_config == "Printer" ? CONFIG_USER : CONFIG_STAMPE, _config);
TConfig prini(_config == "Printer" ? CONFIG_GUI : CONFIG_STAMPE, _config);
prini.set("Type", _printertype); // Tipo stampante
prini.set("Name", _prname); // Nome stampante corrente