Duplicate header file.
[bertos.git] / wizard / BBoardPage.py
index fd6fc9292e7a51afe8fe83fe9ec97fe813eb021a..03f96048202ba2a00a7a0458930c48aaa64c0dff 100644 (file)
@@ -28,7 +28,6 @@
 #
 # Copyright 2010 Develer S.r.l. (http://www.develer.com/)
 #
-# $Id$
 #
 # Author: Lorenzo Berni <duplo@develer.com>
 #
@@ -54,7 +53,7 @@ class BBoardPage(BWizardPage):
     
     def __init__(self):
         BWizardPage.__init__(self, const.UI_LOCATION + "/board_select.ui")
-        self.setTitle(self.tr("Select the board from the predefined ones"))
+        self.setTitle(self.tr("Select your development board"))
 
     ## Overloaded QWizardPage methods ##
 
@@ -68,6 +67,7 @@ class BBoardPage(BWizardPage):
             preset_path = preset_path["path"]
             self.setProjectInfo("PROJECT_BOARD", preset_path)
             self.setProjectInfo("PROJECT_FROM_PRESET", True)
+            self.setProjectInfo("PRESET_LOADED", False)
             return True
         else:
             return False
@@ -93,11 +93,11 @@ class BBoardPage(BWizardPage):
         """
         Overload of the BWizardPage connectSignals method.
         """
-        self.connect(self.pageContent.boardList, SIGNAL("itemSelectionChanged()"), self.updateUi)
-        self.connect(self.pageContent.boardList, SIGNAL("itemSelectionChanged()"), self, SIGNAL("completeChanged()"))
+        self.connect(self.pageContent.boardList, SIGNAL("currentItemChanged(QListWidgetItem*,QListWidgetItem*)"), self.updateUi)
+        self.connect(self.pageContent.boardList, SIGNAL("currentItemChanged(QListWidgetItem*,QListWidgetItem*)"), self, SIGNAL("completeChanged()"))
         self.connect(self.pageContent.customButton, SIGNAL("clicked()"), self.customButtonClicked)
 
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         """
         Overload of the BWizardPage reloadData method.
         """
@@ -106,6 +106,10 @@ class BBoardPage(BWizardPage):
         preset_list = preset_list["children"]
         preset_list = sorted(preset_list.values(), _cmp)
         self.setItems(preset_list)
+        project_from_preset = self.projectInfo("PROJECT_FROM_PRESET")
+        project_board = self.projectInfo("PROJECT_BOARD")
+        if not (project_from_preset and project_board):
+            self.pageContent.boardList.setCurrentRow(0)
 
     ####
 
@@ -142,4 +146,4 @@ class BBoardPage(BWizardPage):
 
     @property
     def selected(self):
-        return self.pageContent.boardList.currentItem()
\ No newline at end of file
+        return self.pageContent.boardList.currentItem()