Merge lp:~trb143/openlp/ThemeManager into lp:openlp
- ThemeManager
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~trb143/openlp/ThemeManager |
Merge into: | lp:openlp |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~trb143/openlp/ThemeManager |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenLP Core | Pending | ||
Review via email:
|
This proposal has been superseded by a proposal from 2009-04-05.
Commit message
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Bentley (trb143) wrote : | # |
- 444. By Tim Bentley
-
Add new event for Theme Loading
Unmerged revisions
- 444. By Tim Bentley
-
Add new event for Theme Loading
- 443. By Tim Bentley
-
Add Eventing after Themes loaded to tell plugins the themes have changed
- 442. By Tim Bentley
-
Store Theme name in list for correct display
- 441. By Tim Bentley
-
Add ThemeManagerDialog
More Rendering improvements - 440. By Tim Bentley
-
Add Themes to Bible Tab and default values
- 439. By Tim Bentley
-
Add rendering for Circles and amend XML schema accordingly
- 438. By Tim Bentley
-
Renderer now supports linear gradients correctly
Update XML to include direction
Add Booleans instead of 0/1 to XML schema - 437. By Tim Bentley
-
More ThemeManager changes
Fix Rendering and theme handling
Generate PNG theme on conversion - 436. By Tim Bentley
-
Fix up Theme XML code to work with strings and files.
Fix Render.py to work with new XML schema - 435. By Tim Bentley
-
Import version 2 xml and build object.
Preview Diff
1 | === modified file 'openlp/core/__init__.py' | |||
2 | --- openlp/core/__init__.py 2009-02-28 23:19:45 +0000 | |||
3 | +++ openlp/core/__init__.py 2009-04-03 19:32:00 +0000 | |||
4 | @@ -23,7 +23,14 @@ | |||
5 | 23 | from settingsmanager import SettingsManager | 23 | from settingsmanager import SettingsManager |
6 | 24 | from pluginmanager import PluginManager | 24 | from pluginmanager import PluginManager |
7 | 25 | 25 | ||
9 | 26 | __all__ = ['Renderer', 'SettingsManager', 'PluginManager', 'translate'] | 26 | __all__ = ['Renderer', 'SettingsManager', 'PluginManager', 'translate', 'fileToXML'] |
10 | 27 | 27 | ||
11 | 28 | def translate(context, text): | 28 | def translate(context, text): |
12 | 29 | return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8) | 29 | return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8) |
13 | 30 | |||
14 | 31 | def fileToXML(xmlfile): | ||
15 | 32 | file=open(xmlfile) | ||
16 | 33 | xml =''.join(file.readlines()) # read the file and change list to a string | ||
17 | 34 | file.close() | ||
18 | 35 | return xml | ||
19 | 36 | |||
20 | 30 | 37 | ||
21 | === modified file 'openlp/core/lib/eventmanager.py' | |||
22 | --- openlp/core/lib/eventmanager.py 2009-03-25 20:30:48 +0000 | |||
23 | +++ openlp/core/lib/eventmanager.py 2009-03-30 19:58:34 +0000 | |||
24 | @@ -26,21 +26,21 @@ | |||
25 | 26 | A mechanism to send events to all registered endpoints | 26 | A mechanism to send events to all registered endpoints |
26 | 27 | the endpoints are registered and listen with a handle_event method | 27 | the endpoints are registered and listen with a handle_event method |
27 | 28 | the endpoint will decide whether to do somthing with the event or ignore it | 28 | the endpoint will decide whether to do somthing with the event or ignore it |
29 | 29 | 29 | ||
30 | 30 | """ | 30 | """ |
31 | 31 | global log | 31 | global log |
32 | 32 | log=logging.getLogger(u'EventManager') | 32 | log=logging.getLogger(u'EventManager') |
34 | 33 | 33 | ||
35 | 34 | def __init__(self): | 34 | def __init__(self): |
36 | 35 | self.endpoints=[] | 35 | self.endpoints=[] |
37 | 36 | log.info(u'Initialising') | 36 | log.info(u'Initialising') |
39 | 37 | 37 | ||
40 | 38 | def register(self, plugin): | 38 | def register(self, plugin): |
42 | 39 | log.debug(u'plugin %s registered with EventManager'%plugin) | 39 | log.debug(u'plugin %s registered with EventManager', plugin) |
43 | 40 | self.endpoints.append(plugin) | 40 | self.endpoints.append(plugin) |
45 | 41 | 41 | ||
46 | 42 | def post_event(self, event): | 42 | def post_event(self, event): |
48 | 43 | log.debug(u'post event called for event %s'%event.get_type) | 43 | log.debug(u'post event called for event %s', event.get_type) |
49 | 44 | for point in self.endpoints: | 44 | for point in self.endpoints: |
50 | 45 | point.handle_event(event) | 45 | point.handle_event(event) |
51 | 46 | 46 | ||
52 | 47 | 47 | ||
53 | === modified file 'openlp/core/lib/songxmlhandler.py' | |||
54 | --- openlp/core/lib/songxmlhandler.py 2009-03-14 07:08:15 +0000 | |||
55 | +++ openlp/core/lib/songxmlhandler.py 2009-03-31 20:16:54 +0000 | |||
56 | @@ -1,6 +1,24 @@ | |||
57 | 1 | # -*- coding: utf-8 -*- | ||
58 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | ||
59 | 3 | """ | ||
60 | 4 | OpenLP - Open Source Lyrics Projection | ||
61 | 5 | Copyright (c) 2008 Raoul Snyman | ||
62 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard | ||
63 | 7 | |||
64 | 8 | This program is free software; you can redistribute it and/or modify it under | ||
65 | 9 | the terms of the GNU General Public License as published by the Free Software | ||
66 | 10 | Foundation; version 2 of the License. | ||
67 | 11 | |||
68 | 12 | This program is distributed in the hope that it will be useful, but WITHOUT ANY | ||
69 | 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
70 | 14 | PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
71 | 15 | |||
72 | 16 | You should have received a copy of the GNU General Public License along with | ||
73 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
74 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | ||
75 | 1 | from xml.dom.minidom import Document | 19 | from xml.dom.minidom import Document |
76 | 2 | from xml.etree.ElementTree import ElementTree, XML, dump | 20 | from xml.etree.ElementTree import ElementTree, XML, dump |
78 | 3 | """ | 21 | |
79 | 4 | <?xml version="1.0" encoding="UTF-8"?> | 22 | <?xml version="1.0" encoding="UTF-8"?> |
80 | 5 | <song version="1.0"> | 23 | <song version="1.0"> |
81 | 6 | <lyrics language="en"> | 24 | <lyrics language="en"> |
82 | @@ -11,24 +29,27 @@ | |||
83 | 11 | </song> | 29 | </song> |
84 | 12 | 30 | ||
85 | 13 | """ | 31 | """ |
86 | 32 | from xml.dom.minidom import Document | ||
87 | 33 | from xml.etree.ElementTree import ElementTree, XML, dump | ||
88 | 34 | |||
89 | 14 | class SongXMLBuilder(): | 35 | class SongXMLBuilder(): |
90 | 15 | def __init__(self): | 36 | def __init__(self): |
92 | 16 | # Create the minidom document | 37 | # Create the minidom document |
93 | 17 | self.song_xml = Document() | 38 | self.song_xml = Document() |
95 | 18 | 39 | ||
96 | 19 | def new_document(self): | 40 | def new_document(self): |
97 | 20 | # Create the <song> base element | 41 | # Create the <song> base element |
98 | 21 | self.song = self.song_xml.createElement(u'song') | 42 | self.song = self.song_xml.createElement(u'song') |
99 | 22 | self.song_xml.appendChild(self.song) | 43 | self.song_xml.appendChild(self.song) |
100 | 23 | self.song.setAttribute(u'version', u'1.0') | 44 | self.song.setAttribute(u'version', u'1.0') |
102 | 24 | 45 | ||
103 | 25 | def add_lyrics_to_song(self): | 46 | def add_lyrics_to_song(self): |
104 | 26 | # Create the main <lyrics> element | 47 | # Create the main <lyrics> element |
105 | 27 | self.lyrics = self.song_xml.createElement(u'lyrics') | 48 | self.lyrics = self.song_xml.createElement(u'lyrics') |
106 | 28 | self.lyrics.setAttribute(u'language', u'en') | 49 | self.lyrics.setAttribute(u'language', u'en') |
107 | 29 | self.song.appendChild(self.lyrics) | 50 | self.song.appendChild(self.lyrics) |
110 | 30 | 51 | ||
111 | 31 | def add_verse_to_lyrics(self, type, number, content): | 52 | def add_verse_to_lyrics(self, type, number, content): |
112 | 32 | """ | 53 | """ |
113 | 33 | type - type of verse (Chorus, Verse , Bridge, Custom etc | 54 | type - type of verse (Chorus, Verse , Bridge, Custom etc |
114 | 34 | number - number of item eg verse 1 | 55 | number - number of item eg verse 1 |
115 | @@ -36,34 +57,34 @@ | |||
116 | 36 | """ | 57 | """ |
117 | 37 | verse = self.song_xml.createElement(u'verse') | 58 | verse = self.song_xml.createElement(u'verse') |
118 | 38 | verse.setAttribute(u'type', type) | 59 | verse.setAttribute(u'type', type) |
120 | 39 | verse.setAttribute(u'label', number) | 60 | verse.setAttribute(u'label', number) |
121 | 40 | self.lyrics.appendChild(verse) | 61 | self.lyrics.appendChild(verse) |
123 | 41 | 62 | ||
124 | 42 | # add data as a CDATA section | 63 | # add data as a CDATA section |
125 | 43 | cds = self.song_xml.createCDATASection(content) | 64 | cds = self.song_xml.createCDATASection(content) |
126 | 44 | verse.appendChild(cds) | 65 | verse.appendChild(cds) |
128 | 45 | 66 | ||
129 | 46 | def dump_xml(self): | 67 | def dump_xml(self): |
130 | 47 | # Debugging aid to see what we have | 68 | # Debugging aid to see what we have |
131 | 48 | print self.song_xml.toprettyxml(indent=" ") | 69 | print self.song_xml.toprettyxml(indent=" ") |
133 | 49 | 70 | ||
134 | 50 | def extract_xml(self): | 71 | def extract_xml(self): |
135 | 51 | # Print our newly created XML | 72 | # Print our newly created XML |
136 | 52 | return self.song_xml.toxml() | 73 | return self.song_xml.toxml() |
138 | 53 | 74 | ||
139 | 54 | class SongXMLParser(): | 75 | class SongXMLParser(): |
140 | 55 | def __init__(self, xml): | 76 | def __init__(self, xml): |
141 | 56 | self.song_xml = ElementTree(element=XML(xml)) | 77 | self.song_xml = ElementTree(element=XML(xml)) |
143 | 57 | 78 | ||
144 | 58 | def get_verses(self): | 79 | def get_verses(self): |
145 | 59 | #return a list of verse's and attributes | 80 | #return a list of verse's and attributes |
146 | 60 | iter=self.song_xml.getiterator() | 81 | iter=self.song_xml.getiterator() |
147 | 61 | verse_list = [] | 82 | verse_list = [] |
149 | 62 | for element in iter: | 83 | for element in iter: |
150 | 63 | if element.tag == u'verse': | 84 | if element.tag == u'verse': |
151 | 64 | verse_list.append([element.attrib, element.text]) | 85 | verse_list.append([element.attrib, element.text]) |
152 | 65 | return verse_list | 86 | return verse_list |
154 | 66 | 87 | ||
155 | 67 | def dump_xml(self): | 88 | def dump_xml(self): |
156 | 68 | # Debugging aid to see what we have | 89 | # Debugging aid to see what we have |
157 | 69 | print dump(self.song_xml) | 90 | print dump(self.song_xml) |
158 | 70 | 91 | ||
159 | === modified file 'openlp/core/lib/themexmlhandler.py' | |||
160 | --- openlp/core/lib/themexmlhandler.py 2009-03-28 20:12:22 +0000 | |||
161 | +++ openlp/core/lib/themexmlhandler.py 2009-04-04 17:36:15 +0000 | |||
162 | @@ -1,16 +1,29 @@ | |||
176 | 1 | from xml.dom.minidom import Document | 1 | # -*- coding: utf-8 -*- |
177 | 2 | from xml.etree.ElementTree import ElementTree, XML, dump | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
178 | 3 | """ | 3 | """ |
179 | 4 | <?xml version="1.0" encoding="UTF-8"?> | 4 | OpenLP - Open Source Lyrics Projection |
180 | 5 | <song version="1.0"> | 5 | Copyright (c) 2008 Raoul Snyman |
181 | 6 | <lyrics language="en"> | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard |
182 | 7 | <verse type="chorus" label="1"> | 7 | |
183 | 8 | <![CDATA[ ... ]]> | 8 | This program is free software; you can redistribute it and/or modify it under |
184 | 9 | </verse> | 9 | the terms of the GNU General Public License as published by the Free Software |
185 | 10 | </lyrics> | 10 | Foundation; version 2 of the License. |
186 | 11 | </song> | 11 | |
187 | 12 | 12 | This program is distributed in the hope that it will be useful, but WITHOUT ANY | |
188 | 13 | """ | 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
189 | 14 | PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
190 | 15 | |||
191 | 16 | You should have received a copy of the GNU General Public License along with | ||
192 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
193 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | ||
194 | 19 | from xml.dom.minidom import Document | ||
195 | 20 | from xml.etree.ElementTree import ElementTree, XML, dump | ||
196 | 21 | |||
197 | 22 | For XML Schema see wiki.openlp.org | ||
198 | 23 | """ | ||
199 | 24 | from xml.dom.minidom import Document | ||
200 | 25 | from xml.etree.ElementTree import ElementTree, XML, dump | ||
201 | 26 | |||
202 | 14 | class ThemeXMLBuilder(): | 27 | class ThemeXMLBuilder(): |
203 | 15 | def __init__(self): | 28 | def __init__(self): |
204 | 16 | # Create the minidom document | 29 | # Create the minidom document |
205 | @@ -29,12 +42,12 @@ | |||
206 | 29 | 42 | ||
207 | 30 | def add_background_transparent(self): | 43 | def add_background_transparent(self): |
208 | 31 | # Create the main <lyrics> element | 44 | # Create the main <lyrics> element |
210 | 32 | background = self.theme_xml.createElement(u'Background') | 45 | background = self.theme_xml.createElement(u'background') |
211 | 33 | background.setAttribute(u'mode', u'transparent') | 46 | background.setAttribute(u'mode', u'transparent') |
212 | 34 | self.theme.appendChild(background) | 47 | self.theme.appendChild(background) |
213 | 35 | 48 | ||
214 | 36 | def add_background_solid(self, bkcolor): | 49 | def add_background_solid(self, bkcolor): |
216 | 37 | background = self.theme_xml.createElement(u'Background') | 50 | background = self.theme_xml.createElement(u'background') |
217 | 38 | background.setAttribute(u'mode', u'opaque') | 51 | background.setAttribute(u'mode', u'opaque') |
218 | 39 | background.setAttribute(u'type', u'solid') | 52 | background.setAttribute(u'type', u'solid') |
219 | 40 | self.theme.appendChild(background) | 53 | self.theme.appendChild(background) |
220 | @@ -44,24 +57,29 @@ | |||
221 | 44 | color.appendChild(bkc) | 57 | color.appendChild(bkc) |
222 | 45 | background.appendChild(color) | 58 | background.appendChild(color) |
223 | 46 | 59 | ||
226 | 47 | def add_background_gradient(self, startcolor, endcolor): | 60 | def add_background_gradient(self, startcolor, endcolor, direction): |
227 | 48 | background = self.theme_xml.createElement(u'Background') | 61 | background = self.theme_xml.createElement(u'background') |
228 | 49 | background.setAttribute(u'mode', u'opaque') | 62 | background.setAttribute(u'mode', u'opaque') |
230 | 50 | background.setAttribute(u'type', u'gradient') | 63 | background.setAttribute(u'type', u'Gradient') |
231 | 51 | self.theme.appendChild(background) | 64 | self.theme.appendChild(background) |
232 | 52 | 65 | ||
234 | 53 | color = self.theme_xml.createElement(u'startcolor') | 66 | color = self.theme_xml.createElement(u'startColor') |
235 | 54 | bkc = self.theme_xml.createTextNode(startcolor) | 67 | bkc = self.theme_xml.createTextNode(startcolor) |
236 | 55 | color.appendChild(bkc) | 68 | color.appendChild(bkc) |
237 | 56 | background.appendChild(color) | 69 | background.appendChild(color) |
238 | 57 | 70 | ||
240 | 58 | color = self.theme_xml.createElement(u'endcolor') | 71 | color = self.theme_xml.createElement(u'endColor') |
241 | 59 | bkc = self.theme_xml.createTextNode(endcolor) | 72 | bkc = self.theme_xml.createTextNode(endcolor) |
242 | 60 | color.appendChild(bkc) | 73 | color.appendChild(bkc) |
243 | 61 | background.appendChild(color) | 74 | background.appendChild(color) |
244 | 62 | 75 | ||
247 | 63 | def add_background_image(self, filename, bordercolor): | 76 | color = self.theme_xml.createElement(u'direction') |
248 | 64 | background = self.theme_xml.createElement(u'Background') | 77 | bkc = self.theme_xml.createTextNode(direction) |
249 | 78 | color.appendChild(bkc) | ||
250 | 79 | background.appendChild(color) | ||
251 | 80 | |||
252 | 81 | def add_background_image(self, filename): | ||
253 | 82 | background = self.theme_xml.createElement(u'background') | ||
254 | 65 | background.setAttribute(u'mode', u'opaque') | 83 | background.setAttribute(u'mode', u'opaque') |
255 | 66 | background.setAttribute(u'type', u'image') | 84 | background.setAttribute(u'type', u'image') |
256 | 67 | self.theme.appendChild(background) | 85 | self.theme.appendChild(background) |
257 | @@ -71,26 +89,62 @@ | |||
258 | 71 | color.appendChild(bkc) | 89 | color.appendChild(bkc) |
259 | 72 | background.appendChild(color) | 90 | background.appendChild(color) |
260 | 73 | 91 | ||
281 | 74 | color = self.theme_xml.createElement(u'bordercolor') | 92 | def add_font(self, fontname, fontcolor, fontproportion, fonttype=u'main'): |
282 | 75 | bkc = self.theme_xml.createTextNode(bordercolor) | 93 | background = self.theme_xml.createElement(u'font') |
283 | 76 | color.appendChild(bkc) | 94 | background.setAttribute(u'type',fonttype) |
284 | 77 | background.appendChild(color) | 95 | self.theme.appendChild(background) |
285 | 78 | 96 | ||
286 | 79 | 97 | name = self.theme_xml.createElement(u'name') | |
287 | 80 | def add_verse_to_lyrics(self, type, number, content): | 98 | fn = self.theme_xml.createTextNode(fontname) |
288 | 81 | """ | 99 | name.appendChild(fn) |
289 | 82 | type - type of verse (Chorus, Verse , Bridge, Custom etc | 100 | background.appendChild(name) |
290 | 83 | number - number of item eg verse 1 | 101 | |
291 | 84 | content - the text to be stored | 102 | name = self.theme_xml.createElement(u'color') |
292 | 85 | """ | 103 | fn = self.theme_xml.createTextNode(fontcolor) |
293 | 86 | verse = self.theme_xml.createElement(u'verse') | 104 | name.appendChild(fn) |
294 | 87 | verse.setAttribute(u'type', type) | 105 | background.appendChild(name) |
295 | 88 | verse.setAttribute(u'label', number) | 106 | |
296 | 89 | self.lyrics.appendChild(verse) | 107 | name = self.theme_xml.createElement(u'proportion') |
297 | 90 | 108 | fn = self.theme_xml.createTextNode(fontproportion) | |
298 | 91 | # add data as a CDATA section | 109 | name.appendChild(fn) |
299 | 92 | cds = self.theme_xml.createCDATASection(content) | 110 | background.appendChild(name) |
300 | 93 | verse.appendChild(cds) | 111 | |
301 | 112 | def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap): | ||
302 | 113 | background = self.theme_xml.createElement(u'display') | ||
303 | 114 | self.theme.appendChild(background) | ||
304 | 115 | |||
305 | 116 | tagElement = self.theme_xml.createElement(u'shadow') | ||
306 | 117 | tagElement.setAttribute(u'color',shadowColor) | ||
307 | 118 | tagValue = self.theme_xml.createTextNode(shadow) | ||
308 | 119 | tagElement.appendChild(tagValue) | ||
309 | 120 | background.appendChild(tagElement) | ||
310 | 121 | |||
311 | 122 | tagElement = self.theme_xml.createElement(u'outline') | ||
312 | 123 | tagElement.setAttribute(u'color',outlineColor) | ||
313 | 124 | tagValue = self.theme_xml.createTextNode(outline) | ||
314 | 125 | tagElement.appendChild(tagValue) | ||
315 | 126 | background.appendChild(tagElement) | ||
316 | 127 | |||
317 | 128 | tagElement = self.theme_xml.createElement(u'horizontalAlign') | ||
318 | 129 | tagValue = self.theme_xml.createTextNode(horizontal) | ||
319 | 130 | tagElement.appendChild(tagValue) | ||
320 | 131 | background.appendChild(tagElement) | ||
321 | 132 | |||
322 | 133 | tagElement = self.theme_xml.createElement(u'verticalAlign') | ||
323 | 134 | tagValue = self.theme_xml.createTextNode(vertical) | ||
324 | 135 | tagElement.appendChild(tagValue) | ||
325 | 136 | background.appendChild(tagElement) | ||
326 | 137 | |||
327 | 138 | tagElement = self.theme_xml.createElement(u'wrapStyle') | ||
328 | 139 | tagValue = self.theme_xml.createTextNode(wrap) | ||
329 | 140 | tagElement.appendChild(tagValue) | ||
330 | 141 | background.appendChild(tagElement) | ||
331 | 142 | |||
332 | 143 | def child_element(self, tag, value): | ||
333 | 144 | tagElement = self.theme_xml.createElement(tag) | ||
334 | 145 | tagValue = self.theme_xml.createTextNode(value) | ||
335 | 146 | tagElement.appendChild(ftagValue) | ||
336 | 147 | self.background.appendChild(tagElement) | ||
337 | 94 | 148 | ||
338 | 95 | def dump_xml(self): | 149 | def dump_xml(self): |
339 | 96 | # Debugging aid to see what we have | 150 | # Debugging aid to see what we have |
340 | @@ -102,17 +156,35 @@ | |||
341 | 102 | 156 | ||
342 | 103 | class ThemeXMLParser(): | 157 | class ThemeXMLParser(): |
343 | 104 | def __init__(self, xml): | 158 | def __init__(self, xml): |
350 | 105 | self.theme_xml = ElementTree(element=XML(xml)) | 159 | theme_xml = ElementTree(element=XML(xml)) |
351 | 106 | 160 | iter=theme_xml.getiterator() | |
352 | 107 | def get_verses(self): | 161 | master = u'' |
347 | 108 | #return a list of verse's and attributes | ||
348 | 109 | iter=self.theme_xml.getiterator() | ||
349 | 110 | verse_list = [] | ||
353 | 111 | for element in iter: | 162 | for element in iter: |
357 | 112 | if element.tag == u'verse': | 163 | #print element.tag, element.text |
358 | 113 | verse_list.append([element.attrib, element.text]) | 164 | if len(element.getchildren()) > 0: |
359 | 114 | return verse_list | 165 | master= element.tag + u'_' |
360 | 166 | if len(element.attrib) > 0: | ||
361 | 167 | #print "D", element.tag , element.attrib | ||
362 | 168 | for e in element.attrib.iteritems(): | ||
363 | 169 | #print "A", master, e[0], e[1] | ||
364 | 170 | if master == u'font_' and e[0] == u'type': | ||
365 | 171 | master += e[1] + u'_' | ||
366 | 172 | elif master == u'display_' and (element.tag == u'shadow' or element.tag == u'outline'): | ||
367 | 173 | #print "b", master, element.tag, element.text, e[0], e[1] | ||
368 | 174 | setattr(self, master + element.tag , element.text) | ||
369 | 175 | setattr(self, master + element.tag +u'_'+ e[0], e[1]) | ||
370 | 176 | else: | ||
371 | 177 | field = master + e[0] | ||
372 | 178 | setattr(self, field, e[1]) | ||
373 | 179 | else: | ||
374 | 180 | #print "c", element.tag | ||
375 | 181 | if element.tag is not None : | ||
376 | 182 | field = master + element.tag | ||
377 | 183 | setattr(self, field, element.text) | ||
378 | 115 | 184 | ||
382 | 116 | def dump_xml(self): | 185 | def __str__(self): |
383 | 117 | # Debugging aid to see what we have | 186 | s = u'' |
384 | 118 | print dump(self.theme_xml) | 187 | for k in dir(self): |
385 | 188 | if k[0:1] != u'_': | ||
386 | 189 | s+= u'%30s : %s\n' %(k,getattr(self,k)) | ||
387 | 190 | return s | ||
388 | 119 | 191 | ||
389 | === modified file 'openlp/core/render.py' | |||
390 | --- openlp/core/render.py 2009-03-29 16:51:42 +0000 | |||
391 | +++ openlp/core/render.py 2009-04-04 17:36:15 +0000 | |||
392 | @@ -56,11 +56,11 @@ | |||
393 | 56 | 56 | ||
394 | 57 | def set_theme(self, theme): | 57 | def set_theme(self, theme): |
395 | 58 | self._theme=theme | 58 | self._theme=theme |
398 | 59 | if theme.BackgroundType == 2: | 59 | if theme.background_type == u'image': |
399 | 60 | self.set_bg_image(theme.BackgroundParameter1) | 60 | self.set_bg_image(theme.background_filename) |
400 | 61 | 61 | ||
401 | 62 | def set_bg_image(self, filename): | 62 | def set_bg_image(self, filename): |
403 | 63 | log.debug(u"set bg image %s", filename) | 63 | log.debug(u'set bg image %s', filename) |
404 | 64 | self._bg_image_filename=filename | 64 | self._bg_image_filename=filename |
405 | 65 | if self._paint is not None: | 65 | if self._paint is not None: |
406 | 66 | self.scale_bg_image() | 66 | self.scale_bg_image() |
407 | @@ -69,11 +69,13 @@ | |||
408 | 69 | assert self._paint | 69 | assert self._paint |
409 | 70 | i=QtGui.QImage(self._bg_image_filename) | 70 | i=QtGui.QImage(self._bg_image_filename) |
410 | 71 | # rescale and offset | 71 | # rescale and offset |
413 | 72 | imw=i.width();imh=i.height() | 72 | imw=i.width() |
414 | 73 | dcw=self._paint.width()+1;dch=self._paint.height() | 73 | imh=i.height() |
415 | 74 | dcw=self._paint.width()+1 | ||
416 | 75 | dch=self._paint.height() | ||
417 | 74 | imratio=imw/float(imh) | 76 | imratio=imw/float(imh) |
418 | 75 | dcratio=dcw/float(dch) | 77 | dcratio=dcw/float(dch) |
420 | 76 | log.debug(u"Image scaling params %s %s %s %s %s %s", imw, imh, imratio, dcw, dch, dcratio) | 78 | log.debug(u'Image scaling params %s %s %s %s %s %s', imw, imh, imratio, dcw, dch, dcratio) |
421 | 77 | if imratio > dcratio: | 79 | if imratio > dcratio: |
422 | 78 | scale=dcw/float(imw) | 80 | scale=dcw/float(imw) |
423 | 79 | elif imratio < dcratio: | 81 | elif imratio < dcratio: |
424 | @@ -94,20 +96,20 @@ | |||
425 | 94 | def set_words_openlp(self, words): | 96 | def set_words_openlp(self, words): |
426 | 95 | # log.debug(u" "set words openlp", words | 97 | # log.debug(u" "set words openlp", words |
427 | 96 | verses=[] | 98 | verses=[] |
430 | 97 | words=words.replace("\r\n", "\n") | 99 | words=words.replace(u'\r\n', u'\n') |
431 | 98 | verses_text=words.split('\n\n') | 100 | verses_text=words.split(u'\n\n') |
432 | 99 | for v in verses_text: | 101 | for v in verses_text: |
434 | 100 | lines=v.split('\n') | 102 | lines=v.split(u'\n') |
435 | 101 | verses.append(self.split_set_of_lines(lines)[0]) | 103 | verses.append(self.split_set_of_lines(lines)[0]) |
436 | 102 | self.words=verses | 104 | self.words=verses |
437 | 103 | verses_text=[] | 105 | verses_text=[] |
438 | 104 | for v in verses: | 106 | for v in verses: |
440 | 105 | verses_text.append('\n'.join(v).lstrip()) # remove first \n | 107 | verses_text.append(u'\n'.join(v).lstrip()) # remove first \n |
441 | 106 | 108 | ||
442 | 107 | return verses_text | 109 | return verses_text |
443 | 108 | 110 | ||
444 | 109 | def render_screen(self, screennum): | 111 | def render_screen(self, screennum): |
446 | 110 | log.debug(u"render screen\n %s %s ", screennum, self.words[screennum]) | 112 | log.debug(u'render screen\n %s %s ', screennum, self.words[screennum]) |
447 | 111 | import time | 113 | import time |
448 | 112 | t=0.0 | 114 | t=0.0 |
449 | 113 | words=self.words[screennum] | 115 | words=self.words[screennum] |
450 | @@ -121,40 +123,49 @@ | |||
451 | 121 | def _render_background(self): | 123 | def _render_background(self): |
452 | 122 | assert(self._theme) | 124 | assert(self._theme) |
453 | 123 | assert(self._paint) | 125 | assert(self._paint) |
455 | 124 | log.debug(u"render background %s %s", self._theme.BackgroundType) | 126 | log.debug(u'render background %s ', self._theme.background_type) |
456 | 125 | p=QtGui.QPainter() | 127 | p=QtGui.QPainter() |
457 | 126 | p.begin(self._paint) | 128 | p.begin(self._paint) |
467 | 127 | if self._theme.BackgroundType == 0: | 129 | if self._theme.background_type == u'solid': |
468 | 128 | p.fillRect(self._paint.rect(), self._theme.BackgroundParameter1) | 130 | p.fillRect(self._paint.rect(), QtGui.QColor(self._theme.background_color)) |
469 | 129 | elif self._theme.BackgroundType == 1: # gradient | 131 | elif self._theme.background_type == u'Gradient' : # gradient |
470 | 130 | #TODO Add Theme code and fix direction | 132 | gradient = None |
471 | 131 | 133 | if self._theme.background_direction == u'vertical': | |
472 | 132 | gradient = QtGui.QLinearGradient(0, 0, self._paint.width(), self._paint.height()) | 134 | w = int(self._paint.width())/2 |
473 | 133 | gradient.setColorAt(0, QtGui.QColor(255, 0, 0)) | 135 | gradient = QtGui.QLinearGradient(w, 0, w, self._paint.height()) # vertical |
474 | 134 | gradient.setColorAt(0.5, QtGui.QColor(0, 255, 0)) | 136 | elif self._theme.background_direction == u'horizontal': |
475 | 135 | gradient.setColorAt(1, QtGui.QColor(0, 0, 255)) | 137 | h = int(self._paint.height())/2 |
476 | 138 | gradient = QtGui.QLinearGradient(0, h, self._paint.width(), h) # Horizontal | ||
477 | 139 | else: | ||
478 | 140 | w = int(self._paint.width())/2 | ||
479 | 141 | h = int(self._paint.height())/2 | ||
480 | 142 | gradient = QtGui.QRadialGradient(w, h, w) # Circular | ||
481 | 143 | |||
482 | 144 | gradient.setColorAt(0, QtGui.QColor(self._theme.background_startColor)) | ||
483 | 145 | gradient.setColorAt(1, QtGui.QColor(self._theme.background_endColor)) | ||
484 | 146 | |||
485 | 136 | p.setBrush(QtGui.QBrush(gradient)) | 147 | p.setBrush(QtGui.QBrush(gradient)) |
486 | 137 | rectPath = QtGui.QPainterPath() | 148 | rectPath = QtGui.QPainterPath() |
487 | 138 | 149 | ||
491 | 139 | MAX_X = self._paint.width() | 150 | max_x = self._paint.width() |
492 | 140 | MAX_Y = self._paint.height() | 151 | max_y = self._paint.height() |
490 | 141 | |||
493 | 142 | rectPath.moveTo(0, 0) | 152 | rectPath.moveTo(0, 0) |
497 | 143 | rectPath.lineTo(0, MAX_Y) | 153 | rectPath.lineTo(0, max_y) |
498 | 144 | rectPath.lineTo(MAX_X, MAX_Y) | 154 | rectPath.lineTo(max_x, max_y) |
499 | 145 | rectPath.lineTo(MAX_X, 0) | 155 | rectPath.lineTo(max_x, 0) |
500 | 156 | |||
501 | 146 | rectPath.closeSubpath() | 157 | rectPath.closeSubpath() |
502 | 147 | p.drawPath(rectPath) | 158 | p.drawPath(rectPath) |
503 | 148 | 159 | ||
505 | 149 | elif self._theme.BackgroundType == 2: # image | 160 | elif self._theme.background_type== u'image': # image |
506 | 150 | r=self._paint.rect() | 161 | r=self._paint.rect() |
511 | 151 | log.debug(r.x(), r.y(), r.width(),r.height()) | 162 | log.debug(u'Image size details %d %d %d %d ', r.x(), r.y(), r.width(),r.height()) |
512 | 152 | log.debug(self._theme.BackgroundParameter2) | 163 | log.debug(u' Background Parameter %d ', self._theme.background_borderColor) |
513 | 153 | if self._theme.BackgroundParameter2 is not None: | 164 | if self._theme.Bbackground_borderColor is not None: |
514 | 154 | p.fillRect(self._paint.rect(), self._theme.BackgroundParameter2) | 165 | p.fillRect(self._paint.rect(), self._theme.background_borderColor) |
515 | 155 | p.drawPixmap(self.background_offsetx,self.background_offsety, self.img) | 166 | p.drawPixmap(self.background_offsetx,self.background_offsety, self.img) |
516 | 156 | p.end() | 167 | p.end() |
518 | 157 | log.debug(u"render background done") | 168 | log.debug(u'render background done') |
519 | 158 | 169 | ||
520 | 159 | def split_set_of_lines(self, lines): | 170 | def split_set_of_lines(self, lines): |
521 | 160 | 171 | ||
522 | @@ -221,24 +232,23 @@ | |||
523 | 221 | 232 | ||
524 | 222 | def _render_lines(self, lines): | 233 | def _render_lines(self, lines): |
525 | 223 | """render a set of lines according to the theme, return bounding box""" | 234 | """render a set of lines according to the theme, return bounding box""" |
527 | 224 | log.debug(u"_render_lines %s", lines) | 235 | #log.debug(u'_render_lines %s', lines) |
528 | 225 | 236 | ||
529 | 226 | bbox=self._render_lines_unaligned(lines) | 237 | bbox=self._render_lines_unaligned(lines) |
530 | 227 | print bbox | ||
531 | 228 | 238 | ||
532 | 229 | t=self._theme | 239 | t=self._theme |
533 | 230 | x=self._rect.left() | 240 | x=self._rect.left() |
535 | 231 | if t.VerticalAlign==0: # top align | 241 | if int(t.display_verticalAlign) == 0: # top align |
536 | 232 | y = self._rect.top() | 242 | y = self._rect.top() |
538 | 233 | elif t.VerticalAlign==1: # bottom align | 243 | elif int(t.display_verticalAlign) == 1: # bottom align |
539 | 234 | y=self._rect.bottom()-bbox.height() | 244 | y=self._rect.bottom()-bbox.height() |
541 | 235 | elif t.VerticalAlign==2: # centre align | 245 | elif int(t.display_verticalAlign) == 2: # centre align |
542 | 236 | y=self._rect.top()+(self._rect.height()-bbox.height())/2 | 246 | y=self._rect.top()+(self._rect.height()-bbox.height())/2 |
543 | 237 | else: | 247 | else: |
545 | 238 | assert(0, "Invalid value for theme.VerticalAlign:%d" % t.VerticalAlign) | 248 | assert(0, u'Invalid value for theme.VerticalAlign:%s' % t.display_verticalAlign) |
546 | 239 | self._render_background() | 249 | self._render_background() |
547 | 240 | bbox=self._render_lines_unaligned(lines, (x,y)) | 250 | bbox=self._render_lines_unaligned(lines, (x,y)) |
549 | 241 | log.debug(u"render lines DONE") | 251 | log.debug(u'render lines DONE') |
550 | 242 | 252 | ||
551 | 243 | return bbox | 253 | return bbox |
552 | 244 | 254 | ||
553 | @@ -250,7 +260,7 @@ | |||
554 | 250 | than a screenful (eg. by using split_set_of_lines) | 260 | than a screenful (eg. by using split_set_of_lines) |
555 | 251 | 261 | ||
556 | 252 | Returns the bounding box of the text as QRect""" | 262 | Returns the bounding box of the text as QRect""" |
558 | 253 | log.debug(u"render unaligned %s", lines) | 263 | log.debug(u'render unaligned %s', lines) |
559 | 254 | x,y=tlcorner | 264 | x,y=tlcorner |
560 | 255 | brx=x | 265 | brx=x |
561 | 256 | bry=y | 266 | bry=y |
562 | @@ -269,7 +279,7 @@ | |||
563 | 269 | p.setPen(QtGui.QPen(QtGui.QColor(0,0,255))) | 279 | p.setPen(QtGui.QPen(QtGui.QColor(0,0,255))) |
564 | 270 | p.drawRect(retval) | 280 | p.drawRect(retval) |
565 | 271 | p.end() | 281 | p.end() |
567 | 272 | log.debug(u"render unaligned DONE") | 282 | log.debug(u'render unaligned DONE') |
568 | 273 | 283 | ||
569 | 274 | return retval | 284 | return retval |
570 | 275 | 285 | ||
571 | @@ -283,7 +293,7 @@ | |||
572 | 283 | 293 | ||
573 | 284 | Returns the bottom-right corner (of what was rendered) as a tuple(x,y). | 294 | Returns the bottom-right corner (of what was rendered) as a tuple(x,y). |
574 | 285 | """ | 295 | """ |
576 | 286 | log.debug(u"Render single line '%s' @ %s "%( line, tlcorner)) | 296 | #log.debug(u'Render single line %s @ %s '%( line, tlcorner)) |
577 | 287 | x,y=tlcorner | 297 | x,y=tlcorner |
578 | 288 | # We draw the text to see how big it is and then iterate to make it fit | 298 | # We draw the text to see how big it is and then iterate to make it fit |
579 | 289 | # when we line wrap we do in in the "lyrics" style, so the second line is | 299 | # when we line wrap we do in in the "lyrics" style, so the second line is |
580 | @@ -291,8 +301,8 @@ | |||
581 | 291 | 301 | ||
582 | 292 | # get the words | 302 | # get the words |
583 | 293 | # log.debug(u" "Getting the words split right" | 303 | # log.debug(u" "Getting the words split right" |
586 | 294 | words=line.split(" ") | 304 | words=line.split(u' ') |
587 | 295 | thisline=' '.join(words) | 305 | thisline=u' '.join(words) |
588 | 296 | lastword=len(words) | 306 | lastword=len(words) |
589 | 297 | lines=[] | 307 | lines=[] |
590 | 298 | maxx=self._rect.width(); maxy=self._rect.height(); | 308 | maxx=self._rect.width(); maxy=self._rect.height(); |
591 | @@ -307,25 +317,22 @@ | |||
592 | 307 | else: | 317 | else: |
593 | 308 | lastword-=1 | 318 | lastword-=1 |
594 | 309 | thisline=' '.join(words[:lastword]) | 319 | thisline=' '.join(words[:lastword]) |
595 | 310 | |||
596 | 311 | # log.debug(u" "This is how they split", lines | ||
597 | 312 | # log.debug(u" "Now render them" | ||
598 | 313 | startx=x | 320 | startx=x |
599 | 314 | starty=y | 321 | starty=y |
600 | 315 | rightextent=None | 322 | rightextent=None |
601 | 316 | t=self._theme | 323 | t=self._theme |
604 | 317 | align=t.HorizontalAlign | 324 | align=t.display_horizontalAlign |
605 | 318 | wrapstyle=t.WrapStyle | 325 | wrapstyle=t.display_wrapStyle |
606 | 319 | 326 | ||
607 | 320 | for linenum in range(len(lines)): | 327 | for linenum in range(len(lines)): |
608 | 321 | line=lines[linenum] | 328 | line=lines[linenum] |
609 | 322 | #find out how wide line is | 329 | #find out how wide line is |
611 | 323 | w,h=self._get_extent_and_render(line, tlcorner=(x,y), dodraw=False) | 330 | w,h=self._get_extent_and_render(line, tlcorner=(x,y), draw=False) |
612 | 324 | 331 | ||
614 | 325 | if t.Shadow: | 332 | if t.display_shadow: |
615 | 326 | w+=self._shadow_offset | 333 | w+=self._shadow_offset |
616 | 327 | h+=self._shadow_offset | 334 | h+=self._shadow_offset |
618 | 328 | if t.Outline: | 335 | if t.display_outline: |
619 | 329 | w+=2*self._outline_offset # pixels either side | 336 | w+=2*self._outline_offset # pixels either side |
620 | 330 | h+=2*self._outline_offset # pixels top/bottom | 337 | h+=2*self._outline_offset # pixels top/bottom |
621 | 331 | if align==0: # left align | 338 | if align==0: # left align |
622 | @@ -343,21 +350,22 @@ | |||
623 | 343 | x=(maxx-w)/2; | 350 | x=(maxx-w)/2; |
624 | 344 | rightextent=x+w | 351 | rightextent=x+w |
625 | 345 | # now draw the text, and any outlines/shadows | 352 | # now draw the text, and any outlines/shadows |
633 | 346 | if t.Shadow: | 353 | if t.display_shadow: |
634 | 347 | self._get_extent_and_render(line, tlcorner=(x+self._shadow_offset,y+self._shadow_offset), dodraw=True, color = t.ShadowColor) | 354 | self._get_extent_and_render(line, tlcorner=(x+self._shadow_offset,y+self._shadow_offset), |
635 | 348 | if t.Outline: | 355 | draw=True, color = t.display_shadow_color) |
636 | 349 | self._get_extent_and_render(line, (x+self._outline_offset,y), dodraw=True, color = t.OutlineColor) | 356 | if t.display_outline: |
637 | 350 | self._get_extent_and_render(line, (x,y+self._outline_offset), dodraw=True, color = t.OutlineColor) | 357 | self._get_extent_and_render(line, (x+self._outline_offset,y), draw=True, color = t.display_outline_color) |
638 | 351 | self._get_extent_and_render(line, (x,y-self._outline_offset), dodraw=True, color = t.OutlineColor) | 358 | self._get_extent_and_render(line, (x,y+self._outline_offset), draw=True, color = t.display_outline_color) |
639 | 352 | self._get_extent_and_render(line, (x-self._outline_offset,y), dodraw=True, color = t.OutlineColor) | 359 | self._get_extent_and_render(line, (x,y-self._outline_offset), draw=True, color = t.display_outline_color) |
640 | 360 | self._get_extent_and_render(line, (x-self._outline_offset,y), draw=True, color = t.display_outline_color) | ||
641 | 353 | if self._outline_offset > 1: | 361 | if self._outline_offset > 1: |
646 | 354 | self._get_extent_and_render(line, (x+self._outline_offset,y+self._outline_offset), dodraw=True, color = t.OutlineColor) | 362 | self._get_extent_and_render(line, (x+self._outline_offset,y+self._outline_offset), draw=True, color = t.display_outline_color) |
647 | 355 | self._get_extent_and_render(line, (x-self._outline_offset,y+self._outline_offset), dodraw=True, color = t.OutlineColor) | 363 | self._get_extent_and_render(line, (x-self._outline_offset,y+self._outline_offset), draw=True, color = t.display_outline_color) |
648 | 356 | self._get_extent_and_render(line, (x+self._outline_offset,y-self._outline_offset), dodraw=True, color = t.OutlineColor) | 364 | self._get_extent_and_render(line, (x+self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color) |
649 | 357 | self._get_extent_and_render(line, (x-self._outline_offset,y-self._outline_offset), dodraw=True, color = t.OutlineColor) | 365 | self._get_extent_and_render(line, (x-self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color) |
650 | 358 | 366 | ||
653 | 359 | self._get_extent_and_render(line, tlcorner=(x,y), dodraw=True) | 367 | self._get_extent_and_render(line, tlcorner=(x,y), draw=True) |
654 | 360 | # log.debug(u" "Line %2d: Render '%s' at (%d, %d) wh=(%d,%d)"%( linenum, line, x, y,w,h) | 368 | # log.debug(u'Line %2d: Render '%s' at (%d, %d) wh=(%d,%d)' % ( linenum, line, x, y,w,h) |
655 | 361 | y += h | 369 | y += h |
656 | 362 | if linenum == 0: | 370 | if linenum == 0: |
657 | 363 | self._first_line_right_extent=rightextent | 371 | self._first_line_right_extent=rightextent |
658 | @@ -373,47 +381,48 @@ | |||
659 | 373 | return brcorner | 381 | return brcorner |
660 | 374 | 382 | ||
661 | 375 | # xxx this is what to override for an SDL version | 383 | # xxx this is what to override for an SDL version |
663 | 376 | def _get_extent_and_render(self, line, tlcorner=(0,0), dodraw=False, color=None, footer = False): | 384 | def _get_extent_and_render(self, line, tlcorner=(0,0), draw=False, color=None, footer=False): |
664 | 377 | """Find bounding box of text - as render_single_line. | 385 | """Find bounding box of text - as render_single_line. |
666 | 378 | If dodraw is set, actually draw the text to the current DC as well | 386 | If draw is set, actually draw the text to the current DC as well |
667 | 379 | 387 | ||
668 | 380 | return width and height of text as a tuple (w,h)""" | 388 | return width and height of text as a tuple (w,h)""" |
669 | 381 | # setup defaults | 389 | # setup defaults |
671 | 382 | log.debug(u"_get_extent_and_render %s %s %s ", [line], tlcorner, dodraw) | 390 | #log.debug(u"_get_extent_and_render %s %s %s ", [line], tlcorner, draw) |
672 | 383 | p=QtGui.QPainter() | 391 | p=QtGui.QPainter() |
673 | 384 | p.begin(self._paint) | 392 | p.begin(self._paint) |
674 | 385 | # 'twould be more efficient to set this once when theme changes | 393 | # 'twould be more efficient to set this once when theme changes |
675 | 386 | # or p changes | 394 | # or p changes |
676 | 387 | if footer : | 395 | if footer : |
679 | 388 | font=QtGui.QFont(self._theme.FontName, | 396 | font=QtGui.QFont(self._theme.font_footer_name, |
680 | 389 | 12, # size | 397 | int(self._theme.font_footer_proportion), # size |
681 | 390 | QtGui.QFont.Normal, # weight | 398 | QtGui.QFont.Normal, # weight |
682 | 391 | 0)# italic | 399 | 0)# italic |
683 | 392 | else: | 400 | else: |
686 | 393 | font=QtGui.QFont(self._theme.FontName, | 401 | font=QtGui.QFont(self._theme.font_main_name, |
687 | 394 | self._theme.FontProportion, # size | 402 | int(self._theme.font_main_proportion), # size |
688 | 395 | QtGui.QFont.Normal, # weight | 403 | QtGui.QFont.Normal, # weight |
689 | 396 | 0)# italic | 404 | 0)# italic |
690 | 397 | # to make the unit tests monitor independent, we have to be able to | 405 | # to make the unit tests monitor independent, we have to be able to |
691 | 398 | # specify whether a font proportion is in pixels or points | 406 | # specify whether a font proportion is in pixels or points |
699 | 399 | if self._theme.FontUnits.lower() == "pixels": | 407 | if footer: |
700 | 400 | log.debug(u"pixels") | 408 | font.setPixelSize(int(self._theme.font_footer_proportion)) |
701 | 401 | if footer: | 409 | else: |
702 | 402 | font.setPixelSize(12) | 410 | font.setPixelSize(int(self._theme.font_main_proportion)) |
703 | 403 | else: | 411 | #log.debug(u'Font details %s %s %s %d', self._theme.font_main_name, self._theme.font_main_proportion, font.family(), font.pointSize()) |
697 | 404 | font.setPixelSize(self._theme.FontProportion) | ||
698 | 405 | log.debug(u'Font details %s %s %s %s', self._theme.FontName, self._theme.FontProportion, font.family(), font.pointSize()) | ||
704 | 406 | p.setFont(font) | 412 | p.setFont(font) |
705 | 407 | if color == None: | 413 | if color == None: |
707 | 408 | p.setPen(self._theme.FontColor) | 414 | if footer: |
708 | 415 | p.setPen(QtGui.QColor(self._theme.font_footer_color)) | ||
709 | 416 | else: | ||
710 | 417 | p.setPen(QtGui.QColor(self._theme.font_main_color)) | ||
711 | 409 | else: | 418 | else: |
713 | 410 | p.setPen(color) | 419 | p.setPen(QtGui.QColor(color)) |
714 | 411 | x,y=tlcorner | 420 | x,y=tlcorner |
715 | 412 | metrics=QtGui.QFontMetrics(font) | 421 | metrics=QtGui.QFontMetrics(font) |
716 | 413 | # xxx some fudges to make it exactly like wx! Take 'em out later | 422 | # xxx some fudges to make it exactly like wx! Take 'em out later |
717 | 414 | w=metrics.width(line) | 423 | w=metrics.width(line) |
718 | 415 | h=metrics.height()-2 | 424 | h=metrics.height()-2 |
720 | 416 | if dodraw: | 425 | if draw: |
721 | 417 | p.drawText(x,y+metrics.height()-metrics.descent()-1, line) | 426 | p.drawText(x,y+metrics.height()-metrics.descent()-1, line) |
722 | 418 | p.end() | 427 | p.end() |
723 | 419 | return (w, h) | 428 | return (w, h) |
724 | 420 | 429 | ||
725 | === modified file 'openlp/core/theme/theme.py' | |||
726 | --- openlp/core/theme/theme.py 2009-03-29 14:38:23 +0000 | |||
727 | +++ openlp/core/theme/theme.py 2009-04-03 19:32:00 +0000 | |||
728 | @@ -35,7 +35,7 @@ | |||
729 | 35 | ''' | 35 | ''' |
730 | 36 | 36 | ||
731 | 37 | class Theme: | 37 | class Theme: |
733 | 38 | def __init__(self, xmlfile=None): | 38 | def __init__(self, xml): |
734 | 39 | """ stores the info about a theme | 39 | """ stores the info about a theme |
735 | 40 | attributes: | 40 | attributes: |
736 | 41 | name : theme name | 41 | name : theme name |
737 | @@ -77,11 +77,7 @@ | |||
738 | 77 | """ | 77 | """ |
739 | 78 | # init to defaults | 78 | # init to defaults |
740 | 79 | self._set_from_XML(blankstylexml) | 79 | self._set_from_XML(blankstylexml) |
746 | 80 | if xmlfile != None: | 80 | self._set_from_XML(xml) |
742 | 81 | # init from xmlfile | ||
743 | 82 | file=open(xmlfile) | ||
744 | 83 | t=''.join(file.readlines()) # read the file and change list to a string | ||
745 | 84 | self._set_from_XML(t) | ||
747 | 85 | 81 | ||
748 | 86 | def _get_as_string(self): | 82 | def _get_as_string(self): |
749 | 87 | s="" | 83 | s="" |
750 | 88 | 84 | ||
751 | === modified file 'openlp/core/ui/__init__.py' | |||
752 | --- openlp/core/ui/__init__.py 2009-03-22 07:11:05 +0000 | |||
753 | +++ openlp/core/ui/__init__.py 2009-04-04 17:36:15 +0000 | |||
754 | @@ -18,6 +18,7 @@ | |||
755 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | 18 | Place, Suite 330, Boston, MA 02111-1307 USA |
756 | 19 | """ | 19 | """ |
757 | 20 | 20 | ||
758 | 21 | from amendthemeform import AmendThemeForm | ||
759 | 21 | from slidecontroller import SlideController | 22 | from slidecontroller import SlideController |
760 | 22 | from splashscreen import SplashScreen | 23 | from splashscreen import SplashScreen |
761 | 23 | from alertstab import AlertsTab | 24 | from alertstab import AlertsTab |
762 | @@ -31,4 +32,4 @@ | |||
763 | 31 | from mainwindow import MainWindow | 32 | from mainwindow import MainWindow |
764 | 32 | 33 | ||
765 | 33 | __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', | 34 | __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', |
767 | 34 | 'MainWindow', 'SlideController', 'ServiceManager', 'ThemeManager'] | 35 | 'MainWindow', 'SlideController', 'ServiceManager', 'ThemeManager', 'AmendThemeForm'] |
768 | 35 | 36 | ||
769 | === added file 'openlp/core/ui/amendthemedialog.py' | |||
770 | --- openlp/core/ui/amendthemedialog.py 1970-01-01 00:00:00 +0000 | |||
771 | +++ openlp/core/ui/amendthemedialog.py 2009-04-04 17:36:15 +0000 | |||
772 | @@ -0,0 +1,282 @@ | |||
773 | 1 | # -*- coding: utf-8 -*- | ||
774 | 2 | |||
775 | 3 | # Form implementation generated from reading ui file 'amendthemedialog.ui' | ||
776 | 4 | # | ||
777 | 5 | # Created: Sat Apr 4 18:09:38 2009 | ||
778 | 6 | # by: PyQt4 UI code generator 4.4.4 | ||
779 | 7 | # | ||
780 | 8 | # WARNING! All changes made in this file will be lost! | ||
781 | 9 | |||
782 | 10 | from PyQt4 import QtCore, QtGui | ||
783 | 11 | |||
784 | 12 | class Ui_AmendThemeDialog(object): | ||
785 | 13 | def setupUi(self, AmendThemeDialog): | ||
786 | 14 | AmendThemeDialog.setObjectName("AmendThemeDialog") | ||
787 | 15 | AmendThemeDialog.resize(752, 533) | ||
788 | 16 | icon = QtGui.QIcon() | ||
789 | 17 | icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||
790 | 18 | AmendThemeDialog.setWindowIcon(icon) | ||
791 | 19 | self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog) | ||
792 | 20 | self.ThemeButtonBox.setGeometry(QtCore.QRect(580, 500, 156, 26)) | ||
793 | 21 | self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) | ||
794 | 22 | self.ThemeButtonBox.setObjectName("ThemeButtonBox") | ||
795 | 23 | self.layoutWidget = QtGui.QWidget(AmendThemeDialog) | ||
796 | 24 | self.layoutWidget.setGeometry(QtCore.QRect(30, 70, 691, 401)) | ||
797 | 25 | self.layoutWidget.setObjectName("layoutWidget") | ||
798 | 26 | self.horizontalLayout_2 = QtGui.QHBoxLayout(self.layoutWidget) | ||
799 | 27 | self.horizontalLayout_2.setObjectName("horizontalLayout_2") | ||
800 | 28 | self.LeftSide = QtGui.QWidget(self.layoutWidget) | ||
801 | 29 | self.LeftSide.setObjectName("LeftSide") | ||
802 | 30 | self.tabWidget = QtGui.QTabWidget(self.LeftSide) | ||
803 | 31 | self.tabWidget.setGeometry(QtCore.QRect(0, 0, 341, 401)) | ||
804 | 32 | self.tabWidget.setObjectName("tabWidget") | ||
805 | 33 | self.BackgroundTab = QtGui.QWidget() | ||
806 | 34 | self.BackgroundTab.setObjectName("BackgroundTab") | ||
807 | 35 | self.layoutWidget1 = QtGui.QWidget(self.BackgroundTab) | ||
808 | 36 | self.layoutWidget1.setGeometry(QtCore.QRect(10, 10, 321, 351)) | ||
809 | 37 | self.layoutWidget1.setObjectName("layoutWidget1") | ||
810 | 38 | self.gridLayout = QtGui.QGridLayout(self.layoutWidget1) | ||
811 | 39 | self.gridLayout.setObjectName("gridLayout") | ||
812 | 40 | self.BackgroundLabel = QtGui.QLabel(self.layoutWidget1) | ||
813 | 41 | self.BackgroundLabel.setObjectName("BackgroundLabel") | ||
814 | 42 | self.gridLayout.addWidget(self.BackgroundLabel, 0, 0, 1, 2) | ||
815 | 43 | self.BackgroundComboBox = QtGui.QComboBox(self.layoutWidget1) | ||
816 | 44 | self.BackgroundComboBox.setObjectName("BackgroundComboBox") | ||
817 | 45 | self.BackgroundComboBox.addItem(QtCore.QString()) | ||
818 | 46 | self.BackgroundComboBox.addItem(QtCore.QString()) | ||
819 | 47 | self.gridLayout.addWidget(self.BackgroundComboBox, 0, 2, 1, 2) | ||
820 | 48 | self.BackgroundTypeLabel = QtGui.QLabel(self.layoutWidget1) | ||
821 | 49 | self.BackgroundTypeLabel.setObjectName("BackgroundTypeLabel") | ||
822 | 50 | self.gridLayout.addWidget(self.BackgroundTypeLabel, 1, 0, 1, 2) | ||
823 | 51 | self.BackgroundTypeComboBox = QtGui.QComboBox(self.layoutWidget1) | ||
824 | 52 | self.BackgroundTypeComboBox.setObjectName("BackgroundTypeComboBox") | ||
825 | 53 | self.BackgroundTypeComboBox.addItem(QtCore.QString()) | ||
826 | 54 | self.BackgroundTypeComboBox.addItem(QtCore.QString()) | ||
827 | 55 | self.BackgroundTypeComboBox.addItem(QtCore.QString()) | ||
828 | 56 | self.gridLayout.addWidget(self.BackgroundTypeComboBox, 1, 2, 1, 2) | ||
829 | 57 | self.Color1Label = QtGui.QLabel(self.layoutWidget1) | ||
830 | 58 | self.Color1Label.setObjectName("Color1Label") | ||
831 | 59 | self.gridLayout.addWidget(self.Color1Label, 2, 0, 1, 1) | ||
832 | 60 | self.Color1PushButton = QtGui.QPushButton(self.layoutWidget1) | ||
833 | 61 | self.Color1PushButton.setObjectName("Color1PushButton") | ||
834 | 62 | self.gridLayout.addWidget(self.Color1PushButton, 2, 2, 1, 2) | ||
835 | 63 | self.Color2Label = QtGui.QLabel(self.layoutWidget1) | ||
836 | 64 | self.Color2Label.setObjectName("Color2Label") | ||
837 | 65 | self.gridLayout.addWidget(self.Color2Label, 3, 0, 1, 1) | ||
838 | 66 | self.Color2PushButton = QtGui.QPushButton(self.layoutWidget1) | ||
839 | 67 | self.Color2PushButton.setObjectName("Color2PushButton") | ||
840 | 68 | self.gridLayout.addWidget(self.Color2PushButton, 3, 2, 1, 2) | ||
841 | 69 | self.ImageLabel = QtGui.QLabel(self.layoutWidget1) | ||
842 | 70 | self.ImageLabel.setObjectName("ImageLabel") | ||
843 | 71 | self.gridLayout.addWidget(self.ImageLabel, 4, 0, 1, 1) | ||
844 | 72 | self.ImageLineEdit = QtGui.QLineEdit(self.layoutWidget1) | ||
845 | 73 | self.ImageLineEdit.setObjectName("ImageLineEdit") | ||
846 | 74 | self.gridLayout.addWidget(self.ImageLineEdit, 4, 1, 1, 2) | ||
847 | 75 | self.ImagePushButton = QtGui.QPushButton(self.layoutWidget1) | ||
848 | 76 | icon1 = QtGui.QIcon() | ||
849 | 77 | icon1.addPixmap(QtGui.QPixmap(":/services/service_open.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||
850 | 78 | self.ImagePushButton.setIcon(icon1) | ||
851 | 79 | self.ImagePushButton.setObjectName("ImagePushButton") | ||
852 | 80 | self.gridLayout.addWidget(self.ImagePushButton, 4, 3, 1, 1) | ||
853 | 81 | self.GradientLabel = QtGui.QLabel(self.layoutWidget1) | ||
854 | 82 | self.GradientLabel.setObjectName("GradientLabel") | ||
855 | 83 | self.gridLayout.addWidget(self.GradientLabel, 5, 0, 1, 1) | ||
856 | 84 | self.GradientComboBox = QtGui.QComboBox(self.layoutWidget1) | ||
857 | 85 | self.GradientComboBox.setObjectName("GradientComboBox") | ||
858 | 86 | self.GradientComboBox.addItem(QtCore.QString()) | ||
859 | 87 | self.GradientComboBox.addItem(QtCore.QString()) | ||
860 | 88 | self.GradientComboBox.addItem(QtCore.QString()) | ||
861 | 89 | self.gridLayout.addWidget(self.GradientComboBox, 5, 2, 1, 2) | ||
862 | 90 | self.tabWidget.addTab(self.BackgroundTab, "") | ||
863 | 91 | self.FontTab = QtGui.QWidget() | ||
864 | 92 | self.FontTab.setObjectName("FontTab") | ||
865 | 93 | self.MainFontGroupBox = QtGui.QGroupBox(self.FontTab) | ||
866 | 94 | self.MainFontGroupBox.setGeometry(QtCore.QRect(20, 20, 307, 119)) | ||
867 | 95 | self.MainFontGroupBox.setObjectName("MainFontGroupBox") | ||
868 | 96 | self.gridLayout_2 = QtGui.QGridLayout(self.MainFontGroupBox) | ||
869 | 97 | self.gridLayout_2.setObjectName("gridLayout_2") | ||
870 | 98 | self.MainFontlabel = QtGui.QLabel(self.MainFontGroupBox) | ||
871 | 99 | self.MainFontlabel.setObjectName("MainFontlabel") | ||
872 | 100 | self.gridLayout_2.addWidget(self.MainFontlabel, 0, 0, 1, 1) | ||
873 | 101 | self.MainFontComboBox = QtGui.QFontComboBox(self.MainFontGroupBox) | ||
874 | 102 | self.MainFontComboBox.setObjectName("MainFontComboBox") | ||
875 | 103 | self.gridLayout_2.addWidget(self.MainFontComboBox, 0, 1, 1, 2) | ||
876 | 104 | self.MainFontColorLabel = QtGui.QLabel(self.MainFontGroupBox) | ||
877 | 105 | self.MainFontColorLabel.setObjectName("MainFontColorLabel") | ||
878 | 106 | self.gridLayout_2.addWidget(self.MainFontColorLabel, 1, 0, 1, 1) | ||
879 | 107 | self.MainFontColorPushButton = QtGui.QPushButton(self.MainFontGroupBox) | ||
880 | 108 | self.MainFontColorPushButton.setObjectName("MainFontColorPushButton") | ||
881 | 109 | self.gridLayout_2.addWidget(self.MainFontColorPushButton, 1, 2, 1, 1) | ||
882 | 110 | self.MainFontSize = QtGui.QLabel(self.MainFontGroupBox) | ||
883 | 111 | self.MainFontSize.setObjectName("MainFontSize") | ||
884 | 112 | self.gridLayout_2.addWidget(self.MainFontSize, 2, 0, 1, 1) | ||
885 | 113 | self.MainFontSizeLineEdit = QtGui.QLineEdit(self.MainFontGroupBox) | ||
886 | 114 | self.MainFontSizeLineEdit.setObjectName("MainFontSizeLineEdit") | ||
887 | 115 | self.gridLayout_2.addWidget(self.MainFontSizeLineEdit, 2, 1, 1, 1) | ||
888 | 116 | self.MainFontlSlider = QtGui.QSlider(self.MainFontGroupBox) | ||
889 | 117 | self.MainFontlSlider.setProperty("value", QtCore.QVariant(15)) | ||
890 | 118 | self.MainFontlSlider.setMaximum(40) | ||
891 | 119 | self.MainFontlSlider.setOrientation(QtCore.Qt.Horizontal) | ||
892 | 120 | self.MainFontlSlider.setTickPosition(QtGui.QSlider.TicksBelow) | ||
893 | 121 | self.MainFontlSlider.setTickInterval(5) | ||
894 | 122 | self.MainFontlSlider.setObjectName("MainFontlSlider") | ||
895 | 123 | self.gridLayout_2.addWidget(self.MainFontlSlider, 2, 2, 1, 1) | ||
896 | 124 | self.FooterFontGroupBox = QtGui.QGroupBox(self.FontTab) | ||
897 | 125 | self.FooterFontGroupBox.setGeometry(QtCore.QRect(20, 170, 307, 119)) | ||
898 | 126 | self.FooterFontGroupBox.setObjectName("FooterFontGroupBox") | ||
899 | 127 | self.gridLayout_3 = QtGui.QGridLayout(self.FooterFontGroupBox) | ||
900 | 128 | self.gridLayout_3.setObjectName("gridLayout_3") | ||
901 | 129 | self.FooterFontlabel = QtGui.QLabel(self.FooterFontGroupBox) | ||
902 | 130 | self.FooterFontlabel.setObjectName("FooterFontlabel") | ||
903 | 131 | self.gridLayout_3.addWidget(self.FooterFontlabel, 0, 0, 1, 1) | ||
904 | 132 | self.FooterFontComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox) | ||
905 | 133 | self.FooterFontComboBox.setObjectName("FooterFontComboBox") | ||
906 | 134 | self.gridLayout_3.addWidget(self.FooterFontComboBox, 0, 1, 1, 2) | ||
907 | 135 | self.FooterFontColorLabel = QtGui.QLabel(self.FooterFontGroupBox) | ||
908 | 136 | self.FooterFontColorLabel.setObjectName("FooterFontColorLabel") | ||
909 | 137 | self.gridLayout_3.addWidget(self.FooterFontColorLabel, 1, 0, 1, 1) | ||
910 | 138 | self.FooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox) | ||
911 | 139 | self.FooterColorPushButton.setObjectName("FooterColorPushButton") | ||
912 | 140 | self.gridLayout_3.addWidget(self.FooterColorPushButton, 1, 2, 1, 1) | ||
913 | 141 | self.FooterFontSize = QtGui.QLabel(self.FooterFontGroupBox) | ||
914 | 142 | self.FooterFontSize.setObjectName("FooterFontSize") | ||
915 | 143 | self.gridLayout_3.addWidget(self.FooterFontSize, 2, 0, 1, 1) | ||
916 | 144 | self.FooterFontSizeLineEdit = QtGui.QLineEdit(self.FooterFontGroupBox) | ||
917 | 145 | self.FooterFontSizeLineEdit.setObjectName("FooterFontSizeLineEdit") | ||
918 | 146 | self.gridLayout_3.addWidget(self.FooterFontSizeLineEdit, 2, 1, 1, 1) | ||
919 | 147 | self.FooterFontlSlider = QtGui.QSlider(self.FooterFontGroupBox) | ||
920 | 148 | self.FooterFontlSlider.setProperty("value", QtCore.QVariant(15)) | ||
921 | 149 | self.FooterFontlSlider.setMaximum(40) | ||
922 | 150 | self.FooterFontlSlider.setOrientation(QtCore.Qt.Horizontal) | ||
923 | 151 | self.FooterFontlSlider.setTickPosition(QtGui.QSlider.TicksBelow) | ||
924 | 152 | self.FooterFontlSlider.setTickInterval(5) | ||
925 | 153 | self.FooterFontlSlider.setObjectName("FooterFontlSlider") | ||
926 | 154 | self.gridLayout_3.addWidget(self.FooterFontlSlider, 2, 2, 1, 1) | ||
927 | 155 | self.tabWidget.addTab(self.FontTab, "") | ||
928 | 156 | self.OptionsTab = QtGui.QWidget() | ||
929 | 157 | self.OptionsTab.setObjectName("OptionsTab") | ||
930 | 158 | self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsTab) | ||
931 | 159 | self.ShadowGroupBox.setGeometry(QtCore.QRect(20, 10, 301, 80)) | ||
932 | 160 | self.ShadowGroupBox.setObjectName("ShadowGroupBox") | ||
933 | 161 | self.layoutWidget2 = QtGui.QWidget(self.ShadowGroupBox) | ||
934 | 162 | self.layoutWidget2.setGeometry(QtCore.QRect(10, 20, 281, 54)) | ||
935 | 163 | self.layoutWidget2.setObjectName("layoutWidget2") | ||
936 | 164 | self.formLayout = QtGui.QFormLayout(self.layoutWidget2) | ||
937 | 165 | self.formLayout.setObjectName("formLayout") | ||
938 | 166 | self.ShadowCheckBox = QtGui.QCheckBox(self.layoutWidget2) | ||
939 | 167 | self.ShadowCheckBox.setObjectName("ShadowCheckBox") | ||
940 | 168 | self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowCheckBox) | ||
941 | 169 | self.ShadowColorLabel = QtGui.QLabel(self.layoutWidget2) | ||
942 | 170 | self.ShadowColorLabel.setObjectName("ShadowColorLabel") | ||
943 | 171 | self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel) | ||
944 | 172 | self.ShadowColorPushButton = QtGui.QPushButton(self.layoutWidget2) | ||
945 | 173 | self.ShadowColorPushButton.setObjectName("ShadowColorPushButton") | ||
946 | 174 | self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton) | ||
947 | 175 | self.AlignmentGroupBox = QtGui.QGroupBox(self.OptionsTab) | ||
948 | 176 | self.AlignmentGroupBox.setGeometry(QtCore.QRect(10, 200, 321, 161)) | ||
949 | 177 | self.AlignmentGroupBox.setObjectName("AlignmentGroupBox") | ||
950 | 178 | self.gridLayout_4 = QtGui.QGridLayout(self.AlignmentGroupBox) | ||
951 | 179 | self.gridLayout_4.setObjectName("gridLayout_4") | ||
952 | 180 | self.HorizontalLabel = QtGui.QLabel(self.AlignmentGroupBox) | ||
953 | 181 | self.HorizontalLabel.setObjectName("HorizontalLabel") | ||
954 | 182 | self.gridLayout_4.addWidget(self.HorizontalLabel, 0, 0, 1, 1) | ||
955 | 183 | self.HorizontalComboBox = QtGui.QComboBox(self.AlignmentGroupBox) | ||
956 | 184 | self.HorizontalComboBox.setObjectName("HorizontalComboBox") | ||
957 | 185 | self.HorizontalComboBox.addItem(QtCore.QString()) | ||
958 | 186 | self.HorizontalComboBox.addItem(QtCore.QString()) | ||
959 | 187 | self.HorizontalComboBox.addItem(QtCore.QString()) | ||
960 | 188 | self.gridLayout_4.addWidget(self.HorizontalComboBox, 0, 1, 1, 1) | ||
961 | 189 | self.VerticalLabel = QtGui.QLabel(self.AlignmentGroupBox) | ||
962 | 190 | self.VerticalLabel.setObjectName("VerticalLabel") | ||
963 | 191 | self.gridLayout_4.addWidget(self.VerticalLabel, 1, 0, 1, 1) | ||
964 | 192 | self.VerticalComboBox = QtGui.QComboBox(self.AlignmentGroupBox) | ||
965 | 193 | self.VerticalComboBox.setObjectName("VerticalComboBox") | ||
966 | 194 | self.VerticalComboBox.addItem(QtCore.QString()) | ||
967 | 195 | self.VerticalComboBox.addItem(QtCore.QString()) | ||
968 | 196 | self.VerticalComboBox.addItem(QtCore.QString()) | ||
969 | 197 | self.gridLayout_4.addWidget(self.VerticalComboBox, 1, 1, 1, 1) | ||
970 | 198 | self.OutlineGroupBox = QtGui.QGroupBox(self.OptionsTab) | ||
971 | 199 | self.OutlineGroupBox.setGeometry(QtCore.QRect(20, 110, 301, 80)) | ||
972 | 200 | self.OutlineGroupBox.setObjectName("OutlineGroupBox") | ||
973 | 201 | self.layoutWidget_3 = QtGui.QWidget(self.OutlineGroupBox) | ||
974 | 202 | self.layoutWidget_3.setGeometry(QtCore.QRect(10, 20, 281, 54)) | ||
975 | 203 | self.layoutWidget_3.setObjectName("layoutWidget_3") | ||
976 | 204 | self.OutlineformLayout = QtGui.QFormLayout(self.layoutWidget_3) | ||
977 | 205 | self.OutlineformLayout.setObjectName("OutlineformLayout") | ||
978 | 206 | self.OutlineCheckBox = QtGui.QCheckBox(self.layoutWidget_3) | ||
979 | 207 | self.OutlineCheckBox.setObjectName("OutlineCheckBox") | ||
980 | 208 | self.OutlineformLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.OutlineCheckBox) | ||
981 | 209 | self.OutlineColorLabel = QtGui.QLabel(self.layoutWidget_3) | ||
982 | 210 | self.OutlineColorLabel.setObjectName("OutlineColorLabel") | ||
983 | 211 | self.OutlineformLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel) | ||
984 | 212 | self.OutlineColorPushButton = QtGui.QPushButton(self.layoutWidget_3) | ||
985 | 213 | self.OutlineColorPushButton.setObjectName("OutlineColorPushButton") | ||
986 | 214 | self.OutlineformLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton) | ||
987 | 215 | self.tabWidget.addTab(self.OptionsTab, "") | ||
988 | 216 | self.horizontalLayout_2.addWidget(self.LeftSide) | ||
989 | 217 | self.RightSide = QtGui.QWidget(self.layoutWidget) | ||
990 | 218 | self.RightSide.setObjectName("RightSide") | ||
991 | 219 | self.ThemePreView = QtGui.QGraphicsView(self.RightSide) | ||
992 | 220 | self.ThemePreView.setGeometry(QtCore.QRect(0, 30, 341, 341)) | ||
993 | 221 | self.ThemePreView.setObjectName("ThemePreView") | ||
994 | 222 | self.horizontalLayout_2.addWidget(self.RightSide) | ||
995 | 223 | self.layoutWidget3 = QtGui.QWidget(AmendThemeDialog) | ||
996 | 224 | self.layoutWidget3.setGeometry(QtCore.QRect(50, 20, 441, 41)) | ||
997 | 225 | self.layoutWidget3.setObjectName("layoutWidget3") | ||
998 | 226 | self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget3) | ||
999 | 227 | self.horizontalLayout.setObjectName("horizontalLayout") | ||
1000 | 228 | self.ThemeNameLabel = QtGui.QLabel(self.layoutWidget3) | ||
1001 | 229 | self.ThemeNameLabel.setObjectName("ThemeNameLabel") | ||
1002 | 230 | self.horizontalLayout.addWidget(self.ThemeNameLabel) | ||
1003 | 231 | self.ThemeNameEdit = QtGui.QLineEdit(self.layoutWidget3) | ||
1004 | 232 | self.ThemeNameEdit.setObjectName("ThemeNameEdit") | ||
1005 | 233 | self.horizontalLayout.addWidget(self.ThemeNameEdit) | ||
1006 | 234 | |||
1007 | 235 | self.retranslateUi(AmendThemeDialog) | ||
1008 | 236 | self.tabWidget.setCurrentIndex(1) | ||
1009 | 237 | QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog) | ||
1010 | 238 | |||
1011 | 239 | def retranslateUi(self, AmendThemeDialog): | ||
1012 | 240 | AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintance", None, QtGui.QApplication.UnicodeUTF8)) | ||
1013 | 241 | self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1014 | 242 | self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8)) | ||
1015 | 243 | self.BackgroundComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Transparent", None, QtGui.QApplication.UnicodeUTF8)) | ||
1016 | 244 | self.BackgroundTypeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background Type:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1017 | 245 | self.BackgroundTypeComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Solid Color", None, QtGui.QApplication.UnicodeUTF8)) | ||
1018 | 246 | self.BackgroundTypeComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Gradient", None, QtGui.QApplication.UnicodeUTF8)) | ||
1019 | 247 | self.BackgroundTypeComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Image", None, QtGui.QApplication.UnicodeUTF8)) | ||
1020 | 248 | self.Color1Label.setText(QtGui.QApplication.translate("AmendThemeDialog", "<Color1>", None, QtGui.QApplication.UnicodeUTF8)) | ||
1021 | 249 | self.Color2Label.setText(QtGui.QApplication.translate("AmendThemeDialog", "<Color2>", None, QtGui.QApplication.UnicodeUTF8)) | ||
1022 | 250 | self.ImageLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Image:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1023 | 251 | self.GradientLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Gradient :", None, QtGui.QApplication.UnicodeUTF8)) | ||
1024 | 252 | self.GradientComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Horizontal", None, QtGui.QApplication.UnicodeUTF8)) | ||
1025 | 253 | self.GradientComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Vertical", None, QtGui.QApplication.UnicodeUTF8)) | ||
1026 | 254 | self.GradientComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Circular", None, QtGui.QApplication.UnicodeUTF8)) | ||
1027 | 255 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.BackgroundTab), QtGui.QApplication.translate("AmendThemeDialog", "Background", None, QtGui.QApplication.UnicodeUTF8)) | ||
1028 | 256 | self.MainFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8)) | ||
1029 | 257 | self.MainFontlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1030 | 258 | self.MainFontColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color", None, QtGui.QApplication.UnicodeUTF8)) | ||
1031 | 259 | self.MainFontSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1032 | 260 | self.FooterFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Footer Font", None, QtGui.QApplication.UnicodeUTF8)) | ||
1033 | 261 | self.FooterFontlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1034 | 262 | self.FooterFontColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color", None, QtGui.QApplication.UnicodeUTF8)) | ||
1035 | 263 | self.FooterFontSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1036 | 264 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.FontTab), QtGui.QApplication.translate("AmendThemeDialog", "Font", None, QtGui.QApplication.UnicodeUTF8)) | ||
1037 | 265 | self.ShadowGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Shadow", None, QtGui.QApplication.UnicodeUTF8)) | ||
1038 | 266 | self.ShadowCheckBox.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Shadow", None, QtGui.QApplication.UnicodeUTF8)) | ||
1039 | 267 | self.ShadowColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Shadow Color:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1040 | 268 | self.AlignmentGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Alignment", None, QtGui.QApplication.UnicodeUTF8)) | ||
1041 | 269 | self.HorizontalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Horizontal Align:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1042 | 270 | self.HorizontalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Left", None, QtGui.QApplication.UnicodeUTF8)) | ||
1043 | 271 | self.HorizontalComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Right", None, QtGui.QApplication.UnicodeUTF8)) | ||
1044 | 272 | self.HorizontalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Center", None, QtGui.QApplication.UnicodeUTF8)) | ||
1045 | 273 | self.VerticalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Vertical Align:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1046 | 274 | self.VerticalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Top", None, QtGui.QApplication.UnicodeUTF8)) | ||
1047 | 275 | self.VerticalComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Middle", None, QtGui.QApplication.UnicodeUTF8)) | ||
1048 | 276 | self.VerticalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Bottom", None, QtGui.QApplication.UnicodeUTF8)) | ||
1049 | 277 | self.OutlineGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Outline", None, QtGui.QApplication.UnicodeUTF8)) | ||
1050 | 278 | self.OutlineCheckBox.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Outline", None, QtGui.QApplication.UnicodeUTF8)) | ||
1051 | 279 | self.OutlineColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Outline Color:", None, QtGui.QApplication.UnicodeUTF8)) | ||
1052 | 280 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.OptionsTab), QtGui.QApplication.translate("AmendThemeDialog", "Display Options", None, QtGui.QApplication.UnicodeUTF8)) | ||
1053 | 281 | self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name", None, QtGui.QApplication.UnicodeUTF8)) | ||
1054 | 282 | |||
1055 | 0 | 283 | ||
1056 | === added file 'openlp/core/ui/amendthemeform.py' | |||
1057 | --- openlp/core/ui/amendthemeform.py 1970-01-01 00:00:00 +0000 | |||
1058 | +++ openlp/core/ui/amendthemeform.py 2009-04-04 17:36:15 +0000 | |||
1059 | @@ -0,0 +1,37 @@ | |||
1060 | 1 | # -*- coding: utf-8 -*- | ||
1061 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | ||
1062 | 3 | """ | ||
1063 | 4 | OpenLP - Open Source Lyrics Projection | ||
1064 | 5 | Copyright (c) 2008 Raoul Snyman | ||
1065 | 6 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley, | ||
1066 | 7 | |||
1067 | 8 | This program is free software; you can redistribute it and/or modify it under | ||
1068 | 9 | the terms of the GNU General Public License as published by the Free Software | ||
1069 | 10 | Foundation; version 2 of the License. | ||
1070 | 11 | |||
1071 | 12 | This program is distributed in the hope that it will be useful, but WITHOUT ANY | ||
1072 | 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
1073 | 14 | PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
1074 | 15 | |||
1075 | 16 | You should have received a copy of the GNU General Public License along with | ||
1076 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
1077 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | ||
1078 | 19 | """ | ||
1079 | 20 | import logging | ||
1080 | 21 | |||
1081 | 22 | from PyQt4 import QtCore, QtGui | ||
1082 | 23 | |||
1083 | 24 | #from openlp.core.resources import * | ||
1084 | 25 | |||
1085 | 26 | from amendthemedialog import Ui_AmendThemeDialog | ||
1086 | 27 | |||
1087 | 28 | log = logging.getLogger(u'AmendThemeForm') | ||
1088 | 29 | |||
1089 | 30 | class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): | ||
1090 | 31 | |||
1091 | 32 | def __init__(self, parent=None): | ||
1092 | 33 | QtGui.QDialog.__init__(self, parent) | ||
1093 | 34 | self.setupUi(self) | ||
1094 | 35 | |||
1095 | 36 | def loadTheme(self, theme): | ||
1096 | 37 | pass | ||
1097 | 0 | 38 | ||
1098 | === modified file 'openlp/core/ui/mainwindow.py' (properties changed: -x to +x) | |||
1099 | --- openlp/core/ui/mainwindow.py 2009-03-23 19:17:07 +0000 | |||
1100 | +++ openlp/core/ui/mainwindow.py 2009-04-05 18:33:56 +0000 | |||
1101 | @@ -39,16 +39,16 @@ | |||
1102 | 39 | 39 | ||
1103 | 40 | def __init__(self): | 40 | def __init__(self): |
1104 | 41 | self.main_window = QtGui.QMainWindow() | 41 | self.main_window = QtGui.QMainWindow() |
1106 | 42 | self.EventManager = EventManager() | 42 | self.EventManager = EventManager() |
1107 | 43 | self.alert_form = AlertForm() | 43 | self.alert_form = AlertForm() |
1108 | 44 | self.about_form = AboutForm() | 44 | self.about_form = AboutForm() |
1109 | 45 | self.settings_form = SettingsForm() | 45 | self.settings_form = SettingsForm() |
1111 | 46 | 46 | ||
1112 | 47 | pluginpath = os.path.split(os.path.abspath(__file__))[0] | 47 | pluginpath = os.path.split(os.path.abspath(__file__))[0] |
1113 | 48 | pluginpath = os.path.abspath(os.path.join(pluginpath, '..', '..','plugins')) | 48 | pluginpath = os.path.abspath(os.path.join(pluginpath, '..', '..','plugins')) |
1114 | 49 | self.plugin_manager = PluginManager(pluginpath) | 49 | self.plugin_manager = PluginManager(pluginpath) |
1115 | 50 | self.plugin_helpers = {} | 50 | self.plugin_helpers = {} |
1117 | 51 | 51 | ||
1118 | 52 | self.setupUi() | 52 | self.setupUi() |
1119 | 53 | 53 | ||
1120 | 54 | log.info(u'Load Plugins') | 54 | log.info(u'Load Plugins') |
1121 | @@ -56,7 +56,7 @@ | |||
1122 | 56 | self.plugin_helpers[u'live'] = self.LiveController | 56 | self.plugin_helpers[u'live'] = self.LiveController |
1123 | 57 | self.plugin_helpers[u'event'] = self.EventManager | 57 | self.plugin_helpers[u'event'] = self.EventManager |
1124 | 58 | self.plugin_helpers[u'theme'] = self.ThemeManagerContents # Theme manger | 58 | self.plugin_helpers[u'theme'] = self.ThemeManagerContents # Theme manger |
1126 | 59 | 59 | ||
1127 | 60 | self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers, self.EventManager) | 60 | self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers, self.EventManager) |
1128 | 61 | # hook methods have to happen after find_plugins. Find plugins needs the controllers | 61 | # hook methods have to happen after find_plugins. Find plugins needs the controllers |
1129 | 62 | # hence the hooks have moved from setupUI() to here | 62 | # hence the hooks have moved from setupUI() to here |
1130 | @@ -77,9 +77,14 @@ | |||
1131 | 77 | self.plugin_manager.hook_export_menu(self.FileExportMenu) | 77 | self.plugin_manager.hook_export_menu(self.FileExportMenu) |
1132 | 78 | 78 | ||
1133 | 79 | # Call the initialise method to setup plugins. | 79 | # Call the initialise method to setup plugins. |
1135 | 80 | log.info(u'initialise plugins') | 80 | log.info(u'initialise plugins') |
1136 | 81 | self.plugin_manager.initialise_plugins() | 81 | self.plugin_manager.initialise_plugins() |
1138 | 82 | 82 | ||
1139 | 83 | # Once all components are initialised load the Themes | ||
1140 | 84 | log.info(u'Load Themes') | ||
1141 | 85 | self.ThemeManagerContents.setEventManager(self.EventManager) | ||
1142 | 86 | self.ThemeManagerContents.loadThemes() | ||
1143 | 87 | |||
1144 | 83 | def setupUi(self): | 88 | def setupUi(self): |
1145 | 84 | self.main_window.setObjectName("main_window") | 89 | self.main_window.setObjectName("main_window") |
1146 | 85 | self.main_window.resize(1087, 847) | 90 | self.main_window.resize(1087, 847) |
1147 | @@ -176,7 +181,7 @@ | |||
1148 | 176 | self.ServiceManagerContents = ServiceManager(self) | 181 | self.ServiceManagerContents = ServiceManager(self) |
1149 | 177 | self.ServiceManagerDock.setWidget(self.ServiceManagerContents) | 182 | self.ServiceManagerDock.setWidget(self.ServiceManagerContents) |
1150 | 178 | self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock) | 183 | self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock) |
1152 | 179 | #Theme Manager Defined | 184 | #Theme Manager Defined |
1153 | 180 | self.ThemeManagerDock = QtGui.QDockWidget(self.main_window) | 185 | self.ThemeManagerDock = QtGui.QDockWidget(self.main_window) |
1154 | 181 | ThemeManagerIcon = QtGui.QIcon() | 186 | ThemeManagerIcon = QtGui.QIcon() |
1155 | 182 | ThemeManagerIcon.addPixmap(QtGui.QPixmap(":/system/system_thememanager.png"), | 187 | ThemeManagerIcon.addPixmap(QtGui.QPixmap(":/system/system_thememanager.png"), |
1156 | @@ -184,46 +189,12 @@ | |||
1157 | 184 | self.ThemeManagerDock.setWindowIcon(ThemeManagerIcon) | 189 | self.ThemeManagerDock.setWindowIcon(ThemeManagerIcon) |
1158 | 185 | self.ThemeManagerDock.setFloating(False) | 190 | self.ThemeManagerDock.setFloating(False) |
1159 | 186 | self.ThemeManagerDock.setObjectName("ThemeManagerDock") | 191 | self.ThemeManagerDock.setObjectName("ThemeManagerDock") |
1196 | 187 | 192 | ||
1197 | 188 | self.ThemeManagerContents = ThemeManager(self) | 193 | self.ThemeManagerContents = ThemeManager(self) |
1162 | 189 | |||
1163 | 190 | # self.ThemeManagerContents = QtGui.QWidget() | ||
1164 | 191 | # self.ThemeManagerContents.setObjectName("ThemeManagerContents") | ||
1165 | 192 | # self.ThemeManagerLayout = QtGui.QVBoxLayout(self.ThemeManagerContents) | ||
1166 | 193 | # self.ThemeManagerLayout.setSpacing(0) | ||
1167 | 194 | # self.ThemeManagerLayout.setMargin(0) | ||
1168 | 195 | # self.ThemeManagerLayout.setObjectName("ThemeManagerLayout") | ||
1169 | 196 | # self.ThemeManagerToolbar = QtGui.QToolBar(self.ThemeManagerContents) | ||
1170 | 197 | # self.ThemeManagerToolbar.setObjectName("ThemeManagerToolbar") | ||
1171 | 198 | # NewThemeIcon = QtGui.QIcon() | ||
1172 | 199 | # NewThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_new.png"), | ||
1173 | 200 | # QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||
1174 | 201 | # self.ThemeNewItem = self.ThemeManagerToolbar.addAction(NewThemeIcon, 'New theme') | ||
1175 | 202 | # EditThemeIcon = QtGui.QIcon() | ||
1176 | 203 | # EditThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_edit.png"), | ||
1177 | 204 | # QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||
1178 | 205 | # self.ThemeEditItem = self.ThemeManagerToolbar.addAction(EditThemeIcon, 'Edit theme') | ||
1179 | 206 | # DeleteThemeIcon = QtGui.QIcon() | ||
1180 | 207 | # DeleteThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_delete.png"), | ||
1181 | 208 | # QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||
1182 | 209 | # self.ThemeDeleteButton = self.ThemeManagerToolbar.addAction(DeleteThemeIcon, 'Delete theme') | ||
1183 | 210 | # self.ThemeManagerToolbar.addSeparator() | ||
1184 | 211 | # ImportThemeIcon = QtGui.QIcon() | ||
1185 | 212 | # ImportThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_import.png"), | ||
1186 | 213 | # QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||
1187 | 214 | # self.ThemeImportButton = self.ThemeManagerToolbar.addAction(ImportThemeIcon, 'Import theme') | ||
1188 | 215 | # ExportThemeIcon = QtGui.QIcon() | ||
1189 | 216 | # ExportThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_export.png"), | ||
1190 | 217 | # QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||
1191 | 218 | # self.ThemeExportButton = self.ThemeManagerToolbar.addAction(ExportThemeIcon, 'Export theme') | ||
1192 | 219 | # self.ThemeManagerLayout.addWidget(self.ThemeManagerToolbar) | ||
1193 | 220 | # self.ThemeManagerListView = QtGui.QListView(self.ThemeManagerContents) | ||
1194 | 221 | # self.ThemeManagerListView.setObjectName("ThemeManagerListView") | ||
1195 | 222 | # self.ThemeManagerLayout.addWidget(self.ThemeManagerListView) | ||
1198 | 223 | 194 | ||
1199 | 224 | self.ThemeManagerDock.setWidget(self.ThemeManagerContents) | 195 | self.ThemeManagerDock.setWidget(self.ThemeManagerContents) |
1200 | 225 | self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock) | 196 | self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock) |
1202 | 226 | 197 | ||
1203 | 227 | self.FileNewItem = QtGui.QAction(self.main_window) | 198 | self.FileNewItem = QtGui.QAction(self.main_window) |
1204 | 228 | self.FileNewItem.setIcon(self.ServiceManagerContents.Toolbar.getIconFromTitle("New Service")) | 199 | self.FileNewItem.setIcon(self.ServiceManagerContents.Toolbar.getIconFromTitle("New Service")) |
1205 | 229 | self.FileNewItem.setObjectName("FileNewItem") | 200 | self.FileNewItem.setObjectName("FileNewItem") |
1206 | 230 | 201 | ||
1207 | === modified file 'openlp/core/ui/thememanager.py' (properties changed: -x to +x) | |||
1208 | --- openlp/core/ui/thememanager.py 2009-03-28 20:12:22 +0000 | |||
1209 | +++ openlp/core/ui/thememanager.py 2009-04-05 18:33:56 +0000 | |||
1210 | @@ -28,14 +28,20 @@ | |||
1211 | 28 | from PyQt4 import QtCore, QtGui | 28 | from PyQt4 import QtCore, QtGui |
1212 | 29 | from PyQt4.QtCore import * | 29 | from PyQt4.QtCore import * |
1213 | 30 | from PyQt4.QtGui import * | 30 | from PyQt4.QtGui import * |
1216 | 31 | # from openlp.core.resources import * | 31 | |
1217 | 32 | # from openlp.core.ui import AboutForm, AlertForm, SettingsForm, SlideController | 32 | from openlp.core.ui import AmendThemeForm |
1218 | 33 | from openlp.core import translate | 33 | from openlp.core import translate |
1219 | 34 | from openlp.core import Renderer | ||
1220 | 35 | from openlp.core.theme import Theme | ||
1221 | 36 | from openlp.core.lib import Event | ||
1222 | 37 | from openlp.core.lib import EventType | ||
1223 | 38 | from openlp.core.lib import EventManager | ||
1224 | 34 | from openlp.core.lib import OpenLPToolbar | 39 | from openlp.core.lib import OpenLPToolbar |
1225 | 40 | from openlp.core.lib import ThemeXMLBuilder | ||
1226 | 41 | from openlp.core.lib import ThemeXMLParser | ||
1227 | 35 | from openlp.core.utils import ConfigHelper | 42 | from openlp.core.utils import ConfigHelper |
1231 | 36 | #from openlp.core.lib import ThemeItem | 43 | |
1232 | 37 | 44 | ||
1230 | 38 | # from openlp.core import PluginManager | ||
1233 | 39 | import logging | 45 | import logging |
1234 | 40 | 46 | ||
1235 | 41 | class ThemeData(QAbstractItemModel): | 47 | class ThemeData(QAbstractItemModel): |
1236 | @@ -51,7 +57,7 @@ | |||
1237 | 51 | self.items=[] | 57 | self.items=[] |
1238 | 52 | self.rowheight=50 | 58 | self.rowheight=50 |
1239 | 53 | self.maximagewidth=self.rowheight*16/9.0; | 59 | self.maximagewidth=self.rowheight*16/9.0; |
1241 | 54 | log.info("Starting") | 60 | log.info(u'Starting') |
1242 | 55 | 61 | ||
1243 | 56 | def clearItems(self): | 62 | def clearItems(self): |
1244 | 57 | self.items=[] | 63 | self.items=[] |
1245 | @@ -64,9 +70,10 @@ | |||
1246 | 64 | 70 | ||
1247 | 65 | def insertRow(self, row, filename): | 71 | def insertRow(self, row, filename): |
1248 | 66 | self.beginInsertRows(QModelIndex(),row,row) | 72 | self.beginInsertRows(QModelIndex(),row,row) |
1250 | 67 | log.info("insert row %d:%s"%(row,filename)) | 73 | log.info(u'insert row %d:%s'%(row,filename)) |
1251 | 68 | (prefix, shortfilename) = os.path.split(str(filename)) | 74 | (prefix, shortfilename) = os.path.split(str(filename)) |
1253 | 69 | log.info("shortfilename=%s"%(shortfilename)) | 75 | log.info(u'shortfilename=%s'%(shortfilename)) |
1254 | 76 | theme = shortfilename.split(u'.') | ||
1255 | 70 | # create a preview image | 77 | # create a preview image |
1256 | 71 | if os.path.exists(filename): | 78 | if os.path.exists(filename): |
1257 | 72 | preview = QPixmap(str(filename)) | 79 | preview = QPixmap(str(filename)) |
1258 | @@ -83,8 +90,8 @@ | |||
1259 | 83 | p=QPixmap(w,h) | 90 | p=QPixmap(w,h) |
1260 | 84 | p.fill(Qt.transparent) | 91 | p.fill(Qt.transparent) |
1261 | 85 | # finally create the row | 92 | # finally create the row |
1264 | 86 | self.items.insert(row,(filename, p, shortfilename)) | 93 | self.items.insert(row,(filename, p, shortfilename, theme[0])) |
1265 | 87 | log.info("Items: %s" % self.items) | 94 | log.info(u'Items: %s' % self.items) |
1266 | 88 | self.endInsertRows() | 95 | self.endInsertRows() |
1267 | 89 | 96 | ||
1268 | 90 | def removeRow(self, row): | 97 | def removeRow(self, row): |
1269 | @@ -106,7 +113,7 @@ | |||
1270 | 106 | if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row! | 113 | if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row! |
1271 | 107 | return QVariant() | 114 | return QVariant() |
1272 | 108 | if role==Qt.DisplayRole: | 115 | if role==Qt.DisplayRole: |
1274 | 109 | retval= self.items[row][2] | 116 | retval= self.items[row][3] |
1275 | 110 | elif role == Qt.DecorationRole: | 117 | elif role == Qt.DecorationRole: |
1276 | 111 | retval= self.items[row][1] | 118 | retval= self.items[row][1] |
1277 | 112 | else: | 119 | else: |
1278 | @@ -122,7 +129,7 @@ | |||
1279 | 122 | yield i | 129 | yield i |
1280 | 123 | 130 | ||
1281 | 124 | def item(self, row): | 131 | def item(self, row): |
1283 | 125 | log.info("Get Item:%d -> %s" %(row, str(self.items))) | 132 | log.info(u'Get Item:%d -> %s' %(row, str(self.items))) |
1284 | 126 | return self.items[row] | 133 | return self.items[row] |
1285 | 127 | 134 | ||
1286 | 128 | class ThemeManager(QWidget): | 135 | class ThemeManager(QWidget): |
1287 | @@ -138,14 +145,19 @@ | |||
1288 | 138 | self.Layout = QtGui.QVBoxLayout(self) | 145 | self.Layout = QtGui.QVBoxLayout(self) |
1289 | 139 | self.Layout.setSpacing(0) | 146 | self.Layout.setSpacing(0) |
1290 | 140 | self.Layout.setMargin(0) | 147 | self.Layout.setMargin(0) |
1291 | 148 | self.amendThemeForm = AmendThemeForm() | ||
1292 | 141 | self.Toolbar = OpenLPToolbar(self) | 149 | self.Toolbar = OpenLPToolbar(self) |
1296 | 142 | self.Toolbar.addToolbarButton("New Theme", ":/themes/theme_new.png") | 150 | self.Toolbar.addToolbarButton(translate('ThemeManager',u'New Theme'), ":/themes/theme_new.png", |
1297 | 143 | self.Toolbar.addToolbarButton("Edit Theme", ":/themes/theme_edit.png") | 151 | translate('ThemeManager',u'Allows a Theme to be created'), self.onAddTheme) |
1298 | 144 | self.Toolbar.addToolbarButton("Delete Theme", ":/themes/theme_delete.png") | 152 | self.Toolbar.addToolbarButton(translate('ThemeManager',u'Edit Theme'), ":/themes/theme_edit.png", |
1299 | 153 | translate('ThemeManager',u'Allows a Theme to be amended'), self.onEditTheme) | ||
1300 | 154 | self.Toolbar.addToolbarButton(translate('ThemeManager',u'Delete Theme'), ":/themes/theme_delete.png", | ||
1301 | 155 | translate('ThemeManager',u'Allows a Theme to be deleted'), self.onDeleteTheme) | ||
1302 | 145 | self.Toolbar.addSeparator() | 156 | self.Toolbar.addSeparator() |
1306 | 146 | self.Toolbar.addToolbarButton("Import Theme", ":/themes/theme_import.png", | 157 | self.Toolbar.addToolbarButton(translate('ThemeManager',u'Import Theme'), ":/themes/theme_import.png", |
1307 | 147 | u'Allows Themes to be imported', self.onImportTheme) | 158 | translate('ThemeManager',u'Allows Themes to be imported'), self.onImportTheme) |
1308 | 148 | self.Toolbar.addToolbarButton("Export Theme", ":/themes/theme_export.png") | 159 | self.Toolbar.addToolbarButton(translate('ThemeManager',u'Export Theme'), ":/themes/theme_export.png", |
1309 | 160 | translate('ThemeManager',u'Allows Themes to be exported'), self.onExportTheme) | ||
1310 | 149 | self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar) | 161 | self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar) |
1311 | 150 | self.Toolbar.addAction(self.ThemeWidget) | 162 | self.Toolbar.addAction(self.ThemeWidget) |
1312 | 151 | 163 | ||
1313 | @@ -161,62 +173,29 @@ | |||
1314 | 161 | self.themelist= [] | 173 | self.themelist= [] |
1315 | 162 | self.path = os.path.join(ConfigHelper.get_data_path(), u'themes') | 174 | self.path = os.path.join(ConfigHelper.get_data_path(), u'themes') |
1316 | 163 | self.checkThemesExists(self.path) | 175 | self.checkThemesExists(self.path) |
1366 | 164 | self.loadThemes() # load the themes | 176 | |
1367 | 165 | 177 | def setEventManager(self, eventManager): | |
1368 | 166 | # def addThemeItem(self, item): | 178 | self.eventManager = eventManager |
1369 | 167 | # """Adds Theme item""" | 179 | |
1370 | 168 | # log.info("addThemeItem") | 180 | def onAddTheme(self): |
1371 | 169 | # indexes=self.TreeView.selectedIndexes() | 181 | self.amendThemeForm.exec_() |
1372 | 170 | # assert len(indexes) <= 1 # can only have one selected index in this view | 182 | |
1373 | 171 | # if indexes == []: | 183 | def onEditTheme(self): |
1374 | 172 | # log.info("No row") | 184 | self.amendThemeForm.loadTheme(theme) |
1375 | 173 | # row = None | 185 | self.amendThemeForm.exec_() |
1376 | 174 | # selected_item = None | 186 | |
1377 | 175 | # else: | 187 | def onDeleteTheme(self): |
1378 | 176 | # row=indexes[0].row() | 188 | pass |
1379 | 177 | # # if currently selected is of correct type, add it to it | 189 | |
1380 | 178 | # log.info("row:%d"%row) | 190 | def onExportTheme(self): |
1381 | 179 | # selected_item=self.Theme_data.item(row) | 191 | pass |
1333 | 180 | # if type(selected_item) == type(item): | ||
1334 | 181 | # log.info("Add to existing item") | ||
1335 | 182 | # selected_item.add(item) | ||
1336 | 183 | # else: | ||
1337 | 184 | # log.info("Create new item") | ||
1338 | 185 | # if row is None: | ||
1339 | 186 | # self.Theme_data.addRow(item) | ||
1340 | 187 | # else: | ||
1341 | 188 | # self.Theme_data.insertRow(row+1, item) | ||
1342 | 189 | # | ||
1343 | 190 | # def removeThemeItem(self): | ||
1344 | 191 | # """Remove currently selected item""" | ||
1345 | 192 | # pass | ||
1346 | 193 | # | ||
1347 | 194 | # def oos_as_text(self): | ||
1348 | 195 | # text=[] | ||
1349 | 196 | # log.info( "oos as text") | ||
1350 | 197 | # log.info("Data:"+str(self.Theme_data)) | ||
1351 | 198 | # for i in self.Theme_data: | ||
1352 | 199 | # text.append("# " + str(i)) | ||
1353 | 200 | # text.append(i.get_oos_text()) | ||
1354 | 201 | # return '\n'.join(text) | ||
1355 | 202 | # | ||
1356 | 203 | # def write_oos(self, filename): | ||
1357 | 204 | # """ | ||
1358 | 205 | # Write a full OOS file out - iterate over plugins and call their respective methods | ||
1359 | 206 | # This format is totally arbitrary testing purposes - something sensible needs to go in here! | ||
1360 | 207 | # """ | ||
1361 | 208 | # oosfile=open(filename, "w") | ||
1362 | 209 | # oosfile.write("# BEGIN OOS\n") | ||
1363 | 210 | # oosfile.write(self.oos_as_text) | ||
1364 | 211 | # oosfile.write("# END OOS\n") | ||
1365 | 212 | # oosfile.close() | ||
1382 | 213 | 192 | ||
1383 | 214 | def onImportTheme(self): | 193 | def onImportTheme(self): |
1384 | 215 | files = QtGui.QFileDialog.getOpenFileNames(None, | 194 | files = QtGui.QFileDialog.getOpenFileNames(None, |
1385 | 216 | translate('ThemeManager', u'Select Import File'), | 195 | translate('ThemeManager', u'Select Import File'), |
1386 | 217 | self.path, | 196 | self.path, |
1387 | 218 | u'Theme (*.theme)') | 197 | u'Theme (*.theme)') |
1389 | 219 | log.info(u'New Themes) %s', str(files)) | 198 | log.info(u'New Themes %s', str(files)) |
1390 | 220 | if len(files) > 0: | 199 | if len(files) > 0: |
1391 | 221 | for file in files: | 200 | for file in files: |
1392 | 222 | self.unzipTheme(file, self.path) | 201 | self.unzipTheme(file, self.path) |
1393 | @@ -228,9 +207,11 @@ | |||
1394 | 228 | # self.themelist = [u'African Sunset', u'Snowy Mountains', u'Wilderness', u'Wet and Windy London'] | 207 | # self.themelist = [u'African Sunset', u'Snowy Mountains', u'Wilderness', u'Wet and Windy London'] |
1395 | 229 | for root, dirs, files in os.walk(self.path): | 208 | for root, dirs, files in os.walk(self.path): |
1396 | 230 | for name in files: | 209 | for name in files: |
1398 | 231 | if name.endswith(u'.bmp'): | 210 | if name.endswith(u'.png'): |
1399 | 232 | self.Theme_data.addRow(os.path.join(self.path, name)) | 211 | self.Theme_data.addRow(os.path.join(self.path, name)) |
1400 | 233 | 212 | ||
1401 | 213 | self.eventManager.post_event(Event(EventType.ThemeListChanged)) | ||
1402 | 214 | |||
1403 | 234 | def getThemes(self): | 215 | def getThemes(self): |
1404 | 235 | return self.themelist | 216 | return self.themelist |
1405 | 236 | 217 | ||
1406 | @@ -249,16 +230,99 @@ | |||
1407 | 249 | os.mkdir(os.path.join(dir, file)) | 230 | os.mkdir(os.path.join(dir, file)) |
1408 | 250 | else: | 231 | else: |
1409 | 251 | fullpath = os.path.join(dir, file) | 232 | fullpath = os.path.join(dir, file) |
1410 | 233 | names = file.split(u'/') | ||
1411 | 234 | xml_data = zip.read(file) | ||
1412 | 252 | if file.endswith(u'.xml'): | 235 | if file.endswith(u'.xml'): |
1417 | 253 | self.checkVersion1(fullpath) | 236 | if self.checkVersion1(xml_data): |
1418 | 254 | outfile = open(fullpath, 'w') | 237 | filexml = self.migrateVersion122(filename, fullpath, xml_data) |
1419 | 255 | outfile.write(zip.read(file)) | 238 | outfile = open(fullpath, 'w') |
1420 | 256 | outfile.close() | 239 | outfile.write(filexml) |
1421 | 240 | outfile.close() | ||
1422 | 241 | self.generateImage(dir,names[0], filexml) | ||
1423 | 242 | else: | ||
1424 | 243 | if file.endswith(u'.bmp'): | ||
1425 | 244 | if fullpath is not os.path.join(dir, file): | ||
1426 | 245 | outfile = open(fullpath, 'w') | ||
1427 | 246 | outfile.write(zip.read(file)) | ||
1428 | 247 | outfile.close() | ||
1429 | 257 | 248 | ||
1430 | 258 | def checkVersion1(self, xmlfile): | 249 | def checkVersion1(self, xmlfile): |
1433 | 259 | file=open(xmlfile) | 250 | log.debug(u'checkVersion1 ') |
1434 | 260 | t=''.join(file.readlines()) # read the file and change list to a string | 251 | t = xmlfile |
1435 | 261 | tree = ElementTree(element=XML(t)).getroot() | 252 | tree = ElementTree(element=XML(t)).getroot() |
1439 | 262 | print "AA" | 253 | if tree.find(u'BackgroundType') is None : |
1440 | 263 | print tree.find('BackgroundType') | 254 | return False |
1441 | 264 | print "AAA" | 255 | else: |
1442 | 256 | return True | ||
1443 | 257 | |||
1444 | 258 | def migrateVersion122(self, filename , fullpath, xml_data): | ||
1445 | 259 | log.debug(u'migrateVersion122 %s %s', filename , fullpath) | ||
1446 | 260 | t=Theme(xml_data) | ||
1447 | 261 | |||
1448 | 262 | newtheme = ThemeXMLBuilder() | ||
1449 | 263 | newtheme.new_document(t.Name) | ||
1450 | 264 | if t.BackgroundType == 0: | ||
1451 | 265 | newtheme.add_background_solid(str(t.BackgroundParameter1.name())) | ||
1452 | 266 | elif t.BackgroundType == 1: | ||
1453 | 267 | direction = "vertical" | ||
1454 | 268 | if t.BackgroundParameter1.name() == 1: | ||
1455 | 269 | direction = "horizontal" | ||
1456 | 270 | newtheme.add_background_gradient(str(t.BackgroundParameter1.name()), str(t.BackgroundParameter2.name()), direction) | ||
1457 | 271 | else: | ||
1458 | 272 | newtheme.add_background_image(str(t.BackgroundParameter1)) | ||
1459 | 273 | |||
1460 | 274 | newtheme.add_font(str(t.FontName), str(t.FontColor.name()), str(t.FontProportion * 2)) | ||
1461 | 275 | newtheme.add_font(str(t.FontName), str(t.FontColor.name()), str(12), u'footer') | ||
1462 | 276 | outline = False | ||
1463 | 277 | shadow = False | ||
1464 | 278 | if t.Shadow == 1: | ||
1465 | 279 | shadow = True | ||
1466 | 280 | if t.Outline == 1: | ||
1467 | 281 | outline = True | ||
1468 | 282 | newtheme.add_display(str(shadow), str(t.ShadowColor.name()), str(outline), str(t.OutlineColor.name()), | ||
1469 | 283 | str(t.HorizontalAlign), str(t.VerticalAlign), str(t.WrapStyle)) | ||
1470 | 284 | return newtheme.extract_xml() | ||
1471 | 285 | |||
1472 | 286 | def generateImage(self, dir, name, theme_xml): | ||
1473 | 287 | log.debug(u'generateImage %s %s ', dir, theme_xml) | ||
1474 | 288 | theme = ThemeXMLParser(theme_xml) | ||
1475 | 289 | #print theme | ||
1476 | 290 | size=QtCore.QSize(800,600) | ||
1477 | 291 | frame=TstFrame(size) | ||
1478 | 292 | frame=frame | ||
1479 | 293 | paintdest=frame.GetPixmap() | ||
1480 | 294 | r=Renderer() | ||
1481 | 295 | r.set_paint_dest(paintdest) | ||
1482 | 296 | |||
1483 | 297 | r.set_theme(theme) # set default theme | ||
1484 | 298 | r._render_background() | ||
1485 | 299 | r.set_text_rectangle(QtCore.QRect(0,0, size.width()-1, size.height()-1)) | ||
1486 | 300 | |||
1487 | 301 | lines=[] | ||
1488 | 302 | lines.append(u'Amazing Grace!') | ||
1489 | 303 | lines.append(u'How sweet the sound') | ||
1490 | 304 | lines.append(u'To save a wretch like me;') | ||
1491 | 305 | lines.append(u'I once was lost but now am found,') | ||
1492 | 306 | lines.append(u'Was blind, but now I see.') | ||
1493 | 307 | |||
1494 | 308 | answer=r._render_lines(lines) | ||
1495 | 309 | r._get_extent_and_render(u'Amazing Grace (John Newton) ', (10, 560), True, None, True) | ||
1496 | 310 | r._get_extent_and_render(u'CCLI xxx (c)Openlp.org', (10, 580), True, None, True) | ||
1497 | 311 | |||
1498 | 312 | im=frame.GetPixmap().toImage() | ||
1499 | 313 | testpathname=os.path.join(dir, name+u'.png') | ||
1500 | 314 | if os.path.exists(testpathname): | ||
1501 | 315 | os.unlink(testpathname) | ||
1502 | 316 | im.save(testpathname, u'png') | ||
1503 | 317 | log.debug(u'Theme image written to %s',testpathname) | ||
1504 | 318 | |||
1505 | 319 | |||
1506 | 320 | class TstFrame: | ||
1507 | 321 | def __init__(self, size): | ||
1508 | 322 | """Create the DemoPanel.""" | ||
1509 | 323 | self.width=size.width(); | ||
1510 | 324 | self.height=size.height(); | ||
1511 | 325 | # create something to be painted into | ||
1512 | 326 | self._Buffer = QtGui.QPixmap(self.width, self.height) | ||
1513 | 327 | def GetPixmap(self): | ||
1514 | 328 | return self._Buffer | ||
1515 | 265 | 329 | ||
1516 | === modified file 'openlp/plugins/bibles/lib/biblestab.py' | |||
1517 | --- openlp/plugins/bibles/lib/biblestab.py 2009-03-09 12:49:55 +0000 | |||
1518 | +++ openlp/plugins/bibles/lib/biblestab.py 2009-04-04 10:24:39 +0000 | |||
1519 | @@ -68,12 +68,14 @@ | |||
1520 | 68 | self.NewChaptersCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox) | 68 | self.NewChaptersCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox) |
1521 | 69 | self.NewChaptersCheckBox.setObjectName("NewChaptersCheckBox") | 69 | self.NewChaptersCheckBox.setObjectName("NewChaptersCheckBox") |
1522 | 70 | self.VerseDisplayLayout.addWidget(self.NewChaptersCheckBox, 1, 0, 1, 1) | 70 | self.VerseDisplayLayout.addWidget(self.NewChaptersCheckBox, 1, 0, 1, 1) |
1523 | 71 | |||
1524 | 71 | self.DisplayStyleWidget = QtGui.QWidget(self.VerseDisplayGroupBox) | 72 | self.DisplayStyleWidget = QtGui.QWidget(self.VerseDisplayGroupBox) |
1525 | 72 | self.DisplayStyleWidget.setObjectName(u'DisplayStyleWidget') | 73 | self.DisplayStyleWidget.setObjectName(u'DisplayStyleWidget') |
1526 | 73 | self.DisplayStyleLayout = QtGui.QHBoxLayout(self.DisplayStyleWidget) | 74 | self.DisplayStyleLayout = QtGui.QHBoxLayout(self.DisplayStyleWidget) |
1527 | 74 | self.DisplayStyleLayout.setSpacing(8) | 75 | self.DisplayStyleLayout.setSpacing(8) |
1528 | 75 | self.DisplayStyleLayout.setMargin(0) | 76 | self.DisplayStyleLayout.setMargin(0) |
1529 | 76 | self.DisplayStyleLayout.setObjectName(u'DisplayStyleLayout') | 77 | self.DisplayStyleLayout.setObjectName(u'DisplayStyleLayout') |
1530 | 78 | |||
1531 | 77 | self.DisplayStyleLabel = QtGui.QLabel(self.DisplayStyleWidget) | 79 | self.DisplayStyleLabel = QtGui.QLabel(self.DisplayStyleWidget) |
1532 | 78 | self.DisplayStyleLabel.setObjectName(u'DisplayStyleLabel') | 80 | self.DisplayStyleLabel.setObjectName(u'DisplayStyleLabel') |
1533 | 79 | self.DisplayStyleLayout.addWidget(self.DisplayStyleLabel) | 81 | self.DisplayStyleLayout.addWidget(self.DisplayStyleLabel) |
1534 | @@ -85,9 +87,26 @@ | |||
1535 | 85 | self.DisplayStyleComboBox.addItem(QtCore.QString()) | 87 | self.DisplayStyleComboBox.addItem(QtCore.QString()) |
1536 | 86 | self.DisplayStyleLayout.addWidget(self.DisplayStyleComboBox) | 88 | self.DisplayStyleLayout.addWidget(self.DisplayStyleComboBox) |
1537 | 87 | self.VerseDisplayLayout.addWidget(self.DisplayStyleWidget, 2, 0, 1, 1) | 89 | self.VerseDisplayLayout.addWidget(self.DisplayStyleWidget, 2, 0, 1, 1) |
1538 | 90 | |||
1539 | 91 | self.BibleThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox) | ||
1540 | 92 | self.BibleThemeWidget.setObjectName(u'BibleThemeWidget') | ||
1541 | 93 | self.BibleThemeLayout = QtGui.QHBoxLayout(self.BibleThemeWidget) | ||
1542 | 94 | self.BibleThemeLayout.setSpacing(8) | ||
1543 | 95 | self.BibleThemeLayout.setMargin(0) | ||
1544 | 96 | self.BibleThemeLayout.setObjectName(u'BibleThemeLayout') | ||
1545 | 97 | |||
1546 | 98 | self.BibleThemeLabel = QtGui.QLabel(self.BibleThemeWidget) | ||
1547 | 99 | self.BibleThemeLabel.setObjectName(u'BibleThemeLabel') | ||
1548 | 100 | self.BibleThemeLayout.addWidget(self.BibleThemeLabel) | ||
1549 | 101 | self.BibleThemeComboBox = QtGui.QComboBox(self.BibleThemeWidget) | ||
1550 | 102 | self.BibleThemeComboBox.setObjectName(u'BibleThemeComboBox') | ||
1551 | 103 | self.BibleThemeComboBox.addItem(QtCore.QString()) | ||
1552 | 104 | self.BibleThemeLayout.addWidget(self.BibleThemeComboBox) | ||
1553 | 105 | self.VerseDisplayLayout.addWidget(self.BibleThemeWidget, 3, 0, 1, 1) | ||
1554 | 106 | |||
1555 | 88 | self.ChangeNoteLabel = QtGui.QLabel(self.VerseDisplayGroupBox) | 107 | self.ChangeNoteLabel = QtGui.QLabel(self.VerseDisplayGroupBox) |
1556 | 89 | self.ChangeNoteLabel.setObjectName(u'ChangeNoteLabel') | 108 | self.ChangeNoteLabel.setObjectName(u'ChangeNoteLabel') |
1558 | 90 | self.VerseDisplayLayout.addWidget(self.ChangeNoteLabel, 3, 0, 1, 1) | 109 | self.VerseDisplayLayout.addWidget(self.ChangeNoteLabel, 4, 0, 1, 1) |
1559 | 91 | self.BibleLeftLayout.addWidget(self.VerseDisplayGroupBox) | 110 | self.BibleLeftLayout.addWidget(self.VerseDisplayGroupBox) |
1560 | 92 | self.BibleLeftSpacer = QtGui.QSpacerItem(40, 20, | 111 | self.BibleLeftSpacer = QtGui.QSpacerItem(40, 20, |
1561 | 93 | QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | 112 | QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
1562 | @@ -132,6 +151,7 @@ | |||
1563 | 132 | self.ParagraphRadioButton.setText(translate('SettingsForm','Paragraph style')) | 151 | self.ParagraphRadioButton.setText(translate('SettingsForm','Paragraph style')) |
1564 | 133 | self.NewChaptersCheckBox.setText(translate('SettingsForm', 'Only show new chapter numbers')) | 152 | self.NewChaptersCheckBox.setText(translate('SettingsForm', 'Only show new chapter numbers')) |
1565 | 134 | self.DisplayStyleLabel.setText(translate('SettingsForm', 'Display Style:')) | 153 | self.DisplayStyleLabel.setText(translate('SettingsForm', 'Display Style:')) |
1566 | 154 | self.BibleThemeLabel.setText(translate('SettingsForm', 'Bible Theme:')) | ||
1567 | 135 | self.DisplayStyleComboBox.setItemText(0, translate('SettingsForm', 'No brackets')) | 155 | self.DisplayStyleComboBox.setItemText(0, translate('SettingsForm', 'No brackets')) |
1568 | 136 | self.DisplayStyleComboBox.setItemText(1, translate('SettingsForm', '( and )')) | 156 | self.DisplayStyleComboBox.setItemText(1, translate('SettingsForm', '( and )')) |
1569 | 137 | self.DisplayStyleComboBox.setItemText(2, translate('SettingsForm', '{ and }')) | 157 | self.DisplayStyleComboBox.setItemText(2, translate('SettingsForm', '{ and }')) |
1570 | @@ -165,6 +185,7 @@ | |||
1571 | 165 | self.paragraph_style = self.convertStringToBoolean(self.config.get_config('paragraph style', u'True')) | 185 | self.paragraph_style = self.convertStringToBoolean(self.config.get_config('paragraph style', u'True')) |
1572 | 166 | self.show_new_chapters = self.convertStringToBoolean(self.config.get_config('display new chapter', u"False")) | 186 | self.show_new_chapters = self.convertStringToBoolean(self.config.get_config('display new chapter', u"False")) |
1573 | 167 | self.display_style = int(self.config.get_config('display brackets', '0')) | 187 | self.display_style = int(self.config.get_config('display brackets', '0')) |
1574 | 188 | self.bible_theme = int(self.config.get_config('bible theme', '0')) | ||
1575 | 168 | self.bible_search = self.convertStringToBoolean(self.config.get_config('search as type', u'True')) | 189 | self.bible_search = self.convertStringToBoolean(self.config.get_config('search as type', u'True')) |
1576 | 169 | if self.paragraph_style: | 190 | if self.paragraph_style: |
1577 | 170 | self.ParagraphRadioButton.setChecked(True) | 191 | self.ParagraphRadioButton.setChecked(True) |
1578 | @@ -173,9 +194,14 @@ | |||
1579 | 173 | self.NewChaptersCheckBox.setChecked(self.show_new_chapters) | 194 | self.NewChaptersCheckBox.setChecked(self.show_new_chapters) |
1580 | 174 | self.DisplayStyleComboBox.setCurrentIndex(self.display_style) | 195 | self.DisplayStyleComboBox.setCurrentIndex(self.display_style) |
1581 | 175 | self.BibleSearchCheckBox.setChecked(self.bible_search) | 196 | self.BibleSearchCheckBox.setChecked(self.bible_search) |
1582 | 197 | if self.bible_theme == 0: # must be new set to first | ||
1583 | 198 | self.BibleThemeComboBox.setCurrentIndex(self.bible_theme) | ||
1584 | 199 | else: | ||
1585 | 200 | pass # TODO need to code | ||
1586 | 176 | 201 | ||
1587 | 177 | def save(self): | 202 | def save(self): |
1588 | 178 | self.config.set_config("paragraph style", str(self.paragraph_style)) | 203 | self.config.set_config("paragraph style", str(self.paragraph_style)) |
1589 | 179 | self.config.set_config("display new chapter", str(self.show_new_chapters)) | 204 | self.config.set_config("display new chapter", str(self.show_new_chapters)) |
1590 | 180 | self.config.set_config("display brackets", str(self.display_style)) | 205 | self.config.set_config("display brackets", str(self.display_style)) |
1591 | 181 | self.config.set_config("search as type", str(self.bible_search)) | 206 | self.config.set_config("search as type", str(self.bible_search)) |
1592 | 207 | self.config.set_config("bible theme", str(self.bible_theme)) | ||
1593 | 182 | 208 | ||
1594 | === added file 'resources/forms/amendthemedialog.ui' | |||
1595 | --- resources/forms/amendthemedialog.ui 1970-01-01 00:00:00 +0000 | |||
1596 | +++ resources/forms/amendthemedialog.ui 2009-04-04 17:36:15 +0000 | |||
1597 | @@ -0,0 +1,547 @@ | |||
1598 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
1599 | 2 | <ui version="4.0"> | ||
1600 | 3 | <class>AmendThemeDialog</class> | ||
1601 | 4 | <widget class="QWidget" name="AmendThemeDialog"> | ||
1602 | 5 | <property name="geometry"> | ||
1603 | 6 | <rect> | ||
1604 | 7 | <x>0</x> | ||
1605 | 8 | <y>0</y> | ||
1606 | 9 | <width>752</width> | ||
1607 | 10 | <height>533</height> | ||
1608 | 11 | </rect> | ||
1609 | 12 | </property> | ||
1610 | 13 | <property name="windowTitle"> | ||
1611 | 14 | <string>Theme Maintance</string> | ||
1612 | 15 | </property> | ||
1613 | 16 | <property name="windowIcon"> | ||
1614 | 17 | <iconset resource="../images/openlp-2.qrc"> | ||
1615 | 18 | <normaloff>:/icon/openlp.org-icon-32.bmp</normaloff>:/icon/openlp.org-icon-32.bmp</iconset> | ||
1616 | 19 | </property> | ||
1617 | 20 | <widget class="QDialogButtonBox" name="ThemeButtonBox"> | ||
1618 | 21 | <property name="geometry"> | ||
1619 | 22 | <rect> | ||
1620 | 23 | <x>580</x> | ||
1621 | 24 | <y>500</y> | ||
1622 | 25 | <width>156</width> | ||
1623 | 26 | <height>26</height> | ||
1624 | 27 | </rect> | ||
1625 | 28 | </property> | ||
1626 | 29 | <property name="standardButtons"> | ||
1627 | 30 | <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
1628 | 31 | </property> | ||
1629 | 32 | </widget> | ||
1630 | 33 | <widget class="QWidget" name="layoutWidget"> | ||
1631 | 34 | <property name="geometry"> | ||
1632 | 35 | <rect> | ||
1633 | 36 | <x>30</x> | ||
1634 | 37 | <y>70</y> | ||
1635 | 38 | <width>691</width> | ||
1636 | 39 | <height>401</height> | ||
1637 | 40 | </rect> | ||
1638 | 41 | </property> | ||
1639 | 42 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
1640 | 43 | <item> | ||
1641 | 44 | <widget class="QWidget" name="LeftSide" native="true"> | ||
1642 | 45 | <widget class="QTabWidget" name="tabWidget"> | ||
1643 | 46 | <property name="geometry"> | ||
1644 | 47 | <rect> | ||
1645 | 48 | <x>0</x> | ||
1646 | 49 | <y>0</y> | ||
1647 | 50 | <width>341</width> | ||
1648 | 51 | <height>401</height> | ||
1649 | 52 | </rect> | ||
1650 | 53 | </property> | ||
1651 | 54 | <property name="currentIndex"> | ||
1652 | 55 | <number>1</number> | ||
1653 | 56 | </property> | ||
1654 | 57 | <widget class="QWidget" name="BackgroundTab"> | ||
1655 | 58 | <attribute name="title"> | ||
1656 | 59 | <string>Background</string> | ||
1657 | 60 | </attribute> | ||
1658 | 61 | <widget class="QWidget" name="layoutWidget"> | ||
1659 | 62 | <property name="geometry"> | ||
1660 | 63 | <rect> | ||
1661 | 64 | <x>10</x> | ||
1662 | 65 | <y>10</y> | ||
1663 | 66 | <width>321</width> | ||
1664 | 67 | <height>351</height> | ||
1665 | 68 | </rect> | ||
1666 | 69 | </property> | ||
1667 | 70 | <layout class="QGridLayout" name="gridLayout"> | ||
1668 | 71 | <item row="0" column="0" colspan="2"> | ||
1669 | 72 | <widget class="QLabel" name="BackgroundLabel"> | ||
1670 | 73 | <property name="text"> | ||
1671 | 74 | <string>Background:</string> | ||
1672 | 75 | </property> | ||
1673 | 76 | </widget> | ||
1674 | 77 | </item> | ||
1675 | 78 | <item row="0" column="2" colspan="2"> | ||
1676 | 79 | <widget class="QComboBox" name="BackgroundComboBox"> | ||
1677 | 80 | <item> | ||
1678 | 81 | <property name="text"> | ||
1679 | 82 | <string>Opaque</string> | ||
1680 | 83 | </property> | ||
1681 | 84 | </item> | ||
1682 | 85 | <item> | ||
1683 | 86 | <property name="text"> | ||
1684 | 87 | <string>Transparent</string> | ||
1685 | 88 | </property> | ||
1686 | 89 | </item> | ||
1687 | 90 | </widget> | ||
1688 | 91 | </item> | ||
1689 | 92 | <item row="1" column="0" colspan="2"> | ||
1690 | 93 | <widget class="QLabel" name="BackgroundTypeLabel"> | ||
1691 | 94 | <property name="text"> | ||
1692 | 95 | <string>Background Type:</string> | ||
1693 | 96 | </property> | ||
1694 | 97 | </widget> | ||
1695 | 98 | </item> | ||
1696 | 99 | <item row="1" column="2" colspan="2"> | ||
1697 | 100 | <widget class="QComboBox" name="BackgroundTypeComboBox"> | ||
1698 | 101 | <item> | ||
1699 | 102 | <property name="text"> | ||
1700 | 103 | <string>Solid Color</string> | ||
1701 | 104 | </property> | ||
1702 | 105 | </item> | ||
1703 | 106 | <item> | ||
1704 | 107 | <property name="text"> | ||
1705 | 108 | <string>Gradient</string> | ||
1706 | 109 | </property> | ||
1707 | 110 | </item> | ||
1708 | 111 | <item> | ||
1709 | 112 | <property name="text"> | ||
1710 | 113 | <string>Image</string> | ||
1711 | 114 | </property> | ||
1712 | 115 | </item> | ||
1713 | 116 | </widget> | ||
1714 | 117 | </item> | ||
1715 | 118 | <item row="2" column="0"> | ||
1716 | 119 | <widget class="QLabel" name="Color1Label"> | ||
1717 | 120 | <property name="text"> | ||
1718 | 121 | <string><Color1></string> | ||
1719 | 122 | </property> | ||
1720 | 123 | </widget> | ||
1721 | 124 | </item> | ||
1722 | 125 | <item row="2" column="2" colspan="2"> | ||
1723 | 126 | <widget class="QPushButton" name="Color1PushButton"> | ||
1724 | 127 | <property name="text"> | ||
1725 | 128 | <string/> | ||
1726 | 129 | </property> | ||
1727 | 130 | </widget> | ||
1728 | 131 | </item> | ||
1729 | 132 | <item row="3" column="0"> | ||
1730 | 133 | <widget class="QLabel" name="Color2Label"> | ||
1731 | 134 | <property name="text"> | ||
1732 | 135 | <string><Color2></string> | ||
1733 | 136 | </property> | ||
1734 | 137 | </widget> | ||
1735 | 138 | </item> | ||
1736 | 139 | <item row="3" column="2" colspan="2"> | ||
1737 | 140 | <widget class="QPushButton" name="Color2PushButton"> | ||
1738 | 141 | <property name="text"> | ||
1739 | 142 | <string/> | ||
1740 | 143 | </property> | ||
1741 | 144 | </widget> | ||
1742 | 145 | </item> | ||
1743 | 146 | <item row="4" column="0"> | ||
1744 | 147 | <widget class="QLabel" name="ImageLabel"> | ||
1745 | 148 | <property name="text"> | ||
1746 | 149 | <string>Image:</string> | ||
1747 | 150 | </property> | ||
1748 | 151 | </widget> | ||
1749 | 152 | </item> | ||
1750 | 153 | <item row="4" column="1" colspan="2"> | ||
1751 | 154 | <widget class="QLineEdit" name="ImageLineEdit"/> | ||
1752 | 155 | </item> | ||
1753 | 156 | <item row="4" column="3"> | ||
1754 | 157 | <widget class="QPushButton" name="ImagePushButton"> | ||
1755 | 158 | <property name="text"> | ||
1756 | 159 | <string/> | ||
1757 | 160 | </property> | ||
1758 | 161 | <property name="icon"> | ||
1759 | 162 | <iconset resource="../images/openlp-2.qrc"> | ||
1760 | 163 | <normaloff>:/services/service_open.png</normaloff>:/services/service_open.png</iconset> | ||
1761 | 164 | </property> | ||
1762 | 165 | </widget> | ||
1763 | 166 | </item> | ||
1764 | 167 | <item row="5" column="0"> | ||
1765 | 168 | <widget class="QLabel" name="GradientLabel"> | ||
1766 | 169 | <property name="text"> | ||
1767 | 170 | <string>Gradient :</string> | ||
1768 | 171 | </property> | ||
1769 | 172 | </widget> | ||
1770 | 173 | </item> | ||
1771 | 174 | <item row="5" column="2" colspan="2"> | ||
1772 | 175 | <widget class="QComboBox" name="GradientComboBox"> | ||
1773 | 176 | <item> | ||
1774 | 177 | <property name="text"> | ||
1775 | 178 | <string>Horizontal</string> | ||
1776 | 179 | </property> | ||
1777 | 180 | </item> | ||
1778 | 181 | <item> | ||
1779 | 182 | <property name="text"> | ||
1780 | 183 | <string>Vertical</string> | ||
1781 | 184 | </property> | ||
1782 | 185 | </item> | ||
1783 | 186 | <item> | ||
1784 | 187 | <property name="text"> | ||
1785 | 188 | <string>Circular</string> | ||
1786 | 189 | </property> | ||
1787 | 190 | </item> | ||
1788 | 191 | </widget> | ||
1789 | 192 | </item> | ||
1790 | 193 | </layout> | ||
1791 | 194 | </widget> | ||
1792 | 195 | </widget> | ||
1793 | 196 | <widget class="QWidget" name="FontTab"> | ||
1794 | 197 | <attribute name="title"> | ||
1795 | 198 | <string>Font</string> | ||
1796 | 199 | </attribute> | ||
1797 | 200 | <widget class="QGroupBox" name="MainFontGroupBox"> | ||
1798 | 201 | <property name="geometry"> | ||
1799 | 202 | <rect> | ||
1800 | 203 | <x>20</x> | ||
1801 | 204 | <y>20</y> | ||
1802 | 205 | <width>307</width> | ||
1803 | 206 | <height>119</height> | ||
1804 | 207 | </rect> | ||
1805 | 208 | </property> | ||
1806 | 209 | <property name="title"> | ||
1807 | 210 | <string>Main Font</string> | ||
1808 | 211 | </property> | ||
1809 | 212 | <layout class="QGridLayout" name="gridLayout_2"> | ||
1810 | 213 | <item row="0" column="0"> | ||
1811 | 214 | <widget class="QLabel" name="MainFontlabel"> | ||
1812 | 215 | <property name="text"> | ||
1813 | 216 | <string>Font:</string> | ||
1814 | 217 | </property> | ||
1815 | 218 | </widget> | ||
1816 | 219 | </item> | ||
1817 | 220 | <item row="0" column="1" colspan="2"> | ||
1818 | 221 | <widget class="QFontComboBox" name="MainFontComboBox"/> | ||
1819 | 222 | </item> | ||
1820 | 223 | <item row="1" column="0"> | ||
1821 | 224 | <widget class="QLabel" name="MainFontColorLabel"> | ||
1822 | 225 | <property name="text"> | ||
1823 | 226 | <string>Font Color</string> | ||
1824 | 227 | </property> | ||
1825 | 228 | </widget> | ||
1826 | 229 | </item> | ||
1827 | 230 | <item row="1" column="2"> | ||
1828 | 231 | <widget class="QPushButton" name="MainFontColorPushButton"> | ||
1829 | 232 | <property name="text"> | ||
1830 | 233 | <string/> | ||
1831 | 234 | </property> | ||
1832 | 235 | </widget> | ||
1833 | 236 | </item> | ||
1834 | 237 | <item row="2" column="0"> | ||
1835 | 238 | <widget class="QLabel" name="MainFontSize"> | ||
1836 | 239 | <property name="text"> | ||
1837 | 240 | <string>Size:</string> | ||
1838 | 241 | </property> | ||
1839 | 242 | </widget> | ||
1840 | 243 | </item> | ||
1841 | 244 | <item row="2" column="1"> | ||
1842 | 245 | <widget class="QLineEdit" name="MainFontSizeLineEdit"/> | ||
1843 | 246 | </item> | ||
1844 | 247 | <item row="2" column="2"> | ||
1845 | 248 | <widget class="QSlider" name="MainFontlSlider"> | ||
1846 | 249 | <property name="value"> | ||
1847 | 250 | <number>15</number> | ||
1848 | 251 | </property> | ||
1849 | 252 | <property name="maximum"> | ||
1850 | 253 | <number>40</number> | ||
1851 | 254 | </property> | ||
1852 | 255 | <property name="orientation"> | ||
1853 | 256 | <enum>Qt::Horizontal</enum> | ||
1854 | 257 | </property> | ||
1855 | 258 | <property name="tickPosition"> | ||
1856 | 259 | <enum>QSlider::TicksBelow</enum> | ||
1857 | 260 | </property> | ||
1858 | 261 | <property name="tickInterval"> | ||
1859 | 262 | <number>5</number> | ||
1860 | 263 | </property> | ||
1861 | 264 | </widget> | ||
1862 | 265 | </item> | ||
1863 | 266 | </layout> | ||
1864 | 267 | </widget> | ||
1865 | 268 | <widget class="QGroupBox" name="FooterFontGroupBox"> | ||
1866 | 269 | <property name="geometry"> | ||
1867 | 270 | <rect> | ||
1868 | 271 | <x>20</x> | ||
1869 | 272 | <y>170</y> | ||
1870 | 273 | <width>307</width> | ||
1871 | 274 | <height>119</height> | ||
1872 | 275 | </rect> | ||
1873 | 276 | </property> | ||
1874 | 277 | <property name="title"> | ||
1875 | 278 | <string>Footer Font</string> | ||
1876 | 279 | </property> | ||
1877 | 280 | <layout class="QGridLayout" name="gridLayout_3"> | ||
1878 | 281 | <item row="0" column="0"> | ||
1879 | 282 | <widget class="QLabel" name="FooterFontlabel"> | ||
1880 | 283 | <property name="text"> | ||
1881 | 284 | <string>Font:</string> | ||
1882 | 285 | </property> | ||
1883 | 286 | </widget> | ||
1884 | 287 | </item> | ||
1885 | 288 | <item row="0" column="1" colspan="2"> | ||
1886 | 289 | <widget class="QFontComboBox" name="FooterFontComboBox"/> | ||
1887 | 290 | </item> | ||
1888 | 291 | <item row="1" column="0"> | ||
1889 | 292 | <widget class="QLabel" name="FooterFontColorLabel"> | ||
1890 | 293 | <property name="text"> | ||
1891 | 294 | <string>Font Color</string> | ||
1892 | 295 | </property> | ||
1893 | 296 | </widget> | ||
1894 | 297 | </item> | ||
1895 | 298 | <item row="1" column="2"> | ||
1896 | 299 | <widget class="QPushButton" name="FooterColorPushButton"> | ||
1897 | 300 | <property name="text"> | ||
1898 | 301 | <string/> | ||
1899 | 302 | </property> | ||
1900 | 303 | </widget> | ||
1901 | 304 | </item> | ||
1902 | 305 | <item row="2" column="0"> | ||
1903 | 306 | <widget class="QLabel" name="FooterFontSize"> | ||
1904 | 307 | <property name="text"> | ||
1905 | 308 | <string>Size:</string> | ||
1906 | 309 | </property> | ||
1907 | 310 | </widget> | ||
1908 | 311 | </item> | ||
1909 | 312 | <item row="2" column="1"> | ||
1910 | 313 | <widget class="QLineEdit" name="FooterFontSizeLineEdit"/> | ||
1911 | 314 | </item> | ||
1912 | 315 | <item row="2" column="2"> | ||
1913 | 316 | <widget class="QSlider" name="FooterFontlSlider"> | ||
1914 | 317 | <property name="value"> | ||
1915 | 318 | <number>15</number> | ||
1916 | 319 | </property> | ||
1917 | 320 | <property name="maximum"> | ||
1918 | 321 | <number>40</number> | ||
1919 | 322 | </property> | ||
1920 | 323 | <property name="orientation"> | ||
1921 | 324 | <enum>Qt::Horizontal</enum> | ||
1922 | 325 | </property> | ||
1923 | 326 | <property name="tickPosition"> | ||
1924 | 327 | <enum>QSlider::TicksBelow</enum> | ||
1925 | 328 | </property> | ||
1926 | 329 | <property name="tickInterval"> | ||
1927 | 330 | <number>5</number> | ||
1928 | 331 | </property> | ||
1929 | 332 | </widget> | ||
1930 | 333 | </item> | ||
1931 | 334 | </layout> | ||
1932 | 335 | </widget> | ||
1933 | 336 | </widget> | ||
1934 | 337 | <widget class="QWidget" name="OptionsTab"> | ||
1935 | 338 | <attribute name="title"> | ||
1936 | 339 | <string>Display Options</string> | ||
1937 | 340 | </attribute> | ||
1938 | 341 | <widget class="QGroupBox" name="ShadowGroupBox"> | ||
1939 | 342 | <property name="geometry"> | ||
1940 | 343 | <rect> | ||
1941 | 344 | <x>20</x> | ||
1942 | 345 | <y>10</y> | ||
1943 | 346 | <width>301</width> | ||
1944 | 347 | <height>80</height> | ||
1945 | 348 | </rect> | ||
1946 | 349 | </property> | ||
1947 | 350 | <property name="title"> | ||
1948 | 351 | <string>Shadow</string> | ||
1949 | 352 | </property> | ||
1950 | 353 | <widget class="QWidget" name="layoutWidget"> | ||
1951 | 354 | <property name="geometry"> | ||
1952 | 355 | <rect> | ||
1953 | 356 | <x>10</x> | ||
1954 | 357 | <y>20</y> | ||
1955 | 358 | <width>281</width> | ||
1956 | 359 | <height>54</height> | ||
1957 | 360 | </rect> | ||
1958 | 361 | </property> | ||
1959 | 362 | <layout class="QFormLayout" name="formLayout"> | ||
1960 | 363 | <item row="0" column="0"> | ||
1961 | 364 | <widget class="QCheckBox" name="ShadowCheckBox"> | ||
1962 | 365 | <property name="text"> | ||
1963 | 366 | <string>Use Shadow</string> | ||
1964 | 367 | </property> | ||
1965 | 368 | </widget> | ||
1966 | 369 | </item> | ||
1967 | 370 | <item row="1" column="0"> | ||
1968 | 371 | <widget class="QLabel" name="ShadowColorLabel"> | ||
1969 | 372 | <property name="text"> | ||
1970 | 373 | <string>Shadow Color:</string> | ||
1971 | 374 | </property> | ||
1972 | 375 | </widget> | ||
1973 | 376 | </item> | ||
1974 | 377 | <item row="1" column="1"> | ||
1975 | 378 | <widget class="QPushButton" name="ShadowColorPushButton"> | ||
1976 | 379 | <property name="text"> | ||
1977 | 380 | <string/> | ||
1978 | 381 | </property> | ||
1979 | 382 | </widget> | ||
1980 | 383 | </item> | ||
1981 | 384 | </layout> | ||
1982 | 385 | </widget> | ||
1983 | 386 | </widget> | ||
1984 | 387 | <widget class="QGroupBox" name="AlignmentGroupBox"> | ||
1985 | 388 | <property name="geometry"> | ||
1986 | 389 | <rect> | ||
1987 | 390 | <x>10</x> | ||
1988 | 391 | <y>200</y> | ||
1989 | 392 | <width>321</width> | ||
1990 | 393 | <height>161</height> | ||
1991 | 394 | </rect> | ||
1992 | 395 | </property> | ||
1993 | 396 | <property name="title"> | ||
1994 | 397 | <string>Alignment</string> | ||
1995 | 398 | </property> | ||
1996 | 399 | <layout class="QGridLayout" name="gridLayout_4"> | ||
1997 | 400 | <item row="0" column="0"> | ||
1998 | 401 | <widget class="QLabel" name="HorizontalLabel"> | ||
1999 | 402 | <property name="text"> | ||
2000 | 403 | <string>Horizontal Align:</string> | ||
2001 | 404 | </property> | ||
2002 | 405 | </widget> | ||
2003 | 406 | </item> | ||
2004 | 407 | <item row="0" column="1"> | ||
2005 | 408 | <widget class="QComboBox" name="HorizontalComboBox"> | ||
2006 | 409 | <item> | ||
2007 | 410 | <property name="text"> | ||
2008 | 411 | <string>Left</string> | ||
2009 | 412 | </property> | ||
2010 | 413 | </item> | ||
2011 | 414 | <item> | ||
2012 | 415 | <property name="text"> | ||
2013 | 416 | <string>Right</string> | ||
2014 | 417 | </property> | ||
2015 | 418 | </item> | ||
2016 | 419 | <item> | ||
2017 | 420 | <property name="text"> | ||
2018 | 421 | <string>Center</string> | ||
2019 | 422 | </property> | ||
2020 | 423 | </item> | ||
2021 | 424 | </widget> | ||
2022 | 425 | </item> | ||
2023 | 426 | <item row="1" column="0"> | ||
2024 | 427 | <widget class="QLabel" name="VerticalLabel"> | ||
2025 | 428 | <property name="text"> | ||
2026 | 429 | <string>Vertical Align:</string> | ||
2027 | 430 | </property> | ||
2028 | 431 | </widget> | ||
2029 | 432 | </item> | ||
2030 | 433 | <item row="1" column="1"> | ||
2031 | 434 | <widget class="QComboBox" name="VerticalComboBox"> | ||
2032 | 435 | <item> | ||
2033 | 436 | <property name="text"> | ||
2034 | 437 | <string>Top</string> | ||
2035 | 438 | </property> | ||
2036 | 439 | </item> | ||
2037 | 440 | <item> | ||
2038 | 441 | <property name="text"> | ||
2039 | 442 | <string>Middle</string> | ||
2040 | 443 | </property> | ||
2041 | 444 | </item> | ||
2042 | 445 | <item> | ||
2043 | 446 | <property name="text"> | ||
2044 | 447 | <string>Bottom</string> | ||
2045 | 448 | </property> | ||
2046 | 449 | </item> | ||
2047 | 450 | </widget> | ||
2048 | 451 | </item> | ||
2049 | 452 | </layout> | ||
2050 | 453 | </widget> | ||
2051 | 454 | <widget class="QGroupBox" name="OutlineGroupBox"> | ||
2052 | 455 | <property name="geometry"> | ||
2053 | 456 | <rect> | ||
2054 | 457 | <x>20</x> | ||
2055 | 458 | <y>110</y> | ||
2056 | 459 | <width>301</width> | ||
2057 | 460 | <height>80</height> | ||
2058 | 461 | </rect> | ||
2059 | 462 | </property> | ||
2060 | 463 | <property name="title"> | ||
2061 | 464 | <string>Outline</string> | ||
2062 | 465 | </property> | ||
2063 | 466 | <widget class="QWidget" name="layoutWidget_3"> | ||
2064 | 467 | <property name="geometry"> | ||
2065 | 468 | <rect> | ||
2066 | 469 | <x>10</x> | ||
2067 | 470 | <y>20</y> | ||
2068 | 471 | <width>281</width> | ||
2069 | 472 | <height>54</height> | ||
2070 | 473 | </rect> | ||
2071 | 474 | </property> | ||
2072 | 475 | <layout class="QFormLayout" name="OutlineformLayout"> | ||
2073 | 476 | <item row="0" column="0"> | ||
2074 | 477 | <widget class="QCheckBox" name="OutlineCheckBox"> | ||
2075 | 478 | <property name="text"> | ||
2076 | 479 | <string>Use Outline</string> | ||
2077 | 480 | </property> | ||
2078 | 481 | </widget> | ||
2079 | 482 | </item> | ||
2080 | 483 | <item row="1" column="0"> | ||
2081 | 484 | <widget class="QLabel" name="OutlineColorLabel"> | ||
2082 | 485 | <property name="text"> | ||
2083 | 486 | <string>Outline Color:</string> | ||
2084 | 487 | </property> | ||
2085 | 488 | </widget> | ||
2086 | 489 | </item> | ||
2087 | 490 | <item row="1" column="1"> | ||
2088 | 491 | <widget class="QPushButton" name="OutlineColorPushButton"> | ||
2089 | 492 | <property name="text"> | ||
2090 | 493 | <string/> | ||
2091 | 494 | </property> | ||
2092 | 495 | </widget> | ||
2093 | 496 | </item> | ||
2094 | 497 | </layout> | ||
2095 | 498 | </widget> | ||
2096 | 499 | </widget> | ||
2097 | 500 | </widget> | ||
2098 | 501 | </widget> | ||
2099 | 502 | </widget> | ||
2100 | 503 | </item> | ||
2101 | 504 | <item> | ||
2102 | 505 | <widget class="QWidget" name="RightSide" native="true"> | ||
2103 | 506 | <widget class="QGraphicsView" name="ThemePreView"> | ||
2104 | 507 | <property name="geometry"> | ||
2105 | 508 | <rect> | ||
2106 | 509 | <x>0</x> | ||
2107 | 510 | <y>30</y> | ||
2108 | 511 | <width>341</width> | ||
2109 | 512 | <height>341</height> | ||
2110 | 513 | </rect> | ||
2111 | 514 | </property> | ||
2112 | 515 | </widget> | ||
2113 | 516 | </widget> | ||
2114 | 517 | </item> | ||
2115 | 518 | </layout> | ||
2116 | 519 | </widget> | ||
2117 | 520 | <widget class="QWidget" name="layoutWidget"> | ||
2118 | 521 | <property name="geometry"> | ||
2119 | 522 | <rect> | ||
2120 | 523 | <x>50</x> | ||
2121 | 524 | <y>20</y> | ||
2122 | 525 | <width>441</width> | ||
2123 | 526 | <height>41</height> | ||
2124 | 527 | </rect> | ||
2125 | 528 | </property> | ||
2126 | 529 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
2127 | 530 | <item> | ||
2128 | 531 | <widget class="QLabel" name="ThemeNameLabel"> | ||
2129 | 532 | <property name="text"> | ||
2130 | 533 | <string>Theme Name</string> | ||
2131 | 534 | </property> | ||
2132 | 535 | </widget> | ||
2133 | 536 | </item> | ||
2134 | 537 | <item> | ||
2135 | 538 | <widget class="QLineEdit" name="ThemeNameEdit"/> | ||
2136 | 539 | </item> | ||
2137 | 540 | </layout> | ||
2138 | 541 | </widget> | ||
2139 | 542 | </widget> | ||
2140 | 543 | <resources> | ||
2141 | 544 | <include location="../images/openlp-2.qrc"/> | ||
2142 | 545 | </resources> | ||
2143 | 546 | <connections/> | ||
2144 | 547 | </ui> |
443. By Tim Bentley 3 minutes ago
Add Eventing after Themes loaded to tell plugins the themes have changed
442. By Tim Bentley 21 hours ago
Store Theme name in list for correct display
441. By Tim Bentley on 2009-04-04
Add ThemeManagerDialog
More Rendering improvements
440. By Tim Bentley on 2009-04-04
Add Themes to Bible Tab and default values
439. By Tim Bentley on 2009-04-04
Add rendering for Circles and amend XML schema accordingly
438. By Tim Bentley on 2009-04-04
Renderer now supports linear gradients correctly
Update XML to include direction
Add Booleans instead of 0/1 to XML schema
437. By Tim Bentley on 2009-04-03
More ThemeManager changes
Fix Rendering and theme handling
Generate PNG theme on conversion
436. By Tim Bentley on 2009-04-01
Fix up Theme XML code to work with strings and files.
Fix Render.py to work with new XML schema
435. By Tim Bentley on 2009-04-01
Import version 2 xml and build object.
434. By Tim Bentley on 2009-03-31
Finish Import conversions take 1
Add copyright information
433. By Tim Bentley on 2009-03-29
Clean Up code style
Add Theme migration code
Fixes to Renderer