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 oper_mode
set prev_oper_mode $oper_mode
if { [popupStopSessionPrompt] == "cancel" } {
return
}
if { [lindex [file extension $filename] 0] == ".py" } {
execPythonFile $filename
return
}
set prev_oper_mode $oper_mode
if { [popupStopSessionPrompt] == "cancel" } {
return
# disconnect and get a new session number
set name [lindex [getEmulPlugin "*"] 0]
if { $name != "" } {
pluginConnect $name disconnect 1
pluginConnect $name connect 1
}
set currentFile $filename
@ -174,13 +181,6 @@ proc openFile { filename } {
setOperMode edit
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" } {