- working to differentiate between temporary units change and permanent units change

This commit is contained in:
Marius Stanciu
2021-09-27 17:28:54 +03:00
committed by Marius
parent 89426e8ac3
commit 3fc0ab826f
50 changed files with 185 additions and 186 deletions

View File

@@ -3265,7 +3265,7 @@ class MainGUI(QtWidgets.QMainWindow):
# Change Units
if key == QtCore.Qt.Key.Key_Q:
# if self.app.defaults["units"] == 'MM':
# if self.app.app_units == 'MM':
# self.app.ui.general_pref_form.general_app_group.units_radio.set_value("IN")
# else:
# self.app.ui.general_pref_form.general_app_group.units_radio.set_value("MM")

View File

@@ -313,7 +313,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
:rtype: None
"""
# units
units = self.fcapp.defaults["units"].lower()
units = self.fcapp.app_units.lower()
dx_dec = str(self.fcapp.dec_format(dx, self.fcapp.decimals)) if dx else '0.0'
dy_dec = str(self.fcapp.dec_format(dy, self.fcapp.decimals)) if dy else '0.0'
@@ -416,7 +416,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
:return:
"""
try:
if self.fcapp.defaults['units'].upper() == 'MM':
if self.fcapp.app_units.upper() == 'MM':
dims = self.pagesize_dict[workspace_size]
else:
dims = (self.pagesize_dict[workspace_size][0]/25.4, self.pagesize_dict[workspace_size][1]/25.4)
@@ -620,7 +620,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
# rect.right *= 1.04
# rect.top *= 1.04
# units = self.fcapp.defaults['units'].upper()
# units = self.fcapp.app_units.upper()
# if units == 'MM':
# compensation = 0.5
# else:

View File

@@ -162,7 +162,7 @@ class PlotCanvas3d(QtCore.QObject, scene.SceneCanvas):
fsize = 8
# units
# units = self.fcapp.defaults["units"].upper()
# units = self.fcapp.app_units.upper()
# coordinates and anchors
height = fsize * 11 # 90. Constant 11 is something that works

View File

@@ -446,7 +446,7 @@ class PlotCanvasLegacy(QtCore.QObject):
super().__init__()
self.p = plotcanvas
units = self.p.app.defaults['units']
units = self.p.app.app_units
# self._text = 'Dx: %s [%s]\nDy: %s [%s]\n\nX: %s [%s]\nY: %s [%s]' % \
# ('0.0000', units, '0.0000', units, '0.0000', units, '0.0000', units)
self.on_update_text_hud()
@@ -509,7 +509,7 @@ class PlotCanvasLegacy(QtCore.QObject):
:return:
"""
# units
units = self.p.app.defaults['units'].lower()
units = self.p.app.app_units.lower()
dx_dec = str(self.p.app.dec_format(dx, self.p.app.decimals)) if dx else '0.0'
dy_dec = str(self.p.app.dec_format(dy, self.p.app.decimals)) if dy else '0.0'
@@ -553,7 +553,7 @@ class PlotCanvasLegacy(QtCore.QObject):
:return:
"""
try:
if self.app.defaults['units'].upper() == 'MM':
if self.app.app_units.upper() == 'MM':
dims = self.pagesize_dict[workspace_size]
else:
dims = (self.pagesize_dict[workspace_size][0] / 25.4, self.pagesize_dict[workspace_size][1] / 25.4)

View File

@@ -33,8 +33,6 @@ class PreferencesUIManager:
self.inform = inform
self.ignore_tab_close_event = False
self.preferences_units = "MM"
# if Preferences are changed in the Edit -> Preferences tab the value will be set to True
self.preferences_changed_flag = False