Skip to content

Commit

Permalink
Some fixes for ProfileLib
Browse files Browse the repository at this point in the history
  • Loading branch information
jriegel committed Apr 17, 2014
1 parent 2a950d6 commit 55d0ad5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/Mod/Sketcher/App/CMakeLists.txt
Expand Up @@ -105,6 +105,7 @@ SET(Sketcher_Scripts
TestSketcherApp.py
Profiles.py
ProfileLib/Hexagon.py
ProfileLib/__init__.py
)

add_library(Sketcher SHARED ${Sketcher_SRCS})
Expand Down
8 changes: 5 additions & 3 deletions src/Mod/Sketcher/InitGui.py
Expand Up @@ -70,9 +70,11 @@ def Initialize(self):
# load the module
import SketcherGui
import Sketcher
#try:
# import Profiles
#except: pass
try:
import Profiles
except:
print "Error in Profiles module"

def GetClassName(self):
return "SketcherGui::Workbench"

Expand Down
16 changes: 11 additions & 5 deletions src/Mod/Sketcher/Profiles.py
Expand Up @@ -20,8 +20,14 @@
#* *
#***************************************************************************

import FreeCAD, FreeCADGui, Sketcher
import FreeCAD, Sketcher

if FreeCAD.GuiUp:
import FreeCADGui,SketcherGui
from PySide import QtCore, QtGui
from PySide.QtCore import Qt
from PySide.QtGui import QApplication, QCursor
from FreeCADGui import PySideUic as uic

__title__="Sketcher profile lib handling"
__author__ = "Juergen Riegel"
Expand All @@ -35,19 +41,19 @@ class _CommandProfileHexagon1:
"The basis hexagon profile command definition"
def GetResources(self):
return {'Pixmap' : 'Sketcher_Hexagon',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Creates a hexagon profile in the sketch"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Sketcher_ProfilesHexagon1","Creates a hexagon profile in the sketch"),
'Accel': "",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Sketcher_ProfilesHexagon1","Creates a hexagon profile in the sketch")}

def Activated(self):

FreeCAD.ActiveDocument.openTransaction("Create hexagon profile")
FreeCADGui.addModule("ProfileLib.Hexagon")
FreeCADGui.doCommand("Hexagon.makeHexagonSimple()")
FreeCADGui.doCommand("ProfileLib.Hexagon.makeHexagonSimple()")

def IsActive(self):
return isProfileActive()



FreeCADGui.addCommand('Sketcher_ProfilesHexagon1',_CommandProfileHexagon1())

0 comments on commit 55d0ad5

Please sign in to comment.