- make sure that the fixes above apply when rebooting app for theme change or for language change
This commit is contained in:
parent
24260b29b4
commit
a9d69a57fe
@ -5203,7 +5203,20 @@ class App(QtCore.QObject):
|
|||||||
del stgs
|
del stgs
|
||||||
|
|
||||||
log.debug("App.final_save() --> App UI state saved.")
|
log.debug("App.final_save() --> App UI state saved.")
|
||||||
|
|
||||||
|
# try to quit the QThread that run ArgsThread class
|
||||||
|
try:
|
||||||
self.th.quit()
|
self.th.quit()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# try to quit the Socket opened by ArgsThread class
|
||||||
|
try:
|
||||||
|
self.new_launch.listener.close()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# quit app by signalling for self.kill_app() method
|
||||||
self.close_app_signal.emit()
|
self.close_app_signal.emit()
|
||||||
|
|
||||||
def kill_app(self):
|
def kill_app(self):
|
||||||
@ -12644,13 +12657,15 @@ class ArgsThread(QtCore.QObject):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(ArgsThread, self).__init__()
|
super(ArgsThread, self).__init__()
|
||||||
|
self.listener = None
|
||||||
|
|
||||||
self.start.connect(self.run)
|
self.start.connect(self.run)
|
||||||
|
|
||||||
def my_loop(self, address):
|
def my_loop(self, address):
|
||||||
try:
|
try:
|
||||||
listener = Listener(*address)
|
self.listener = Listener(*address)
|
||||||
while True:
|
while True:
|
||||||
conn = listener.accept()
|
conn = self.listener.accept()
|
||||||
self.serve(conn)
|
self.serve(conn)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
conn = Client(*address)
|
conn = Client(*address)
|
||||||
@ -12659,7 +12674,7 @@ class ArgsThread(QtCore.QObject):
|
|||||||
# close the current instance only if there are args
|
# close the current instance only if there are args
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
try:
|
try:
|
||||||
listener.close()
|
self.listener.close()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
@ -183,6 +183,12 @@ def restart_program(app, ask=None):
|
|||||||
else:
|
else:
|
||||||
resource_loc = 'share'
|
resource_loc = 'share'
|
||||||
|
|
||||||
|
# close the Socket in ArgsThread class
|
||||||
|
app.new_launch.listener.close()
|
||||||
|
|
||||||
|
# close the QThread that runs ArgsThread class
|
||||||
|
app.th.quit()
|
||||||
|
|
||||||
if app.should_we_save and app.collection.get_list() or ask is True:
|
if app.should_we_save and app.collection.get_list() or ask is True:
|
||||||
msgbox = QtWidgets.QMessageBox()
|
msgbox = QtWidgets.QMessageBox()
|
||||||
msgbox.setText(_("There are files/objects modified in FlatCAM. "
|
msgbox.setText(_("There are files/objects modified in FlatCAM. "
|
||||||
|
@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
19.01.2020
|
19.01.2020
|
||||||
|
|
||||||
- fixed some bugs that are visible in Linux regarding the ArgsThread class: on app close we need to quit the QThread running the ArgsThread class and also close the opened Socket
|
- fixed some bugs that are visible in Linux regarding the ArgsThread class: on app close we need to quit the QThread running the ArgsThread class and also close the opened Socket
|
||||||
|
- make sure that the fixes above apply when rebooting app for theme change or for language change
|
||||||
|
|
||||||
15.01.2020
|
15.01.2020
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user