-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathlattice2Preferences.py
64 lines (54 loc) · 1.6 KB
/
lattice2Preferences.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
__doc__ = 'module that registers preference page'
allSettings = """
Mod/Lattice2
WeakParenting True
MarkerColor #ffb300 (255,179,0)
Mod/Lattice2/Autosize
MarkerAdj 1.0
FeatureAdj 1.0
ModelAdj 1.0
AutoPosition True
Mod/Lattice2/Warnings
PopUpWarn True
PopUpErr True
LengthMismatch True
ParaSeriesRecompute True
"""
def addPreferences():
import os
import FreeCADGui as Gui
# ## this works
# import PySide.QtCore as qtc
#
# ret = \
# qtc.QResource.registerResource(os.path.dirname(__file__) + '/ui/pref/pref.rcc'.replace('/', os.path.sep))
#
# if not ret:
# raise RuntimeError('Loading Lattice2/ui/pref/pref.rcc returned False, not loaded?')
#
# Gui.addPreferencePage(':/ui/lattice2-pref-general.ui','Lattice2')
## but this is better for now
Gui.addPreferencePage(os.path.dirname(__file__) + '/ui/pref/lattice2-pref-general.ui'.replace('/', os.path.sep),"Lattice2")
# ## interactive!
# Gui.addPreferencePage(MyPrefPage,'Lattice2')
# # interactive version - not now, as it requires manual parameter read/write
# from PySide import QtGui
#
# class MyPrefPage:
# form = None # the widget
#
# def __init__(self, parent=None):
# import FreeCADGui as Gui
# self.form = Gui.PySideUic.loadUi(':/ui/lattice2-pref-general.ui')
# self.form.setWindowTitle("window title")
#
# #debug:
# global prefpage
# prefpage = self.form
#
# def saveSettings(self):
# print ("saveSettings")
# def loadSettings(self):
# print ("loadSettings")
#
addPreferences()