From 5e45699c35a5cc4d077da764064010d601b52900 Mon Sep 17 00:00:00 2001 From: Juan Pablo Caram Date: Fri, 11 Sep 2015 15:19:28 -0400 Subject: [PATCH] Fixes #120. --- FlatCAMApp.py | 5 +++++ FlatCAMDraw.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index b05ffb48..b2f286cc 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -2186,6 +2186,11 @@ class App(QtCore.QObject): return 'Ok' def write_gcode(obj_name, filename, preamble='', postamble=''): + """ + Requires obj_name to be available. It might still be in the + making at the time this function is called, so check for + promises and send to background if there are promises. + """ if self.collection.has_promises(): self.log.debug("Collection has promises. write_gcode() queued.") self.worker_task.emit({ diff --git a/FlatCAMDraw.py b/FlatCAMDraw.py index d64d4b54..8f832a44 100644 --- a/FlatCAMDraw.py +++ b/FlatCAMDraw.py @@ -827,7 +827,8 @@ class FlatCAMDraw(QtCore.QObject): """ assert isinstance(fcgeometry, Geometry) - self.clear() + self.deactivate() + self.connect_canvas_event_handlers() self.select_tool("select")