Added code to the multi project 'Add Project' dialog to ensure, that the filename returned is absolute. If a relative one is entered it is concatenated with the path of the multi project file or the 'workspace', if it hasn't been saved yet. 5_4_x

Tue, 17 Jun 2014 19:48:58 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 17 Jun 2014 19:48:58 +0200
branch
5_4_x
changeset 3639
5234afd7a6d7
parent 3637
5ac63ebd5c4e
child 3641
8cfe4af1af36

Added code to the multi project 'Add Project' dialog to ensure, that the filename returned is absolute. If a relative one is entered it is concatenated with the path of the multi project file or the 'workspace', if it hasn't been saved yet.

MultiProject/AddProjectDialog.py file | annotate | diff | comparison | revisions
--- a/MultiProject/AddProjectDialog.py	Mon Jun 16 18:35:31 2014 +0200
+++ b/MultiProject/AddProjectDialog.py	Tue Jun 17 19:48:58 2014 +0200
@@ -7,6 +7,8 @@
 Module implementing the add project dialog.
 """
 
+import os
+
 from PyQt4.QtCore import pyqtSlot
 from PyQt4.QtGui import QDialog, QDialogButtonBox
 
@@ -78,7 +80,12 @@
             whether the project shall be the main project and a short
             description for the project
         """
-        return (self.nameEdit.text(), self.filenameEdit.text(),
+        filename = Utilities.toNativeSeparators(self.filenameEdit.text())
+        if not os.path.isabs(filename):
+            filename = Utilities.toNativeSeparators(
+                os.path.join(self.startdir, filename))
+        
+        return (self.nameEdit.text(), filename,
                 self.masterCheckBox.isChecked(),
                 self.descriptionEdit.toPlainText())
     

eric ide

mercurial