982 "<p>The project session file <b>{0}</b> could" |
982 "<p>The project session file <b>{0}</b> could" |
983 " not be deleted.</p>").format(fn)) |
983 " not be deleted.</p>").format(fn)) |
984 |
984 |
985 def __readTasks(self): |
985 def __readTasks(self): |
986 """ |
986 """ |
987 Private method to read in the project tasks file (.e4t). |
987 Private method to read in the project tasks file (.e6t). |
988 """ |
988 """ |
989 if self.pfile is None: |
989 if self.pfile is None: |
990 E5MessageBox.critical( |
990 E5MessageBox.critical( |
991 self.ui, |
991 self.ui, |
992 self.tr("Read tasks"), |
992 self.tr("Read tasks"), |
993 self.tr("Please save the project first.")) |
993 self.tr("Please save the project first.")) |
994 return |
994 return |
995 |
995 |
996 fn, ext = os.path.splitext(os.path.basename(self.pfile)) |
996 base, ext = os.path.splitext(os.path.basename(self.pfile)) |
997 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4t'.format(fn)) |
997 fn = os.path.join(self.getProjectManagementDir(), |
|
998 '{0}.e6t'.format(base)) |
998 if not os.path.exists(fn): |
999 if not os.path.exists(fn): |
999 return |
1000 # try again with the old extension |
|
1001 fn = os.path.join(self.getProjectManagementDir(), |
|
1002 '{0}.e4t'.format(base)) |
|
1003 if not os.path.exists(fn): |
|
1004 return |
1000 f = QFile(fn) |
1005 f = QFile(fn) |
1001 if f.open(QIODevice.ReadOnly): |
1006 if f.open(QIODevice.ReadOnly): |
1002 from E5XML.TasksReader import TasksReader |
1007 from E5XML.TasksReader import TasksReader |
1003 reader = TasksReader(f, True) |
1008 reader = TasksReader(f, True) |
1004 reader.readXML() |
1009 reader.readXML() |
1011 "<p>The tasks file <b>{0}</b> could not be read.</p>") |
1016 "<p>The tasks file <b>{0}</b> could not be read.</p>") |
1012 .format(fn)) |
1017 .format(fn)) |
1013 |
1018 |
1014 def writeTasks(self): |
1019 def writeTasks(self): |
1015 """ |
1020 """ |
1016 Public method to write the tasks data to an XML file (.e4t). |
1021 Public method to write the tasks data to an XML file (.e6t). |
1017 """ |
1022 """ |
1018 if self.pfile is None: |
1023 if self.pfile is None: |
1019 return |
1024 return |
1020 |
1025 |
1021 fn, ext = os.path.splitext(os.path.basename(self.pfile)) |
1026 fn, ext = os.path.splitext(os.path.basename(self.pfile)) |
1022 |
1027 |
1023 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4t'.format(fn)) |
1028 fn = os.path.join(self.getProjectManagementDir(), '{0}.e6t'.format(fn)) |
1024 f = QFile(fn) |
1029 f = QFile(fn) |
1025 ok = f.open(QIODevice.WriteOnly) |
1030 ok = f.open(QIODevice.WriteOnly) |
1026 if not ok: |
1031 if not ok: |
1027 E5MessageBox.critical( |
1032 E5MessageBox.critical( |
1028 self.ui, |
1033 self.ui, |