If more than one valid toolchain are found by the wizard the first of them is selecte...
[bertos.git] / wizard / BToolchainPage.py
index 5db15b7b6645a7dcc3d711c4afc9c0247e3e2a49..25fa260f3c67587b2442e2557ea2e091b27dbb22 100644 (file)
@@ -37,6 +37,8 @@ import os
 import collections
 
 from BWizardPage import *
+from BCreationPage import BCreationPage
+
 import BToolchainSearch
 import bertos_utils
 import qvariant_converter
@@ -54,7 +56,7 @@ class BToolchainPage(BWizardPage):
     def __init__(self):
         BWizardPage.__init__(self, UI_LOCATION + "/toolchain_select.ui")
         self.setTitle(self.tr("Select toolchain"))
-        self._validation_process = None
+        self.setSubTitle(self.tr("You can look for more toolchains in your system by pressing the \"Search\" button, or manually add them with the \"+\" button"))
         self._valid_items = []
         self._toolchain_manager = ToolchainManager()
 
@@ -71,6 +73,16 @@ class BToolchainPage(BWizardPage):
         else:
             return False
 
+    def nextId(self):
+        """
+        Overload of the QWizardPage nextId method.
+        """
+        # Route to Output page if it's a predefined easy project.
+        if self.projectInfo("PROJECT_FROM_PRESET") and self.projectInfo("BASE_MODE"):
+            return self.wizard().pageIndex(BCreationPage)
+        else:
+            return QWizardPage.nextId(self)
+
     ####
 
     ## Overloaded BWizardPage methods. ##
@@ -85,7 +97,7 @@ class BToolchainPage(BWizardPage):
         """
         Connects the signals with the related slots.
         """
-        self.connect(self.pageContent.toolchainList, SIGNAL("itemSelectionChanged()"), self.selectionChanged)
+        self.connect(self.pageContent.toolchainList, SIGNAL("currentItemChanged(QListWidgetItem *, QListWidgetItem*)"), self.selectionChanged)
         self.connect(self.pageContent.addButton, SIGNAL("clicked()"), self.addToolchain)
         self.connect(self.pageContent.removeButton, SIGNAL("clicked()"), self.removeToolchain)
         self.connect(self.pageContent.searchButton, SIGNAL("clicked()"), self.searchToolchain)
@@ -98,7 +110,7 @@ class BToolchainPage(BWizardPage):
         self._clearList()
         self.setupUi()
         self._populateToolchainList()
-        if len(self._valid_items) == 1:
+        if len(self._valid_items) >= 1:
             self.pageContent.toolchainList.setCurrentItem(self._valid_items[0])
 
     ####
@@ -206,7 +218,7 @@ class BToolchainPage(BWizardPage):
         for toolchain in toolchain_list:
             self._toolchain_manager.addToolchain(toolchain, _toolchain_dict.get(toolchain, False))
         self._populateToolchainList()
-        self.showMessage(self.tr("Toolchain search result."), self.tr("%1 toolchains founded").arg(len(self._toolchain_manager.toolchains)))
+        self.showMessage(self.tr("Toolchain search result."), self.tr("%1 toolchains found").arg(len(toolchain_list)))
 
     def _validItem(self, index, infos):
         """