Debugger/DebugViewer.py

branch
Py2 comp.
changeset 2791
a9577f248f04
parent 2677
3d4277929fb3
parent 2766
c413e9eeaf95
child 2847
1843ef6e2656
diff -r 6686a3326df8 -r a9577f248f04 Debugger/DebugViewer.py
--- a/Debugger/DebugViewer.py	Mon Jul 08 21:47:26 2013 +0200
+++ b/Debugger/DebugViewer.py	Mon Jul 08 22:36:10 2013 +0200
@@ -278,9 +278,9 @@
         """
         self.globalsViewer.handleResetUI()
         self.localsViewer.handleResetUI()
-        self.stackComboBox.clear()
         self.sourceButton.setEnabled(False)
         self.currentStack = None
+        self.stackComboBox.clear()
         self.__threadList.clear()
         if self.embeddedShell:
             self.__tabWidget.setCurrentWidget(self.shellAssembly)
@@ -388,6 +388,7 @@
         @param stack list of tuples with call stack data (file name, line number,
             function name, formatted argument/values list)
         """
+        block = self.stackComboBox.blockSignals(True)
         self.framenr = 0
         self.stackComboBox.clear()
         self.currentStack = stack
@@ -396,6 +397,7 @@
             # just show base filename to make it readable
             s = (os.path.basename(s[0]), s[1], s[2])
             self.stackComboBox.addItem('{0}:{1}:{2}'.format(*s))
+        self.stackComboBox.blockSignals(block)
         
     def setVariablesFilter(self, globalsFilter, localsFilter):
         """
@@ -411,8 +413,10 @@
         """
         Private slot to handle the source button press to show the selected file.
         """
-        s = self.currentStack[self.stackComboBox.currentIndex()]
-        self.sourceFile.emit(s[0], int(s[1]))
+        index = self.stackComboBox.currentIndex()
+        if index > -1 and self.currentStack:
+            s = self.currentStack[index]
+            self.sourceFile.emit(s[0], int(s[1]))
         
     def __frameSelected(self, frmnr):
         """

eric ide

mercurial