Henning Schröder avatar Henning Schröder committed e85e52c

bug fixed for closing all tabs

Comments (0)

Files changed (4)

codeaide/ide/simple/base.py

                 
     def on_current_changed(self, i):
         edit = self.currentWidget()
-        doc = edit.document()
-        self.connect(doc, SIGNAL("modificationChanged(bool)"), self.on_modification_change)
-        self.window().setWindowModified(edit.document().isModified())
         self.window().setWindowTitle("")
-        self.window().setWindowFilePath(self.tabText(i))
+        if edit:
+            doc = edit.document()
+            self.connect(doc, SIGNAL("modificationChanged(bool)"), self.on_modification_change)
+            self.window().setWindowModified(doc.isModified())
+            self.window().setWindowFilePath(self.tabText(i))
         self.window().emit(SIGNAL("active_document_changed(PyQt_PyObject)"), edit)
 
 

codeaide/ide/simple/python.py

             self.tree.key = str(id(editor))
             del self.items[:]
             self.tree.clear()
-            editor.connect(editor, SIGNAL("structure_changed"), self.update)
+            if editor:
+                editor.connect(editor, SIGNAL("structure_changed"), self.update)
             nodes = getattr(editor, "structure", None)
-            if nodes:
-                self.update(nodes)
+            self.update(nodes)
 
 
     def on_expanded(self, item):
 
 
     def update(self, nodes):
+        del self.items[:]
+        self.tree.clear()
         if not nodes:
             return
-        del self.items[:]
-        self.tree.clear()
         for n in nodes:
             i = OutlineItem(self.tree, n)
             self.items.append(i)

codeaide/interface.py

             
             def __call__(self, obj):
                 if DEBUG:
-                    print "desctruct", repr(obj), self.interfaces
+                    print "destruct", repr(obj), self.interfaces
                 for iface in self.interfaces:
-                    iface.__objects__.remove(obj)
-
+                    try:
+                        iface.__objects__.remove(obj)
+                    except: pass
         
         if DEBUG:
             print "%s.%s:%s.%s" % (
 
 
     def busy(self):
-        self.killTimer(self.idle_timer_id)
+        try:
+            self.killTimer(self.idle_timer_id)
+        except AttributeError: pass
         self.idle_timer_id = self.startTimer(1000)
 
 
     def timerEvent(self, event):
-        self.killTimer(self.idle_timer_id)
+        try:
+            self.killTimer(self.idle_timer_id)
+        except AttributeError: pass
         QTimer.singleShot(0, self._emit_idle)
         self.idle_timer_id = self.startTimer(1000)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.