From: duplo Date: Wed, 26 May 2010 15:40:26 +0000 (+0000) Subject: Use QTextBrowser to show html text and images for boards and presets. X-Git-Tag: 2.5.0~73 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=6ef882a511647f7d078e40717303eeeccf30ea93;p=bertos.git Use QTextBrowser to show html text and images for boards and presets. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3844 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BBoardPage.py b/wizard/BBoardPage.py index 85363bd2..fd6fc929 100644 --- a/wizard/BBoardPage.py +++ b/wizard/BBoardPage.py @@ -116,13 +116,9 @@ class BBoardPage(BWizardPage): info_dict = qvariant_converter.getDict(self.selected.data(Qt.UserRole)) info_dict = qvariant_converter.getStringDict(info_dict["info"]) description = info_dict.get("description", "") - image = os.path.join(info_dict["path"], ".image.png") - if os.path.exists(image): - self.pageContent.imageLabel.setPixmap(QPixmap(image)) - self.pageContent.imageLabel.setVisible(True) - else: - self.pageContent.imageLabel.setVisible(False) - self.pageContent.descriptionLabel.setText(description) + path = unicode(QUrl.fromLocalFile(info_dict["path"]).toString()) + description = description.replace("$path", path) + self.pageContent.descriptionArea.setHtml(description) def customButtonClicked(self): self.setProjectInfo("PROJECT_FROM_PRESET", False) diff --git a/wizard/BProjectPresets.py b/wizard/BProjectPresets.py index 818f0fa7..ee6d0a06 100644 --- a/wizard/BProjectPresets.py +++ b/wizard/BProjectPresets.py @@ -87,13 +87,10 @@ class BProjectPresetsPage(QWidget): if self.selected: preset_path = qvariant_converter.getString(self.selected.data(Qt.UserRole)) preset = self.preset_data["children"][preset_path] - self.pageContent.descriptionLabel.setText(preset["info"].get("description", "")) - image = os.path.join(preset["info"]["path"], const.PREDEFINED_BOARD_IMAGE_FILE) - if os.path.exists(image): - self.pageContent.imageLabel.setPixmap(QPixmap(image)) - self.pageContent.imageLabel.setVisible(True) - else: - self.pageContent.imageLabel.setVisible(False) + description = preset["info"].get("description", "") + path = unicode(QUrl.fromLocalFile(preset_path).toString()) + description = description.replace("$path", path) + self.pageContent.descriptionArea.setHtml(description) @property def selected(self): diff --git a/wizard/ui/board_select.ui b/wizard/ui/board_select.ui index 6731a70e..80cc0de2 100644 --- a/wizard/ui/board_select.ui +++ b/wizard/ui/board_select.ui @@ -60,7 +60,7 @@ - <p><strong>Custom board project </strong>- select me when your board is not preset into the list above.</p> + <p><strong>Custom board project </strong>- select me when your board is not present into the list above.</p> Custom Board @@ -85,55 +85,10 @@ - - + + true - - - - 0 - 0 - 316 - 336 - - - - - - - - - - true - - - - - - - - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - diff --git a/wizard/ui/preset_page.ui b/wizard/ui/preset_page.ui index 00dcfcfb..0da7fc65 100644 --- a/wizard/ui/preset_page.ui +++ b/wizard/ui/preset_page.ui @@ -13,7 +13,7 @@ Form - + @@ -22,7 +22,7 @@ - + @@ -40,52 +40,10 @@ - - + + true - - - - 0 - 0 - 311 - 431 - - - - - - - - - - - - - - - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - -