Index: /pykoticon/trunk/bin/pykoticon
===================================================================
--- /pykoticon/trunk/bin/pykoticon (revision 137)
+++ /pykoticon/trunk/bin/pykoticon (revision 138)
@@ -4,5 +4,5 @@
 """PyKotIcon is a generic, networked, cross-platform dialog box manager."""
 
-# PyKotIcon - Client side helper for PyKota
+# PyKotIcon - Client side helper for PyKota and other applications
 #
 # (c) 2003, 2004, 2005, 2006 Jerome Alet <alet@librelogiciel.com>
@@ -23,5 +23,5 @@
 #
 
-__version__ = "1.01"
+__version__ = "1.02"
 __author__ = "Jerome Alet"
 __author_email__ = "alet@librelogiciel.com"
@@ -148,4 +148,12 @@
         return True
         
+    def _dispatch(self, method, params) :    
+        """Ensure that only export_* methods are available."""
+        return getattr(self, "export_%s" % method)(*params)
+        
+    def handle_error(self, request, client_address) :    
+        """Doesn't display an ugly traceback in case an error occurs."""
+        self.logDebug("An exception occured while handling an incoming request from %s:%s" % (client_address[0], client_address[1]))
+        
     def verify_request(self, request, client_address) :
         """Ensures that requests which don't come from the print server are rejected."""
@@ -158,8 +166,4 @@
             self.logDebug("%s rejected." % client)
             return False
-        
-    def _dispatch(self, method, params) :    
-        """Ensure that only export_* methods are available."""
-        return getattr(self, "export_%s" % method)(*params)
         
     def mainloop(self) :
@@ -248,5 +252,5 @@
         
         wx.EVT_ICONIZE(self, self.OnIconify)
-        wx.EVT_CLOSE(self, self.FakeOnClose)
+        wx.EVT_CLOSE(self, self.OnClose)
         self.Show(True)
         
@@ -277,8 +281,11 @@
     def OnClose(self, event) :
         """Cleanly quit the application."""
-        self.closeServer()
-        self.menu.Destroy()
-        self.tbicon.Destroy()
-        self.Destroy()
+        if (event is None) or self.options.allowquit :
+            self.closeServer()
+            self.menu.Destroy()
+            self.tbicon.Destroy()
+            self.Destroy()
+        else :    
+            self.quitIsForbidden()
 
     def OnTaskBarMenu(self, event) :
@@ -286,11 +293,4 @@
         self.tbicon.PopupMenu(self.menu)
 
-    def FakeOnClose(self, event) :
-        """React to close from windows corner."""
-        if self.options.allowquit :
-            self.Close()
-        else :
-            self.quitIsForbidden()
-            
     def OnTaskBarClose(self, event) :
         """React to close from the taskbar."""
@@ -302,11 +302,10 @@
     def quitIsForbidden(self) :        
         """Displays a message indicating that quitting the application is not allowed."""
-        #�message = _("Sorry, this was forbidden by your system administrator.")
-        #�caption = _("Information")
-        #�style = wx.OK | wx.ICON_INFORMATION | wx.STAY_ON_TOP
-        # dialog = wx.MessageDialog(self, message, caption, style)
-        # dialog.ShowModal()
-        #�dialog.Destroy()
-        pass
+        message = _("Sorry, this was forbidden by your system administrator.")
+        caption = _("Information")
+        style = wx.OK | wx.ICON_INFORMATION | wx.STAY_ON_TOP
+        dialog = wx.MessageDialog(self, message, caption, style)
+        dialog.ShowModal()
+        dialog.Destroy()
         
     def OnAbout(self, event) :    
@@ -473,15 +472,4 @@
     
     
-def crashed() :    
-    """Minimal crash method."""
-    import traceback
-    lines = []
-    for line in traceback.format_exception(*sys.exc_info()) :
-        lines.extend([l for l in line.split("\n") if l])
-    msg = "ERROR: ".join(["%s\n" % l for l in (["ERROR: PyKotIcon"] + lines)])
-    sys.stderr.write(msg)
-    sys.stderr.flush()
-    
-    
 if __name__ == '__main__':
     main()
Index: /pykoticon/trunk/NEWS
===================================================================
--- /pykoticon/trunk/NEWS (revision 126)
+++ /pykoticon/trunk/NEWS (revision 138)
@@ -22,4 +22,13 @@
 PyKotIcon NEWS :
 
+  - 1.02 (2006-06-06) :
+    
+    - Now displays an error message when the end user wants to quit
+      and it is forbidden.
+      
+    - Doesn't display the ugly traceback anymore when the client  
+      disconnects before the server has sent the answer back
+      (pknotify --timeout).
+      
   - 1.01 (2006-05-01) :
       
