- fixed the warning that old preferences found even for new installation
- in Paint Tool fixed the message to select a polygon when using the Selection: Single Polygon being overwritten by the "Grid disabled" message
This commit is contained in:
parent
440d0dde02
commit
c1fb0b5cdb
@ -308,13 +308,6 @@ class AlignObjects(AppTool):
|
|||||||
else:
|
else:
|
||||||
self.grid_status_memory = False
|
self.grid_status_memory = False
|
||||||
|
|
||||||
self.mr = self.canvas.graph_event_connect('mouse_release', self.on_mouse_click_release)
|
|
||||||
|
|
||||||
if self.app.is_legacy is False:
|
|
||||||
self.canvas.graph_event_disconnect('mouse_release', self.app.on_mouse_click_release_over_plot)
|
|
||||||
else:
|
|
||||||
self.canvas.graph_event_disconnect(self.app.mr)
|
|
||||||
|
|
||||||
self.local_connected = True
|
self.local_connected = True
|
||||||
|
|
||||||
self.aligner_old_fill_color = self.aligner_obj.fill_color
|
self.aligner_old_fill_color = self.aligner_obj.fill_color
|
||||||
@ -322,10 +315,17 @@ class AlignObjects(AppTool):
|
|||||||
self.aligned_old_fill_color = self.aligned_obj.fill_color
|
self.aligned_old_fill_color = self.aligned_obj.fill_color
|
||||||
self.aligned_old_line_color = self.aligned_obj.outline_color
|
self.aligned_old_line_color = self.aligned_obj.outline_color
|
||||||
|
|
||||||
self.app.inform.emit('%s: %s' % (_("First Point"), _("Click on the START point.")))
|
|
||||||
self.target_obj = self.aligned_obj
|
self.target_obj = self.aligned_obj
|
||||||
self.set_color()
|
self.set_color()
|
||||||
|
|
||||||
|
self.app.inform.emit('%s: %s' % (_("First Point"), _("Click on the START point.")))
|
||||||
|
self.mr = self.canvas.graph_event_connect('mouse_release', self.on_mouse_click_release)
|
||||||
|
|
||||||
|
if self.app.is_legacy is False:
|
||||||
|
self.canvas.graph_event_disconnect('mouse_release', self.app.on_mouse_click_release_over_plot)
|
||||||
|
else:
|
||||||
|
self.canvas.graph_event_disconnect(self.app.mr)
|
||||||
|
|
||||||
def on_mouse_click_release(self, event):
|
def on_mouse_click_release(self, event):
|
||||||
if self.app.is_legacy is False:
|
if self.app.is_legacy is False:
|
||||||
event_pos = event.pos
|
event_pos = event.pos
|
||||||
|
@ -9,7 +9,7 @@ from PyQt5 import QtWidgets, QtCore, QtGui
|
|||||||
|
|
||||||
from AppTool import AppTool
|
from AppTool import AppTool
|
||||||
from AppGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCInputDialog, FCButton, \
|
from AppGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCInputDialog, FCButton, \
|
||||||
FCComboBox, OptionalHideInputSection, FCSpinner
|
FCComboBox, OptionalInputSection, FCSpinner
|
||||||
from AppParsers.ParseGerber import Gerber
|
from AppParsers.ParseGerber import Gerber
|
||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
@ -484,11 +484,11 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
|
|
||||||
self.grid3.addWidget(self.exc_obj_combo, 29, 0, 1, 2)
|
self.grid3.addWidget(self.exc_obj_combo, 29, 0, 1, 2)
|
||||||
|
|
||||||
self.e_ois = OptionalHideInputSection(self.except_cb,
|
self.e_ois = OptionalInputSection(self.except_cb,
|
||||||
[
|
[
|
||||||
self.type_excobj_radio,
|
self.type_excobj_radio,
|
||||||
self.exc_obj_combo
|
self.exc_obj_combo
|
||||||
])
|
])
|
||||||
|
|
||||||
# Isolation Scope
|
# Isolation Scope
|
||||||
self.select_label = QtWidgets.QLabel('%s:' % _("Selection"))
|
self.select_label = QtWidgets.QLabel('%s:' % _("Selection"))
|
||||||
@ -1691,6 +1691,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
else:
|
else:
|
||||||
self.grid_status_memory = False
|
self.grid_status_memory = False
|
||||||
|
|
||||||
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click on a polygon to isolate it."))
|
||||||
self.mr = self.app.plotcanvas.graph_event_connect('mouse_release', self.on_poly_mouse_click_release)
|
self.mr = self.app.plotcanvas.graph_event_connect('mouse_release', self.on_poly_mouse_click_release)
|
||||||
self.kp = self.app.plotcanvas.graph_event_connect('key_press', self.on_key_press)
|
self.kp = self.app.plotcanvas.graph_event_connect('key_press', self.on_key_press)
|
||||||
|
|
||||||
@ -1703,7 +1704,6 @@ class ToolIsolation(AppTool, Gerber):
|
|||||||
# disconnect flags
|
# disconnect flags
|
||||||
self.poly_sel_disconnect_flag = True
|
self.poly_sel_disconnect_flag = True
|
||||||
|
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click on a polygon to isolate it."))
|
|
||||||
elif selection == _("Reference Object"):
|
elif selection == _("Reference Object"):
|
||||||
ref_obj = self.app.collection.get_by_name(self.reference_combo.get_value())
|
ref_obj = self.app.collection.get_by_name(self.reference_combo.get_value())
|
||||||
ref_geo = cascaded_union(ref_obj.solid_geometry)
|
ref_geo = cascaded_union(ref_obj.solid_geometry)
|
||||||
|
@ -1429,8 +1429,6 @@ class ToolPaint(AppTool, Gerber):
|
|||||||
outname=self.o_name)
|
outname=self.o_name)
|
||||||
|
|
||||||
elif self.select_method == _("Polygon Selection"):
|
elif self.select_method == _("Polygon Selection"):
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click on a polygon to paint it."))
|
|
||||||
|
|
||||||
# disengage the grid snapping since it may be hard to click on polygons with grid snapping on
|
# disengage the grid snapping since it may be hard to click on polygons with grid snapping on
|
||||||
if self.app.ui.grid_snap_btn.isChecked():
|
if self.app.ui.grid_snap_btn.isChecked():
|
||||||
self.grid_status_memory = True
|
self.grid_status_memory = True
|
||||||
@ -1438,6 +1436,8 @@ class ToolPaint(AppTool, Gerber):
|
|||||||
else:
|
else:
|
||||||
self.grid_status_memory = False
|
self.grid_status_memory = False
|
||||||
|
|
||||||
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click on a polygon to paint it."))
|
||||||
|
|
||||||
self.mr = self.app.plotcanvas.graph_event_connect('mouse_release', self.on_single_poly_mouse_release)
|
self.mr = self.app.plotcanvas.graph_event_connect('mouse_release', self.on_single_poly_mouse_release)
|
||||||
self.kp = self.app.plotcanvas.graph_event_connect('key_press', self.on_key_press)
|
self.kp = self.app.plotcanvas.graph_event_connect('key_press', self.on_key_press)
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ class App(QtCore.QObject):
|
|||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
# Write factory_defaults.FlatConfig file to disk
|
# Write factory_defaults.FlatConfig file to disk
|
||||||
FlatCAMDefaults.save_factory_defaults(os.path.join(self.data_path, "factory_defaults.FlatConfig"))
|
FlatCAMDefaults.save_factory_defaults(os.path.join(self.data_path, "factory_defaults.FlatConfig"), self.version)
|
||||||
|
|
||||||
# create a recent files json file if there is none
|
# create a recent files json file if there is none
|
||||||
try:
|
try:
|
||||||
|
@ -11,6 +11,8 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
- made the Distance Tool display the angle in values between 0 and 359.9999 degrees
|
- made the Distance Tool display the angle in values between 0 and 359.9999 degrees
|
||||||
- changed some strings
|
- changed some strings
|
||||||
|
- fixed the warning that old preferences found even for new installation
|
||||||
|
- in Paint Tool fixed the message to select a polygon when using the Selection: Single Polygon being overwritten by the "Grid disabled" message
|
||||||
|
|
||||||
31.05.2020
|
31.05.2020
|
||||||
|
|
||||||
|
@ -697,13 +697,15 @@ class FlatCAMDefaults:
|
|||||||
}
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def save_factory_defaults(cls, file_path: str):
|
def save_factory_defaults(cls, file_path: str, version: float):
|
||||||
"""Writes the factory defaults to a file at the given path, overwriting any existing file."""
|
"""Writes the factory defaults to a file at the given path, overwriting any existing file."""
|
||||||
# Delete any existing factory defaults file
|
# Delete any existing factory defaults file
|
||||||
if os.path.isfile(file_path):
|
if os.path.isfile(file_path):
|
||||||
os.chmod(file_path, stat.S_IRWXO | stat.S_IWRITE | stat.S_IWGRP)
|
os.chmod(file_path, stat.S_IRWXO | stat.S_IWRITE | stat.S_IWGRP)
|
||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
|
|
||||||
|
cls.factory_defaults['version'] = version
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# recreate a new factory defaults file and save the factory defaults data into it
|
# recreate a new factory defaults file and save the factory defaults data into it
|
||||||
f_f_def_s = open(file_path, "w")
|
f_f_def_s = open(file_path, "w")
|
||||||
@ -784,8 +786,8 @@ class FlatCAMDefaults:
|
|||||||
if defaults is None:
|
if defaults is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Perform migration if necessary
|
# Perform migration if necessary but only if the defaults dict is not empty
|
||||||
if self.__is_old_defaults(defaults):
|
if self.__is_old_defaults(defaults) and defaults:
|
||||||
self.old_defaults_found = True
|
self.old_defaults_found = True
|
||||||
defaults = self.__migrate_old_defaults(defaults=defaults)
|
defaults = self.__migrate_old_defaults(defaults=defaults)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user