From: duplo Date: Tue, 20 Apr 2010 14:43:39 +0000 (+0000) Subject: Select the current preset when the user go back after preset selection X-Git-Tag: 2.5.0~425 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=39c1c5711f7cd8b27348ba8f28fbc06491174df2;p=bertos.git Select the current preset when the user go back after preset selection git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3483 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BBoardPage.py b/wizard/BBoardPage.py index e565eb82..9e70a68a 100644 --- a/wizard/BBoardPage.py +++ b/wizard/BBoardPage.py @@ -129,11 +129,14 @@ class BBoardPage(BWizardPage): self._createPresetNode(self.pageContent.boardTree, obj) def _createPresetNode(self, parent, obj): + selected_item_name = self.projectInfo("PROJECT_PRESET") item_name = obj["info"].get("name", obj["info"]["filename"]) item = QTreeWidgetItem(parent, [item_name]) item.setIcon(0, QIcon(self._getNodeIcon(obj))) children_dict = obj["children"] item.setData(0, Qt.UserRole, qvariant_converter.convertDict(obj["info"])) + if obj["info"]["path"] == selected_item_name: + self.pageContent.boardTree.setCurrentItem(item) for child in children_dict: self._createPresetNode(item, child)