summaryrefslogtreecommitdiff
path: root/Lib/idlelib/IOBinding.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2007-10-28 19:03:59 +0000
committerKurt B. Kaiser <kbk@shore.net>2007-10-28 19:03:59 +0000
commit60d58406d0d43190c0caaf2cf29d574b152dae53 (patch)
tree2a0ff06dfba46e0d2f5d1c6a9fdada000fab3e75 /Lib/idlelib/IOBinding.py
parentea684743daa0c198ab327d07832eca48a9578c68 (diff)
downloadcpython-git-60d58406d0d43190c0caaf2cf29d574b152dae53.tar.gz
Add confirmation dialog before printing. Patch 1717170 Tal Einat.
Diffstat (limited to 'Lib/idlelib/IOBinding.py')
-rw-r--r--Lib/idlelib/IOBinding.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index 37aa08ee3f..01d278e87c 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -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)