gui: Always disconnect/connect when loading a file; this creates a new

session.
This commit is contained in:
tgoff0 2015-03-09 15:21:08 +00:00
parent 8248a292d0
commit a02c9a3f6e

View file

@ -149,14 +149,21 @@ proc openFile { filename } {
global changed global changed
global oper_mode global oper_mode
set prev_oper_mode $oper_mode
if { [popupStopSessionPrompt] == "cancel" } {
return
}
if { [lindex [file extension $filename] 0] == ".py" } { if { [lindex [file extension $filename] 0] == ".py" } {
execPythonFile $filename execPythonFile $filename
return return
} }
set prev_oper_mode $oper_mode # disconnect and get a new session number
if { [popupStopSessionPrompt] == "cancel" } { set name [lindex [getEmulPlugin "*"] 0]
return if { $name != "" } {
pluginConnect $name disconnect 1
pluginConnect $name connect 1
} }
set currentFile $filename set currentFile $filename
@ -169,18 +176,11 @@ proc openFile { filename } {
} }
if { $prev_oper_mode == "exec" } { if { $prev_oper_mode == "exec" } {
if { $oper_mode == "exec" } { if { $oper_mode == "exec" } {
global g_current_session global g_current_session
setOperMode edit setOperMode edit
set g_current_session 0 set g_current_session 0
} }
# disconnect and get a new session number
set name [lindex [getEmulPlugin "*"] 0]
if { $name != "" } {
pluginConnect $name disconnect 1
pluginConnect $name connect 1
}
} }
if { [file extension $currentFile] == ".xml" } { if { [file extension $currentFile] == ".xml" } {