From 98c9cd8fdcf45680606672eb88317d76a509c9fa Mon Sep 17 00:00:00 2001 From: duplo Date: Mon, 23 Feb 2009 10:35:57 +0000 Subject: [PATCH] Use the native separator displaying pathnames git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2374 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BCreationPage.py | 8 +++++--- wizard/BFolderPage.py | 6 +++--- wizard/BToolchainPage.py | 2 +- wizard/BVersionPage.py | 6 ++++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/wizard/BCreationPage.py b/wizard/BCreationPage.py index 1cc3ab66..42a419cb 100644 --- a/wizard/BCreationPage.py +++ b/wizard/BCreationPage.py @@ -9,6 +9,8 @@ # Author: Lorenzo Berni # +import os + from PyQt4.QtGui import * from BWizardPage import * @@ -41,12 +43,12 @@ class BCreationPage(BWizardPage): self.pageContent.summaryTree.clear() topLevel = [] folderTitle = QTreeWidgetItem(QStringList([self.tr("Project folder")])) - folderItem = QTreeWidgetItem(folderTitle, QStringList([self._projectInfoRetrieve("PROJECT_PATH")])) + folderItem = QTreeWidgetItem(folderTitle, QStringList([os.path.normpath(self._projectInfoRetrieve("PROJECT_PATH"))])) topLevel.append(folderTitle) versionTitle = QTreeWidgetItem(QStringList([self.tr("BeRTOS version")])) sources_path = self._projectInfoRetrieve("SOURCES_PATH") version = QTreeWidgetItem(versionTitle, QStringList([self.tr("version: ") + bertos_utils.bertosVersion(sources_path)])) - sourcePath = QTreeWidgetItem(versionTitle, QStringList([self.tr("path: ") + sources_path])) + sourcePath = QTreeWidgetItem(versionTitle, QStringList([self.tr("path: ") + os.path.normpath(sources_path)])) topLevel.append(versionTitle) cpuTitle = QTreeWidgetItem(QStringList([self.tr("CPU")])) cpuName = QTreeWidgetItem(cpuTitle, QStringList([self.tr("cpu name: ") + self._projectInfoRetrieve("CPU_NAME")])) @@ -57,7 +59,7 @@ class BCreationPage(BWizardPage): toolchainTarget = QTreeWidgetItem(toolchainTitle, QStringList([self.tr("target: " + toolchainInfo["target"])])) if "version" in toolchainInfo.keys(): toolchainTarget = QTreeWidgetItem(toolchainTitle, QStringList([self.tr("version: " + "GCC " + toolchainInfo["version"] + " (" + toolchainInfo["build"] + ")")])) - toolchainPath = QTreeWidgetItem(toolchainTitle, QStringList([self.tr("path: " + toolchainInfo["path"])])) + toolchainPath = QTreeWidgetItem(toolchainTitle, QStringList([self.tr("path: " + os.path.normpath(toolchainInfo["path"]))])) topLevel.append(toolchainTitle) moduleTitle = QTreeWidgetItem(QStringList([self.tr("Modules")])) configurations = self._projectInfoRetrieve("CONFIGURATIONS") diff --git a/wizard/BFolderPage.py b/wizard/BFolderPage.py index ba79b4a9..e1af7e32 100644 --- a/wizard/BFolderPage.py +++ b/wizard/BFolderPage.py @@ -44,14 +44,14 @@ class BFolderPage(BWizardPage): self._setProjectPath() def _directoryChanged(self, directory): - self._destinationFolder = str(directory) + self._destinationFolder = str(QDir.toNativeSeparators(directory)) self._setProjectPath() def _setProjectPath(self): if self._destinationFolder != "" and self._projectName <> "": if not self._destinationFolder.endswith(os.sep): - self._destinationFolder += os.sep - self.pageContent.projectPath.setText(self._destinationFolder + self._projectName) + self._destinationFolder += "/" + self.pageContent.projectPath.setText(QDir.toNativeSeparators(self._destinationFolder + self._projectName)) if os.path.exists(self._destinationFolder + self._projectName): self.pageContent.warningLabel.setVisible(True) self.pageContent.warningLabel.setText(self.tr("Warning: the selected directory exists, \ diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index 4c832c4a..a2ecfeb5 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -48,7 +48,7 @@ class BToolchainPage(BWizardPage): if self.pageContent.toolchainList.currentIndex != -1: infos = collections.defaultdict(lambda: unicode("not defined")) infos.update(qvariant_converter.getStringDict(self.pageContent.toolchainList.currentItem().data(Qt.UserRole))) - self.pageContent.infoLabel.setText("GCC " + infos["version"] + " (" + infos["build"] + ")\nTarget: " + infos["target"] + "\nPath: " + infos["path"]) + self.pageContent.infoLabel.setText("GCC " + infos["version"] + " (" + infos["build"] + ")\nTarget: " + infos["target"] + "\nPath: " + os.path.normpath(infos["path"])) self.pageContent.infoLabel.setVisible(True) self.emit(SIGNAL("completeChanged()")) diff --git a/wizard/BVersionPage.py b/wizard/BVersionPage.py index ce72ff46..bdd14cba 100644 --- a/wizard/BVersionPage.py +++ b/wizard/BVersionPage.py @@ -9,6 +9,8 @@ # Author: Lorenzo Berni # +import os + from PyQt4.QtGui import * from BWizardPage import * import bertos_utils @@ -47,11 +49,11 @@ class BVersionPage(BWizardPage): def _insertListElement(self, directory): if bertos_utils.isBertosDir(directory): - item = QListWidgetItem(QIcon(":/images/ok.png"), bertos_utils.bertosVersion(directory) + " (\"" + directory + "\")") + item = QListWidgetItem(QIcon(":/images/ok.png"), bertos_utils.bertosVersion(directory) + " (\"" + os.path.normpath(directory) + "\")") item.setData(Qt.UserRole, qvariant_converter.convertString(directory)) self.pageContent.versionList.addItem(item) elif len(directory) > 0: - item = QListWidgetItem(QIcon(":/images/warning.png"), "UNKNOWN" + " (\"" + directory + "\")") + item = QListWidgetItem(QIcon(":/images/warning.png"), "UNKNOWN" + " (\"" + os.path.normpath(directory) + "\")") item.setData(Qt.UserRole, qvariant_converter.convertString(directory)) self.pageContent.versionList.addItem(item) -- 2.25.1