- fixed the color set for the application objects

- made some reverts regarding the mods in the quit_application() method - problems when freezed
RELEASE 8.993
This commit is contained in:
Marius Stanciu 2020-06-06 02:36:53 +03:00 committed by Marius
parent 6d8ccaca85
commit 427f2bcbe0
4 changed files with 17 additions and 14 deletions

View File

@ -20,6 +20,8 @@ CHANGELOG for FlatCAM beta
- Tool Isolation - added a GUI element to control if the isolation of a polygon, when done with rest, should be done with the current tool even if its interiors (holes in it) could not be isolated or to be left for the next tool
- updated all the translation strings to the latest changes
- small fix
- fixed the color set for the application objects
- made some reverts regarding the mods in the quit_application() method - problems when freezed
RELEASE 8.993
4.06.2020

View File

@ -17,6 +17,7 @@ if sys.platform == "win32":
MIN_VERSION_MAJOR = 3
MIN_VERSION_MINOR = 5
def debug_trace():
"""
Set a tracepoint in the Python debugger that works with Qt

View File

@ -174,6 +174,7 @@ def restart_program(app, ask=None):
Note: this function does not return. Any cleanup action (like
saving data) must be done before calling this function.
"""
log.debug("FlatCAMTranslation.restart_program()")
theme_settings = QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
@ -188,9 +189,9 @@ def restart_program(app, ask=None):
# try to quit the Socket opened by ArgsThread class
try:
# app.new_launch.stop.emit()
app.new_launch.thread_exit = True
app.new_launch.listener.close()
app.new_launch.stop.emit()
# app.new_launch.thread_exit = True
# app.new_launch.listener.close()
except Exception as err:
log.debug("FlatCAMTranslation.restart_program() --> %s" % str(err))

View File

@ -264,8 +264,6 @@ class App(QtCore.QObject):
# graphic residues behind
cleanup = pyqtSignal()
listen_th = QtCore.QThread()
def __init__(self, user_defaults=True):
"""
Starts the application.
@ -278,13 +276,12 @@ class App(QtCore.QObject):
App.log.info("FlatCAM Starting...")
self.main_thread = QtWidgets.QApplication.instance().thread()
# ############################################################################################################
# ################# Setup the listening thread for another instance launching with args ######################
# ############################################################################################################
if sys.platform == 'win32' or sys.platform == 'linux':
# make sure the thread is stored by using a self. otherwise it's garbage collected
self.listen_th = QtCore.QThread()
self.listen_th.start(priority=QtCore.QThread.LowestPriority)
self.new_launch = ArgsThread()
@ -605,6 +602,8 @@ class App(QtCore.QObject):
self.project_filename = None
self.toggle_units_ignore = False
self.main_thread = QtWidgets.QApplication.instance().thread()
# ###########################################################################################################
# ########################################## LOAD LANGUAGES ################################################
# ###########################################################################################################
@ -3349,21 +3348,21 @@ class App(QtCore.QObject):
# try to quit the Socket opened by ArgsThread class
try:
self.new_launch.thread_exit = True
self.new_launch.listener.close()
# self.new_launch.thread_exit = True
# self.new_launch.listener.close()
self.new_launch.stop.emit()
except Exception as err:
log.debug("App.quit_application() --> %s" % str(err))
# try to quit the QThread that run ArgsThread class
try:
del self.new_launch
self.listen_th.terminate()
# del self.new_launch
self.listen_th.quit()
except Exception as e:
log.debug("App.quit_application() --> %s" % str(e))
# terminate workers
self.workers.__del__()
# self.workers.__del__()
self.clear_pool()
# quit app by signalling for self.kill_app() method
@ -9754,9 +9753,9 @@ class App(QtCore.QObject):
for sel_obj in sel_obj_list:
if sel_obj.kind == 'excellon':
alpha_level = str(hex(
self.ui.excellon_defaults_form.excellon_gen_group.color_alpha_slider.value())[2:])
self.ui.excellon_defaults_form.excellon_gen_group.excellon_alpha_entry.get_value())[2:])
elif sel_obj.kind == 'gerber':
alpha_level = str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
alpha_level = str(hex(self.ui.gerber_defaults_form.gerber_gen_group.gerber_alpha_entry.get_value())[2:])
elif sel_obj.kind == 'geometry':
alpha_level = 'FF'
else: