5476 "<p>The tasks file <b>{0}</b> could not be read.</p>") |
5476 "<p>The tasks file <b>{0}</b> could not be read.</p>") |
5477 .format(fn)) |
5477 .format(fn)) |
5478 |
5478 |
5479 def __writeSession(self): |
5479 def __writeSession(self): |
5480 """ |
5480 """ |
5481 Private slot to write the session data to an XML file (.e4s). |
5481 Private slot to write the session data to an XML file (.e5s). |
5482 """ |
5482 """ |
5483 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s") |
5483 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e5s") |
5484 f = QFile(fn) |
5484 f = QFile(fn) |
5485 if f.open(QIODevice.WriteOnly): |
5485 if f.open(QIODevice.WriteOnly): |
5486 from E5XML.SessionWriter import SessionWriter |
5486 from E5XML.SessionWriter import SessionWriter |
5487 SessionWriter(f, None).writeXML() |
5487 SessionWriter(f, None).writeXML() |
5488 f.close() |
5488 f.close() |
5494 "<p>The session file <b>{0}</b> could not be written.</p>") |
5494 "<p>The session file <b>{0}</b> could not be written.</p>") |
5495 .format(fn)) |
5495 .format(fn)) |
5496 |
5496 |
5497 def __readSession(self): |
5497 def __readSession(self): |
5498 """ |
5498 """ |
5499 Private slot to read in the session file (.e4s). |
5499 Private slot to read in the session file (.e5s or .e4s). |
5500 """ |
5500 """ |
5501 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s") |
5501 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e5s") |
5502 if not os.path.exists(fn): |
5502 if not os.path.exists(fn): |
5503 E5MessageBox.critical( |
5503 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s") |
5504 self, |
5504 if not os.path.exists(fn): |
5505 self.tr("Read session"), |
5505 E5MessageBox.critical( |
5506 self.tr( |
5506 self, |
5507 "<p>The session file <b>{0}</b> could not be read.</p>") |
5507 self.tr("Read session"), |
5508 .format(fn)) |
5508 self.tr( |
5509 return |
5509 "<p>The session file <b>{0}</b> could not" |
|
5510 " be read.</p>") |
|
5511 .format(fn)) |
|
5512 return |
5510 |
5513 |
5511 f = QFile(fn) |
5514 f = QFile(fn) |
5512 if f.open(QIODevice.ReadOnly): |
5515 if f.open(QIODevice.ReadOnly): |
5513 from E5XML.SessionReader import SessionReader |
5516 from E5XML.SessionReader import SessionReader |
5514 reader = SessionReader(f, True) |
5517 reader = SessionReader(f, True) |