- fixed Scripts repeating multiple time when the Code Editor is used. This repetition was correlated with multiple openings of the Code Editor window (especially after an error)
- added the autocomplete keywords that can be changed to the defaults dictionary - modified the TclCommand New so it will no longer close all tabs when called (it closed the Code Editor tab which may have been holding the code that run)
This commit is contained in:
parent
78b6aa9a83
commit
61120911c6
|
@ -2257,6 +2257,7 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
# reference for the self.ui.code_editor
|
# reference for the self.ui.code_editor
|
||||||
self.reference_code_editor = None
|
self.reference_code_editor = None
|
||||||
|
self.script_code = ''
|
||||||
|
|
||||||
# if Preferences are changed in the Edit -> Preferences tab the value will be set to True
|
# if Preferences are changed in the Edit -> Preferences tab the value will be set to True
|
||||||
self.preferences_changed_flag = False
|
self.preferences_changed_flag = False
|
||||||
|
@ -5918,11 +5919,11 @@ class App(QtCore.QObject):
|
||||||
if self.ui.shell_dock.isHidden():
|
if self.ui.shell_dock.isHidden():
|
||||||
self.ui.shell_dock.show()
|
self.ui.shell_dock.show()
|
||||||
|
|
||||||
script_code = self.ui.code_editor.toPlainText()
|
self.script_code = deepcopy(self.ui.code_editor.toPlainText())
|
||||||
# self.shell._sysShell.exec_command(script_code)
|
# self.shell._sysShell.exec_command(script_code)
|
||||||
|
|
||||||
old_line = ''
|
old_line = ''
|
||||||
for tcl_command_line in script_code.splitlines():
|
for tcl_command_line in self.script_code.splitlines():
|
||||||
# do not process lines starting with '#' = comment and empty lines
|
# do not process lines starting with '#' = comment and empty lines
|
||||||
if not tcl_command_line.startswith('#') and tcl_command_line != '':
|
if not tcl_command_line.startswith('#') and tcl_command_line != '':
|
||||||
# id FlatCAM is run in Windows then replace all the slashes with
|
# id FlatCAM is run in Windows then replace all the slashes with
|
||||||
|
@ -5945,8 +5946,7 @@ class App(QtCore.QObject):
|
||||||
self.shell.append_output(result + '\n')
|
self.shell.append_output(result + '\n')
|
||||||
|
|
||||||
old_line = ''
|
old_line = ''
|
||||||
except tk.TclError as e:
|
except tk.TclError:
|
||||||
log.debug("App.handleRunCode() --> %s" % str(e))
|
|
||||||
old_line = old_line + tcl_command_line + '\n'
|
old_line = old_line + tcl_command_line + '\n'
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("App.handleRunCode() --> %s" % str(e))
|
log.debug("App.handleRunCode() --> %s" % str(e))
|
||||||
|
@ -7525,7 +7525,7 @@ class App(QtCore.QObject):
|
||||||
self.inform.emit('[success] %s...' %
|
self.inform.emit('[success] %s...' %
|
||||||
_("New Project created"))
|
_("New Project created"))
|
||||||
|
|
||||||
def on_file_new(self):
|
def on_file_new(self, cli=None):
|
||||||
"""
|
"""
|
||||||
Callback for menu item File->New. Returns the application to its
|
Callback for menu item File->New. Returns the application to its
|
||||||
startup state. This method is thread-safe.
|
startup state. This method is thread-safe.
|
||||||
|
@ -7585,6 +7585,7 @@ class App(QtCore.QObject):
|
||||||
# Init Tools
|
# Init Tools
|
||||||
self.init_tools()
|
self.init_tools()
|
||||||
|
|
||||||
|
if cli is None:
|
||||||
# Close any Tabs opened in the Plot Tab Area section
|
# Close any Tabs opened in the Plot Tab Area section
|
||||||
for index in range(self.ui.plot_tab_area.count()):
|
for index in range(self.ui.plot_tab_area.count()):
|
||||||
self.ui.plot_tab_area.closeTab(index)
|
self.ui.plot_tab_area.closeTab(index)
|
||||||
|
|
|
@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
16.09.2019
|
||||||
|
|
||||||
|
- modified the TclCommand New so it will no longer close all tabs when called (it closed the Code Editor tab which may have been holding the code that run)
|
||||||
|
|
||||||
15.09.2019
|
15.09.2019
|
||||||
|
|
||||||
- refactored FlatCAMGeometry.mtool_gen_cncjob() method
|
- refactored FlatCAMGeometry.mtool_gen_cncjob() method
|
||||||
|
|
|
@ -36,4 +36,4 @@ class TclCommandNew(TclCommand):
|
||||||
:return: None or exception
|
:return: None or exception
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.app.on_file_new()
|
self.app.on_file_new(cli=True)
|
||||||
|
|
Loading…
Reference in New Issue