Merge pull request #403 from coreemu/coretk-enhance/fix-bugs
Coretk enhance/fix bugs
This commit is contained in:
commit
f2da8dc2c9
3 changed files with 9 additions and 4 deletions
|
@ -57,9 +57,7 @@ class PreferencesDialog(Dialog):
|
||||||
label = ttk.Label(frame, text="Terminal")
|
label = ttk.Label(frame, text="Terminal")
|
||||||
label.grid(row=2, column=0, pady=PADY, padx=PADX, sticky="w")
|
label.grid(row=2, column=0, pady=PADY, padx=PADX, sticky="w")
|
||||||
terminals = sorted(appconfig.TERMINALS.values())
|
terminals = sorted(appconfig.TERMINALS.values())
|
||||||
combobox = ttk.Combobox(
|
combobox = ttk.Combobox(frame, textvariable=self.terminal, values=terminals)
|
||||||
frame, textvariable=self.terminal, values=terminals, state="readonly"
|
|
||||||
)
|
|
||||||
combobox.grid(row=2, column=1, sticky="ew")
|
combobox.grid(row=2, column=1, sticky="ew")
|
||||||
|
|
||||||
label = ttk.Label(frame, text="3D GUI")
|
label = ttk.Label(frame, text="3D GUI")
|
||||||
|
|
|
@ -90,6 +90,7 @@ class MenuAction:
|
||||||
if file_path:
|
if file_path:
|
||||||
self.add_recent_file_to_gui_config(file_path)
|
self.add_recent_file_to_gui_config(file_path)
|
||||||
self.app.core.save_xml(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):
|
def file_open_xml(self, event: tk.Event = None):
|
||||||
init_dir = self.app.core.xml_dir
|
init_dir = self.app.core.xml_dir
|
||||||
|
@ -192,3 +193,8 @@ class MenuAction:
|
||||||
logging.error("unexpected number of recent files")
|
logging.error("unexpected number of recent files")
|
||||||
self.app.save_config()
|
self.app.save_config()
|
||||||
self.app.menubar.update_recent_files()
|
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
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Menubar(tk.Menu):
|
||||||
menu.add_command(
|
menu.add_command(
|
||||||
label="New Session",
|
label="New Session",
|
||||||
accelerator="Ctrl+N",
|
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())
|
self.app.bind_all("<Control-n>", lambda e: self.app.core.create_new_session())
|
||||||
menu.add_command(
|
menu.add_command(
|
||||||
|
@ -58,6 +58,7 @@ class Menubar(tk.Menu):
|
||||||
)
|
)
|
||||||
self.app.bind_all("<Control-o>", self.menuaction.file_open_xml)
|
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", 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)
|
menu.add_command(label="Reload", underline=0, state=tk.DISABLED)
|
||||||
self.app.bind_all("<Control-s>", self.save)
|
self.app.bind_all("<Control-s>", self.save)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue