ProjectPyramid/FormSelectionDialog.py

Wed, 02 Jan 2013 10:54:20 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 02 Jan 2013 10:54:20 +0100
changeset 34
d20f7218d53c
parent 19
f4adfe6e51b0
child 54
71c83a661c83
child 56
c7adc68350dd
permissions
-rw-r--r--

Updated copyright for 2013.

2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
34
d20f7218d53c Updated copyright for 2013.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 19
diff changeset
3 # Copyright (c) 2012 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to select the template type.
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 from PyQt4.QtCore import pyqtSlot
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 from PyQt4.QtGui import QDialog, QDialogButtonBox
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .Ui_FormSelectionDialog import Ui_FormSelectionDialog
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 class FormSelectionDialog(QDialog, Ui_FormSelectionDialog):
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 """
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 Class implementing a dialog to select the template type.
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
19
f4adfe6e51b0 Corrected PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 18
diff changeset
20 def __init__(self, parent=None):
2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 Constructor
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 @param parent reference to the parent widget (QWidget)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 super().__init__(parent)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 self.setupUi(self)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 self.__templates = {
19
f4adfe6e51b0 Corrected PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 18
diff changeset
30 "html5": [self.trUtf8("Standard HTML 5 template"),
2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 '''<!DOCTYPE html>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 ''' <head>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 ''' <title></title>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 ''' <style>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 ''' </style>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 ''' </head>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 '''\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 ''' <body>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 ''' </body>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 '''</html>\n'''
19
f4adfe6e51b0 Corrected PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 18
diff changeset
41 ],
f4adfe6e51b0 Corrected PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 18
diff changeset
42 "simple": [self.trUtf8("Standard HTML template"),
18
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
43 '''<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
44 ''' "http://www.w3.org/TR/html4/strict.dtd">\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
45 ''' <head>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
46 ''' <title></title>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
47 ''' <style>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
48 ''' </style>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
49 ''' </head>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
50 '''\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
51 ''' <body>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
52 ''' </body>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
53 '''</html>\n'''
19
f4adfe6e51b0 Corrected PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 18
diff changeset
54 ],
f4adfe6e51b0 Corrected PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 18
diff changeset
55 "complex": [self.trUtf8("Chameleon template"),
18
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
56 '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
57 ''' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
58 '''<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
59 ''' xmlns:tal="http://xml.zope.org/namespaces/tal">\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
60 ''' xmlns:metal="http://xml.zope.org/namespaces/metal">\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
61 '''<head>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
62 ''' <title>The Pyramid Web Application Development Framework</title>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
63 ''' <meta http-equiv="Content-Type"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
64 ''' content="text/html;charset=UTF-8"/>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
65 ''' <meta name="keywords" content="python web application" />\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
66 ''' <meta name="description" content="pyramid web application" />\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
67 ''' <link rel="shortcut icon"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
68 ''' href="${request.static_url('site:static/favicon.ico')}" />\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
69 ''' <link rel="stylesheet"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
70 ''' href="${request.static_url('site:static/pylons.css')}"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
71 ''' type="text/css" media="screen" charset="utf-8" />\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
72 ''' <link rel="stylesheet"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
73 ''' href="http://static.pylonsproject.org/fonts/nobile/stylesheet.css"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
74 ''' media="screen" />\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
75 ''' <link rel="stylesheet"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
76 ''' href="http://static.pylonsproject.org/fonts/neuton/stylesheet.css"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
77 ''' media="screen" />\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
78 ''' <!--[if lte IE 6]>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
79 ''' <link rel="stylesheet"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
80 ''' href="${request.static_url('site:static/ie6.css')}"\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
81 ''' type="text/css" media="screen" charset="utf-8" />\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
82 ''' <![endif]-->\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
83 '''</head>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
84 '''<body>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
85 ''' <div id="wrap">\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
86 ''' <div id="top">\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
87 ''' </div>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
88 ''' <div id="middle">\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
89 ''' </div>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
90 ''' <div id="bottom">\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
91 ''' </div>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
92 ''' </div>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
93 ''' <div id="footer">\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
94 ''' <div class="footer">&copy; Copyright 2012, Somebody.</div>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
95 ''' </div>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
96 '''</body>\n'''
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
97 '''</html>\n'''
19
f4adfe6e51b0 Corrected PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 18
diff changeset
98 ],
f4adfe6e51b0 Corrected PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 18
diff changeset
99 "sections": [self.trUtf8("Mako template with sections"),
2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 '''## -*- coding: utf-8 -*-\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 '''\n'''
18
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
102 '''<!DOCTYPE html>\n'''
2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 '''<html>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 '''<head>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 ''' <title>${self.title()}</title>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 ''' ${self.head()}\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 '''</head>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 '''<body>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 ''' ${self.header()}\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 ''' ${self.tabs()}\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 ''' ${self.menu()}\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 ''' ${self.heading()}\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 ''' ${self.breadcrumbs()}\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 ''' ${next.body()}\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 ''' ${self.footer()}\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 '''</body>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 '''</html>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 '''\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 '''<%def name="title()">SimpleSite</%def>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 '''<%def name="head()"></%def>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 '''<%def name="header()"><a name="top"></a></%def>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 '''<%def name="tabs()"></%def>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 '''<%def name="menu()"></%def>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 '''<%def name="heading()"><h1>${c.heading or 'No Title'}</h1></%def>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 '''<%def name="breadcrumbs()"></%def>\n'''
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 '''<%def name="footer()"><p><a href="#top">Top ^</a></p></%def>\n'''
19
f4adfe6e51b0 Corrected PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 18
diff changeset
127 ],
2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 }
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 self.__okButton.setEnabled(False)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132
18
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
133 templates = {}
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
134 for templateType in self.__templates:
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
135 templates[self.__templates[templateType][0]] = templateType
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
136
2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 self.typeCombo.addItem("")
18
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
138 for templateString, templateType in sorted(templates.items()):
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
139 self.typeCombo.addItem(templateString, templateType)
2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 self.typeCombo.setCurrentIndex(0)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 @pyqtSlot(int)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 def on_typeCombo_currentIndexChanged(self, index):
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 """
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 Private slot to act upon a change of the selected template type.
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 @param index selected index (integer)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 """
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 templateType = self.typeCombo.itemData(index)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 if templateType:
18
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
151 self.preview.setPlainText(self.__templates[templateType][1])
2
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 self.__okButton.setEnabled(True)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 else:
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 self.preview.clear()
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 self.__okButton.setEnabled(False)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 def getTemplateText(self):
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 """
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 Public method to get the template text.
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 @return text of the template (string)
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 """
e691c51ab655 Implemented the required command actions for supporting development of Pyramid projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 templateType = self.typeCombo.itemData(self.typeCombo.currentIndex())
18
c27d4435675a Added a new template to the Form Selection dialof and corrected some issues in it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2
diff changeset
164 return self.__templates[templateType][1]

eric ide

mercurial