-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathInitGui.py
94 lines (76 loc) · 3.4 KB
/
InitGui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#################################################
#
# Airfoil creation - Aircraft
#
# Copyright (c) F. Nivoix - 2018 - V0.1
#
# For FreeCAD Versions = or > 0.17 Revision xxxx
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (LGPL)
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
# for detail see the LICENCE text file.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
################################################
#------------------------------------------------------
#AirPlaneDesign
#------------------------------------------------------
import path_locator
from PySide import QtCore
import os
import FreeCADGui as Gui
import FreeCAD as App
# Qt translation handling
#from DraftGui import translate
#from DraftGui import utf8_decode
FreeCADGui.addLanguagePath(":/translations")
smWBpath = os.path.dirname(path_locator.__file__)
smWB_icons_path = os.path.join( smWBpath, 'resources', 'icons')
global main_smWB_Icon # lgtm[py/redundant-global-declaration]
main_smWB_Icon = os.path.join( smWB_icons_path , 'appicon.svg')
#def QT_TRANSLATE_NOOP(scope, text):
# return text
# Qt translation handling
def translate(context, text, disambig=None):
return QtCore.QCoreApplication.translate(context, text, disambig)
class AirPlaneDesignWorkbench(Workbench):
def __init__(self):
self.__class__.Icon = main_smWB_Icon
self.__class__.MenuText = "AirPlaneDesign"
self.__class__.ToolTip = "A description of my workbench"
def Initialize(self):
def QT_TRANSLATE_NOOP(scope, text):
return text
#"This function is executed when FreeCAD starts"
import airPlanePanel
import airPlaneRib
import airPlanePlane
import airPlaneWPanel
import airPlaneWing
import airPlaneWingWizard
import airPlaneNacelle
self.comList= ['airPlaneDesignPlane','airPlaneDesignWing','airPlaneDesignWingPanel','airPlaneDesignWRib','airPlaneDesignWingWizard','airPlaneDesignWPanel','airPlaneDesignNacelle']
# creates a new toolbar with your commands
self.appendToolbar(QT_TRANSLATE_NOOP("AirPlaneDesign", "Air Plane Design"), self.comList)
# creates a new menu
self.appendMenu([QT_TRANSLATE_NOOP("AirPlaneDesign","Air Plane Design")],self.comList)
def Activated(self):
#This function is executed when the workbench is activated
return
def Deactivated(self):
#This function is executed when the workbench is deactivated
return
def ContextMenu(self, recipient):
# This is executed whenever the user right-clicks on screen
# "recipient" will be either "view" or "tree"
self.appendContextMenu("AirPlaneDesignInitPlane",self.comlist) # add commands to the context menu
def GetClassName(self):
# this function is mandatory if this is a full python workbench
return "Gui::PythonWorkbench"
Gui.addWorkbench(AirPlaneDesignWorkbench())