Files
flatcam-wsl/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py
Marius Stanciu a1530963f5 - clicking the splash screen will close it; also if an error is triggered, the error message will pop over the splash screen
- the Aperture Table in the Gerber Editor is no longer extended to show all apertures at once
- in Preferences: Excellon, Geometry and CNCJob tabs, updated the UI to the new design
2021-10-01 02:23:02 +03:00

79 lines
2.9 KiB
Python

from PyQt6 import QtGui
from PyQt6.QtCore import QSettings
from appGUI.GUIElements import RadioSet, FCCheckBox, FCLabel, FCGridLayout, FCFrame
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import appTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
class CNCJobOptPrefGroupUI(OptionsGroupUI):
def __init__(self, defaults, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "CNC Job Options Preferences", parent=None)
super(CNCJobOptPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("CNC Job Options")))
self.decimals = decimals
self.defaults = defaults
# #############################################################################################################
# GCode Frame
# #############################################################################################################
self.export_gcode_label = FCLabel('<span style="color:brown;"><b>%s</b></span>' % _("Export G-Code"))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
"make this object to a file.")
)
self.layout.addWidget(self.export_gcode_label)
qsettings = QSettings("Open Source", "FlatCAM")
if qsettings.contains("textbox_font_size"):
tb_fsize = qsettings.value('textbox_font_size', type=int)
else:
tb_fsize = 10
font = QtGui.QFont()
font.setPointSize(tb_fsize)
gcode_frame = FCFrame()
self.layout.addWidget(gcode_frame)
gcode_grid = FCGridLayout(v_spacing=5, h_spacing=3)
gcode_frame.setLayout(gcode_grid)
# Plot Kind
self.cncplot_method_label = FCLabel('%s:' % _("Plot kind"))
self.cncplot_method_label.setToolTip(
_("This selects the kind of geometries on the canvas to plot.\n"
"Those can be either of type 'Travel' which means the moves\n"
"above the work piece or it can be of type 'Cut',\n"
"which means the moves that cut into the material.")
)
self.cncplot_method_radio = RadioSet([
{"label": _("All"), "value": "all"},
{"label": _("Travel"), "value": "travel"},
{"label": _("Cut"), "value": "cut"}
], orientation='vertical')
gcode_grid.addWidget(self.cncplot_method_label, 0, 0)
gcode_grid.addWidget(self.cncplot_method_radio, 0, 1)
# Display Annotation
self.annotation_cb = FCCheckBox(_("Display Annotation"))
self.annotation_cb.setToolTip(
_("This selects if to display text annotation on the plot.\n"
"When checked it will display numbers in order for each end\n"
"of a travel line."
)
)
gcode_grid.addWidget(self.annotation_cb, 2, 0, 1, 2)
# self.layout.addStretch()