# Path: importerUtils.py
# def getIconPath(fileName):
# 	return os.path.join(os.path.dirname(__file__), "Resources", "icons", fileName)


import os, sys, FreeCAD, FreeCADGui
import InventorViewProviders
	import imp
	import importlib
		import SketcherGui
		import DraftGui
		import Part
	import PartDesign
	import PartDesign
from InventorViewProviders import *
from FreeCADGui            import Workbench, addCommand
from importerUtils         import getIconPath
from PySide.QtGui          import QMessageBox
from PySide.QtCore         import Qt

	def __init__(self, menuText = None, toolTip = None, pixmap = None, accel=None):
		self.resources = {}
		self.addResource('MenuText', menuText)
		self.addResource('ToolTip',  toolTip)
		self.addResource('Pixmap',   pixmap)
		self.addResource('Accel',    accel)
	def addResource(self, resource, value):
		if (not value is None):
			self.resources[resource] = value
	def GetResources(self):
		return self.resources
	def IsActive(self):
		return not (FreeCAD.ActiveDocument is None)

class _CmdAbstract(_CmdNoCommand):
	def __init__(self, menuText = None, toolTip = None, pixmap = None, accel=None):
		super(_CmdAbstract, self).__init__(menuText, toolTip, pixmap, accel)
	def Activated(self):
		dlg = QMessageBox(QMessageBox.Information, 'FreeCAD: Inventor workbench...', 'Command not ' + self.__class__.__name__ + ' yet implemented!')
		dlg.setWindowModality(Qt.ApplicationModal)
		dlg.exec_()
	def commit(self, name, commands):
		FreeCAD.ActiveDocument.openTransaction(str(name))
		for command in commands:
			FreeCADGui.doCommand(command)
		FreeCAD.ActiveDocument.commitTransaction()

# Sketch
class _CmdSketch2D(_CmdAbstract):
	def __init__(self):

# Path: importerUtils.py
# def getIconPath(fileName):
# 	return os.path.join(os.path.dirname(__file__), "Resources", "icons", fileName)


# Path: InventorWorkbench.py
import os, sys, FreeCAD, FreeCADGui
import InventorViewProviders
	import imp
	import importlib
		import SketcherGui
		import DraftGui
		import Part
	import PartDesign
	import PartDesign
from InventorViewProviders import *
from FreeCADGui            import Workbench, addCommand
from importerUtils         import getIconPath
from PySide.QtGui          import QMessageBox
from PySide.QtCore         import Qt

	def __init__(self, menuText = None, toolTip = None, pixmap = None, accel=None):
		self.resources = {}
		self.addResource('MenuText', menuText)
		self.addResource('ToolTip',  toolTip)
		self.addResource('Pixmap',   pixmap)
		self.addResource('Accel',    accel)
	def addResource(self, resource, value):
		if (not value is None):
			self.resources[resource] = value
	def GetResources(self):
		return self.resources
	def IsActive(self):
		return not (FreeCAD.ActiveDocument is None)

class _CmdAbstract(_CmdNoCommand):
	def __init__(self, menuText = None, toolTip = None, pixmap = None, accel=None):
		super(_CmdAbstract, self).__init__(menuText, toolTip, pixmap, accel)
	def Activated(self):
		dlg = QMessageBox(QMessageBox.Information, 'FreeCAD: Inventor workbench...', 'Command not ' + self.__class__.__name__ + ' yet implemented!')
		dlg.setWindowModality(Qt.ApplicationModal)
		dlg.exec_()
	def commit(self, name, commands):
		FreeCAD.ActiveDocument.openTransaction(str(name))
		for command in commands:
			FreeCADGui.doCommand(command)
		FreeCAD.ActiveDocument.commitTransaction()

# Sketch
class _CmdSketch2D(_CmdAbstract):
	def __init__(self):

		super(_CmdSketch2D, self).__init__(menuText="&2D Sketch", toolTip="Creates an 2D sketch", pixmap=getIconPath("Sketch2D.png"), accel="I, 2")
