Commit 179d81bc authored by sumpfralle's avatar sumpfralle

fix repetitive loading of model files (3d view was disabled before)

closing the main window cancels a potentially running multi-threaded calculation


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@169 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 4ad99e71
...@@ -624,6 +624,12 @@ class ProjectGui: ...@@ -624,6 +624,12 @@ class ProjectGui:
def destroy(self, widget=None, data=None): def destroy(self, widget=None, data=None):
self.update_view() self.update_view()
# check if there is a running process
if self._progress_running:
self.cancel_progress()
# wait until if is finished
while self._progress_running:
time.sleep(0.5)
gtk.main_quit() gtk.main_quit()
def open(self, filename): def open(self, filename):
...@@ -665,7 +671,7 @@ class ProjectGui: ...@@ -665,7 +671,7 @@ class ProjectGui:
self.settings.set("safety_height", (2 * self.model.maxz - self.model.minz)) self.settings.set("safety_height", (2 * self.model.maxz - self.model.minz))
# do some initialization # do some initialization
self.append_to_queue(self.reset_bounds) self.append_to_queue(self.reset_bounds)
self.append_to_queue(self.toggle_3d_view, True) self.append_to_queue(self.toggle_3d_view, value=True)
self.append_to_queue(self.update_view) self.append_to_queue(self.update_view)
def load_processing_settings(self, filename=None): def load_processing_settings(self, filename=None):
......
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