Skip to content

Commit

Permalink
Part: AttachmentEditor: withdraw code to use Show module
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepSOIC committed Jun 19, 2016
1 parent 541e840 commit 32f5466
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 202 deletions.
2 changes: 0 additions & 2 deletions src/Mod/Part/App/CMakeLists.txt
Expand Up @@ -289,11 +289,9 @@ SET(Part_Scripts
JoinFeatures.py
AttachmentEditor/__init__.py
AttachmentEditor/Commands.py
AttachmentEditor/DepGraphTools.py
AttachmentEditor/FrozenClass.py
AttachmentEditor/TaskAttachmentEditor.py
AttachmentEditor/TaskAttachmentEditor.ui
AttachmentEditor/TempoVis.py
)

add_library(Part SHARED ${Part_SRCS})
Expand Down
82 changes: 0 additions & 82 deletions src/Mod/Part/AttachmentEditor/DepGraphTools.py

This file was deleted.

22 changes: 16 additions & 6 deletions src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py
Expand Up @@ -31,8 +31,16 @@
from Units import Quantity as Q

from AttachmentEditor.FrozenClass import FrozenClass
from AttachmentEditor.TempoVis import TempoVis
from AttachmentEditor.DepGraphTools import getAllDependent
try:
from Show.TempoVis import TempoVis
from Show.DepGraphTools import getAllDependent
except ImportError as err:
def TempoVis(doc):
return None
def getAllDependent(feature):
return []
App.Console.PrintWarning("AttachmentEditor: Failed to import some code from Show module. Functionality will be limited.\n")
App.Console.PrintWarning(err.message)

if App.GuiUp:
import FreeCADGui as Gui
Expand Down Expand Up @@ -280,9 +288,10 @@ def __init__(self, obj_to_attach,
self.updateRefButtons()

self.tv = TempoVis(self.obj.Document)
self.tv.hide_all_dependent(self.obj)
self.tv.show(self.obj)
self.tv.show([obj for (obj,subname) in self.attacher.References])
if self.tv: # tv will still be None if Show module is unavailable
self.tv.hide_all_dependent(self.obj)
self.tv.show(self.obj)
self.tv.show([obj for (obj,subname) in self.attacher.References])

# task dialog handling
def getStandardButtons(self):
Expand Down Expand Up @@ -582,4 +591,5 @@ def updatePreview(self):
def cleanUp(self):
'''stuff that needs to be done when dialog is closed.'''
Gui.Selection.removeObserver(self)
self.tv.restore()
if self.tv:
self.tv.restore()
110 changes: 0 additions & 110 deletions src/Mod/Part/AttachmentEditor/TempoVis.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/Mod/Part/CMakeLists.txt
Expand Up @@ -20,11 +20,9 @@ INSTALL(
FILES
AttachmentEditor/__init__.py
AttachmentEditor/Commands.py
AttachmentEditor/DepGraphTools.py
AttachmentEditor/FrozenClass.py
AttachmentEditor/TaskAttachmentEditor.py
AttachmentEditor/TaskAttachmentEditor.ui
AttachmentEditor/TempoVis.py
DESTINATION
Mod/Part/AttachmentEditor
)

0 comments on commit 32f5466

Please sign in to comment.