- added a new TclCommand named quit_flatcam which will ... quit FlatCAM from Tcl Shell or from a script
This commit is contained in:
@@ -2050,7 +2050,8 @@ class App(QtCore.QObject):
|
|||||||
'mirror', 'ncc',
|
'mirror', 'ncc',
|
||||||
'ncc_clear', 'ncr', 'new', 'new_geometry', 'non_copper_regions', 'offset',
|
'ncc_clear', 'ncr', 'new', 'new_geometry', 'non_copper_regions', 'offset',
|
||||||
'open_excellon', 'open_gcode', 'open_gerber', 'open_project', 'options', 'paint',
|
'open_excellon', 'open_gcode', 'open_gerber', 'open_project', 'options', 'paint',
|
||||||
'pan', 'panel', 'panelize', 'plot_all', 'plot_objects', 'save', 'save_project',
|
'pan', 'panel', 'panelize', 'plot_all', 'plot_objects', 'quit_flatcam',
|
||||||
|
'save', 'save_project',
|
||||||
'save_sys', 'scale',
|
'save_sys', 'scale',
|
||||||
'set_active', 'set_sys', 'setsys', 'skew', 'subtract_poly', 'subtract_rectangle',
|
'set_active', 'set_sys', 'setsys', 'skew', 'subtract_poly', 'subtract_rectangle',
|
||||||
'version', 'write_gcode'
|
'version', 'write_gcode'
|
||||||
@@ -4536,21 +4537,27 @@ class App(QtCore.QObject):
|
|||||||
self.save_defaults()
|
self.save_defaults()
|
||||||
log.debug("App.final_save() --> App Defaults saved.")
|
log.debug("App.final_save() --> App Defaults saved.")
|
||||||
|
|
||||||
# save toolbar state to file
|
if self.cmd_line_headless != 1:
|
||||||
|
# save app state to file
|
||||||
settings = QSettings("Open Source", "FlatCAM")
|
settings = QSettings("Open Source", "FlatCAM")
|
||||||
settings.setValue('saved_gui_state', self.ui.saveState())
|
settings.setValue('saved_gui_state', self.ui.saveState())
|
||||||
settings.setValue('maximized_gui', self.ui.isMaximized())
|
settings.setValue('maximized_gui', self.ui.isMaximized())
|
||||||
settings.setValue('language', self.ui.general_defaults_form.general_app_group.language_cb.get_value())
|
settings.setValue('language', self.ui.general_defaults_form.general_app_group.language_cb.get_value())
|
||||||
settings.setValue('notebook_font_size',
|
settings.setValue(
|
||||||
self.ui.general_defaults_form.general_gui_set_group.notebook_font_size_spinner.get_value())
|
'notebook_font_size',
|
||||||
|
self.ui.general_defaults_form.general_gui_set_group.notebook_font_size_spinner.get_value()
|
||||||
|
)
|
||||||
settings.setValue('axis_font_size',
|
settings.setValue('axis_font_size',
|
||||||
self.ui.general_defaults_form.general_gui_set_group.axis_font_size_spinner.get_value())
|
self.ui.general_defaults_form.general_gui_set_group.axis_font_size_spinner.get_value())
|
||||||
settings.setValue('textbox_font_size',
|
settings.setValue(
|
||||||
self.ui.general_defaults_form.general_gui_set_group.textbox_font_size_spinner.get_value())
|
'textbox_font_size',
|
||||||
|
self.ui.general_defaults_form.general_gui_set_group.textbox_font_size_spinner.get_value()
|
||||||
|
)
|
||||||
settings.setValue('toolbar_lock', self.ui.lock_action.isChecked())
|
settings.setValue('toolbar_lock', self.ui.lock_action.isChecked())
|
||||||
|
|
||||||
# This will write the setting to the platform specific storage.
|
# This will write the setting to the platform specific storage.
|
||||||
del settings
|
del settings
|
||||||
|
|
||||||
log.debug("App.final_save() --> App UI state saved.")
|
log.debug("App.final_save() --> App UI state saved.")
|
||||||
QtWidgets.qApp.quit()
|
QtWidgets.qApp.quit()
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
- added control over the display of Sys Tray Icon in Edit -> Preferences -> General -> GUI Settings -> Sys Tray Icon checkbox
|
- added control over the display of Sys Tray Icon in Edit -> Preferences -> General -> GUI Settings -> Sys Tray Icon checkbox
|
||||||
- updated some of the default values to more reasonable ones
|
- updated some of the default values to more reasonable ones
|
||||||
- FlatCAM can be run in HEADLESS mode now. This node can be selected by using the --headless=1 command line argument or by changing the line headless=False to True in config/configuration.txt file. In this mod the Sys Tray Icon menu will hold only the Run Scrip menu entry and Exit entry.
|
- FlatCAM can be run in HEADLESS mode now. This node can be selected by using the --headless=1 command line argument or by changing the line headless=False to True in config/configuration.txt file. In this mod the Sys Tray Icon menu will hold only the Run Scrip menu entry and Exit entry.
|
||||||
|
- added a new TclCommand named quit_flatcam which will ... quit FlatCAM from Tcl Shell or from a script
|
||||||
|
|
||||||
18.09.2019
|
18.09.2019
|
||||||
|
|
||||||
|
|||||||
47
tclCommands/TclCommandQuit.py
Normal file
47
tclCommands/TclCommandQuit.py
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
from ObjectCollection import *
|
||||||
|
from tclCommands.TclCommand import TclCommand
|
||||||
|
|
||||||
|
|
||||||
|
class TclCommandQuit(TclCommand):
|
||||||
|
"""
|
||||||
|
Tcl shell command to quit FlatCAM from Tcl shell.
|
||||||
|
|
||||||
|
example:
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
|
||||||
|
aliases = ['quit_flatcam']
|
||||||
|
|
||||||
|
# Dictionary of types from Tcl command, needs to be ordered
|
||||||
|
arg_names = collections.OrderedDict([
|
||||||
|
|
||||||
|
])
|
||||||
|
|
||||||
|
# Dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
|
||||||
|
option_types = collections.OrderedDict([
|
||||||
|
|
||||||
|
])
|
||||||
|
|
||||||
|
# array of mandatory options for current Tcl command: required = {'name','outname'}
|
||||||
|
required = []
|
||||||
|
|
||||||
|
# structured help for current command, args needs to be ordered
|
||||||
|
help = {
|
||||||
|
'main': "Tcl shell command to quit FlatCAM from Tcl shell.",
|
||||||
|
'args': collections.OrderedDict([
|
||||||
|
|
||||||
|
]),
|
||||||
|
'examples': ['quit_flatcam']
|
||||||
|
}
|
||||||
|
|
||||||
|
def execute(self, args, unnamed_args):
|
||||||
|
"""
|
||||||
|
|
||||||
|
:param args:
|
||||||
|
:param unnamed_args:
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.app.quit_application()
|
||||||
|
|
||||||
@@ -48,6 +48,7 @@ import tclCommands.TclCommandPaint
|
|||||||
import tclCommands.TclCommandPanelize
|
import tclCommands.TclCommandPanelize
|
||||||
import tclCommands.TclCommandPlotAll
|
import tclCommands.TclCommandPlotAll
|
||||||
import tclCommands.TclCommandPlotObjects
|
import tclCommands.TclCommandPlotObjects
|
||||||
|
import tclCommands.TclCommandQuit
|
||||||
import tclCommands.TclCommandSaveProject
|
import tclCommands.TclCommandSaveProject
|
||||||
import tclCommands.TclCommandSaveSys
|
import tclCommands.TclCommandSaveSys
|
||||||
import tclCommands.TclCommandScale
|
import tclCommands.TclCommandScale
|
||||||
|
|||||||
Reference in New Issue
Block a user