From: duplo Date: Tue, 21 Apr 2009 12:36:30 +0000 (+0000) Subject: If no BeRTOS version is selected the Wizard automatically select the latest X-Git-Tag: 2.1.0~86 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=440450f9f44c7bfc5bf1813adab87716e0a422fd;p=bertos.git If no BeRTOS version is selected the Wizard automatically select the latest git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2596 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BVersionPage.py b/wizard/BVersionPage.py index fde94dbb..ed44d48b 100644 --- a/wizard/BVersionPage.py +++ b/wizard/BVersionPage.py @@ -163,6 +163,21 @@ class BVersionPage(BWizardPage): item = self.insertListElement(directory) if selected and selected == directory: self.setCurrentItem(item) + if not selected: + self.setCurrentItem(self.latestVersionItem()) + + def latestVersionItem(self): + """ + Returns the latest BeRTOS version founded. + """ + latest_version_item = QTableWidgetItem("") + for index in range(self.pageContent.versionList.count()): + item = self.pageContent.versionList.item(index) + version = item.text().split(" (")[0] + latest = latest_version_item.text().split(" (")[0] + if version != "UNKNOWN" and version > latest: + latest_version_item = item + return latest_version_item def setCurrentItem(self, item): """