Commit d99be75b authored by Guillaume Seguin's avatar Guillaume Seguin

Fix potential thread conflict in lock() behavior

parent 5a039b9f
...@@ -343,8 +343,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -343,8 +343,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
print _("Print started at: %s") % format_time(self.starttime) print _("Print started at: %s") % format_time(self.starttime)
self.compute_eta = RemainingTimeEstimator(self.fgcode) self.compute_eta = RemainingTimeEstimator(self.fgcode)
if self.settings.lockbox and self.settings.lockonstart: if self.settings.lockbox and self.settings.lockonstart:
self.locker.SetValue(True) wx.CallAfter(self.lock, force = True)
self.lock()
def endcb(self): def endcb(self):
if self.p.queueindex == 0: if self.p.queueindex == 0:
...@@ -1749,7 +1748,9 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -1749,7 +1748,9 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.paused = 0 self.paused = 0
dlg.Destroy() dlg.Destroy()
def lock(self, event = None): def lock(self, event = None, force = None):
if force != None:
self.locker.SetValue(force)
if self.locker.GetValue(): if self.locker.GetValue():
print _("Locking interface.") print _("Locking interface.")
for panel in self.panels: for panel in self.panels:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment