avoid double "is already open" warning when doing Shift-Backspace or Ctrl-Backstapce when schematic already loaded

This commit is contained in:
stefan schippers 2025-09-29 10:23:43 +02:00
parent b14b94523d
commit 8d2088edd5
2 changed files with 14 additions and 6 deletions

View File

@ -624,7 +624,7 @@ void ask_new_file(int in_new_window, char *filename)
int skip = 0;
dbg(1, "ask_new_file(): load: f=%s\n", f);
if(check_loaded(f, win_path)) {
if(check_loaded(f, win_path) && !filename) {
char msg[PATH_MAX + 100];
my_snprintf(msg, S(msg),
"tk_messageBox -type okcancel -icon warning -parent [xschem get topwindow] "

View File

@ -8562,7 +8562,7 @@ proc set_geom {win {filename {}}} {
set geom_file $USER_CONF_DIR/geometry
if { [file exists $geom_file]} {
set fd [ open $geom_file]
set fd [open $geom_file]
while {[gets $fd line] >= 0} {
if { [llength $line] == 2} {
lassign $line f g
@ -8601,12 +8601,20 @@ proc set_geom {win {filename {}}} {
proc get_lastclosed {} {
global USER_CONF_DIR
set geom_file $USER_CONF_DIR/geometry
set ret {}
if {[file exists $USER_CONF_DIR/geometry]} {
set ret [lindex [read_data $USER_CONF_DIR/geometry] 0]
if {$ret eq [abs_sym_path untitled.sch]} {
set ret {}
if {[file exists $geom_file]} {
set fd [open $geom_file]
while {[gets $fd line] >= 0} {
set ret [lindex $line 0]
if {$ret eq [abs_sym_path untitled.sch]} {
continue
}
if { $ret ne {}} {
break
}
}
close $fd
}
return $ret
}