Refactor to use new protocol module and sipo.
[bertos.git] / wizard / BFinalPage.py
index ecfbf63a549afedd0f0ea439e014ce2bda95483d..a191d3c0a81326ef9fddb5560760fd959eed4cf4 100644 (file)
@@ -28,7 +28,6 @@
 #
 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
 #
-# $Id$
 #
 # Author: Lorenzo Berni <duplo@develer.com>
 #
@@ -49,19 +48,31 @@ class BFinalPage(BWizardPage):
     
     def __init__(self):
         BWizardPage.__init__(self, UI_LOCATION + "/final_page.ui")
-        self.setTitle(self.tr("Project created successfully"))
+        self.setTitle(self.tr("Project created successfully!"))
     
     ## Overloaded BWizardPage methods ##
         
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
+        self.setVisible(False)
         """
         Overload of the BWizardPage reloadData method.
         """
         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("Error removing the destination directory. This directory or a file in it is in use by another user or application.\nClose the application which is using the directory and retry."))
+                self.wizard().back()
+                return
         finally:
             QApplication.instance().restoreOverrideCursor()
+        self.setVisible(True)
         self._plugin_dict = {}
         if os.name == "nt":
             output = self.projectInfo("OUTPUT")
@@ -105,4 +116,4 @@ class BFinalPage(BWizardPage):
                 to_be_opened.append(plugin)
         self.setProjectInfo("TO_BE_OPENED", to_be_opened)
     
-    ####
\ No newline at end of file
+    ####