Add also files, when selecting the modules in the project loading process
[bertos.git] / wizard / BEditingDialog.py
index 773aadf767739249dd14b68760d5e72658f63df7..1b297d3879ce84d8015b984abb8f23c58954099b 100644 (file)
@@ -72,7 +72,7 @@ class BEditingDialog(QDialog):
         button_layout.addWidget(self.apply_button)
         layout.addLayout(button_layout)
         self.setLayout(layout)
-        self.setWindowTitle(self.tr("Edit %1 project").arg(os.path.basename(self.module_page.projectInfo("SOURCES_PATH"))))
+        self.setWindowTitle(self.tr("Edit \"%1\" project").arg(os.path.basename(self.module_page.projectInfo("PROJECT_PATH"))))
 
     def setupMenu(self):
         self.menu = QMenu(self.tr("Advanced options"))
@@ -93,6 +93,7 @@ class BEditingDialog(QDialog):
         toolchain_page = BToolchainPage()
        current_toolchain = toolchain_page.projectInfo("TOOLCHAIN")
         toolchain_page.reloadData()
+       # TODO: to be moved in BToolchainPage
        for toolchain_row in range(toolchain_page.pageContent.toolchainList.count()):
             toolchain = qvariant_converter.getStringDict(toolchain_page.pageContent.toolchainList.item(toolchain_row).data(Qt.UserRole))
            if toolchain["path"] == current_toolchain["path"]:
@@ -159,6 +160,9 @@ class BEditingDialog(QDialog):
                     version_page.setProjectInfo("CONFIGURATIONS", merged_configuration)
                     bertos_utils.setEnabledModules(version_page.project(), enabled_modules)
                     self.module_page.fillModuleTree()
+               else:
+                   # Rollback version to the previous selected one.
+                   version_page.setProjectInfo("SOURCES_PATH", current_version)
 
     def apply(self):
         createBertosProject(self.module_page.project(), edit=True)