add tcl variable no_ask_save: if set to 1 xschem will not ask to save modified schematics
This commit is contained in:
parent
6a0fcdae05
commit
112a12a87b
|
|
@ -479,7 +479,7 @@ int save(int confirm)
|
|||
if(force || xctx->modified)
|
||||
{
|
||||
if(confirm) {
|
||||
tcleval("ask_save");
|
||||
tcleval("ask_save_optional");
|
||||
if(!strcmp(tclresult(), "") ) return -1; /* user clicks "Cancel" */
|
||||
else if(!strcmp(tclresult(), "yes") ) return save_schematic(xctx->sch[xctx->currsch]);
|
||||
else return 0; /* user clicks "no" */
|
||||
|
|
@ -1969,7 +1969,7 @@ void go_back(int confirm) /* 20171006 add confirm */
|
|||
if(xctx->modified)
|
||||
{
|
||||
if(confirm) {
|
||||
tcleval("ask_save");
|
||||
tcleval("ask_save_optional");
|
||||
if(!strcmp(tclresult(), "yes") ) save_ok = save_schematic(xctx->sch[xctx->currsch]);
|
||||
else if(!strcmp(tclresult(), "") ) return;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -2345,7 +2345,7 @@ int save_schematic(const char *schname) /* 20171020 added return value */
|
|||
else { /* user asks to save to same filename */
|
||||
if(!stat(xctx->sch[xctx->currsch], &buf)) {
|
||||
if(xctx->time_last_modify && xctx->time_last_modify != buf.st_mtime) {
|
||||
tclvareval("ask_save \"Schematic file: ", xctx->sch[xctx->currsch],
|
||||
tclvareval("ask_save_optional \"Schematic file: ", xctx->sch[xctx->currsch],
|
||||
"\nHas been changed since opening.\nSave anyway?\" 0", NULL);
|
||||
if(strcmp(tclresult(), "yes") ) return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3852,6 +3852,17 @@ proc attach_labels_to_inst {} {
|
|||
return {}
|
||||
}
|
||||
|
||||
# if no_ask_save is set to 1 just return yes (always save)
|
||||
proc ask_save_optional { {ask {save file?}} {cancel 1}} {
|
||||
global no_ask_save
|
||||
|
||||
if { $no_ask_save } {
|
||||
return yes
|
||||
} else {
|
||||
return [ask_save $ask $cancel]
|
||||
}
|
||||
}
|
||||
|
||||
proc ask_save { {ask {save file?}} {cancel 1}} {
|
||||
global rcode wm_fix
|
||||
set rcode {}
|
||||
|
|
@ -5576,8 +5587,8 @@ set tctx::global_list {
|
|||
graph_selected graph_sort graph_unlocked hide_empty_graphs hide_symbols hsize
|
||||
incr_hilight infowindow_text input_line_cmd input_line_data launcher_default_program
|
||||
light_colors line_width live_cursor2_backannotate local_netlist_dir lvs_ignore
|
||||
lvs_netlist measure_text netlist_dir netlist_show
|
||||
netlist_type no_change_attrs nolist_libs noprint_libs old_selected_tok only_probes path pathlist
|
||||
lvs_netlist measure_text netlist_dir netlist_show netlist_type no_ask_save
|
||||
no_change_attrs nolist_libs noprint_libs old_selected_tok only_probes path pathlist
|
||||
persistent_command preserve_unchanged_attrs prev_symbol ps_colors ps_paper_size rainbow_colors
|
||||
rawfile_loaded rcode recentfile
|
||||
replace_key retval retval_orig rotated_text search_case search_exact search_found search_schematic
|
||||
|
|
@ -6736,6 +6747,7 @@ set_ne disable_unique_names 0
|
|||
set_ne sym_txt 1
|
||||
set_ne show_infowindow 0
|
||||
set_ne show_infowindow_after_netlist onerror
|
||||
set_ne no_ask_save 0 ;# if set to 1 ctrl-s (save) will not ask to save
|
||||
set_ne symbol_width 150
|
||||
set_ne editor {gvim -f}
|
||||
set_ne rainbow_colors 0
|
||||
|
|
|
|||
|
|
@ -186,6 +186,10 @@
|
|||
#### default: 0
|
||||
# set autotrim_wires 0
|
||||
|
||||
#### do not ask to save file when doing control-s or File -> Save
|
||||
#### default: disabled (0), will ask before saving.
|
||||
# set no_ask_save 0
|
||||
|
||||
#### set widget scaling (mainly for font display), this is useful on 4K displays
|
||||
#### default: unset (tk uses its default) > 1.0 ==> bigger
|
||||
# set tk_scaling 1.7
|
||||
|
|
|
|||
Loading…
Reference in New Issue