ProjectPyramid/FormSelectionDialog.py

changeset 19
f4adfe6e51b0
parent 18
c27d4435675a
child 34
d20f7218d53c
equal deleted inserted replaced
18:c27d4435675a 19:f4adfe6e51b0
15 15
16 class FormSelectionDialog(QDialog, Ui_FormSelectionDialog): 16 class FormSelectionDialog(QDialog, Ui_FormSelectionDialog):
17 """ 17 """
18 Class implementing a dialog to select the template type. 18 Class implementing a dialog to select the template type.
19 """ 19 """
20 def __init__(self, parent = None): 20 def __init__(self, parent=None):
21 """ 21 """
22 Constructor 22 Constructor
23 23
24 @param parent reference to the parent widget (QWidget) 24 @param parent reference to the parent widget (QWidget)
25 """ 25 """
26 super().__init__(parent) 26 super().__init__(parent)
27 self.setupUi(self) 27 self.setupUi(self)
28 28
29 self.__templates = { 29 self.__templates = {
30 "html5" : [self.trUtf8("Standard HTML 5 template"), 30 "html5": [self.trUtf8("Standard HTML 5 template"),
31 '''<!DOCTYPE html>\n''' 31 '''<!DOCTYPE html>\n'''
32 ''' <head>\n''' 32 ''' <head>\n'''
33 ''' <title></title>\n''' 33 ''' <title></title>\n'''
34 ''' <style>\n''' 34 ''' <style>\n'''
35 ''' </style>\n''' 35 ''' </style>\n'''
36 ''' </head>\n''' 36 ''' </head>\n'''
37 '''\n''' 37 '''\n'''
38 ''' <body>\n''' 38 ''' <body>\n'''
39 ''' </body>\n''' 39 ''' </body>\n'''
40 '''</html>\n''' 40 '''</html>\n'''
41 ], 41 ],
42 "simple" : [self.trUtf8("Standard HTML template"), 42 "simple": [self.trUtf8("Standard HTML template"),
43 '''<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"\n''' 43 '''<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"\n'''
44 ''' "http://www.w3.org/TR/html4/strict.dtd">\n''' 44 ''' "http://www.w3.org/TR/html4/strict.dtd">\n'''
45 ''' <head>\n''' 45 ''' <head>\n'''
46 ''' <title></title>\n''' 46 ''' <title></title>\n'''
47 ''' <style>\n''' 47 ''' <style>\n'''
49 ''' </head>\n''' 49 ''' </head>\n'''
50 '''\n''' 50 '''\n'''
51 ''' <body>\n''' 51 ''' <body>\n'''
52 ''' </body>\n''' 52 ''' </body>\n'''
53 '''</html>\n''' 53 '''</html>\n'''
54 ], 54 ],
55 "complex" : [self.trUtf8("Chameleon template"), 55 "complex": [self.trUtf8("Chameleon template"),
56 '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n''' 56 '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n'''
57 ''' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n''' 57 ''' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n'''
58 '''<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"\n''' 58 '''<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"\n'''
59 ''' xmlns:tal="http://xml.zope.org/namespaces/tal">\n''' 59 ''' xmlns:tal="http://xml.zope.org/namespaces/tal">\n'''
60 ''' xmlns:metal="http://xml.zope.org/namespaces/metal">\n''' 60 ''' xmlns:metal="http://xml.zope.org/namespaces/metal">\n'''
93 ''' <div id="footer">\n''' 93 ''' <div id="footer">\n'''
94 ''' <div class="footer">&copy; Copyright 2012, Somebody.</div>\n''' 94 ''' <div class="footer">&copy; Copyright 2012, Somebody.</div>\n'''
95 ''' </div>\n''' 95 ''' </div>\n'''
96 '''</body>\n''' 96 '''</body>\n'''
97 '''</html>\n''' 97 '''</html>\n'''
98 ], 98 ],
99 "sections" : [self.trUtf8("Mako template with sections"), 99 "sections": [self.trUtf8("Mako template with sections"),
100 '''## -*- coding: utf-8 -*-\n''' 100 '''## -*- coding: utf-8 -*-\n'''
101 '''\n''' 101 '''\n'''
102 '''<!DOCTYPE html>\n''' 102 '''<!DOCTYPE html>\n'''
103 '''<html>\n''' 103 '''<html>\n'''
104 '''<head>\n''' 104 '''<head>\n'''
122 '''<%def name="tabs()"></%def>\n''' 122 '''<%def name="tabs()"></%def>\n'''
123 '''<%def name="menu()"></%def>\n''' 123 '''<%def name="menu()"></%def>\n'''
124 '''<%def name="heading()"><h1>${c.heading or 'No Title'}</h1></%def>\n''' 124 '''<%def name="heading()"><h1>${c.heading or 'No Title'}</h1></%def>\n'''
125 '''<%def name="breadcrumbs()"></%def>\n''' 125 '''<%def name="breadcrumbs()"></%def>\n'''
126 '''<%def name="footer()"><p><a href="#top">Top ^</a></p></%def>\n''' 126 '''<%def name="footer()"><p><a href="#top">Top ^</a></p></%def>\n'''
127 ], 127 ],
128 } 128 }
129 129
130 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) 130 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok)
131 self.__okButton.setEnabled(False) 131 self.__okButton.setEnabled(False)
132 132

eric ide

mercurial