If user cancels file saving, native dialog returns False,
while Windows dialog returns None. This changeset changes
Windows dialog to return False, and tests the dlg return
value before attempting to confirm a file overwrite.


# HG changeset patch
# User Emmanuel Rosa <goaway1...@gmail.com>
# Date 1256499055 14400
# Branch stable
# Node ID d496dd95fe07961680e60d9c1e0597cd5db28758
# Parent  9990598892ab1501bd9012b42d894d5c9a471153
gtklib: make both dlg wrappers return False on cancel

If user cancels file saving, native dialog returns False,
while Windows dialog returns None. This changeset changes
Windows dialog to return False, and tests the dlg return
value before attempting to confirm a file overwrite.

diff --git a/tortoisehg/hgtk/gtklib.py b/tortoisehg/hgtk/gtklib.py
--- a/tortoisehg/hgtk/gtklib.py
+++ b/tortoisehg/hgtk/gtklib.py
@@ -166,7 +166,10 @@
             filepath = self.runWindows()
         except ImportError:
             filepath = self.runCompatible()
-        return self.overwriteConfirmation(filepath)
+
+        if filepath:
+            return self.overwriteConfirmation(filepath)
+        return False
 
     def runWindows(self):
 
@@ -203,7 +206,7 @@
         while thread.isAlive():
             # let gtk process events while we wait for rundlg finishing
             gtk.main_iteration(block=True)
-        fname = None
+        fname = False 
         if q.qsize():
             fname = q.get(0)
         return fname
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to