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/>.
import os
import sys
import re
import math
import time
import datetime
import gtk
import gobject
......@@ -37,23 +34,14 @@ import pickle
import logging
import pycam.Gui.Settings
import pycam.Cutters
import pycam.Toolpath.Generator
import pycam.Toolpath
import pycam.Importers.CXFImporter
import pycam.Importers.TestModel
import pycam.Importers
from pycam.Geometry.Point import Point, Vector
from pycam.Geometry.Plane import Plane
import pycam.Geometry.Path
import pycam.Utils.log
from pycam.Utils.locations import get_data_file_location, \
get_ui_file_location, get_external_program_location, \
get_all_program_locations
import pycam.Utils
from pycam.Geometry.utils import sqrt
import pycam.Geometry.Model
from pycam.Toolpath import Bounds
import pycam.Plugins
from pycam import VERSION
import pycam.Physics.ode_physics
......
......@@ -59,8 +59,15 @@ class ModelExport(pycam.Plugins.PluginBase):
def teardown(self):
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_event_handlers(self._event_handlers)
self.core.unregister_chain("model_export", self._fallback_model_export)
def _fallback_model_export(self, models):
if models:
......@@ -149,6 +156,9 @@ class ModelExportContour(pycam.Plugins.PluginBase):
self.core.register_chain("model_export", self.export_contour, weight=40)
return True
def teardown(self):
self.core.unregister_chain("model_export", self.export_contour)
def export_contour(self, models):
removal_list = []
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