layout.addLayout(button_layout)
dialog.setLayout(layout)
dialog.connect(ok_button, SIGNAL("clicked()"), dialog.accept)
- dialog.exec_()
+ if dialog.exec_():
+ toolchain = qvariant_converter.getStringDict(toolchain_page.currentItem().data(Qt.UserRole))
+ toolchain_page.setProjectInfo("TOOLCHAIN", toolchain)
def changeBertosVersion(self):
dialog = QDialog()
layout.addLayout(button_layout)
dialog.setLayout(layout)
dialog.connect(ok_button, SIGNAL("clicked()"), dialog.accept)
- dialog.exec_()
+ current_version = version_page.projectInfo("SOURCES_PATH")
+ if dialog.exec_():
+ 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:
+ version_page.setProjectInfo("SOURCES_PATH", version)
+ version_page.setProjectInfo("OLD_SOURCES_PATH", current_version)
def apply(self):
createBertosProject(self.module_page.project(), edit=True)
Enable the remove button.
"""
self.pageContent.removeButton.setEnabled(True)
-
\ No newline at end of file
+
+ def currentItem(self):
+ return self.pageContent.toolchainList.currentItem()
import winreg_importer
if version in winreg_importer.getBertosDirs():
return True
- return False
\ No newline at end of file
+ return False
+
def createBertosProject(project_info, edit=False):
directory = project_info.info("PROJECT_PATH")
sources_dir = project_info.info("SOURCES_PATH")
+ old_sources_dir = project_info.info("OLD_SOURCES_PATH")
if not edit:
if os.path.isdir(directory):
shutil.rmtree(directory, True)
# If not in editing mode it copies all the bertos sources in the /bertos subdirectory of the project
shutil.rmtree(srcdir, True)
copytree.copytree(sources_dir + "/bertos", srcdir, ignore_list=const.IGNORE_LIST)
- else:
+ elif old_sources_dir:
# If in editing mode it merges the current bertos sources with the selected ones
# TODO: implement the three way merge algotihm
#
- # mergeSources(srcdir, sources_dir, old_sources_dir)
- #
- pass
+ mergeSources(srcdir, sources_dir, old_sources_dir)
# Destination makefile
makefile = directory + "/Makefile"
makefile = open("mktemplates/Makefile").read()