fix merge conflict

This commit is contained in:
Huy Pham 2020-02-04 13:05:08 -08:00
commit e2fba18ba5
12 changed files with 75 additions and 48 deletions

View file

@ -1,3 +1,5 @@
import logging
import os
import tkinter as tk
from functools import partial
from typing import TYPE_CHECKING
@ -55,6 +57,10 @@ class Menubar(tk.Menu):
menu.add_command(label="Save", accelerator="Ctrl+S", command=self.save)
menu.add_command(label="Reload", underline=0, state=tk.DISABLED)
self.app.bind_all("<Control-s>", self.save)
# some hard code values for testing
recent = tk.Menu(menu)
menu.add_cascade(label="Recent files", menu=recent)
menu.add_separator()
menu.add_command(label="Export Python script...", state=tk.DISABLED)
menu.add_command(label="Execute XML or Python script...", state=tk.DISABLED)
@ -409,6 +415,13 @@ class Menubar(tk.Menu):
menu.add_command(label="About", command=self.menuaction.show_about)
self.add_cascade(label="Help", menu=menu)
def open_recent_files(self, filename: str):
if os.path.isfile(filename):
logging.debug("Open recent file %s", filename)
self.menuaction.open_xml_task(filename)
else:
logging.warning("File does not exist %s", filename)
def save(self, event=None):
xml_file = self.app.core.xml_file
if xml_file: