[Python-checkins] r58700 - python/trunk/Lib/idlelib/IOBinding.py python/trunk/Lib/idlelib/NEWS.txt

kurt.kaiser python-checkins at python.org
Sun Oct 28 20:03:59 CET 2007


Author: kurt.kaiser
Date: Sun Oct 28 20:03:59 2007
New Revision: 58700

Modified:
   python/trunk/Lib/idlelib/IOBinding.py
   python/trunk/Lib/idlelib/NEWS.txt
Log:
Add confirmation dialog before printing.  Patch 1717170 Tal Einat.


Modified: python/trunk/Lib/idlelib/IOBinding.py
==============================================================================
--- python/trunk/Lib/idlelib/IOBinding.py	(original)
+++ python/trunk/Lib/idlelib/IOBinding.py	Sun Oct 28 20:03:59 2007
@@ -465,13 +465,23 @@
             self.text.insert("end-1c", "\n")
 
     def print_window(self, event):
+        m = tkMessageBox.Message(
+            title="Print",
+            message="Print to Default Printer",
+            icon=tkMessageBox.QUESTION,
+            type=tkMessageBox.OKCANCEL,
+            default=tkMessageBox.OK,
+            master=self.text)
+        reply = m.show()
+        if reply != tkMessageBox.OK:
+            self.text.focus_set()
+            return "break"
         tempfilename = None
         saved = self.get_saved()
         if saved:
             filename = self.filename
         # shell undo is reset after every prompt, looks saved, probably isn't
         if not saved or filename is None:
-            # XXX KBK 08Jun03 Wouldn't it be better to ask the user to save?
             (tfd, tempfilename) = tempfile.mkstemp(prefix='IDLE_tmp_')
             filename = tempfilename
             os.close(tfd)

Modified: python/trunk/Lib/idlelib/NEWS.txt
==============================================================================
--- python/trunk/Lib/idlelib/NEWS.txt	(original)
+++ python/trunk/Lib/idlelib/NEWS.txt	Sun Oct 28 20:03:59 2007
@@ -3,6 +3,8 @@
 
 *Release date: XX-XXX-200X*
 
+- Add confirmation dialog before printing.  Patch 1717170 Tal Einat.
+
 - Show paste position if > 80 col.  Patch 1659326 Tal Einat.
 
 - Update cursor color without restarting.  Patch 1725576 Tal Einat.


More information about the Python-checkins mailing list