]> granicus.if.org Git - python/commitdiff
Add confirmation dialog before printing. Patch 1717170 Tal Einat.
authorKurt B. Kaiser <kbk@shore.net>
Sun, 28 Oct 2007 19:03:59 +0000 (19:03 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Sun, 28 Oct 2007 19:03:59 +0000 (19:03 +0000)
Lib/idlelib/IOBinding.py
Lib/idlelib/NEWS.txt

index 37aa08ee3ff98c512415175756372226f257b4e1..01d278e87cd7c02648a768ec6437ea38683e2112 100644 (file)
@@ -465,13 +465,23 @@ class IOBinding:
             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)
index 5d165bb9a2cddf9d8d9b3b9db44b15861ecb5379..c1290f45f0da308cc5f9f576dc488603891fc807 100644 (file)
@@ -3,6 +3,8 @@ What's New in IDLE 2.6a1?
 
 *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.