From 696391fd790bcca8d67ee42d135b7e605f19c848 Mon Sep 17 00:00:00 2001 From: duplo Date: Tue, 13 Jan 2009 11:27:10 +0000 Subject: [PATCH] Add a label with the description of the toolchain git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2169 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BToolchainPage.py | 29 +++++++++++++++-------------- wizard/toolchain_select.ui | 10 ++++++++++ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index b9aa7609..a7438e6f 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -22,24 +22,18 @@ class BToolchainPage(BWizardPage): BWizardPage.__init__(self, "toolchain_select.ui") self.setTitle(self.tr("Select toolchain")) self._validationProcess = None + self._updateUi() #self._populateToolchainList() self._connectSignals() def _updateUi(self): - if self.pageContent.customDirBox.isChecked(): - self._enableCustomDir() - else: - self._disableCustomDir() - if self.pageContent.pathBox.isChecked() or (self.pageContent.customDirBox.isChecked() and self.pageContent.customDirList.count() != 0): - self.pageContent.doSearchButton.setEnabled(True) - else: - self.pageContent.doSearchButton.setEnabled(False) + self.pageContent.infoLabel.setVisible(False) def _populateToolchainList(self): toolchains = self.toolchains() for key, value in toolchains.items(): item = QListWidgetItem(key) - item.setData(Qt.UserRole, qvariant_converter.convertString(key)) + item.setData(Qt.UserRole, qvariant_converter.convertDict({"path": key})) self.pageContent.toolchainList.addItem(item) if value: self.validateToolchain(self.pageContent.toolchainList.row(item)) @@ -48,6 +42,9 @@ class BToolchainPage(BWizardPage): self.pageContent.toolchainList.clear() def _selectionChanged(self): + infos = qvariant_converter.getStringDict(self.pageContent.toolchainList.currentItem().data(Qt.UserRole)) + self.pageContent.infoLabel.setText("GCC " + infos["version"] + " (" + infos["build"] + ")\nTarget: " + infos["target"] + "\nThread model: " + infos["thread"]) + self.pageContent.infoLabel.setVisible(True) self.emit(SIGNAL("completeChanged()")) def _search(self): @@ -59,7 +56,7 @@ class BToolchainPage(BWizardPage): for element in toolchainList: if not element in storedToolchains.keys(): item = QListWidgetItem(element) - item.setData(Qt.UserRole, qvariant_converter.convertString(element)) + item.setData(Qt.UserRole, qvariant_converter.convertDict({"path": element})) self.pageContent.toolchainList.addItem(item) storedToolchains[element] = False self.setToolchains(storedToolchains) @@ -73,7 +70,9 @@ class BToolchainPage(BWizardPage): def _validItem(self, index, infos): item = self.pageContent.toolchainList.item(index) - item.setToolTip(qvariant_converter.getString(self.pageContent.toolchainList.item(index).data(Qt.UserRole))) + newData = qvariant_converter.getDict(self.pageContent.toolchainList.item(index).data(Qt.UserRole)) + newData.update(infos) + item.setData(Qt.UserRole, qvariant_converter.convertDict(newData)) needed = self._projectInfoRetrieve("CPU_INFOS") if infos["target"].find(qvariant_converter.getString(needed["TOOLCHAIN"])) != -1: item.setIcon(QIcon(":/images/ok.png")) @@ -98,7 +97,7 @@ class BToolchainPage(BWizardPage): def removeToolchain(self): if self.pageContent.toolchainList.currentRow() != -1: item = self.pageContent.toolchainList.takeItem(self.pageContent.toolchainList.currentRow()) - toolchain = qvariant_converter.getString(item.data(Qt.UserRole)) + toolchain = qvariant_converter.getString(qvariant_converter.getDict(item.data(Qt.UserRole))["path"]) toolchains = self.toolchains() del toolchains[toolchain] self.setToolchains(toolchains) @@ -113,7 +112,7 @@ class BToolchainPage(BWizardPage): self.validateToolchain(i) def validateToolchain(self, i): - filename = qvariant_converter.getString(self.pageContent.toolchainList.item(i).data(Qt.UserRole)) + filename = qvariant_converter.getString(qvariant_converter.getDict(self.pageContent.toolchainList.item(i).data(Qt.UserRole))["path"]) self._validationProcess = QProcess() self._validationProcess.start(filename, ["-v"]) self._validationProcess.waitForStarted(1000) @@ -134,11 +133,13 @@ class BToolchainPage(BWizardPage): def isComplete(self): if self.pageContent.toolchainList.currentRow() != -1: self._projectInfoStore("TOOLCHAIN", - qvariant_converter.getString(self.pageContent.toolchainList.item(self.pageContent.toolchainList.currentRow()).data(Qt.UserRole))) + qvariant_converter.getString( + qvariant_converter.getDict(self.pageContent.toolchainList.currentItem().data(Qt.UserRole))["path"])) return True else: return False def reloadData(self): self._clearList() + self._updateUi() self._populateToolchainList() \ No newline at end of file diff --git a/wizard/toolchain_select.ui b/wizard/toolchain_select.ui index 15f9f50c..43fa81cc 100644 --- a/wizard/toolchain_select.ui +++ b/wizard/toolchain_select.ui @@ -16,6 +16,16 @@ + + + + + + + true + + + -- 2.25.1