Merge pull request #403 from coreemu/coretk-enhance/fix-bugs

Coretk enhance/fix bugs
This commit is contained in:
bharnden 2020-03-04 14:55:10 -08:00 committed by GitHub
commit f2da8dc2c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View file

@ -57,9 +57,7 @@ class PreferencesDialog(Dialog):
label = ttk.Label(frame, text="Terminal")
label.grid(row=2, column=0, pady=PADY, padx=PADX, sticky="w")
terminals = sorted(appconfig.TERMINALS.values())
combobox = ttk.Combobox(
frame, textvariable=self.terminal, values=terminals, state="readonly"
)
combobox = ttk.Combobox(frame, textvariable=self.terminal, values=terminals)
combobox.grid(row=2, column=1, sticky="ew")
label = ttk.Label(frame, text="3D GUI")

View file

@ -90,6 +90,7 @@ class MenuAction:
if file_path:
self.add_recent_file_to_gui_config(file_path)
self.app.core.save_xml(file_path)
self.app.core.xml_file = file_path
def file_open_xml(self, event: tk.Event = None):
init_dir = self.app.core.xml_dir
@ -192,3 +193,8 @@ class MenuAction:
logging.error("unexpected number of recent files")
self.app.save_config()
self.app.menubar.update_recent_files()
def new_session(self):
self.prompt_save_running_session()
self.app.core.create_new_session()
self.app.core.xml_file = None

View file

@ -50,7 +50,7 @@ class Menubar(tk.Menu):
menu.add_command(
label="New Session",
accelerator="Ctrl+N",
command=self.app.core.create_new_session,
command=self.menuaction.new_session,
)
self.app.bind_all("<Control-n>", lambda e: self.app.core.create_new_session())
menu.add_command(
@ -58,6 +58,7 @@ class Menubar(tk.Menu):
)
self.app.bind_all("<Control-o>", self.menuaction.file_open_xml)
menu.add_command(label="Save", accelerator="Ctrl+S", command=self.save)
menu.add_command(label="Save As", command=self.menuaction.file_save_as_xml)
menu.add_command(label="Reload", underline=0, state=tk.DISABLED)
self.app.bind_all("<Control-s>", self.save)