diff --git a/include/applicat.cpp b/include/applicat.cpp index 11c6133e7..17d14b9c2 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -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()) diff --git a/include/applicat.h b/include/applicat.h index c43e3abe9..7f5e3a622 100755 --- a/include/applicat.h +++ b/include/applicat.h @@ -142,12 +142,6 @@ public: virtual bool check_autorization() const {return TRUE;} - // @cmember Ritorna la stringa di attivazione del modo speciale per la funzione

- const TString & god_string(const char * keyword = "GODMODE") const; - - // @cmember Verifica l'attivazione del modo speciale per la funzione

- bool god_mode(const char * keyword = "GODMODE") const { return god_string(keyword).not_empty(); } - // @cmember Forza la chiusura dell'applicazione void stop_run(); diff --git a/include/config.cpp b/include/config.cpp index a8fcf1385..4eb3f9c73 100755 --- a/include/config.cpp +++ b/include/config.cpp @@ -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; diff --git a/include/config.h b/include/config.h index f3f6f0792..7abcd0c6b 100755 --- a/include/config.h +++ b/include/config.h @@ -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); diff --git a/include/printer.cpp b/include/printer.cpp index 606bd0827..dc73276e4 100755 --- a/include/printer.cpp +++ b/include/printer.cpp @@ -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