All pastes #233458 Raw Edit

Mine

public text v1 · immutable
·published 2006-11-01 23:16 UTC
rendered paste body
Index: Chandler.py
===================================================================
--- Chandler.py	(revision 12195)
+++ Chandler.py	(working copy)
@@ -120,10 +120,8 @@
                 # See if we already have a window up, and if so, reuse it
                 from application import feedback
                 feedback.destroyAppOnClose = True
-                win = feedback.activeWindow
-                if win is None:
-                    win = feedback.FeedbackWindow()
-                    win.CreateOutputWindow('')
+                win = feedback.FeedbackWindow()
+                win.CreateOutputWindow('')
                 for line in backtrace:
                     win.write(line)
                 if not app.IsMainLoopRunning():
Index: application/feedback.py
===================================================================
--- application/feedback.py	(revision 12195)
+++ application/feedback.py	(working copy)
@@ -22,7 +22,6 @@
 
 LOGLINES = 500
 
-activeWindow = None
 destroyAppOnClose = False
 
 def initRuntimeLog(profileDir):
@@ -57,6 +56,11 @@
     An error dialog that would be shown in case there is an uncaught
     exception. The user can send the error report back to us as well.
     """
+    def __call__(self, *args, **kw):
+        # Make this a Singleton to avoid the problem of multiple feedback
+        # windows popping up at the same time
+        return self
+    
     def _fillOptionalSection(self):
         try:    
             # columns
@@ -182,9 +186,6 @@
         self.frame.text.AppendText(st)
 
     def CreateOutputWindow(self, st):
-        global activeWindow
-        activeWindow = self
-        
         self.frame = xrcFRAME(None)
         self.text = self.frame.text # superclass expects self.text
         try:
@@ -304,7 +305,8 @@
         else:
             self.frame.sendButton.SetLabel(_(u'Sent'))
             self.logReport(body, response.read())
-        
+                
+FeedbackWindow = FeedbackWindow()
 
 def buildXML(comments, email, optional, required):
     """