- version = qvariant_converter.getString(version_page.currentItem().data(Qt.UserRole))
- if version != current_version:
- if QMessageBox.question(
- 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))
- version_page.setProjectInfo("SOURCES_PATH", version)
- version_page.setProjectInfo("OLD_SOURCES_PATH", current_version)
- enabled_modules = bertos_utils.enabledModules(version_page.project())
- old_configuration = version_page.projectInfo("CONFIGURATIONS")
- bertos_utils.loadSourceTree(version_page.project())
- bertos_utils.loadModuleData(version_page.project())
- new_configuration = version_page.projectInfo("CONFIGURATIONS")
+ version = qvariant_converter.getString(dialog.version_page.currentItem().data(Qt.UserRole))
+ 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:
+ try:
+ qApp.setOverrideCursor(QCursor(Qt.WaitCursor))
+ dialog.version_page.setProjectInfo("BERTOS_PATH", version)
+ dialog.version_page.setProjectInfo("OLD_BERTOS_PATH", current_version)
+ enabled_modules = bertos_utils.enabledModules(dialog.version_page.project)
+ old_configuration = dialog.version_page.projectInfo("CONFIGURATIONS")
+ dialog.version_page.project.loadSourceTree()
+ QApplication.instance().project.reloadCpuInfo()
+ QApplication.instance().project.loadModuleData()
+ new_configuration = dialog.version_page.projectInfo("CONFIGURATIONS")