UI/UserInterface.py

changeset 583
08bc660d6a15
parent 564
b3d966393ba9
child 585
f40889943c0a
equal deleted inserted replaced
582:6b19bd357000 583:08bc660d6a15
5027 5027
5028 def __writeTasks(self): 5028 def __writeTasks(self):
5029 """ 5029 """
5030 Private slot to write the tasks data to an XML file (.e4t). 5030 Private slot to write the tasks data to an XML file (.e4t).
5031 """ 5031 """
5032 try: 5032 fn = os.path.join(Utilities.getConfigDir(), "eric5tasks.e4t")
5033 fn = os.path.join(Utilities.getConfigDir(), "eric5tasks.e4t") 5033 f = QFile(fn)
5034 f = open(fn, "w", encoding = "utf-8") 5034 ok = f.open(QIODevice.WriteOnly)
5035 5035 if not ok:
5036 TasksWriter(f, False).writeXML()
5037
5038 f.close()
5039
5040 except IOError:
5041 E5MessageBox.critical(self, 5036 E5MessageBox.critical(self,
5042 self.trUtf8("Save tasks"), 5037 self.trUtf8("Save tasks"),
5043 self.trUtf8("<p>The tasks file <b>{0}</b> could not be written.</p>") 5038 self.trUtf8("<p>The tasks file <b>{0}</b> could not be written.</p>")
5044 .format(fn)) 5039 .format(fn))
5040 return
5041
5042 TasksWriter(f, False).writeXML()
5043 f.close()
5045 5044
5046 def __readTasks(self): 5045 def __readTasks(self):
5047 """ 5046 """
5048 Private slot to read in the tasks file (.e4t) 5047 Private slot to read in the tasks file (.e4t)
5049 """ 5048 """

eric ide

mercurial