Commit ed7f47eb authored by sumpfralle's avatar sumpfralle

fixed teardown of ModelExport

minor cleanup of imports for Gui.Project


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1180 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 8114f95b
...@@ -24,9 +24,6 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>. ...@@ -24,9 +24,6 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sys import sys
import re
import math
import time
import datetime import datetime
import gtk import gtk
import gobject import gobject
...@@ -37,23 +34,14 @@ import pickle ...@@ -37,23 +34,14 @@ import pickle
import logging import logging
import pycam.Gui.Settings import pycam.Gui.Settings
import pycam.Cutters
import pycam.Toolpath.Generator
import pycam.Toolpath
import pycam.Importers.CXFImporter import pycam.Importers.CXFImporter
import pycam.Importers.TestModel import pycam.Importers.TestModel
import pycam.Importers import pycam.Importers
from pycam.Geometry.Point import Point, Vector
from pycam.Geometry.Plane import Plane
import pycam.Geometry.Path
import pycam.Utils.log import pycam.Utils.log
from pycam.Utils.locations import get_data_file_location, \ from pycam.Utils.locations import get_data_file_location, \
get_ui_file_location, get_external_program_location, \ get_ui_file_location, get_external_program_location, \
get_all_program_locations get_all_program_locations
import pycam.Utils import pycam.Utils
from pycam.Geometry.utils import sqrt
import pycam.Geometry.Model
from pycam.Toolpath import Bounds
import pycam.Plugins import pycam.Plugins
from pycam import VERSION from pycam import VERSION
import pycam.Physics.ode_physics import pycam.Physics.ode_physics
......
...@@ -59,8 +59,15 @@ class ModelExport(pycam.Plugins.PluginBase): ...@@ -59,8 +59,15 @@ class ModelExport(pycam.Plugins.PluginBase):
def teardown(self): def teardown(self):
if self.gui: if self.gui:
save_action = self.gui.get_object("SaveModel")
self.core.unregister_ui("file_menu", save_action)
self.unregister_gtk_accelerator("model", save_action)
save_as_action = self.gui.get_object("SaveAsModel")
self.core.unregister_ui("file_menu", save_as_action)
self.unregister_gtk_accelerator("model", save_as_action)
self.unregister_gtk_handlers(self._gtk_handlers) self.unregister_gtk_handlers(self._gtk_handlers)
self.unregister_event_handlers(self._event_handlers) self.unregister_event_handlers(self._event_handlers)
self.core.unregister_chain("model_export", self._fallback_model_export)
def _fallback_model_export(self, models): def _fallback_model_export(self, models):
if models: if models:
...@@ -149,6 +156,9 @@ class ModelExportContour(pycam.Plugins.PluginBase): ...@@ -149,6 +156,9 @@ class ModelExportContour(pycam.Plugins.PluginBase):
self.core.register_chain("model_export", self.export_contour, weight=40) self.core.register_chain("model_export", self.export_contour, weight=40)
return True return True
def teardown(self):
self.core.unregister_chain("model_export", self.export_contour)
def export_contour(self, models): def export_contour(self, models):
removal_list = [] removal_list = []
for index, model in enumerate(models): for index, model in enumerate(models):
......
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