Attempt to fix WindowsError related bug.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 21 May 2010 12:52:23 +0000 (12:52 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 21 May 2010 12:52:23 +0000 (12:52 +0000)
NOTE: this modification need to be tested on Windows.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3780 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BFinalPage.py

index ecfbf63a549afedd0f0ea439e014ce2bda95483d..1285850aea9bb2fb66a2b6573ecfae403316832b 100644 (file)
@@ -59,7 +59,14 @@ class BFinalPage(BWizardPage):
         """
         try:
             QApplication.instance().setOverrideCursor(Qt.WaitCursor)
-            self.project.createBertosProject()
+            try:
+                # This operation can throw WindowsError, if the directory is
+                # locked.
+                self.project.createBertosProject()
+            except OSError, e:
+                QMessageBox.critical(self, self.tr("Error removing destination directory"), self.tr("Close all the application using this directory and retry."))
+                self.wizard().back()
+                return
         finally:
             QApplication.instance().restoreOverrideCursor()
         self._plugin_dict = {}