- fixed the annotation plotting in the CNCJob object

- created a new InputDialog widget that has the buttons and the context menu translated and replaced the old widget throughout the app
- updated the translation strings
This commit is contained in:
Marius Stanciu
2020-11-05 16:36:41 +02:00
committed by Marius
parent a4c8737ab7
commit d4fec5ae60
27 changed files with 5318 additions and 5164 deletions

View File

@@ -17,7 +17,7 @@ from PyQt5.QtCore import Qt
from camlib import distance, arc, three_point_circle, Geometry, FlatCAMRTreeStorage
from appTool import AppTool
from appGUI.GUIElements import OptionalInputSection, FCCheckBox, FCLabel, FCComboBox, FCTextAreaRich, \
FCDoubleSpinner, FCButton, FCInputDialog, FCTree, NumericalEvalTupleEntry
FCDoubleSpinner, FCButton, FCInputDoubleSpinner, FCTree, NumericalEvalTupleEntry
from appParsers.ParseFont import *
from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point
@@ -1445,12 +1445,12 @@ class TransformEditorTool(AppTool):
return
def on_rotate_key(self):
val_box = FCInputDialog(title=_("Rotate ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_rotate']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
val_box = FCInputDoubleSpinner(title=_("Rotate ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_rotate']),
parent=self.app.ui)
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
val, ok = val_box.get_value()
if ok:
@@ -1463,12 +1463,12 @@ class TransformEditorTool(AppTool):
def on_offx_key(self):
units = self.app.defaults['units'].lower()
val_box = FCInputDialog(title=_("Offset on X axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-10000.0000, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_x']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
val_box = FCInputDoubleSpinner(title=_("Offset on X axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-10000.0000, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_x']),
parent=self.app.ui)
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
val, ok = val_box.get_value()
if ok:
@@ -1481,12 +1481,12 @@ class TransformEditorTool(AppTool):
def on_offy_key(self):
units = self.app.defaults['units'].lower()
val_box = FCInputDialog(title=_("Offset on Y axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-10000.0000, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_y']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
val_box = FCInputDoubleSpinner(title=_("Offset on Y axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-10000.0000, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_y']),
parent=self.app.ui)
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
val, ok = val_box.get_value()
if ok:
@@ -1497,12 +1497,12 @@ class TransformEditorTool(AppTool):
self.app.inform.emit('[success] %s...' % _("Offset on the Y axis canceled"))
def on_skewx_key(self):
val_box = FCInputDialog(title=_("Skew on X axis ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_x']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
val_box = FCInputDoubleSpinner(title=_("Skew on X axis ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_x']),
parent=self.app.ui)
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
val, ok = val_box.get_value()
if ok:
@@ -1513,12 +1513,12 @@ class TransformEditorTool(AppTool):
self.app.inform.emit('[success] %s...' % _("Skew on X axis canceled"))
def on_skewy_key(self):
val_box = FCInputDialog(title=_("Skew on Y axis ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_y']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
val_box = FCInputDoubleSpinner(title=_("Skew on Y axis ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_y']),
parent=self.app.ui)
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
val, ok = val_box.get_value()
if ok:

View File

@@ -19,7 +19,7 @@ import logging
from camlib import distance, arc, three_point_circle
from appGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, FCSpinner, RadioSet, EvalEntry2, \
FCInputDialog, FCButton, OptionalInputSection, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2, FCLabel
FCInputDoubleSpinner, FCButton, OptionalInputSection, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2, FCLabel
from appTool import AppTool
import numpy as np
@@ -6348,12 +6348,12 @@ class TransformEditorTool(AppTool):
return
def on_rotate_key(self):
val_box = FCInputDialog(title=_("Rotate ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_rotate']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
val_box = FCInputDoubleSpinner(title=_("Rotate ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_rotate']),
parent=self.app.ui)
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
val, ok = val_box.get_value()
if ok:
@@ -6366,11 +6366,11 @@ class TransformEditorTool(AppTool):
def on_offx_key(self):
units = self.app.defaults['units'].lower()
val_box = FCInputDialog(title=_("Offset on X axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-10000.0000, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_x']),
parent=self.app.ui)
val_box = FCInputDoubleSpinner(title=_("Offset on X axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-10000.0000, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_x']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
val, ok = val_box.get_value()
@@ -6384,12 +6384,12 @@ class TransformEditorTool(AppTool):
def on_offy_key(self):
units = self.app.defaults['units'].lower()
val_box = FCInputDialog(title=_("Offset on Y axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-10000.0000, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_y']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
val_box = FCInputDoubleSpinner(title=_("Offset on Y axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-10000.0000, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_y']),
parent=self.app.ui)
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
val, ok = val_box.get_value()
if ok:
@@ -6400,11 +6400,11 @@ class TransformEditorTool(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Offset Y cancelled"))
def on_skewx_key(self):
val_box = FCInputDialog(title=_("Skew on X axis ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_x']),
parent=self.app.ui)
val_box = FCInputDoubleSpinner(title=_("Skew on X axis ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_x']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
val, ok = val_box.get_value()
@@ -6416,11 +6416,11 @@ class TransformEditorTool(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Skew X cancelled"))
def on_skewy_key(self):
val_box = FCInputDialog(title=_("Skew on Y axis ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_y']),
parent=self.app.ui)
val_box = FCInputDoubleSpinner(title=_("Skew on Y axis ..."),
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_y']),
parent=self.app.ui)
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
val, ok = val_box.get_value()