Non chiedeva conferma se si usciva senza salvare e non usciva facendo

FINE


git-svn-id: svn://10.65.10.50/trunk@1051 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-03-01 09:42:22 +00:00
parent 6043fdc5fb
commit a0232631e3
2 changed files with 18 additions and 7 deletions

View File

@ -4,6 +4,8 @@
#include <mask.h> #include <mask.h>
#include <relation.h> #include <relation.h>
#define comunque
bool TConfig_application::create() bool TConfig_application::create()
{ {
TApplication::create(); TApplication::create();
@ -90,8 +92,10 @@ void TConfig_application::do_config(int m)
int k = m.run(); int k = m.run();
if (!postprocess_config(m,cnf)) if (!postprocess_config(m,cnf))
break; break;
if (k == K_ENTER) bool tosave = k == K_ENTER || k == K_SAVE;
if (k == K_ENTER || k == K_QUIT)
{ {
// aggiusta campi // aggiusta campi
for (i = 0; i < m.fields(); i++) for (i = 0; i < m.fields(); i++)
@ -105,14 +109,21 @@ void TConfig_application::do_config(int m)
const char* fname = fref->name(); const char* fname = fref->name();
const char* value = f.get(); const char* value = f.get();
const char* oldvl = cnf.get(fname); const char* oldvl = cnf.get(fname);
if (postprocess_config_changed(par,fname,
oldvl,value)) if (!tosave)
cnf.set(fname, value, NULL, TRUE); tosave = yesno_box("Modifiche non registrate. Salvare?");
if (!tosave) break;
if (postprocess_config_changed(par,fname, oldvl,value))
cnf.set(fname, value, NULL, TRUE);
} }
} }
} }
} }
else break; else break;
if (k == K_QUIT)
break comunque;
} }
else else
{ {

View File

@ -35,7 +35,7 @@ class TConfig_application : public TApplication
{ {
TArray _paragraphs; TArray _paragraphs;
int _which_config; int _which_config;
MENU_TAG _last_choice; MENU_TAG _last_choice;
virtual bool create(); virtual bool create();