add a menu option for opening recent files, hard code some example xml files for testing

This commit is contained in:
Huy Pham 2020-02-03 09:10:46 -08:00
parent 2c6307603a
commit ede9e93b52
2 changed files with 27 additions and 4 deletions

View file

@ -89,12 +89,15 @@ class MenuAction:
title="Open",
filetypes=(("XML Files", "*.xml"), ("All Files", "*")),
)
if file_path:
self.app.core.xml_file = file_path
self.app.core.xml_dir = str(os.path.dirname(file_path))
self.open_xml_task(file_path)
def open_xml_task(self, filename):
if filename:
self.app.core.xml_file = filename
self.app.core.xml_dir = str(os.path.dirname(filename))
self.prompt_save_running_session()
self.app.statusbar.progress_bar.start(5)
task = BackgroundTask(self.app, self.app.core.open_xml, args=(file_path,))
task = BackgroundTask(self.app, self.app.core.open_xml, args=(filename,))
task.start()
def gui_preferences(self):