Use the native separator displaying pathnames
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 23 Feb 2009 10:35:57 +0000 (10:35 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 23 Feb 2009 10:35:57 +0000 (10:35 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2374 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BCreationPage.py
wizard/BFolderPage.py
wizard/BToolchainPage.py
wizard/BVersionPage.py

index 1cc3ab661a31cb1ff6c2fda9c4aebe7da3ad35a2..42a419cb22fcc1d144311e4e303bda5244ee84da 100644 (file)
@@ -9,6 +9,8 @@
 # Author: Lorenzo Berni <duplo@develer.com>
 #
 
+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")
index ba79b4a9edade3dc1451f073c6a846140c9daf1e..e1af7e3278f8db5cbdb00de0675b4f8f67b3ba10 100644 (file)
@@ -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("<font color='#FF0000'>Warning: the selected directory exists, \
index 4c832c4a97e31b75f194587466b6aef9bef1f535..a2ecfeb550a13f563f0f3cddac45dd8ae713c175 100644 (file)
@@ -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()"))
     
index ce72ff461607c633688a54b8189a1788dfcca17f..bdd14cba72ba508de60302c5a80f34c8026d13ad 100644 (file)
@@ -9,6 +9,8 @@
 # Author: Lorenzo Berni <duplo@develer.com>
 #
 
+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)