better usage of no_ask_save tcl var (keep asking to save modified schematics when navigating hierarchy to avoid nuking edits)
This commit is contained in:
parent
d3ec547394
commit
9532340a0e
|
|
@ -563,7 +563,7 @@ int save(int confirm, int fast)
|
|||
{
|
||||
dbg(1, "save(): force=%d modified=%d\n", force, xctx->modified);
|
||||
if(confirm) {
|
||||
tcleval("ask_save_optional");
|
||||
tcleval("ask_save");
|
||||
if(!strcmp(tclresult(), "") ) return -1; /* user clicks "Cancel" */
|
||||
else if(!strcmp(tclresult(), "yes") ) return save_schematic(xctx->sch[xctx->currsch], fast);
|
||||
else return 0; /* user clicks "no" */
|
||||
|
|
@ -2619,7 +2619,7 @@ void go_back(int what)
|
|||
if(xctx->modified)
|
||||
{
|
||||
if(confirm) {
|
||||
tcleval("ask_save_optional");
|
||||
tcleval("ask_save");
|
||||
if(!strcmp(tclresult(), "yes") ) save_ok = save_schematic(xctx->sch[xctx->currsch], 0);
|
||||
else if(!strcmp(tclresult(), "") ) return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3404,7 +3404,8 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
if(!strcmp(xctx->sch[xctx->currsch],"") || strstr(xctx->sch[xctx->currsch], "untitled")) {
|
||||
saveas(NULL, SCHEMATIC);
|
||||
} else {
|
||||
save(1, 0);
|
||||
int confirm = !tclgetboolvar("no_ask_save");
|
||||
save(confirm, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3858,7 +3859,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
}
|
||||
break;
|
||||
|
||||
case XK_ISO_Left_Tab:
|
||||
case XK_ISO_Left_Tab: /* Shift is pressed */
|
||||
if(state == (ControlMask | ShiftMask)) {
|
||||
int save = xctx->semaphore;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue