From 1d8749025c5782f38f21c6a41e7e60ca512c883c Mon Sep 17 00:00:00 2001 From: duplo Date: Thu, 11 Dec 2008 14:35:41 +0000 Subject: [PATCH] The add button add the bertos directory in the list git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2008 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BVersionPage.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/wizard/BVersionPage.py b/wizard/BVersionPage.py index 6f8e913c..bad8e97d 100644 --- a/wizard/BVersionPage.py +++ b/wizard/BVersionPage.py @@ -9,7 +9,9 @@ # Author: Lorenzo Berni # +from PyQt4.QtGui import * from BWizardPage import * +from libbertos import * class BVersionPage(BWizardPage): @@ -20,11 +22,30 @@ class BVersionPage(BWizardPage): self.setTitle(self.tr("Select the beRTOS version needed")) def _connectSignals(self): + self.connect(self.pageContent.versionList, SIGNAL("itemClicked(QListWidgetItem *)"), self.itemClicked) + self.connect(self.pageContent.addButton, SIGNAL("clicked()"), self.addVersion) + self.connect(self.pageContent.addButton, SIGNAL("clicked()"), self.removeVersion) + # Fake signal connection for the update button self.connect(self.pageContent.updateButton, SIGNAL("clicked()"), self.updateClicked) def _setupUi(self): - self.pageContent.updateProgressBar.setVisible(False) - self.pageContent.statusLabel.setVisible(False) + pass + + def addVersion(self): + directory = QFileDialog.getExistingDirectory(self, self.tr("Choose a directory"), QString(), QFileDialog.ShowDirsOnly | QFileDialog.DontResolveSymlinks) + if isBertosDir(directory): + version = bertosVersion(directory) + self.pageContent.versionList.addItem(QListWidgetItem(QIcon(":/images/ok.png"), version)) + else: + version = "UNCHECKED" + self.pageContent.versionList.addItem(QListWidgetItem(QIcon(":/images/warning.png"), version)) + + def removeVersion(self): + pass def updateClicked(self): - print "fake update checking" \ No newline at end of file + print "fake update checking" + + def itemClicked(self, item): + print "clicked", repr(item) + \ No newline at end of file -- 2.25.1