If the user select the same version he's using the Wizard will replace it with the...
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 17 Sep 2009 15:42:52 +0000 (15:42 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 17 Sep 2009 15:42:52 +0000 (15:42 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2963 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BEditingDialog.py

index 3a045d194376a311ec42d00666b33b1ab1b1233e..4fae34231e1bc1557158bcde35dcb875a91a86a9 100644 (file)
@@ -119,35 +119,34 @@ class BEditingDialog(QDialog):
         dialog = BVersionDialog()
         if dialog.exec_():
             version = qvariant_converter.getString(dialog.version_page.currentItem().data(Qt.UserRole))
-            if version != current_version:
-                if QMessageBox.question(
-                    dialog.version_page,
-                    self.tr("BeRTOS version update"),
-                    self.tr("Changing the BeRTOS version will destroy all the modification done on the BeRTOS sources"),
-                    QMessageBox.Ok | QMessageBox.Cancel
-                ) == QMessageBox.Ok:
-                   qApp.setOverrideCursor(QCursor(Qt.WaitCursor))
-                    dialog.version_page.setProjectInfo("SOURCES_PATH", version)
-                    dialog.version_page.setProjectInfo("OLD_SOURCES_PATH", current_version)
-                    enabled_modules = bertos_utils.enabledModules(dialog.version_page.project())
-                    old_configuration = dialog.version_page.projectInfo("CONFIGURATIONS")
-                    bertos_utils.loadSourceTree(dialog.version_page.project())
-                    bertos_utils.loadModuleData(dialog.version_page.project())
-                    new_configuration = dialog.version_page.projectInfo("CONFIGURATIONS")
-                    merged_configuration = {}
-                    for conf in new_configuration:
-                        if conf in old_configuration:
-                            configuration = bertos_utils.updateConfigurationValues(new_configuration[conf], old_configuration[conf])
-                        else:
-                            configuration = new_configuration[conf]
-                        merged_configuration[conf] = configuration
-                    dialog.version_page.setProjectInfo("CONFIGURATIONS", merged_configuration)
-                    bertos_utils.setEnabledModules(dialog.version_page.project(), enabled_modules)
-                    self.module_page.fillModuleTree()
-                    qApp.restoreOverrideCursor()
-               else:
-                   # Rollback version to the previous selected one.
-                   dialog.version_page.setProjectInfo("SOURCES_PATH", current_version)
+            if QMessageBox.question(
+                dialog.version_page,
+                self.tr("BeRTOS version update"),
+                self.tr("Changing the BeRTOS version will destroy all the modification done on the BeRTOS sources"),
+                QMessageBox.Ok | QMessageBox.Cancel
+            ) == QMessageBox.Ok:
+                qApp.setOverrideCursor(QCursor(Qt.WaitCursor))
+                dialog.version_page.setProjectInfo("SOURCES_PATH", version)
+                dialog.version_page.setProjectInfo("OLD_SOURCES_PATH", current_version)
+                enabled_modules = bertos_utils.enabledModules(dialog.version_page.project())
+                old_configuration = dialog.version_page.projectInfo("CONFIGURATIONS")
+                bertos_utils.loadSourceTree(dialog.version_page.project())
+                bertos_utils.loadModuleData(dialog.version_page.project())
+                new_configuration = dialog.version_page.projectInfo("CONFIGURATIONS")
+                merged_configuration = {}
+                for conf in new_configuration:
+                    if conf in old_configuration:
+                        configuration = bertos_utils.updateConfigurationValues(new_configuration[conf], old_configuration[conf])
+                    else:
+                        configuration = new_configuration[conf]
+                    merged_configuration[conf] = configuration
+                dialog.version_page.setProjectInfo("CONFIGURATIONS", merged_configuration)
+                bertos_utils.setEnabledModules(dialog.version_page.project(), enabled_modules)
+                self.module_page.fillModuleTree()
+                qApp.restoreOverrideCursor()
+            else:
+                # Rollback version to the previous selected one.
+                dialog.version_page.setProjectInfo("SOURCES_PATH", current_version)
 
     def apply(self):
         qApp.setOverrideCursor(QCursor(Qt.WaitCursor))