Merge lp:~trb143/openlp/ThemeManager2 into lp:openlp

Proposed by Tim Bentley
Status: Merged
Merged at revision: not available
Proposed branch: lp:~trb143/openlp/ThemeManager2
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~trb143/openlp/ThemeManager2
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+5894@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :

Here is a big one.

The code is not complete and needs a lot of polishing but we have some significant functions working.
To summerize the state of play:
Themes Import , Add , Edit (80%) and delete work. (Don't delete last theme!)
Themes pushed to all components.

Service Controller has Theme drop down which pushes themes to the rendermanager.
RenderManager created to help plugins undertake rendering (30% complete)
Bibles and Custom plugins generate a rendered slide (Only one for now)
Rendered slide displayed On preview page and uses Theme set in slide controller.

Move 2 classes to correct place.

Revision history for this message
Michael Gorven (mgorven) wrote :

I would rather write convertStringToBoolean() like this:

    return stringvalue.lower() in ('true', 'on', 'yes', 'y')

+ words=words.replace(u'\r\n', u'\n')
+ verses_text = words.split(u'\n')

Rather use words.splitlines().

+ import time

Any reason why that's not imported at the top of the file?

+from renderer import Renderer

Always use absolute imports (openlp.core.lib.renderer).

+ lines.append(u'Amazing Grace!')

I think that the preview text should either be loaded from a file, or stored
as a variable at the top of the file.

Please use 'bzr mv' when renaming files to prevent breaks in revision history.
(I'd prefer that your pluginmanager.py and renderer.py renames be fixed, but
it probably isn't trivial.)

+ def setRenderManager(self, renderManager):
+ self.renderManager = renderManager

Don't use getter and setter methods. Properties can be used later on if it's
necessary to control access to class variables.

I don't know how feasible it is, but it would be nice if branches/reviews were
smaller.

Revision history for this message
Martin Thompson (mjthompson) wrote :

Here's some comments (of the nit-picky variety - it's great to see this amount of progress!):

In string to boolean - does the string want "stripping" first, otherwise whitespace at the ends will cause it to be false?

In render_lines() the second parameter would be better renamed as "footer" (as elsewhere) and then the docstring could be updated

In the theme, I see the background can be an image with transparent property set - have you tried that with a transparent BG - does it work?

Have we standardised on the US-english spelling of colour/color? This code has color in, but I'm sure there are others with colour in - i think we ought to standardise on one or the other throughout. (I learned to program on an Apple II, so I can cope with "color" :)

I think the test_plugin_manager won't work run with the "import plugin_manager" above the path.insert() call.

amendthemeform.paintUI() has a "print theme" line - probably ought to be a log.debug?

In the mainwindow:
   self.plugin_helpers[u'theme'] = self.ThemeManagerContents # Theme manger
That comment is probably superfluous :)

Revision history for this message
Martin Thompson (mjthompson) wrote :

> I would rather write convertStringToBoolean() like this:
>
> return stringvalue.lower() in ('true', 'on', 'yes', 'y')
>
> + words=words.replace(u'\r\n', u'\n')
> + verses_text = words.split(u'\n')
>
> Rather use words.splitlines().
>

That's probably my historical code - sorry!

> + import time
>
> Any reason why that's not imported at the top of the file?
>

Probably not needed at all actually (again my fault - comes from timing some bits of render code IIRC)

Revision history for this message
Tim Bentley (trb143) wrote :

Agreed by superfly|gprs

review: Approve
lp:~trb143/openlp/ThemeManager2 updated
432. By Tim Bentley

<email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp.pyw'
2--- openlp.pyw 2009-04-10 05:59:40 +0000
3+++ openlp.pyw 2009-04-25 06:11:15 +0000
4@@ -46,15 +46,15 @@
5
6 self.setApplicationName(u'openlp.org')
7 self.setApplicationVersion(u'1.9.0')
8- self.splash = SplashScreen()
9+ self.splash = SplashScreen(self.applicationVersion())
10 self.splash.show()
11 # make sure Qt really display the splash screen
12 self.processEvents()
13 screens = []
14 # Decide how many screens we have and their size
15- for i in range (0 , self.desktop().numScreens()):
16- screens.insert(i, (i+1, self.desktop().availableGeometry(i+1)))
17- log.info(u'Screen %d found with resolution %s', i+1, self.desktop().availableGeometry(i+1))
18+ for screen in xrange (0 , self.desktop().numScreens()):
19+ screens.insert(screen, (screen+1, self.desktop().availableGeometry(screen+1)))
20+ log.info(u'Screen %d found with resolution %s', screen+1, self.desktop().availableGeometry(screen+1))
21 # start the main app window
22 self.main_window = MainWindow(screens)
23 self.main_window.show()
24
25=== modified file 'openlp/__init__.py'
26--- openlp/__init__.py 2008-10-23 19:49:13 +0000
27+++ openlp/__init__.py 2009-04-15 04:58:51 +0000
28@@ -15,3 +15,10 @@
29 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
30 Place, Suite 330, Boston, MA 02111-1307 USA
31 """
32+__all__ = ['convertStringToBoolean']
33+
34+def convertStringToBoolean(stringvalue):
35+ if stringvalue.lower() == 'true':
36+ return True
37+ else:
38+ return False
39
40=== modified file 'openlp/core/__init__.py'
41--- openlp/core/__init__.py 2009-04-07 19:03:36 +0000
42+++ openlp/core/__init__.py 2009-04-20 18:22:42 +0000
43@@ -3,7 +3,7 @@
44 """
45 OpenLP - Open Source Lyrics Projection
46 Copyright (c) 2008 Raoul Snyman
47-Portions copyright (c) 2008 Martin Thompson, Tim Bentley
48+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
49
50 This program is free software; you can redistribute it and/or modify it under
51 the terms of the GNU General Public License as published by the Free Software
52@@ -19,15 +19,14 @@
53 """
54 from PyQt4 import QtCore, QtGui
55
56-from render import Renderer
57 from settingsmanager import SettingsManager
58-from pluginmanager import PluginManager
59+from openlp.core.lib.pluginmanager import PluginManager
60
61-__all__ = ['Renderer', 'SettingsManager', 'PluginManager', 'translate', 'fileToXML']
62+__all__ = ['SettingsManager', 'PluginManager', 'translate',
63+ 'fileToXML' ]
64
65 def translate(context, text):
66 return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8)
67
68 def fileToXML(xmlfile):
69 return open(xmlfile).read()
70-
71
72=== removed file 'openlp/core/interpolate.py'
73--- openlp/core/interpolate.py 2008-12-01 13:15:31 +0000
74+++ openlp/core/interpolate.py 1970-01-01 00:00:00 +0000
75@@ -1,41 +0,0 @@
76-# -*- coding: utf-8 -*-
77-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
78-"""
79-OpenLP - Open Source Lyrics Projection
80-Copyright (c) 2008 Raoul Snyman
81-Portions copyright (c) 2008 Martin Thompson, Tim Bentley
82-
83-This program is free software; you can redistribute it and/or modify it under
84-the terms of the GNU General Public License as published by the Free Software
85-Foundation; version 2 of the License.
86-
87-This program is distributed in the hope that it will be useful, but WITHOUT ANY
88-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
89-PARTICULAR PURPOSE. See the GNU General Public License for more details.
90-
91-You should have received a copy of the GNU General Public License along with
92-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
93-Place, Suite 330, Boston, MA 02111-1307 USA
94-"""
95-
96-# useful linear interpolation routines
97-
98-def interp1(val1, val2, fraction):
99- """return a linear 1d interpolation between val1 and val2 by fraction
100- if fraction=0.0, returns val1
101- if fraction=1.0, returns val2"""
102- return val1+((val2-val1)*fraction)
103-def interpolate(val1, val2, fraction):
104- "vals can be list/tuples - if so, will return a tuple of interpolated values for each element."
105- assert (fraction >= 0.0)
106- assert (fraction <= 1.0)
107- assert (type(val1) == type(val2))
108- if (type(val1) == type(()) or
109- type (val1) == type([])):
110- assert(len(val1) == len(val2))
111- retval=[]
112- for i in range(len(val1)):
113- retval.append(interp1(val1[i], val2[i], fraction))
114- return tuple(retval)
115- else:
116- return interp1(val1, val2, fraction)
117
118=== modified file 'openlp/core/lib/__init__.py'
119--- openlp/core/lib/__init__.py 2009-04-07 19:45:21 +0000
120+++ openlp/core/lib/__init__.py 2009-04-22 19:46:10 +0000
121@@ -3,7 +3,7 @@
122 """
123 OpenLP - Open Source Lyrics Projection
124 Copyright (c) 2008 Raoul Snyman
125-Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
126+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
127
128 This program is free software; you can redistribute it and/or modify it under
129 the terms of the GNU General Public License as published by the Free Software
130@@ -32,7 +32,9 @@
131 from songxmlhandler import SongXMLBuilder
132 from songxmlhandler import SongXMLParser
133 from themexmlhandler import ThemeXML
134+from renderer import Renderer
135+from rendermanager import RenderManager
136
137-__all__ = ['PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType'
138+__all__ = ['Renderer','PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType'
139 'XmlRootClass', 'ServiceItem', 'Receiver', 'OpenLPToolbar', 'SongXMLBuilder',
140- 'SongXMLParser', 'EventManager', 'ThemeXML']
141+ 'SongXMLParser', 'EventManager', 'ThemeXML', 'RenderManager']
142
143=== modified file 'openlp/core/lib/plugin.py'
144--- openlp/core/lib/plugin.py 2009-03-23 20:18:06 +0000
145+++ openlp/core/lib/plugin.py 2009-04-25 06:11:15 +0000
146@@ -91,8 +91,9 @@
147 self.preview_controller=plugin_helpers[u'preview']
148 self.live_controller=plugin_helpers[u'live']
149 self.theme_manager=plugin_helpers[u'theme']
150- self.event_manager=plugin_helpers[u'event']
151-
152+ self.event_manager=plugin_helpers[u'event']
153+ self.render_manager=plugin_helpers[u'render']
154+
155 def check_pre_conditions(self):
156 """
157 Provides the Plugin with a handle to check if it can be loaded.
158@@ -118,7 +119,7 @@
159 Create a menu item and add it to the "Export" menu.
160 """
161 pass
162-
163+
164 def get_settings_tab(self):
165 """
166 Create a menu item and add it to the "Import" menu.
167
168=== added file 'openlp/core/lib/pluginmanager.py'
169--- openlp/core/lib/pluginmanager.py 1970-01-01 00:00:00 +0000
170+++ openlp/core/lib/pluginmanager.py 2009-04-20 18:22:42 +0000
171@@ -0,0 +1,150 @@
172+# -*- coding: utf-8 -*-
173+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
174+"""
175+OpenLP - Open Source Lyrics Projection
176+Copyright (c) 2008 Raoul Snyman
177+Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley,
178+
179+This program is free software; you can redistribute it and/or modify it under
180+the terms of the GNU General Public License as published by the Free Software
181+Foundation; version 2 of the License.
182+
183+This program is distributed in the hope that it will be useful, but WITHOUT ANY
184+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
185+PARTICULAR PURPOSE. See the GNU General Public License for more details.
186+
187+You should have received a copy of the GNU General Public License along with
188+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
189+Place, Suite 330, Boston, MA 02111-1307 USA
190+"""
191+import os
192+import sys
193+import logging
194+
195+from openlp.core.lib import Plugin, EventManager
196+
197+class PluginManager(object):
198+ """
199+ This is the Plugin manager, which loads all the plugins,
200+ and executes all the hooks, as and when necessary.
201+ """
202+ global log
203+ log=logging.getLogger(u'PluginMgr')
204+ log.info(u'Plugin manager loaded')
205+
206+ def __init__(self, dir):
207+ """
208+ The constructor for the plugin manager.
209+ Passes the controllers on to the plugins for them to interact with via their ServiceItems
210+ """
211+ log.info(u'Plugin manager initing')
212+ if not dir in sys.path:
213+ log.debug("Inserting %s into sys.path", dir)
214+ sys.path.insert(0, dir)
215+ self.basepath = os.path.abspath(dir)
216+ log.debug("Base path %s ", self.basepath)
217+ self.plugins = []
218+ # this has to happen after the UI is sorted self.find_plugins(dir)
219+ log.info("Plugin manager done init")
220+
221+ def find_plugins(self, dir, plugin_helpers, eventmanager): # TODO shouldn't dir come from self.basepath
222+ """
223+ Scan the directory dir for objects inheriting from openlp.plugin
224+ """
225+ self.plugin_helpers = plugin_helpers
226+ startdepth=len(os.path.abspath(dir).split(os.sep))
227+ log.debug("find plugins %s at depth %d" %( str(dir), startdepth))
228+
229+ for root, dirs, files in os.walk(dir):
230+ for name in files:
231+ if name.endswith(".py") and not name.startswith("__"):
232+ path = os.path.abspath(os.path.join(root, name))
233+ thisdepth=len(path.split(os.sep))
234+ if thisdepth-startdepth > 2: # skip anything lower down
235+ continue
236+ modulename, pyext = os.path.splitext(path)
237+ prefix = os.path.commonprefix([self.basepath, path])
238+ # hack off the plugin base path
239+ modulename = modulename[len(prefix) + 1:]
240+ modulename = modulename.replace(os.path.sep, '.')
241+ # import the modules
242+ log.debug("Importing %s from %s. Depth %d" % (modulename, path, thisdepth))
243+ try:
244+ __import__(modulename, globals(), locals(), [])
245+ except ImportError, e:
246+ log.error("Failed to import module %s on path %s for reason %s", modulename, path, e.message)
247+ self.plugin_classes = Plugin.__subclasses__()
248+ self.plugins = []
249+ plugin_objects = []
250+ for p in self.plugin_classes:
251+ try:
252+ plugin = p(self.plugin_helpers)
253+ log.debug(u'loaded plugin %s with helpers'%str(p))
254+ log.debug("Plugin="+str(p))
255+ if plugin.check_pre_conditions():
256+ log.debug("Appending "+str(p))
257+ plugin_objects.append(plugin)
258+ eventmanager.register(plugin)
259+ except TypeError:
260+ log.error(u'loaded plugin %s has no helpers'%str(p))
261+ self.plugins = sorted(plugin_objects, self.order_by_weight)
262+
263+ def order_by_weight(self, x, y):
264+ return cmp(x.weight, y.weight)
265+
266+ def hook_media_manager(self, mediatoolbox):
267+ """
268+ Loop through all the plugins. If a plugin has a valid media manager item,
269+ add it to the media manager.
270+ """
271+ for plugin in self.plugins:
272+ media_manager_item = plugin.get_media_manager_item()
273+ if media_manager_item is not None:
274+ log.debug('Inserting media manager item from %s' % plugin.name)
275+ mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)
276+
277+ def hook_settings_tabs(self, settingsform=None):
278+ """
279+ Loop through all the plugins. If a plugin has a valid settings tab item,
280+ add it to the settings tab.
281+ """
282+ for plugin in self.plugins:
283+ settings_tab = plugin.get_settings_tab()
284+ if settings_tab is not None:
285+ log.debug('Inserting settings tab item from %s' % plugin.name)
286+ settingsform.addTab(settings_tab)
287+ else:
288+ log.debug('No settings in %s' % plugin.name)
289+
290+ def hook_import_menu(self, import_menu):
291+ """
292+ Loop through all the plugins and give them an opportunity to add an item
293+ to the import menu.
294+ """
295+ for plugin in self.plugins:
296+ plugin.add_import_menu_item(import_menu)
297+
298+ def hook_export_menu(self, export_menu):
299+ """
300+ Loop through all the plugins and give them an opportunity to add an item
301+ to the export menu.
302+ """
303+ for plugin in self.plugins:
304+ plugin.add_export_menu_item(export_menu)
305+
306+ def hook_handle_event(self, eventmanager):
307+ for plugin in self.plugins:
308+ handle_event = plugin.handle_event(None)
309+ print plugin, handle_event
310+# if settings_tab is not None:
311+# log.debug('Inserting settings tab item from %s' % plugin.name)
312+# settingsform.addTab(settings_tab)
313+# else:
314+# log.debug('No settings in %s' % plugin.name)
315+ def initialise_plugins(self):
316+ """
317+ Loop through all the plugins and give them an opportunity to add an item
318+ to the export menu.
319+ """
320+ for plugin in self.plugins:
321+ plugin.initialise()
322
323=== added file 'openlp/core/lib/renderer.py'
324--- openlp/core/lib/renderer.py 1970-01-01 00:00:00 +0000
325+++ openlp/core/lib/renderer.py 2009-04-25 06:11:15 +0000
326@@ -0,0 +1,447 @@
327+# -*- coding: utf-8 -*-
328+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
329+"""
330+OpenLP - Open Source Lyrics Projection
331+Copyright (c) 2008 Raoul Snyman
332+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
333+
334+This program is free software; you can redistribute it and/or modify it under
335+the terms of the GNU General Public License as published by the Free Software
336+Foundation; version 2 of the License.
337+
338+This program is distributed in the hope that it will be useful, but WITHOUT ANY
339+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
340+PARTICULAR PURPOSE. See the GNU General Public License for more details.
341+
342+You should have received a copy of the GNU General Public License along with
343+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
344+Place, Suite 330, Boston, MA 02111-1307 USA
345+"""
346+import logging
347+import os, os.path
348+
349+import sys
350+from PyQt4 import QtGui, QtCore, Qt
351+
352+from copy import copy
353+
354+class Renderer:
355+
356+ global log
357+ log=logging.getLogger(u'Renderer')
358+ log.info(u'Renderer Loaded')
359+ """All the functions for rendering a set of words onto a Device Context
360+
361+ How to use:
362+ set the words to be displayed with a call to set_words_openlp() - this returns an array of screenfuls of data
363+ set a theme (if you need) with set_theme
364+ tell it which DC to render to with set_DC()
365+ set the borders of where you want the text (if not the whole DC) with set_text_rectangle()
366+ tell it to render a particular screenfull with render_screen(n)
367+
368+ """
369+ def __init__(self, path=None):
370+ self._rect=None
371+ self._debug=0
372+ self.words=None
373+ self._right_margin = 64 # the amount of right indent
374+ self._shadow_offset=5
375+ self._outline_offset=2
376+ self._theme=None
377+ self._bg_image_filename=None
378+ self._paint=None
379+ self._path = path
380+
381+ def set_debug(self, debug):
382+ self._debug=debug
383+
384+ def set_theme(self, theme):
385+ self._theme=theme
386+ if theme.background_type == u'image':
387+ self.set_bg_image(theme.background_filename)
388+
389+ def set_bg_image(self, filename):
390+ log.debug(u'set bg image %s', filename)
391+
392+ self._bg_image_filename=os.path.join(self._path, self._theme.theme_name, filename)
393+ print self._bg_image_filename
394+ if self._paint is not None:
395+ self.scale_bg_image()
396+
397+ def scale_bg_image(self):
398+ assert self._paint
399+ i=QtGui.QImage(self._bg_image_filename)
400+ # rescale and offset
401+ imw=i.width()
402+ imh=i.height()
403+ print imw, imh
404+ dcw=self._paint.width()+1
405+ dch=self._paint.height()
406+ imratio=imw/float(imh)
407+ dcratio=dcw/float(dch)
408+ log.debug(u'Image scaling params %s %s %s %s %s %s', imw, imh, imratio, dcw, dch, dcratio)
409+ if imratio > dcratio:
410+ scale=dcw/float(imw)
411+ elif imratio < dcratio:
412+ scale=dch/float(imh)
413+ else:
414+ scale=dcw/float(imw) # either will do
415+ neww=int(round(imw*scale))
416+ newh=int(round(imh*scale))
417+ self.background_offsetx=(dcw-neww)/2
418+ self.background_offsety=(dch-newh)/2
419+ self.img=QtGui.QPixmap.fromImage(i.scaled(QtCore.QSize(neww, newh), Qt.Qt.KeepAspectRatio))
420+
421+ def set_paint_dest(self, p):
422+ self._paint=p
423+ if self._bg_image_filename is not None:
424+ self.scale_bg_image()
425+
426+ def format_slide(self, words, footer):
427+ log.debug(u'format_slide %s', words)
428+ verses=[]
429+ words=words.replace(u'\r\n', u'\n')
430+ verses_text = words.split(u'\n')
431+ for v in verses_text:
432+ lines=v.split(u'\n')
433+ verses.append(self.split_set_of_lines(lines, footer)[0])
434+ self.words = verses
435+ verses_text=[]
436+ for v in verses:
437+ verses_text.append(u'\n'.join(v).lstrip()) # remove first \n
438+ return verses_text
439+
440+ def render_screen(self, screennum):
441+ log.debug(u'render screen\n %s %s ', screennum, self.words[screennum])
442+ import time
443+ t=0.0
444+ words=self.words[screennum]
445+ retval=self._render_lines(words)
446+ return retval
447+
448+ def set_text_rectangle(self, rect_main, rect_footer):
449+ """ Sets the rectangle within which text should be rendered"""
450+ self._rect=rect_main
451+ self._rect_footer=rect_footer
452+
453+ def _render_background(self):
454+ assert(self._theme)
455+ assert(self._paint)
456+ log.debug(u'render background %s ', self._theme.background_type)
457+ p=QtGui.QPainter()
458+ p.begin(self._paint)
459+ if self._theme.background_type == u'solid':
460+ p.fillRect(self._paint.rect(), QtGui.QColor(self._theme.background_color))
461+ elif self._theme.background_type == u'gradient' : # gradient
462+ gradient = None
463+ if self._theme.background_direction == u'horizontal':
464+ w = int(self._paint.width())/2
465+ gradient = QtGui.QLinearGradient(w, 0, w, self._paint.height()) # vertical
466+ elif self._theme.background_direction == u'vertical':
467+ h = int(self._paint.height())/2
468+ gradient = QtGui.QLinearGradient(0, h, self._paint.width(), h) # Horizontal
469+ else:
470+ w = int(self._paint.width())/2
471+ h = int(self._paint.height())/2
472+ gradient = QtGui.QRadialGradient(w, h, w) # Circular
473+
474+ gradient.setColorAt(0, QtGui.QColor(self._theme.background_startColor))
475+ gradient.setColorAt(1, QtGui.QColor(self._theme.background_endColor))
476+
477+ p.setBrush(QtGui.QBrush(gradient))
478+ rectPath = QtGui.QPainterPath()
479+
480+ max_x = self._paint.width()
481+ max_y = self._paint.height()
482+ rectPath.moveTo(0, 0)
483+ rectPath.lineTo(0, max_y)
484+ rectPath.lineTo(max_x, max_y)
485+ rectPath.lineTo(max_x, 0)
486+
487+ rectPath.closeSubpath()
488+ p.drawPath(rectPath)
489+
490+ elif self._theme.background_type== u'image': # image
491+ r=self._paint.rect()
492+ log.debug(u'Image size details %d %d %d %d ', r.x(), r.y(), r.width(),r.height())
493+ #log.debug(u' Background Parameter %d ', self._theme.background_color1)
494+ #if self._theme.background_color1 is not None:
495+ # p.fillRect(self._paint.rect(), self._theme.background_borderColor)
496+ p.drawPixmap(self.background_offsetx,self.background_offsety, self.img)
497+ p.end()
498+ log.debug(u'render background done')
499+
500+ def split_set_of_lines(self, lines, footer):
501+
502+ """Given a list of lines, decide how to split them best if they don't all fit on the screen
503+ - this is done by splitting at 1/2, 1/3 or 1/4 of the set
504+ If it doesn't fit, even at this size, just split at each opportunity
505+
506+ We'll do this by getting the bounding box of each lline, and then summing them appropriately
507+
508+ Returns a list of [lists of lines], one set for each screenful
509+ """
510+ log.debug(u'Split set of lines')
511+ # Probably ought to save the rendering results to a pseudoDC for redrawing efficiency. But let's not optimse prematurely!
512+
513+ bboxes = []
514+ for line in lines:
515+ bboxes.append(self._render_single_line(line, footer))
516+ numlines=len(lines)
517+ bottom=self._rect.bottom()
518+ for ratio in (numlines, numlines/2, numlines/3, numlines/4):
519+ good=1
520+ startline=0
521+ endline=startline+ratio
522+ while (endline<=numlines):
523+ by=0
524+ for (x, y) in bboxes[startline:endline]:
525+ by+=y
526+ if by > bottom:
527+ good=0
528+ break
529+ startline+=ratio
530+ endline=startline+ratio
531+ if good==1:
532+ break
533+
534+ retval=[]
535+ numlines_per_page=ratio
536+ if good:
537+ c=0
538+ thislines=[]
539+ while c < numlines:
540+ thislines.append(lines[c])
541+ c+=1
542+ if len(thislines) == numlines_per_page:
543+ retval.append(thislines)
544+ thislines=[]
545+ else:
546+# log.debug(u" "Just split where you can"
547+ retval=[]
548+ startline=0
549+ endline=startline+1
550+ while (endline<=numlines):
551+ by=0
552+ for (x, y) in bboxes[startline:endline]:
553+ by+=y
554+ if by > bottom:
555+ retval.append(lines[startline:endline-1])
556+ startline=endline-1
557+ endline=startline # gets incremented below
558+ by=0
559+ endline+=1
560+
561+ return retval
562+
563+ def _correctAlignment(self, rect, bbox):
564+ x=rect.left()
565+ if int(self._theme.display_verticalAlign) == 0: # top align
566+ y = rect.top()
567+ elif int(self._theme.display_verticalAlign) == 2: # bottom align
568+ y=rect.bottom()-bbox.height()
569+ elif int(self._theme.display_verticalAlign) == 1: # centre align
570+ y=rect.top()+(rect.height()-bbox.height())/2
571+ else:
572+ assert(0, u'Invalid value for theme.VerticalAlign:%s' % self._theme.display_verticalAlign)
573+ return x, y
574+
575+ def render_lines(self, lines, lines1=None):
576+ """render a set of lines according to the theme, return bounding box"""
577+ #log.debug(u'_render_lines %s', lines)
578+
579+ bbox=self._render_lines_unaligned(lines, False) # Main font
580+ if lines1 is not None:
581+ bbox1=self._render_lines_unaligned(lines1, True) # Footer Font
582+
583+ # put stuff on background so need to reset before doing the job properly.
584+ self._render_background()
585+ x, y = self._correctAlignment(self._rect, bbox)
586+ bbox=self._render_lines_unaligned(lines, False, (x, y))
587+
588+ if lines1 is not None:
589+ #x, y = self._correctAlignment(self._rect_footer, bbox1)
590+ bbox=self._render_lines_unaligned(lines1, True, (self._rect_footer.left(), self._rect_footer.top()) )
591+
592+ log.debug(u'render lines DONE')
593+
594+ return bbox
595+
596+ def _render_lines_unaligned(self, lines, footer, tlcorner=(0,0)):
597+
598+ """Given a list of lines to render, render each one in turn
599+ (using the _render_single_line fn - which may result in going
600+ off the bottom) They are expected to be pre-arranged to less
601+ than a screenful (eg. by using split_set_of_lines)
602+
603+ Returns the bounding box of the text as QRect"""
604+ log.debug(u'render unaligned %s', lines)
605+ x, y=tlcorner
606+ brx=x
607+ bry=y
608+ for line in lines:
609+ #if (line == ''):
610+ # continue
611+ # render after current bottom, but at original left edge
612+ # keep track of right edge to see which is biggest
613+ (thisx, bry) = self._render_single_line(line, footer, (x,bry))
614+ if (thisx > brx):
615+ brx=thisx
616+ retval=QtCore.QRect(x, y,brx-x, bry-y)
617+ if self._debug:
618+ p=QtGui.QPainter()
619+ p.begin(self._paint)
620+ p.setPen(QtGui.QPen(QtGui.QColor(0,0,255)))
621+ p.drawRect(retval)
622+ p.end()
623+ log.debug(u'render unaligned DONE')
624+
625+ return retval
626+
627+ def _render_single_line(self, line, footer, tlcorner=(0,0)):
628+
629+ """render a single line of words onto the DC, top left corner
630+ specified.
631+
632+ If the line is too wide for the context, it wraps, but
633+ right-aligns the surplus words in the manner of song lyrics
634+
635+ Returns the bottom-right corner (of what was rendered) as a tuple(x, y).
636+ """
637+ log.debug(u'Render single line %s @ %s '%( line, tlcorner))
638+ x, y=tlcorner
639+ # We draw the text to see how big it is and then iterate to make it fit
640+ # when we line wrap we do in in the "lyrics" style, so the second line is
641+ # right aligned with a "hanging indent"
642+
643+ # get the words
644+# log.debug(u" "Getting the words split right"
645+ words=line.split(u' ')
646+ thisline=u' '.join(words)
647+ lastword=len(words)
648+ lines=[]
649+ maxx=self._rect.width(); maxy=self._rect.height();
650+ while (len(words)>0):
651+ w,h=self._get_extent_and_render(thisline, footer)
652+ rhs=w+x
653+ if rhs < maxx-self._right_margin:
654+ lines.append(thisline)
655+ words=words[lastword:]
656+ thisline=' '.join(words)
657+ lastword=len(words)
658+ else:
659+ lastword-=1
660+ thisline=' '.join(words[:lastword])
661+ startx=x
662+ starty=y
663+ rightextent=None
664+ t=self._theme
665+ if footer: # dont allow alignment messing with footers
666+ align = 0
667+ else:
668+ align=t.display_horizontalAlign
669+
670+ wrapstyle=t.display_wrapStyle
671+
672+ for linenum in range(len(lines)):
673+ line=lines[linenum]
674+ #find out how wide line is
675+ w,h=self._get_extent_and_render(line, footer, tlcorner=(x, y), draw=False)
676+
677+ if t.display_shadow:
678+ w+=self._shadow_offset
679+ h+=self._shadow_offset
680+ if t.display_outline:
681+ w+=2*self._outline_offset # pixels either side
682+ h+=2*self._outline_offset # pixels top/bottom
683+ if align==0: # left align
684+ rightextent=x+w
685+ if wrapstyle==1 and linenum != 0: # shift right from last line's rh edge
686+ rightextent=self._first_line_right_extent + self._right_margin
687+ if rightextent > maxx:
688+ rightextent = maxx
689+ x = rightextent-w
690+
691+ elif align==1: # right align
692+ rightextent=maxx
693+ x=maxx-w
694+ elif align==2: # centre
695+ x=(maxx-w)/2;
696+ rightextent=x+w
697+ # now draw the text, and any outlines/shadows
698+ if t.display_shadow:
699+ self._get_extent_and_render(line, footer,tlcorner=(x+self._shadow_offset,y+self._shadow_offset),
700+ draw=True, color = t.display_shadow_color)
701+ if t.display_outline:
702+ self._get_extent_and_render(line, footer,(x+self._outline_offset,y), draw=True, color = t.display_outline_color)
703+ self._get_extent_and_render(line, footer,(x, y+self._outline_offset), draw=True, color = t.display_outline_color)
704+ self._get_extent_and_render(line, footer,(x, y-self._outline_offset), draw=True, color = t.display_outline_color)
705+ self._get_extent_and_render(line, footer,(x-self._outline_offset,y), draw=True, color = t.display_outline_color)
706+ if self._outline_offset > 1:
707+ self._get_extent_and_render(line, footer,(x+self._outline_offset,y+self._outline_offset), draw=True, color = t.display_outline_color)
708+ self._get_extent_and_render(line, footer,(x-self._outline_offset,y+self._outline_offset), draw=True, color = t.display_outline_color)
709+ self._get_extent_and_render(line, footer,(x+self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color)
710+ self._get_extent_and_render(line, footer,(x-self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color)
711+
712+ self._get_extent_and_render(line, footer,tlcorner=(x, y), draw=True)
713+# log.debug(u'Line %2d: Render '%s' at (%d, %d) wh=(%d,%d)' % ( linenum, line, x, y,w,h)
714+ y += h
715+ if linenum == 0:
716+ self._first_line_right_extent=rightextent
717+ # draw a box around the text - debug only
718+ if self._debug:
719+ p=QtGui.QPainter()
720+ p.begin(self._paint)
721+ p.setPen(QtGui.QPen(QtGui.QColor(0,255,0)))
722+ p.drawRect(startx,starty,rightextent-startx, y-starty)
723+ p.end()
724+
725+ brcorner=(rightextent,y)
726+ return brcorner
727+
728+ # xxx this is what to override for an SDL version
729+ def _get_extent_and_render(self, line, footer, tlcorner=(0,0), draw=False, color=None):
730+ """Find bounding box of text - as render_single_line.
731+ If draw is set, actually draw the text to the current DC as well
732+
733+ return width and height of text as a tuple (w,h)"""
734+ # setup defaults
735+ #log.debug(u"_get_extent_and_render %s %s %s ", [line], tlcorner, draw)
736+ p=QtGui.QPainter()
737+ p.begin(self._paint)
738+ # 'twould be more efficient to set this once when theme changes
739+ # or p changes
740+ if footer :
741+ font=QtGui.QFont(self._theme.font_footer_name,
742+ int(self._theme.font_footer_proportion), # size
743+ QtGui.QFont.Normal, # weight
744+ 0)# italic
745+ else:
746+ font=QtGui.QFont(self._theme.font_main_name,
747+ int(self._theme.font_main_proportion), # size
748+ QtGui.QFont.Normal, # weight
749+ 0)# italic
750+ # to make the unit tests monitor independent, we have to be able to
751+ # specify whether a font proportion is in pixels or points
752+ if footer:
753+ font.setPixelSize(int(self._theme.font_footer_proportion))
754+ else:
755+ font.setPixelSize(int(self._theme.font_main_proportion))
756+ #log.debug(u'Font details %s %s %s %d', self._theme.font_main_name, self._theme.font_main_proportion, font.family(), font.pointSize())
757+ p.setFont(font)
758+ if color == None:
759+ if footer:
760+ p.setPen(QtGui.QColor(self._theme.font_footer_color))
761+ else:
762+ p.setPen(QtGui.QColor(self._theme.font_main_color))
763+ else:
764+ p.setPen(QtGui.QColor(color))
765+ x, y=tlcorner
766+ metrics=QtGui.QFontMetrics(font)
767+ # xxx some fudges to make it exactly like wx! Take 'em out later
768+ w=metrics.width(line)
769+ h=metrics.height()-2
770+ if draw:
771+ p.drawText(x, y+metrics.height()-metrics.descent()-1, line)
772+ p.end()
773+ return (w, h)
774
775=== added file 'openlp/core/lib/rendermanager.py'
776--- openlp/core/lib/rendermanager.py 1970-01-01 00:00:00 +0000
777+++ openlp/core/lib/rendermanager.py 2009-04-25 06:38:21 +0000
778@@ -0,0 +1,115 @@
779+# -*- coding: utf-8 -*-
780+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
781+"""
782+OpenLP - Open Source Lyrics Projection
783+Copyright (c) 2008 Raoul Snyman
784+Portions copyright (c) 2008 - 2009Martin Thompson, Tim Bentley
785+
786+This program is free software; you can redistribute it and/or modify it under
787+the terms of the GNU General Public License as published by the Free Software
788+Foundation; version 2 of the License.
789+
790+This program is distributed in the hope that it will be useful, but WITHOUT ANY
791+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
792+PARTICULAR PURPOSE. See the GNU General Public License for more details.
793+
794+You should have received a copy of the GNU General Public License along with
795+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
796+Place, Suite 330, Boston, MA 02111-1307 USA
797+"""
798+import logging
799+import os, os.path
800+import sys
801+from PyQt4 import QtGui, QtCore, Qt
802+from renderer import Renderer
803+
804+class RenderManager:
805+ """
806+ Class to pull all Renderer interactions into one place.
807+ The plugins will call helper methods to do the rendering but
808+ this class will provide display defense code.
809+ """
810+ global log
811+ log=logging.getLogger(u'RenderManager')
812+ log.info(u'RenderManager Loaded')
813+
814+ def __init__(self, theme_manager, screen_list):
815+ log.debug(u'Initilisation started')
816+ self.screen_list = screen_list
817+ self.theme_manager = theme_manager
818+ self.displays = len(screen_list)
819+ self.current_display = 1
820+ self.renderer = Renderer(None)
821+ self.calculate_default(self.screen_list[self.current_display-1][1])
822+ self.frame = None
823+
824+ def set_default_theme(self, theme):
825+ log.debug("default theme set to %s", theme)
826+ self.default_theme = self.theme_manager.getThemeData(theme)
827+ self.renderer.set_theme(self.default_theme)
828+
829+ self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
830+ QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
831+
832+
833+ def set_theme(self, theme):
834+ log.debug("theme set to %s", theme)
835+ self.theme = theme
836+ self.renderer.set_theme(self.theme)
837+
838+ self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
839+ QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
840+ if theme.font_main_override == False:
841+ pass
842+ if theme.font_footer_override == False:
843+ pass
844+
845+ def generate_preview(self):
846+ self.calculate_default(QtCore.QSize(800,600))
847+
848+ self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
849+ QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
850+
851+ frame = QtGui.QPixmap(self.width, self.height)
852+ self.renderer.set_paint_dest(frame)
853+
854+ lines=[]
855+ lines.append(u'Amazing Grace!')
856+ lines.append(u'How sweet the sound')
857+ lines.append(u'To save a wretch like me;')
858+ lines.append(u'I once was lost but now am found,')
859+ lines.append(u'Was blind, but now I see.')
860+ lines1=[]
861+ lines1.append(u'Amazing Grace (John Newton)' )
862+ lines1.append(u'CCLI xxx (c)Openlp.org')
863+ answer=self.renderer.render_lines(lines, lines1)
864+ return frame
865+
866+ def format_slide(self, words, footer):
867+ self.calculate_default(QtCore.QSize(800,600))
868+
869+ self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
870+ QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
871+
872+ return self.renderer.format_slide(words, footer)
873+
874+ def generate_slide(self,main_text, footer_text, preview=True):
875+ if preview == True:
876+ self.calculate_default(QtCore.QSize(800,600))
877+
878+ self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
879+ QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
880+
881+ #frame = QtGui.QPixmap(self.width, self.height)
882+ #self.renderer.set_paint_dest(frame)
883+ #print main_text
884+ answer=self.renderer.render_lines(main_text, footer_text)
885+ return self.frame
886+
887+ def calculate_default(self, screen):
888+ self.width = screen.width()
889+ self.height = screen.height()
890+ self.footer_start = int(self.height*0.95) # 95% is start of footer
891+ #update the rederer frame
892+ self.frame = QtGui.QPixmap(self.width, self.height)
893+ self.renderer.set_paint_dest(self.frame)
894
895=== modified file 'openlp/core/lib/settingstab.py'
896--- openlp/core/lib/settingstab.py 2009-03-06 06:05:01 +0000
897+++ openlp/core/lib/settingstab.py 2009-04-15 04:58:51 +0000
898@@ -19,7 +19,6 @@
899 """
900
901 from PyQt4 import QtCore, QtGui
902-from openlp.core.resources import *
903 from openlp.core.lib import PluginConfig
904
905 class SettingsTab(QtGui.QWidget):
906@@ -39,7 +38,7 @@
907 else:
908 self.config = PluginConfig(str(title))
909 self.load()
910-
911+
912 def setTitle(self, title):
913 self.tabTitle = title
914
915@@ -51,15 +50,9 @@
916
917 def retranslateUi(self):
918 pass
919-
920+
921 def load(self):
922 pass
923-
924+
925 def save(self):
926 pass
927-
928- def convertStringToBoolean(self, stringvalue):
929- if stringvalue.lower() == 'true':
930- return True
931- else:
932- return False
933
934=== modified file 'openlp/core/lib/themexmlhandler.py'
935--- openlp/core/lib/themexmlhandler.py 2009-04-11 07:33:45 +0000
936+++ openlp/core/lib/themexmlhandler.py 2009-04-21 19:45:50 +0000
937@@ -21,9 +21,49 @@
938
939 For XML Schema see wiki.openlp.org
940 """
941+
942+from openlp import convertStringToBoolean
943 from xml.dom.minidom import Document
944 from xml.etree.ElementTree import ElementTree, XML, dump
945
946+blankthemexml=\
947+'''<?xml version="1.0" encoding="iso-8859-1"?>
948+ <theme version="1.0">
949+ <name>BlankStyle</name>
950+ <background mode="transparent"/>
951+ <background type="solid" mode="opaque">
952+ <color>#000000</color>
953+ </background>
954+ <background type="gradient" mode="opaque">
955+ <startColor>#000000</startColor>
956+ <endColor>#000000</endColor>
957+ <direction>vertical</direction>
958+ </background>
959+ <background type="image" mode="opaque">
960+ <filename>fred.bmp</filename>
961+ </background>
962+ <font type="main">
963+ <name>Arial</name>
964+ <color>#000000</color>
965+ <proportion>30</proportion>
966+ <location override="False" x="0" y="0" width="0" height="0"/>
967+ </font>
968+ <font type="footer">
969+ <name>Arial</name>
970+ <color>#000000</color>
971+ <proportion>12</proportion>
972+ <location override="False" x="0" y="0" width="0" height="0"/>
973+ </font>
974+ <display>
975+ <shadow color="#000000">True</shadow>
976+ <outline color="#000000">False</outline>
977+ <horizontalAlign>0</horizontalAlign>
978+ <verticalAlign>0</verticalAlign>
979+ <wrapStyle>0</wrapStyle>
980+ </display>
981+ </theme>
982+'''
983+
984 class ThemeXML():
985 def __init__(self):
986 # Create the minidom document
987@@ -31,11 +71,11 @@
988
989 def new_document(self, name):
990 # Create the <song> base element
991- self.theme = self.theme_xml.createElement(u'Theme')
992+ self.theme = self.theme_xml.createElement(u'theme')
993 self.theme_xml.appendChild(self.theme)
994 self.theme.setAttribute(u'version', u'1.0')
995
996- self.name = self.theme_xml.createElement(u'Name')
997+ self.name = self.theme_xml.createElement(u'name')
998 ctn = self.theme_xml.createTextNode(name)
999 self.name.appendChild(ctn)
1000 self.theme.appendChild(self.name)
1001@@ -52,30 +92,23 @@
1002 background.setAttribute(u'type', u'solid')
1003 self.theme.appendChild(background)
1004
1005- color = self.theme_xml.createElement(u'color1')
1006+ color = self.theme_xml.createElement(u'color')
1007 bkc = self.theme_xml.createTextNode(bkcolor)
1008 color.appendChild(bkc)
1009 background.appendChild(color)
1010
1011- color = self.theme_xml.createElement(u'color2')
1012- background.appendChild(color)
1013-
1014- color = self.theme_xml.createElement(u'direction')
1015- background.appendChild(color)
1016-
1017-
1018 def add_background_gradient(self, startcolor, endcolor, direction):
1019 background = self.theme_xml.createElement(u'background')
1020 background.setAttribute(u'mode', u'opaque')
1021 background.setAttribute(u'type', u'gradient')
1022 self.theme.appendChild(background)
1023
1024- color = self.theme_xml.createElement(u'color1')
1025+ color = self.theme_xml.createElement(u'startColor')
1026 bkc = self.theme_xml.createTextNode(startcolor)
1027 color.appendChild(bkc)
1028 background.appendChild(color)
1029
1030- color = self.theme_xml.createElement(u'color2')
1031+ color = self.theme_xml.createElement(u'endColor')
1032 bkc = self.theme_xml.createTextNode(endcolor)
1033 color.appendChild(bkc)
1034 background.appendChild(color)
1035@@ -96,33 +129,34 @@
1036 color.appendChild(bkc)
1037 background.appendChild(color)
1038
1039- def add_font(self, fontname, fontcolor, fontproportion, override, fonttype=u'main', xpos=0, ypos=0 ,width=0, height=0):
1040+ def add_font(self, name, color, proportion, override, fonttype=u'main', xpos=0, ypos=0 ,width=0, height=0):
1041 background = self.theme_xml.createElement(u'font')
1042 background.setAttribute(u'type',fonttype)
1043 self.theme.appendChild(background)
1044
1045- name = self.theme_xml.createElement(u'name')
1046- fn = self.theme_xml.createTextNode(fontname)
1047- name.appendChild(fn)
1048- background.appendChild(name)
1049-
1050- name = self.theme_xml.createElement(u'color')
1051- fn = self.theme_xml.createTextNode(fontcolor)
1052- name.appendChild(fn)
1053- background.appendChild(name)
1054-
1055- name = self.theme_xml.createElement(u'proportion')
1056- fn = self.theme_xml.createTextNode(fontproportion)
1057- name.appendChild(fn)
1058- background.appendChild(name)
1059-
1060- name = self.theme_xml.createElement(u'location')
1061- name.setAttribute(u'override',override)
1062- name.setAttribute(u'x',str(xpos))
1063- name.setAttribute(u'y',str(ypos))
1064- name.setAttribute(u'width',str(width))
1065- name.setAttribute(u'height',str(height))
1066- background.appendChild(name)
1067+ element = self.theme_xml.createElement(u'name')
1068+ fn = self.theme_xml.createTextNode(name)
1069+ element.appendChild(fn)
1070+ background.appendChild(element)
1071+
1072+ element = self.theme_xml.createElement(u'color')
1073+ fn = self.theme_xml.createTextNode(color)
1074+ element.appendChild(fn)
1075+ background.appendChild(element)
1076+
1077+ element = self.theme_xml.createElement(u'proportion')
1078+ fn = self.theme_xml.createTextNode(proportion)
1079+ element.appendChild(fn)
1080+ background.appendChild(element)
1081+
1082+ element = self.theme_xml.createElement(u'location')
1083+ element.setAttribute(u'override',override)
1084+ if override == True:
1085+ element.setAttribute(u'x',str(xpos))
1086+ element.setAttribute(u'y',str(ypos))
1087+ element.setAttribute(u'width',str(width))
1088+ element.setAttribute(u'height',str(height))
1089+ background.appendChild(element)
1090
1091 def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap):
1092 background = self.theme_xml.createElement(u'display')
1093@@ -170,6 +204,13 @@
1094 return self.theme_xml.toxml()
1095
1096 def parse(self, xml):
1097+ self.baseParseXml()
1098+ self.parse_xml(xml)
1099+
1100+ def baseParseXml(self):
1101+ self.parse_xml(blankthemexml)
1102+
1103+ def parse_xml(self, xml):
1104 theme_xml = ElementTree(element=XML(xml))
1105 iter=theme_xml.getiterator()
1106 master = u''
1107@@ -185,13 +226,17 @@
1108 master += e[1] + u'_'
1109 elif master == u'display_' and (element.tag == u'shadow' or element.tag == u'outline'):
1110 #print "b", master, element.tag, element.text, e[0], e[1]
1111- setattr(self, master + element.tag , element.text)
1112+ et = convertStringToBoolean(element.text)
1113+ setattr(self, master + element.tag , et)
1114 setattr(self, master + element.tag +u'_'+ e[0], e[1])
1115 else:
1116 field = master + e[0]
1117- setattr(self, field, e[1])
1118+ e1 = e[1]
1119+ if e[1] == u'True' or e[1] == u'False':
1120+ e1 = convertStringToBoolean(e[1])
1121+ setattr(self, field, e1)
1122 else:
1123- #print "c", element.tag
1124+ #print "c", element.tag, element.text
1125 if element.tag is not None :
1126 field = master + element.tag
1127 setattr(self, field, element.text)
1128
1129=== removed file 'openlp/core/pluginmanager.py'
1130--- openlp/core/pluginmanager.py 2009-03-25 20:30:48 +0000
1131+++ openlp/core/pluginmanager.py 1970-01-01 00:00:00 +0000
1132@@ -1,151 +0,0 @@
1133-# -*- coding: utf-8 -*-
1134-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
1135-"""
1136-OpenLP - Open Source Lyrics Projection
1137-Copyright (c) 2008 Raoul Snyman
1138-Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley,
1139-
1140-This program is free software; you can redistribute it and/or modify it under
1141-the terms of the GNU General Public License as published by the Free Software
1142-Foundation; version 2 of the License.
1143-
1144-This program is distributed in the hope that it will be useful, but WITHOUT ANY
1145-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1146-PARTICULAR PURPOSE. See the GNU General Public License for more details.
1147-
1148-You should have received a copy of the GNU General Public License along with
1149-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
1150-Place, Suite 330, Boston, MA 02111-1307 USA
1151-"""
1152-
1153-import os
1154-import sys
1155-import logging
1156-
1157-from openlp.core.lib import Plugin, EventManager
1158-
1159-class PluginManager(object):
1160- """
1161- This is the Plugin manager, which loads all the plugins,
1162- and executes all the hooks, as and when necessary.
1163- """
1164- global log
1165- log=logging.getLogger(u'PluginMgr')
1166- log.info(u'Plugin manager loaded')
1167-
1168- def __init__(self, dir):
1169- """
1170- The constructor for the plugin manager.
1171- Passes the controllers on to the plugins for them to interact with via their ServiceItems
1172- """
1173- log.info(u'Plugin manager initing')
1174- if not dir in sys.path:
1175- log.debug("Inserting %s into sys.path", dir)
1176- sys.path.insert(0, dir)
1177- self.basepath = os.path.abspath(dir)
1178- log.debug("Base path %s ", self.basepath)
1179- self.plugins = []
1180- # this has to happen after the UI is sorted self.find_plugins(dir)
1181- log.info("Plugin manager done init")
1182-
1183- def find_plugins(self, dir, plugin_helpers, eventmanager): # TODO shouldn't dir come from self.basepath
1184- """
1185- Scan the directory dir for objects inheriting from openlp.plugin
1186- """
1187- self.plugin_helpers = plugin_helpers
1188- startdepth=len(os.path.abspath(dir).split(os.sep))
1189- log.debug("find plugins %s at depth %d" %( str(dir), startdepth))
1190-
1191- for root, dirs, files in os.walk(dir):
1192- for name in files:
1193- if name.endswith(".py") and not name.startswith("__"):
1194- path = os.path.abspath(os.path.join(root, name))
1195- thisdepth=len(path.split(os.sep))
1196- if thisdepth-startdepth > 2: # skip anything lower down
1197- continue
1198- modulename, pyext = os.path.splitext(path)
1199- prefix = os.path.commonprefix([self.basepath, path])
1200- # hack off the plugin base path
1201- modulename = modulename[len(prefix) + 1:]
1202- modulename = modulename.replace(os.path.sep, '.')
1203- # import the modules
1204- log.debug("Importing %s from %s. Depth %d" % (modulename, path, thisdepth))
1205- try:
1206- __import__(modulename, globals(), locals(), [])
1207- except ImportError, e:
1208- log.error("Failed to import module %s on path %s for reason %s", modulename, path, e.message)
1209- self.plugin_classes = Plugin.__subclasses__()
1210- self.plugins = []
1211- plugin_objects = []
1212- for p in self.plugin_classes:
1213- try:
1214- plugin = p(self.plugin_helpers)
1215- log.debug(u'loaded plugin %s with helpers'%str(p))
1216- log.debug("Plugin="+str(p))
1217- if plugin.check_pre_conditions():
1218- log.debug("Appending "+str(p))
1219- plugin_objects.append(plugin)
1220- eventmanager.register(plugin)
1221- except TypeError:
1222- log.error(u'loaded plugin %s has no helpers'%str(p))
1223- self.plugins = sorted(plugin_objects, self.order_by_weight)
1224-
1225- def order_by_weight(self, x, y):
1226- return cmp(x.weight, y.weight)
1227-
1228- def hook_media_manager(self, mediatoolbox):
1229- """
1230- Loop through all the plugins. If a plugin has a valid media manager item,
1231- add it to the media manager.
1232- """
1233- for plugin in self.plugins:
1234- media_manager_item = plugin.get_media_manager_item()
1235- if media_manager_item is not None:
1236- log.debug('Inserting media manager item from %s' % plugin.name)
1237- mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)
1238-
1239- def hook_settings_tabs(self, settingsform=None):
1240- """
1241- Loop through all the plugins. If a plugin has a valid settings tab item,
1242- add it to the settings tab.
1243- """
1244- for plugin in self.plugins:
1245- settings_tab = plugin.get_settings_tab()
1246- if settings_tab is not None:
1247- log.debug('Inserting settings tab item from %s' % plugin.name)
1248- settingsform.addTab(settings_tab)
1249- else:
1250- log.debug('No settings in %s' % plugin.name)
1251-
1252- def hook_import_menu(self, import_menu):
1253- """
1254- Loop through all the plugins and give them an opportunity to add an item
1255- to the import menu.
1256- """
1257- for plugin in self.plugins:
1258- plugin.add_import_menu_item(import_menu)
1259-
1260- def hook_export_menu(self, export_menu):
1261- """
1262- Loop through all the plugins and give them an opportunity to add an item
1263- to the export menu.
1264- """
1265- for plugin in self.plugins:
1266- plugin.add_export_menu_item(export_menu)
1267-
1268- def hook_handle_event(self, eventmanager):
1269- for plugin in self.plugins:
1270- handle_event = plugin.handle_event(None)
1271- print plugin, handle_event
1272-# if settings_tab is not None:
1273-# log.debug('Inserting settings tab item from %s' % plugin.name)
1274-# settingsform.addTab(settings_tab)
1275-# else:
1276-# log.debug('No settings in %s' % plugin.name)
1277- def initialise_plugins(self):
1278- """
1279- Loop through all the plugins and give them an opportunity to add an item
1280- to the export menu.
1281- """
1282- for plugin in self.plugins:
1283- plugin.initialise()
1284
1285=== removed file 'openlp/core/render.py'
1286--- openlp/core/render.py 2009-04-11 07:33:45 +0000
1287+++ openlp/core/render.py 1970-01-01 00:00:00 +0000
1288@@ -1,440 +0,0 @@
1289-# -*- coding: utf-8 -*-
1290-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
1291-"""
1292-OpenLP - Open Source Lyrics Projection
1293-Copyright (c) 2008 Raoul Snyman
1294-Portions copyright (c) 2008 Martin Thompson, Tim Bentley
1295-
1296-This program is free software; you can redistribute it and/or modify it under
1297-the terms of the GNU General Public License as published by the Free Software
1298-Foundation; version 2 of the License.
1299-
1300-This program is distributed in the hope that it will be useful, but WITHOUT ANY
1301-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1302-PARTICULAR PURPOSE. See the GNU General Public License for more details.
1303-
1304-You should have received a copy of the GNU General Public License along with
1305-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
1306-Place, Suite 330, Boston, MA 02111-1307 USA
1307-"""
1308-import logging
1309-
1310-import sys
1311-from PyQt4 import QtGui, QtCore, Qt
1312-
1313-from copy import copy
1314-#from interpolate import interpolate
1315-
1316-class Renderer:
1317-
1318- global log
1319- log=logging.getLogger(u'Renderer')
1320- log.info(u'Renderer Loaded')
1321- """All the functions for rendering a set of words onto a Device Context
1322-
1323- How to use:
1324- set the words to be displayed with a call to set_words_openlp() - this returns an array of screenfuls of data
1325- set a theme (if you need) with set_theme
1326- tell it which DC to render to with set_DC()
1327- set the borders of where you want the text (if not the whole DC) with set_text_rectangle()
1328- tell it to render a particular screenfull with render_screen(n)
1329-
1330- """
1331- def __init__(self):
1332- self._rect=None
1333- self._debug=0
1334- self.words=None
1335- self._right_margin = 64 # the amount of right indent
1336- self._shadow_offset=5
1337- self._outline_offset=2
1338- self._theme=None
1339- self._bg_image_filename=None
1340- self._paint=None
1341-
1342- def set_debug(self, debug):
1343- self._debug=debug
1344-
1345- def set_theme(self, theme):
1346- self._theme=theme
1347- if theme.background_type == u'image':
1348- self.set_bg_image(theme.background_filename)
1349-
1350- def set_bg_image(self, filename):
1351- log.debug(u'set bg image %s', filename)
1352- self._bg_image_filename=filename
1353- if self._paint is not None:
1354- self.scale_bg_image()
1355-
1356- def scale_bg_image(self):
1357- assert self._paint
1358- i=QtGui.QImage(self._bg_image_filename)
1359- # rescale and offset
1360- imw=i.width()
1361- imh=i.height()
1362- dcw=self._paint.width()+1
1363- dch=self._paint.height()
1364- imratio=imw/float(imh)
1365- dcratio=dcw/float(dch)
1366- log.debug(u'Image scaling params %s %s %s %s %s %s', imw, imh, imratio, dcw, dch, dcratio)
1367- if imratio > dcratio:
1368- scale=dcw/float(imw)
1369- elif imratio < dcratio:
1370- scale=dch/float(imh)
1371- else:
1372- scale=dcw/float(imw) # either will do
1373- neww=int(round(imw*scale))
1374- newh=int(round(imh*scale))
1375- self.background_offsetx=(dcw-neww)/2
1376- self.background_offsety=(dch-newh)/2
1377- self.img=QtGui.QPixmap.fromImage(i.scaled(QtCore.QSize(neww, newh), Qt.Qt.KeepAspectRatio))
1378-
1379- def set_paint_dest(self, p):
1380- self._paint=p
1381- if self._bg_image_filename is not None:
1382- self.scale_bg_image()
1383-
1384- def set_words_openlp(self, words):
1385-# log.debug(u" "set words openlp", words
1386- verses=[]
1387- words=words.replace(u'\r\n', u'\n')
1388- verses_text=words.split(u'\n\n')
1389- for v in verses_text:
1390- lines=v.split(u'\n')
1391- verses.append(self.split_set_of_lines(lines)[0])
1392- self.words=verses
1393- verses_text=[]
1394- for v in verses:
1395- verses_text.append(u'\n'.join(v).lstrip()) # remove first \n
1396-
1397- return verses_text
1398-
1399- def render_screen(self, screennum):
1400- log.debug(u'render screen\n %s %s ', screennum, self.words[screennum])
1401- import time
1402- t=0.0
1403- words=self.words[screennum]
1404- retval=self._render_lines(words)
1405- return retval
1406-
1407- def set_text_rectangle(self, rect_main, rect_footer):
1408- """ Sets the rectangle within which text should be rendered"""
1409- self._rect=rect_main
1410- self._rect_footer=rect_footer
1411-
1412- def _render_background(self):
1413- assert(self._theme)
1414- assert(self._paint)
1415- log.debug(u'render background %s ', self._theme.background_type)
1416- p=QtGui.QPainter()
1417- p.begin(self._paint)
1418- if self._theme.background_type == u'solid':
1419- p.fillRect(self._paint.rect(), QtGui.QColor(self._theme.background_color1))
1420- elif self._theme.background_type == u'gradient' : # gradient
1421- gradient = None
1422- if self._theme.background_direction == u'vertical':
1423- w = int(self._paint.width())/2
1424- gradient = QtGui.QLinearGradient(w, 0, w, self._paint.height()) # vertical
1425- elif self._theme.background_direction == u'horizontal':
1426- h = int(self._paint.height())/2
1427- gradient = QtGui.QLinearGradient(0, h, self._paint.width(), h) # Horizontal
1428- else:
1429- w = int(self._paint.width())/2
1430- h = int(self._paint.height())/2
1431- gradient = QtGui.QRadialGradient(w, h, w) # Circular
1432-
1433- gradient.setColorAt(0, QtGui.QColor(self._theme.background_color1))
1434- gradient.setColorAt(1, QtGui.QColor(self._theme.background_color2))
1435-
1436- p.setBrush(QtGui.QBrush(gradient))
1437- rectPath = QtGui.QPainterPath()
1438-
1439- max_x = self._paint.width()
1440- max_y = self._paint.height()
1441- rectPath.moveTo(0, 0)
1442- rectPath.lineTo(0, max_y)
1443- rectPath.lineTo(max_x, max_y)
1444- rectPath.lineTo(max_x, 0)
1445-
1446- rectPath.closeSubpath()
1447- p.drawPath(rectPath)
1448-
1449- elif self._theme.background_type== u'image': # image
1450- r=self._paint.rect()
1451- log.debug(u'Image size details %d %d %d %d ', r.x(), r.y(), r.width(),r.height())
1452- log.debug(u' Background Parameter %d ', self._theme.background_borderColor)
1453- if self._theme.Bbackground_borderColor is not None:
1454- p.fillRect(self._paint.rect(), self._theme.background_borderColor)
1455- p.drawPixmap(self.background_offsetx,self.background_offsety, self.img)
1456- p.end()
1457- log.debug(u'render background done')
1458-
1459- def split_set_of_lines(self, lines):
1460-
1461- """Given a list of lines, decide how to split them best if they don't all fit on the screen
1462- - this is done by splitting at 1/2, 1/3 or 1/4 of the set
1463- If it doesn't fit, even at this size, just split at each opportunity
1464-
1465- We'll do this by getting the bounding box of each line, and then summing them appropriately
1466-
1467- Returns a list of [lists of lines], one set for each screenful
1468- """
1469-# log.debug(u" "Split set of lines"
1470- # Probably ought to save the rendering results to a pseudoDC for redrawing efficiency. But let's not optimse prematurely!
1471-
1472- bboxes = []
1473- for line in lines:
1474- bboxes.append(self._render_single_line(line))
1475- numlines=len(lines)
1476- bottom=self._rect.bottom()
1477- for ratio in (numlines, numlines/2, numlines/3, numlines/4):
1478- good=1
1479- startline=0
1480- endline=startline+ratio
1481- while (endline<=numlines):
1482- by=0
1483- for (x,y) in bboxes[startline:endline]:
1484- by+=y
1485- if by > bottom:
1486- good=0
1487- break
1488- startline+=ratio
1489- endline=startline+ratio
1490- if good==1:
1491- break
1492-
1493- retval=[]
1494- numlines_per_page=ratio
1495- if good:
1496- c=0
1497- thislines=[]
1498- while c < numlines:
1499- thislines.append(lines[c])
1500- c+=1
1501- if len(thislines) == numlines_per_page:
1502- retval.append(thislines)
1503- thislines=[]
1504- else:
1505-# log.debug(u" "Just split where you can"
1506- retval=[]
1507- startline=0
1508- endline=startline+1
1509- while (endline<=numlines):
1510- by=0
1511- for (x,y) in bboxes[startline:endline]:
1512- by+=y
1513- if by > bottom:
1514- retval.append(lines[startline:endline-1])
1515- startline=endline-1
1516- endline=startline # gets incremented below
1517- by=0
1518- endline+=1
1519-
1520- return retval
1521-
1522- def _correctAlignment(self, rect, bbox):
1523- x=rect.left()
1524- if int(self._theme.display_verticalAlign) == 0: # top align
1525- y = rect.top()
1526- elif int(self._theme.display_verticalAlign) == 1: # bottom align
1527- y=rect.bottom()-bbox.height()
1528- elif int(t.display_verticalAlign) == 2: # centre align
1529- y=rect.top()+(rect.height()-bbox.height())/2
1530- else:
1531- assert(0, u'Invalid value for theme.VerticalAlign:%s' % self._theme.display_verticalAlign)
1532- return x, y
1533-
1534- def _render_lines(self, lines, lines1=None):
1535- """render a set of lines according to the theme, return bounding box"""
1536- #log.debug(u'_render_lines %s', lines)
1537-
1538- bbox=self._render_lines_unaligned(lines, False) # Main font
1539- if lines1 is not None:
1540- bbox1=self._render_lines_unaligned(lines1, True) # Footer Font
1541-
1542- # put stuff on background so need to reset before doing the job properly.
1543- self._render_background()
1544- x, y = self._correctAlignment(self._rect, bbox)
1545- bbox=self._render_lines_unaligned(lines, False, (x,y))
1546-
1547- if lines1 is not None:
1548- x, y = self._correctAlignment(self._rect_footer, bbox1)
1549- bbox=self._render_lines_unaligned(lines1, True, (x,y) )
1550-
1551- log.debug(u'render lines DONE')
1552-
1553- return bbox
1554-
1555- def _render_lines_unaligned(self, lines, footer, tlcorner=(0,0)):
1556-
1557- """Given a list of lines to render, render each one in turn
1558- (using the _render_single_line fn - which may result in going
1559- off the bottom) They are expected to be pre-arranged to less
1560- than a screenful (eg. by using split_set_of_lines)
1561-
1562- Returns the bounding box of the text as QRect"""
1563- log.debug(u'render unaligned %s', lines)
1564- x,y=tlcorner
1565- brx=x
1566- bry=y
1567- for line in lines:
1568- if (line == ''):
1569- continue
1570- # render after current bottom, but at original left edge
1571- # keep track of right edge to see which is biggest
1572- (thisx, bry) = self._render_single_line(line, footer, (x,bry))
1573- if (thisx > brx):
1574- brx=thisx
1575- retval=QtCore.QRect(x,y,brx-x, bry-y)
1576- if self._debug:
1577- p=QtGui.QPainter()
1578- p.begin(self._paint)
1579- p.setPen(QtGui.QPen(QtGui.QColor(0,0,255)))
1580- p.drawRect(retval)
1581- p.end()
1582- log.debug(u'render unaligned DONE')
1583-
1584- return retval
1585-
1586- def _render_single_line(self, line, footer, tlcorner=(0,0)):
1587-
1588- """render a single line of words onto the DC, top left corner
1589- specified.
1590-
1591- If the line is too wide for the context, it wraps, but
1592- right-aligns the surplus words in the manner of song lyrics
1593-
1594- Returns the bottom-right corner (of what was rendered) as a tuple(x,y).
1595- """
1596- #log.debug(u'Render single line %s @ %s '%( line, tlcorner))
1597- x,y=tlcorner
1598- # We draw the text to see how big it is and then iterate to make it fit
1599- # when we line wrap we do in in the "lyrics" style, so the second line is
1600- # right aligned with a "hanging indent"
1601-
1602- # get the words
1603-# log.debug(u" "Getting the words split right"
1604- words=line.split(u' ')
1605- thisline=u' '.join(words)
1606- lastword=len(words)
1607- lines=[]
1608- maxx=self._rect.width(); maxy=self._rect.height();
1609- while (len(words)>0):
1610- w,h=self._get_extent_and_render(thisline, footer)
1611- rhs=w+x
1612- if rhs < maxx-self._right_margin:
1613- lines.append(thisline)
1614- words=words[lastword:]
1615- thisline=' '.join(words)
1616- lastword=len(words)
1617- else:
1618- lastword-=1
1619- thisline=' '.join(words[:lastword])
1620- startx=x
1621- starty=y
1622- rightextent=None
1623- t=self._theme
1624- align=t.display_horizontalAlign
1625- wrapstyle=t.display_wrapStyle
1626-
1627- for linenum in range(len(lines)):
1628- line=lines[linenum]
1629- #find out how wide line is
1630- w,h=self._get_extent_and_render(line, footer, tlcorner=(x,y), draw=False)
1631-
1632- if t.display_shadow:
1633- w+=self._shadow_offset
1634- h+=self._shadow_offset
1635- if t.display_outline:
1636- w+=2*self._outline_offset # pixels either side
1637- h+=2*self._outline_offset # pixels top/bottom
1638- if align==0: # left align
1639- rightextent=x+w
1640- if wrapstyle==1 and linenum != 0: # shift right from last line's rh edge
1641- rightextent=self._first_line_right_extent + self._right_margin
1642- if rightextent > maxx:
1643- rightextent = maxx
1644- x = rightextent-w
1645-
1646- elif align==1: # right align
1647- rightextent=maxx
1648- x=maxx-w
1649- elif align==2: # centre
1650- x=(maxx-w)/2;
1651- rightextent=x+w
1652- # now draw the text, and any outlines/shadows
1653- if t.display_shadow:
1654- self._get_extent_and_render(line, footer,tlcorner=(x+self._shadow_offset,y+self._shadow_offset),
1655- draw=True, color = t.display_shadow_color)
1656- if t.display_outline:
1657- self._get_extent_and_render(line, footer,(x+self._outline_offset,y), draw=True, color = t.display_outline_color)
1658- self._get_extent_and_render(line, footer,(x,y+self._outline_offset), draw=True, color = t.display_outline_color)
1659- self._get_extent_and_render(line, footer,(x,y-self._outline_offset), draw=True, color = t.display_outline_color)
1660- self._get_extent_and_render(line, footer,(x-self._outline_offset,y), draw=True, color = t.display_outline_color)
1661- if self._outline_offset > 1:
1662- self._get_extent_and_render(line, footer,(x+self._outline_offset,y+self._outline_offset), draw=True, color = t.display_outline_color)
1663- self._get_extent_and_render(line, footer,(x-self._outline_offset,y+self._outline_offset), draw=True, color = t.display_outline_color)
1664- self._get_extent_and_render(line, footer,(x+self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color)
1665- self._get_extent_and_render(line, footer,(x-self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color)
1666-
1667- self._get_extent_and_render(line, footer,tlcorner=(x,y), draw=True)
1668-# log.debug(u'Line %2d: Render '%s' at (%d, %d) wh=(%d,%d)' % ( linenum, line, x, y,w,h)
1669- y += h
1670- if linenum == 0:
1671- self._first_line_right_extent=rightextent
1672- # draw a box around the text - debug only
1673- if self._debug:
1674- p=QtGui.QPainter()
1675- p.begin(self._paint)
1676- p.setPen(QtGui.QPen(QtGui.QColor(0,255,0)))
1677- p.drawRect(startx,starty,rightextent-startx,y-starty)
1678- p.end()
1679-
1680- brcorner=(rightextent,y)
1681- return brcorner
1682-
1683- # xxx this is what to override for an SDL version
1684- def _get_extent_and_render(self, line, footer, tlcorner=(0,0), draw=False, color=None):
1685- """Find bounding box of text - as render_single_line.
1686- If draw is set, actually draw the text to the current DC as well
1687-
1688- return width and height of text as a tuple (w,h)"""
1689- # setup defaults
1690- #log.debug(u"_get_extent_and_render %s %s %s ", [line], tlcorner, draw)
1691- p=QtGui.QPainter()
1692- p.begin(self._paint)
1693- # 'twould be more efficient to set this once when theme changes
1694- # or p changes
1695- if footer :
1696- font=QtGui.QFont(self._theme.font_footer_name,
1697- int(self._theme.font_footer_proportion), # size
1698- QtGui.QFont.Normal, # weight
1699- 0)# italic
1700- else:
1701- font=QtGui.QFont(self._theme.font_main_name,
1702- int(self._theme.font_main_proportion), # size
1703- QtGui.QFont.Normal, # weight
1704- 0)# italic
1705- # to make the unit tests monitor independent, we have to be able to
1706- # specify whether a font proportion is in pixels or points
1707- if footer:
1708- font.setPixelSize(int(self._theme.font_footer_proportion))
1709- else:
1710- font.setPixelSize(int(self._theme.font_main_proportion))
1711- #log.debug(u'Font details %s %s %s %d', self._theme.font_main_name, self._theme.font_main_proportion, font.family(), font.pointSize())
1712- p.setFont(font)
1713- if color == None:
1714- if footer:
1715- p.setPen(QtGui.QColor(self._theme.font_footer_color))
1716- else:
1717- p.setPen(QtGui.QColor(self._theme.font_main_color))
1718- else:
1719- p.setPen(QtGui.QColor(color))
1720- x,y=tlcorner
1721- metrics=QtGui.QFontMetrics(font)
1722- # xxx some fudges to make it exactly like wx! Take 'em out later
1723- w=metrics.width(line)
1724- h=metrics.height()-2
1725- if draw:
1726- p.drawText(x,y+metrics.height()-metrics.descent()-1, line)
1727- p.end()
1728- return (w, h)
1729
1730=== modified file 'openlp/core/test/test_plugin_manager.py'
1731--- openlp/core/test/test_plugin_manager.py 2009-03-12 20:19:24 +0000
1732+++ openlp/core/test/test_plugin_manager.py 2009-04-20 18:22:42 +0000
1733@@ -1,4 +1,7 @@
1734 import logging
1735+import os, sys
1736+from openlp.core.lib.pluginmanager import PluginManager
1737+
1738 logging.basicConfig(level=logging.DEBUG,
1739 format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
1740 datefmt='%m-%d %H:%M',
1741@@ -14,11 +17,9 @@
1742 log=logging.getLogger('')
1743
1744 logging.info("Logging started")
1745-import os, sys
1746 mypath=os.path.split(os.path.abspath(__file__))[0]
1747
1748 sys.path.insert(0,(os.path.join(mypath, '..' ,'..', '..')))
1749-from openlp.core.pluginmanager import PluginManager
1750
1751 # test the plugin manager with some plugins in the test_plugins directory
1752 class TestPluginManager:
1753
1754=== modified file 'openlp/core/ui/amendthemedialog.py'
1755--- openlp/core/ui/amendthemedialog.py 2009-04-11 05:43:52 +0000
1756+++ openlp/core/ui/amendthemedialog.py 2009-04-21 19:45:50 +0000
1757@@ -2,7 +2,7 @@
1758
1759 # Form implementation generated from reading ui file 'amendthemedialog.ui'
1760 #
1761-# Created: Fri Apr 10 20:38:33 2009
1762+# Created: Tue Apr 21 06:06:56 2009
1763 # by: PyQt4 UI code generator 4.4.4
1764 #
1765 # WARNING! All changes made in this file will be lost!
1766@@ -12,272 +12,416 @@
1767 class Ui_AmendThemeDialog(object):
1768 def setupUi(self, AmendThemeDialog):
1769 AmendThemeDialog.setObjectName("AmendThemeDialog")
1770- AmendThemeDialog.resize(752, 533)
1771+ AmendThemeDialog.setWindowModality(QtCore.Qt.ApplicationModal)
1772+ AmendThemeDialog.resize(586, 651)
1773 icon = QtGui.QIcon()
1774 icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
1775 AmendThemeDialog.setWindowIcon(icon)
1776- self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog)
1777- self.ThemeButtonBox.setGeometry(QtCore.QRect(580, 500, 156, 26))
1778- self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
1779- self.ThemeButtonBox.setObjectName("ThemeButtonBox")
1780- self.layoutWidget = QtGui.QWidget(AmendThemeDialog)
1781- self.layoutWidget.setGeometry(QtCore.QRect(50, 20, 441, 41))
1782- self.layoutWidget.setObjectName("layoutWidget")
1783- self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget)
1784- self.horizontalLayout.setObjectName("horizontalLayout")
1785- self.ThemeNameLabel = QtGui.QLabel(self.layoutWidget)
1786+ AmendThemeDialog.setModal(True)
1787+ self.AmendThemeLayout = QtGui.QVBoxLayout(AmendThemeDialog)
1788+ self.AmendThemeLayout.setSpacing(8)
1789+ self.AmendThemeLayout.setMargin(8)
1790+ self.AmendThemeLayout.setObjectName("AmendThemeLayout")
1791+ self.ThemeNameWidget = QtGui.QWidget(AmendThemeDialog)
1792+ self.ThemeNameWidget.setObjectName("ThemeNameWidget")
1793+ self.ThemeNameLayout = QtGui.QHBoxLayout(self.ThemeNameWidget)
1794+ self.ThemeNameLayout.setSpacing(8)
1795+ self.ThemeNameLayout.setMargin(0)
1796+ self.ThemeNameLayout.setObjectName("ThemeNameLayout")
1797+ self.ThemeNameLabel = QtGui.QLabel(self.ThemeNameWidget)
1798 self.ThemeNameLabel.setObjectName("ThemeNameLabel")
1799- self.horizontalLayout.addWidget(self.ThemeNameLabel)
1800- self.ThemeNameEdit = QtGui.QLineEdit(self.layoutWidget)
1801+ self.ThemeNameLayout.addWidget(self.ThemeNameLabel)
1802+ self.ThemeNameEdit = QtGui.QLineEdit(self.ThemeNameWidget)
1803 self.ThemeNameEdit.setObjectName("ThemeNameEdit")
1804- self.horizontalLayout.addWidget(self.ThemeNameEdit)
1805- self.widget = QtGui.QWidget(AmendThemeDialog)
1806- self.widget.setGeometry(QtCore.QRect(31, 71, 721, 411))
1807- self.widget.setObjectName("widget")
1808- self.horizontalLayout_2 = QtGui.QHBoxLayout(self.widget)
1809- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
1810- self.LeftSide = QtGui.QWidget(self.widget)
1811- self.LeftSide.setObjectName("LeftSide")
1812- self.tabWidget = QtGui.QTabWidget(self.LeftSide)
1813- self.tabWidget.setGeometry(QtCore.QRect(0, 0, 341, 401))
1814- self.tabWidget.setObjectName("tabWidget")
1815+ self.ThemeNameLayout.addWidget(self.ThemeNameEdit)
1816+ self.AmendThemeLayout.addWidget(self.ThemeNameWidget)
1817+ self.ContentWidget = QtGui.QWidget(AmendThemeDialog)
1818+ self.ContentWidget.setObjectName("ContentWidget")
1819+ self.ContentLayout = QtGui.QHBoxLayout(self.ContentWidget)
1820+ self.ContentLayout.setSpacing(8)
1821+ self.ContentLayout.setMargin(0)
1822+ self.ContentLayout.setObjectName("ContentLayout")
1823+ self.ThemeTabWidget = QtGui.QTabWidget(self.ContentWidget)
1824+ self.ThemeTabWidget.setObjectName("ThemeTabWidget")
1825 self.BackgroundTab = QtGui.QWidget()
1826 self.BackgroundTab.setObjectName("BackgroundTab")
1827- self.layoutWidget1 = QtGui.QWidget(self.BackgroundTab)
1828- self.layoutWidget1.setGeometry(QtCore.QRect(10, 10, 321, 351))
1829- self.layoutWidget1.setObjectName("layoutWidget1")
1830- self.gridLayout = QtGui.QGridLayout(self.layoutWidget1)
1831- self.gridLayout.setObjectName("gridLayout")
1832- self.BackgroundLabel = QtGui.QLabel(self.layoutWidget1)
1833+ self.BackgroundLayout = QtGui.QFormLayout(self.BackgroundTab)
1834+ self.BackgroundLayout.setMargin(8)
1835+ self.BackgroundLayout.setSpacing(8)
1836+ self.BackgroundLayout.setObjectName("BackgroundLayout")
1837+ self.BackgroundLabel = QtGui.QLabel(self.BackgroundTab)
1838 self.BackgroundLabel.setObjectName("BackgroundLabel")
1839- self.gridLayout.addWidget(self.BackgroundLabel, 0, 0, 1, 2)
1840- self.BackgroundComboBox = QtGui.QComboBox(self.layoutWidget1)
1841+ self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.BackgroundLabel)
1842+ self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab)
1843 self.BackgroundComboBox.setObjectName("BackgroundComboBox")
1844 self.BackgroundComboBox.addItem(QtCore.QString())
1845 self.BackgroundComboBox.addItem(QtCore.QString())
1846- self.gridLayout.addWidget(self.BackgroundComboBox, 0, 2, 1, 2)
1847- self.BackgroundTypeLabel = QtGui.QLabel(self.layoutWidget1)
1848+ self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.BackgroundComboBox)
1849+ self.BackgroundTypeLabel = QtGui.QLabel(self.BackgroundTab)
1850 self.BackgroundTypeLabel.setObjectName("BackgroundTypeLabel")
1851- self.gridLayout.addWidget(self.BackgroundTypeLabel, 1, 0, 1, 2)
1852- self.BackgroundTypeComboBox = QtGui.QComboBox(self.layoutWidget1)
1853+ self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.BackgroundTypeLabel)
1854+ self.BackgroundTypeComboBox = QtGui.QComboBox(self.BackgroundTab)
1855 self.BackgroundTypeComboBox.setObjectName("BackgroundTypeComboBox")
1856 self.BackgroundTypeComboBox.addItem(QtCore.QString())
1857 self.BackgroundTypeComboBox.addItem(QtCore.QString())
1858 self.BackgroundTypeComboBox.addItem(QtCore.QString())
1859- self.gridLayout.addWidget(self.BackgroundTypeComboBox, 1, 2, 1, 2)
1860- self.Color1Label = QtGui.QLabel(self.layoutWidget1)
1861+ self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.BackgroundTypeComboBox)
1862+ self.Color1Label = QtGui.QLabel(self.BackgroundTab)
1863 self.Color1Label.setObjectName("Color1Label")
1864- self.gridLayout.addWidget(self.Color1Label, 2, 0, 1, 1)
1865- self.Color1PushButton = QtGui.QPushButton(self.layoutWidget1)
1866+ self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.Color1Label)
1867+ self.Color1PushButton = QtGui.QPushButton(self.BackgroundTab)
1868 self.Color1PushButton.setObjectName("Color1PushButton")
1869- self.gridLayout.addWidget(self.Color1PushButton, 2, 2, 1, 2)
1870- self.Color2Label = QtGui.QLabel(self.layoutWidget1)
1871+ self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.Color1PushButton)
1872+ self.Color2Label = QtGui.QLabel(self.BackgroundTab)
1873 self.Color2Label.setObjectName("Color2Label")
1874- self.gridLayout.addWidget(self.Color2Label, 3, 0, 1, 1)
1875- self.Color2PushButton = QtGui.QPushButton(self.layoutWidget1)
1876+ self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.Color2Label)
1877+ self.Color2PushButton = QtGui.QPushButton(self.BackgroundTab)
1878 self.Color2PushButton.setObjectName("Color2PushButton")
1879- self.gridLayout.addWidget(self.Color2PushButton, 3, 2, 1, 2)
1880- self.ImageLabel = QtGui.QLabel(self.layoutWidget1)
1881+ self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.Color2PushButton)
1882+ self.ImageLabel = QtGui.QLabel(self.BackgroundTab)
1883 self.ImageLabel.setObjectName("ImageLabel")
1884- self.gridLayout.addWidget(self.ImageLabel, 4, 0, 1, 1)
1885- self.ImageLineEdit = QtGui.QLineEdit(self.layoutWidget1)
1886+ self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.ImageLabel)
1887+ self.GradientLabel = QtGui.QLabel(self.BackgroundTab)
1888+ self.GradientLabel.setObjectName("GradientLabel")
1889+ self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.GradientLabel)
1890+ self.GradientComboBox = QtGui.QComboBox(self.BackgroundTab)
1891+ self.GradientComboBox.setObjectName("GradientComboBox")
1892+ self.GradientComboBox.addItem(QtCore.QString())
1893+ self.GradientComboBox.addItem(QtCore.QString())
1894+ self.GradientComboBox.addItem(QtCore.QString())
1895+ self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.FieldRole, self.GradientComboBox)
1896+ self.ImageFilenameWidget = QtGui.QWidget(self.BackgroundTab)
1897+ self.ImageFilenameWidget.setObjectName("ImageFilenameWidget")
1898+ self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImageFilenameWidget)
1899+ self.horizontalLayout_2.setSpacing(0)
1900+ self.horizontalLayout_2.setMargin(0)
1901+ self.horizontalLayout_2.setObjectName("horizontalLayout_2")
1902+ self.ImageLineEdit = QtGui.QLineEdit(self.ImageFilenameWidget)
1903 self.ImageLineEdit.setObjectName("ImageLineEdit")
1904- self.gridLayout.addWidget(self.ImageLineEdit, 4, 1, 1, 2)
1905- self.ImagePushButton = QtGui.QPushButton(self.layoutWidget1)
1906+ self.horizontalLayout_2.addWidget(self.ImageLineEdit)
1907+ self.ImageToolButton = QtGui.QToolButton(self.ImageFilenameWidget)
1908 icon1 = QtGui.QIcon()
1909- icon1.addPixmap(QtGui.QPixmap(":/services/service_open.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
1910- self.ImagePushButton.setIcon(icon1)
1911- self.ImagePushButton.setObjectName("ImagePushButton")
1912- self.gridLayout.addWidget(self.ImagePushButton, 4, 3, 1, 1)
1913- self.GradientLabel = QtGui.QLabel(self.layoutWidget1)
1914- self.GradientLabel.setObjectName("GradientLabel")
1915- self.gridLayout.addWidget(self.GradientLabel, 5, 0, 1, 1)
1916- self.GradientComboBox = QtGui.QComboBox(self.layoutWidget1)
1917- self.GradientComboBox.setObjectName("GradientComboBox")
1918- self.GradientComboBox.addItem(QtCore.QString())
1919- self.GradientComboBox.addItem(QtCore.QString())
1920- self.GradientComboBox.addItem(QtCore.QString())
1921- self.gridLayout.addWidget(self.GradientComboBox, 5, 2, 1, 2)
1922- self.tabWidget.addTab(self.BackgroundTab, "")
1923+ icon1.addPixmap(QtGui.QPixmap(":/images/image_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
1924+ self.ImageToolButton.setIcon(icon1)
1925+ self.ImageToolButton.setObjectName("ImageToolButton")
1926+ self.horizontalLayout_2.addWidget(self.ImageToolButton)
1927+ self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget)
1928+ spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
1929+ #self.BackgroundLayout.addItem(spacerItem, 7, 1, 1, 1)
1930+ self.ThemeTabWidget.addTab(self.BackgroundTab, "")
1931 self.FontMainTab = QtGui.QWidget()
1932 self.FontMainTab.setObjectName("FontMainTab")
1933- self.MainFontGroupBox = QtGui.QGroupBox(self.FontMainTab)
1934- self.MainFontGroupBox.setGeometry(QtCore.QRect(20, 10, 307, 119))
1935- self.MainFontGroupBox.setObjectName("MainFontGroupBox")
1936- self.gridLayout_2 = QtGui.QGridLayout(self.MainFontGroupBox)
1937- self.gridLayout_2.setObjectName("gridLayout_2")
1938- self.MainFontlabel = QtGui.QLabel(self.MainFontGroupBox)
1939- self.MainFontlabel.setObjectName("MainFontlabel")
1940- self.gridLayout_2.addWidget(self.MainFontlabel, 0, 0, 1, 1)
1941- self.MainFontComboBox = QtGui.QFontComboBox(self.MainFontGroupBox)
1942- self.MainFontComboBox.setObjectName("MainFontComboBox")
1943- self.gridLayout_2.addWidget(self.MainFontComboBox, 0, 1, 1, 2)
1944- self.MainFontColorLabel = QtGui.QLabel(self.MainFontGroupBox)
1945- self.MainFontColorLabel.setObjectName("MainFontColorLabel")
1946- self.gridLayout_2.addWidget(self.MainFontColorLabel, 1, 0, 1, 1)
1947- self.MainFontColorPushButton = QtGui.QPushButton(self.MainFontGroupBox)
1948- self.MainFontColorPushButton.setObjectName("MainFontColorPushButton")
1949- self.gridLayout_2.addWidget(self.MainFontColorPushButton, 1, 2, 1, 1)
1950- self.MainFontSize = QtGui.QLabel(self.MainFontGroupBox)
1951- self.MainFontSize.setObjectName("MainFontSize")
1952- self.gridLayout_2.addWidget(self.MainFontSize, 2, 0, 1, 1)
1953- self.MainFontSizeLineEdit = QtGui.QLineEdit(self.MainFontGroupBox)
1954- self.MainFontSizeLineEdit.setObjectName("MainFontSizeLineEdit")
1955- self.gridLayout_2.addWidget(self.MainFontSizeLineEdit, 2, 1, 1, 1)
1956- self.MainFontlSlider = QtGui.QSlider(self.MainFontGroupBox)
1957- self.MainFontlSlider.setProperty("value", QtCore.QVariant(15))
1958- self.MainFontlSlider.setMaximum(40)
1959- self.MainFontlSlider.setOrientation(QtCore.Qt.Horizontal)
1960- self.MainFontlSlider.setTickPosition(QtGui.QSlider.TicksBelow)
1961- self.MainFontlSlider.setTickInterval(5)
1962- self.MainFontlSlider.setObjectName("MainFontlSlider")
1963- self.gridLayout_2.addWidget(self.MainFontlSlider, 2, 2, 1, 1)
1964- self.FooterFontGroupBox = QtGui.QGroupBox(self.FontMainTab)
1965- self.FooterFontGroupBox.setGeometry(QtCore.QRect(20, 160, 301, 190))
1966- self.FooterFontGroupBox.setObjectName("FooterFontGroupBox")
1967- self.verticalLayout = QtGui.QVBoxLayout(self.FooterFontGroupBox)
1968- self.verticalLayout.setObjectName("verticalLayout")
1969- self.FontMainUseDefault = QtGui.QCheckBox(self.FooterFontGroupBox)
1970- self.FontMainUseDefault.setTristate(False)
1971- self.FontMainUseDefault.setObjectName("FontMainUseDefault")
1972- self.verticalLayout.addWidget(self.FontMainUseDefault)
1973- self.horizontalLayout_3 = QtGui.QHBoxLayout()
1974- self.horizontalLayout_3.setObjectName("horizontalLayout_3")
1975- self.FontMainXLabel = QtGui.QLabel(self.FooterFontGroupBox)
1976+ self.FontMainLayout = QtGui.QHBoxLayout(self.FontMainTab)
1977+ self.FontMainLayout.setSpacing(8)
1978+ self.FontMainLayout.setMargin(8)
1979+ self.FontMainLayout.setObjectName("FontMainLayout")
1980+ self.MainLeftWidget = QtGui.QWidget(self.FontMainTab)
1981+ self.MainLeftWidget.setObjectName("MainLeftWidget")
1982+ self.MainLeftLayout = QtGui.QVBoxLayout(self.MainLeftWidget)
1983+ self.MainLeftLayout.setSpacing(8)
1984+ self.MainLeftLayout.setMargin(0)
1985+ self.MainLeftLayout.setObjectName("MainLeftLayout")
1986+ self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget)
1987+ self.FontMainGroupBox.setObjectName("FontMainGroupBox")
1988+ self.MainFontLayout = QtGui.QFormLayout(self.FontMainGroupBox)
1989+ self.MainFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
1990+ self.MainFontLayout.setMargin(8)
1991+ self.MainFontLayout.setSpacing(8)
1992+ self.MainFontLayout.setObjectName("MainFontLayout")
1993+ self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox)
1994+ self.FontMainlabel.setObjectName("FontMainlabel")
1995+ self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontMainlabel)
1996+ self.FontMainComboBox = QtGui.QFontComboBox(self.FontMainGroupBox)
1997+ self.FontMainComboBox.setObjectName("FontMainComboBox")
1998+ self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainComboBox)
1999+ self.FontMainColorLabel = QtGui.QLabel(self.FontMainGroupBox)
2000+ self.FontMainColorLabel.setObjectName("FontMainColorLabel")
2001+ self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainColorLabel)
2002+ self.FontMainColorPushButton = QtGui.QPushButton(self.FontMainGroupBox)
2003+ self.FontMainColorPushButton.setObjectName("FontMainColorPushButton")
2004+ self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainColorPushButton)
2005+ self.FontMainSize = QtGui.QLabel(self.FontMainGroupBox)
2006+ self.FontMainSize.setObjectName("FontMainSize")
2007+ self.MainFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainSize)
2008+ self.FontMainSizeSpinBox = QtGui.QSpinBox(self.FontMainGroupBox)
2009+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
2010+ sizePolicy.setHorizontalStretch(0)
2011+ sizePolicy.setVerticalStretch(0)
2012+ sizePolicy.setHeightForWidth(self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth())
2013+ self.FontMainSizeSpinBox.setSizePolicy(sizePolicy)
2014+ self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
2015+ self.FontMainSizeSpinBox.setProperty("value", QtCore.QVariant(16))
2016+ self.FontMainSizeSpinBox.setMaximum(999)
2017+ self.FontMainSizeSpinBox.setObjectName("FontMainSizeSpinBox")
2018+ self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox)
2019+ self.MainLeftLayout.addWidget(self.FontMainGroupBox)
2020+ spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
2021+ self.MainLeftLayout.addItem(spacerItem1)
2022+ self.FontMainLayout.addWidget(self.MainLeftWidget)
2023+ self.MainRightWidget = QtGui.QWidget(self.FontMainTab)
2024+ self.MainRightWidget.setObjectName("MainRightWidget")
2025+ self.MainRightLayout = QtGui.QVBoxLayout(self.MainRightWidget)
2026+ self.MainRightLayout.setSpacing(8)
2027+ self.MainRightLayout.setMargin(0)
2028+ self.MainRightLayout.setObjectName("MainRightLayout")
2029+ self.MainLocationGroupBox = QtGui.QGroupBox(self.MainRightWidget)
2030+ self.MainLocationGroupBox.setObjectName("MainLocationGroupBox")
2031+ self.MainLocationLayout = QtGui.QFormLayout(self.MainLocationGroupBox)
2032+ self.MainLocationLayout.setMargin(8)
2033+ self.MainLocationLayout.setSpacing(8)
2034+ self.MainLocationLayout.setObjectName("MainLocationLayout")
2035+ self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox)
2036+ self.DefaultLocationLabel.setObjectName("DefaultLocationLabel")
2037+ self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.DefaultLocationLabel)
2038+ self.FontMainDefaultCheckBox = QtGui.QCheckBox(self.MainLocationGroupBox)
2039+ self.FontMainDefaultCheckBox.setTristate(False)
2040+ self.FontMainDefaultCheckBox.setObjectName("FontMainDefaultCheckBox")
2041+ self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainDefaultCheckBox)
2042+ self.FontMainXLabel = QtGui.QLabel(self.MainLocationGroupBox)
2043 self.FontMainXLabel.setObjectName("FontMainXLabel")
2044- self.horizontalLayout_3.addWidget(self.FontMainXLabel)
2045- self.FontMainXEdit = QtGui.QLineEdit(self.FooterFontGroupBox)
2046- self.FontMainXEdit.setObjectName("FontMainXEdit")
2047- self.horizontalLayout_3.addWidget(self.FontMainXEdit)
2048- self.verticalLayout.addLayout(self.horizontalLayout_3)
2049- self.horizontalLayout_4 = QtGui.QHBoxLayout()
2050- self.horizontalLayout_4.setObjectName("horizontalLayout_4")
2051- self.FontMainYLabel = QtGui.QLabel(self.FooterFontGroupBox)
2052+ self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainXLabel)
2053+ self.FontMainYLabel = QtGui.QLabel(self.MainLocationGroupBox)
2054 self.FontMainYLabel.setObjectName("FontMainYLabel")
2055- self.horizontalLayout_4.addWidget(self.FontMainYLabel)
2056- self.FontMainYEdit = QtGui.QLineEdit(self.FooterFontGroupBox)
2057- self.FontMainYEdit.setObjectName("FontMainYEdit")
2058- self.horizontalLayout_4.addWidget(self.FontMainYEdit)
2059- self.verticalLayout.addLayout(self.horizontalLayout_4)
2060- self.horizontalLayout_5 = QtGui.QHBoxLayout()
2061- self.horizontalLayout_5.setObjectName("horizontalLayout_5")
2062- self.FontMainWidthLabel = QtGui.QLabel(self.FooterFontGroupBox)
2063+ self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainYLabel)
2064+ self.FontMainWidthLabel = QtGui.QLabel(self.MainLocationGroupBox)
2065 self.FontMainWidthLabel.setObjectName("FontMainWidthLabel")
2066- self.horizontalLayout_5.addWidget(self.FontMainWidthLabel)
2067- self.FontMainWidthEdit = QtGui.QLineEdit(self.FooterFontGroupBox)
2068- self.FontMainWidthEdit.setObjectName("FontMainWidthEdit")
2069- self.horizontalLayout_5.addWidget(self.FontMainWidthEdit)
2070- self.verticalLayout.addLayout(self.horizontalLayout_5)
2071- self.horizontalLayout_6 = QtGui.QHBoxLayout()
2072- self.horizontalLayout_6.setObjectName("horizontalLayout_6")
2073- self.FontMainHeightLabel = QtGui.QLabel(self.FooterFontGroupBox)
2074+ self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWidthLabel)
2075+ self.FontMainHeightLabel = QtGui.QLabel(self.MainLocationGroupBox)
2076 self.FontMainHeightLabel.setObjectName("FontMainHeightLabel")
2077- self.horizontalLayout_6.addWidget(self.FontMainHeightLabel)
2078- self.FontMainHeightEdit = QtGui.QLineEdit(self.FooterFontGroupBox)
2079- self.FontMainHeightEdit.setObjectName("FontMainHeightEdit")
2080- self.horizontalLayout_6.addWidget(self.FontMainHeightEdit)
2081- self.verticalLayout.addLayout(self.horizontalLayout_6)
2082- self.tabWidget.addTab(self.FontMainTab, "")
2083+ self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainHeightLabel)
2084+ self.FontMainXSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox)
2085+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
2086+ sizePolicy.setHorizontalStretch(0)
2087+ sizePolicy.setVerticalStretch(0)
2088+ sizePolicy.setHeightForWidth(self.FontMainXSpinBox.sizePolicy().hasHeightForWidth())
2089+ self.FontMainXSpinBox.setSizePolicy(sizePolicy)
2090+ self.FontMainXSpinBox.setMinimumSize(QtCore.QSize(78, 0))
2091+ self.FontMainXSpinBox.setProperty("value", QtCore.QVariant(0))
2092+ self.FontMainXSpinBox.setMaximum(9999)
2093+ self.FontMainXSpinBox.setObjectName("FontMainXSpinBox")
2094+ self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainXSpinBox)
2095+ self.FontMainYSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox)
2096+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
2097+ sizePolicy.setHorizontalStretch(0)
2098+ sizePolicy.setVerticalStretch(0)
2099+ sizePolicy.setHeightForWidth(self.FontMainYSpinBox.sizePolicy().hasHeightForWidth())
2100+ self.FontMainYSpinBox.setSizePolicy(sizePolicy)
2101+ self.FontMainYSpinBox.setMinimumSize(QtCore.QSize(78, 0))
2102+ self.FontMainYSpinBox.setMaximum(9999)
2103+ self.FontMainYSpinBox.setObjectName("FontMainYSpinBox")
2104+ self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainYSpinBox)
2105+ self.FontMainWidthSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox)
2106+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
2107+ sizePolicy.setHorizontalStretch(0)
2108+ sizePolicy.setVerticalStretch(0)
2109+ sizePolicy.setHeightForWidth(self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth())
2110+ self.FontMainWidthSpinBox.setSizePolicy(sizePolicy)
2111+ self.FontMainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0))
2112+ self.FontMainWidthSpinBox.setMaximum(9999)
2113+ self.FontMainWidthSpinBox.setObjectName("FontMainWidthSpinBox")
2114+ self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWidthSpinBox)
2115+ self.FontMainHeightSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox)
2116+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
2117+ sizePolicy.setHorizontalStretch(0)
2118+ sizePolicy.setVerticalStretch(0)
2119+ sizePolicy.setHeightForWidth(self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth())
2120+ self.FontMainHeightSpinBox.setSizePolicy(sizePolicy)
2121+ self.FontMainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0))
2122+ self.FontMainHeightSpinBox.setMaximum(9999)
2123+ self.FontMainHeightSpinBox.setObjectName("FontMainHeightSpinBox")
2124+ self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainHeightSpinBox)
2125+ self.MainRightLayout.addWidget(self.MainLocationGroupBox)
2126+ spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
2127+ self.MainRightLayout.addItem(spacerItem2)
2128+ self.FontMainLayout.addWidget(self.MainRightWidget)
2129+ self.ThemeTabWidget.addTab(self.FontMainTab, "")
2130 self.FontFooterTab = QtGui.QWidget()
2131 self.FontFooterTab.setObjectName("FontFooterTab")
2132- self.FooterFontGroupBox_2 = QtGui.QGroupBox(self.FontFooterTab)
2133- self.FooterFontGroupBox_2.setGeometry(QtCore.QRect(20, 160, 301, 190))
2134- self.FooterFontGroupBox_2.setObjectName("FooterFontGroupBox_2")
2135- self.verticalLayout_2 = QtGui.QVBoxLayout(self.FooterFontGroupBox_2)
2136- self.verticalLayout_2.setObjectName("verticalLayout_2")
2137- self.FontMainUseDefault_2 = QtGui.QCheckBox(self.FooterFontGroupBox_2)
2138- self.FontMainUseDefault_2.setTristate(False)
2139- self.FontMainUseDefault_2.setObjectName("FontMainUseDefault_2")
2140- self.verticalLayout_2.addWidget(self.FontMainUseDefault_2)
2141- self.horizontalLayout_7 = QtGui.QHBoxLayout()
2142- self.horizontalLayout_7.setObjectName("horizontalLayout_7")
2143- self.FontFooterXLabel = QtGui.QLabel(self.FooterFontGroupBox_2)
2144+ self.FontFooterLayout = QtGui.QHBoxLayout(self.FontFooterTab)
2145+ self.FontFooterLayout.setSpacing(8)
2146+ self.FontFooterLayout.setMargin(8)
2147+ self.FontFooterLayout.setObjectName("FontFooterLayout")
2148+ self.FooterLeftWidget = QtGui.QWidget(self.FontFooterTab)
2149+ self.FooterLeftWidget.setObjectName("FooterLeftWidget")
2150+ self.FooterLeftLayout = QtGui.QVBoxLayout(self.FooterLeftWidget)
2151+ self.FooterLeftLayout.setSpacing(8)
2152+ self.FooterLeftLayout.setMargin(0)
2153+ self.FooterLeftLayout.setObjectName("FooterLeftLayout")
2154+ self.FooterFontGroupBox = QtGui.QGroupBox(self.FooterLeftWidget)
2155+ self.FooterFontGroupBox.setObjectName("FooterFontGroupBox")
2156+ self.FooterFontLayout = QtGui.QFormLayout(self.FooterFontGroupBox)
2157+ self.FooterFontLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow)
2158+ self.FooterFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
2159+ self.FooterFontLayout.setMargin(8)
2160+ self.FooterFontLayout.setSpacing(8)
2161+ self.FooterFontLayout.setObjectName("FooterFontLayout")
2162+ self.FontFooterLabel = QtGui.QLabel(self.FooterFontGroupBox)
2163+ self.FontFooterLabel.setObjectName("FontFooterLabel")
2164+ self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterLabel)
2165+ self.FontFooterComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox)
2166+ self.FontFooterComboBox.setObjectName("FontFooterComboBox")
2167+ self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterComboBox)
2168+ self.FontFooterColorLabel = QtGui.QLabel(self.FooterFontGroupBox)
2169+ self.FontFooterColorLabel.setObjectName("FontFooterColorLabel")
2170+ self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterColorLabel)
2171+ self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox)
2172+ self.FontFooterColorPushButton.setObjectName("FontFooterColorPushButton")
2173+ self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterColorPushButton)
2174+ self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox)
2175+ self.FontFooterSizeLabel.setObjectName("FontFooterSizeLabel")
2176+ self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterSizeLabel)
2177+ self.FontFooterSizeSpinBox = QtGui.QSpinBox(self.FooterFontGroupBox)
2178+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
2179+ sizePolicy.setHorizontalStretch(0)
2180+ sizePolicy.setVerticalStretch(0)
2181+ sizePolicy.setHeightForWidth(self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth())
2182+ self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy)
2183+ self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
2184+ self.FontFooterSizeSpinBox.setProperty("value", QtCore.QVariant(10))
2185+ self.FontFooterSizeSpinBox.setMaximum(999)
2186+ self.FontFooterSizeSpinBox.setObjectName("FontFooterSizeSpinBox")
2187+ self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox)
2188+ self.FooterLeftLayout.addWidget(self.FooterFontGroupBox)
2189+ spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
2190+ self.FooterLeftLayout.addItem(spacerItem3)
2191+ self.FontFooterLayout.addWidget(self.FooterLeftWidget)
2192+ self.FooterRightWidget = QtGui.QWidget(self.FontFooterTab)
2193+ self.FooterRightWidget.setObjectName("FooterRightWidget")
2194+ self.FooterRightLayout = QtGui.QVBoxLayout(self.FooterRightWidget)
2195+ self.FooterRightLayout.setSpacing(8)
2196+ self.FooterRightLayout.setMargin(0)
2197+ self.FooterRightLayout.setObjectName("FooterRightLayout")
2198+ self.LocationFooterGroupBox = QtGui.QGroupBox(self.FooterRightWidget)
2199+ self.LocationFooterGroupBox.setObjectName("LocationFooterGroupBox")
2200+ self.LocationFooterLayout = QtGui.QFormLayout(self.LocationFooterGroupBox)
2201+ self.LocationFooterLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow)
2202+ self.LocationFooterLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
2203+ self.LocationFooterLayout.setMargin(8)
2204+ self.LocationFooterLayout.setSpacing(8)
2205+ self.LocationFooterLayout.setObjectName("LocationFooterLayout")
2206+ self.FontFooterDefaultLabel = QtGui.QLabel(self.LocationFooterGroupBox)
2207+ self.FontFooterDefaultLabel.setObjectName("FontFooterDefaultLabel")
2208+ self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterDefaultLabel)
2209+ self.FontFooterDefaultCheckBox = QtGui.QCheckBox(self.LocationFooterGroupBox)
2210+ self.FontFooterDefaultCheckBox.setTristate(False)
2211+ self.FontFooterDefaultCheckBox.setObjectName("FontFooterDefaultCheckBox")
2212+ self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterDefaultCheckBox)
2213+ self.FontFooterXLabel = QtGui.QLabel(self.LocationFooterGroupBox)
2214 self.FontFooterXLabel.setObjectName("FontFooterXLabel")
2215- self.horizontalLayout_7.addWidget(self.FontFooterXLabel)
2216- self.FontFooterXEdit = QtGui.QLineEdit(self.FooterFontGroupBox_2)
2217- self.FontFooterXEdit.setObjectName("FontFooterXEdit")
2218- self.horizontalLayout_7.addWidget(self.FontFooterXEdit)
2219- self.verticalLayout_2.addLayout(self.horizontalLayout_7)
2220- self.horizontalLayout_8 = QtGui.QHBoxLayout()
2221- self.horizontalLayout_8.setObjectName("horizontalLayout_8")
2222- self.FontFooterYLabel = QtGui.QLabel(self.FooterFontGroupBox_2)
2223+ self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterXLabel)
2224+ self.FontFooterYLabel = QtGui.QLabel(self.LocationFooterGroupBox)
2225 self.FontFooterYLabel.setObjectName("FontFooterYLabel")
2226- self.horizontalLayout_8.addWidget(self.FontFooterYLabel)
2227- self.FontFooterYEdit = QtGui.QLineEdit(self.FooterFontGroupBox_2)
2228- self.FontFooterYEdit.setObjectName("FontFooterYEdit")
2229- self.horizontalLayout_8.addWidget(self.FontFooterYEdit)
2230- self.verticalLayout_2.addLayout(self.horizontalLayout_8)
2231- self.horizontalLayout_9 = QtGui.QHBoxLayout()
2232- self.horizontalLayout_9.setObjectName("horizontalLayout_9")
2233- self.FontFooterWidthLabel = QtGui.QLabel(self.FooterFontGroupBox_2)
2234+ self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterYLabel)
2235+ self.FontFooterWidthLabel = QtGui.QLabel(self.LocationFooterGroupBox)
2236 self.FontFooterWidthLabel.setObjectName("FontFooterWidthLabel")
2237- self.horizontalLayout_9.addWidget(self.FontFooterWidthLabel)
2238- self.FontFooterWidthEdit = QtGui.QLineEdit(self.FooterFontGroupBox_2)
2239- self.FontFooterWidthEdit.setObjectName("FontFooterWidthEdit")
2240- self.horizontalLayout_9.addWidget(self.FontFooterWidthEdit)
2241- self.verticalLayout_2.addLayout(self.horizontalLayout_9)
2242- self.horizontalLayout_10 = QtGui.QHBoxLayout()
2243- self.horizontalLayout_10.setObjectName("horizontalLayout_10")
2244- self.FontFooterHeightLabel = QtGui.QLabel(self.FooterFontGroupBox_2)
2245+ self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWidthLabel)
2246+ self.FontFooterHeightLabel = QtGui.QLabel(self.LocationFooterGroupBox)
2247 self.FontFooterHeightLabel.setObjectName("FontFooterHeightLabel")
2248- self.horizontalLayout_10.addWidget(self.FontFooterHeightLabel)
2249- self.FontFooterHeightEdit = QtGui.QLineEdit(self.FooterFontGroupBox_2)
2250- self.FontFooterHeightEdit.setObjectName("FontFooterHeightEdit")
2251- self.horizontalLayout_10.addWidget(self.FontFooterHeightEdit)
2252- self.verticalLayout_2.addLayout(self.horizontalLayout_10)
2253- self.FooterFontGroupBox_3 = QtGui.QGroupBox(self.FontFooterTab)
2254- self.FooterFontGroupBox_3.setGeometry(QtCore.QRect(20, 10, 307, 119))
2255- self.FooterFontGroupBox_3.setObjectName("FooterFontGroupBox_3")
2256- self.gridLayout_3 = QtGui.QGridLayout(self.FooterFontGroupBox_3)
2257- self.gridLayout_3.setObjectName("gridLayout_3")
2258- self.FontFooterlabel = QtGui.QLabel(self.FooterFontGroupBox_3)
2259- self.FontFooterlabel.setObjectName("FontFooterlabel")
2260- self.gridLayout_3.addWidget(self.FontFooterlabel, 0, 0, 1, 1)
2261- self.FontFooterComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox_3)
2262- self.FontFooterComboBox.setObjectName("FontFooterComboBox")
2263- self.gridLayout_3.addWidget(self.FontFooterComboBox, 0, 1, 1, 2)
2264- self.FontFooterColorLabel = QtGui.QLabel(self.FooterFontGroupBox_3)
2265- self.FontFooterColorLabel.setObjectName("FontFooterColorLabel")
2266- self.gridLayout_3.addWidget(self.FontFooterColorLabel, 1, 0, 1, 1)
2267- self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox_3)
2268- self.FontFooterColorPushButton.setObjectName("FontFooterColorPushButton")
2269- self.gridLayout_3.addWidget(self.FontFooterColorPushButton, 1, 2, 1, 1)
2270- self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox_3)
2271- self.FontFooterSizeLabel.setObjectName("FontFooterSizeLabel")
2272- self.gridLayout_3.addWidget(self.FontFooterSizeLabel, 2, 0, 1, 1)
2273- self.FontFooterSizeLineEdit = QtGui.QLineEdit(self.FooterFontGroupBox_3)
2274- self.FontFooterSizeLineEdit.setObjectName("FontFooterSizeLineEdit")
2275- self.gridLayout_3.addWidget(self.FontFooterSizeLineEdit, 2, 1, 1, 1)
2276- self.FontFooterSlider = QtGui.QSlider(self.FooterFontGroupBox_3)
2277- self.FontFooterSlider.setProperty("value", QtCore.QVariant(15))
2278- self.FontFooterSlider.setMaximum(40)
2279- self.FontFooterSlider.setOrientation(QtCore.Qt.Horizontal)
2280- self.FontFooterSlider.setTickPosition(QtGui.QSlider.TicksBelow)
2281- self.FontFooterSlider.setTickInterval(5)
2282- self.FontFooterSlider.setObjectName("FontFooterSlider")
2283- self.gridLayout_3.addWidget(self.FontFooterSlider, 2, 2, 1, 1)
2284- self.tabWidget.addTab(self.FontFooterTab, "")
2285- self.OptionsTab = QtGui.QWidget()
2286- self.OptionsTab.setObjectName("OptionsTab")
2287- self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsTab)
2288- self.ShadowGroupBox.setGeometry(QtCore.QRect(20, 10, 301, 80))
2289+ self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontFooterHeightLabel)
2290+ self.FontFooterXSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
2291+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
2292+ sizePolicy.setHorizontalStretch(0)
2293+ sizePolicy.setVerticalStretch(0)
2294+ sizePolicy.setHeightForWidth(self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth())
2295+ self.FontFooterXSpinBox.setSizePolicy(sizePolicy)
2296+ self.FontFooterXSpinBox.setMinimumSize(QtCore.QSize(78, 0))
2297+ self.FontFooterXSpinBox.setProperty("value", QtCore.QVariant(0))
2298+ self.FontFooterXSpinBox.setMaximum(9999)
2299+ self.FontFooterXSpinBox.setObjectName("FontFooterXSpinBox")
2300+ self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterXSpinBox)
2301+ self.FontFooterYSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
2302+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
2303+ sizePolicy.setHorizontalStretch(0)
2304+ sizePolicy.setVerticalStretch(0)
2305+ sizePolicy.setHeightForWidth(self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth())
2306+ self.FontFooterYSpinBox.setSizePolicy(sizePolicy)
2307+ self.FontFooterYSpinBox.setMinimumSize(QtCore.QSize(78, 0))
2308+ self.FontFooterYSpinBox.setProperty("value", QtCore.QVariant(0))
2309+ self.FontFooterYSpinBox.setMaximum(9999)
2310+ self.FontFooterYSpinBox.setObjectName("FontFooterYSpinBox")
2311+ self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterYSpinBox)
2312+ self.FontFooterWidthSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
2313+ self.FontFooterWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0))
2314+ self.FontFooterWidthSpinBox.setMaximum(9999)
2315+ self.FontFooterWidthSpinBox.setObjectName("FontFooterWidthSpinBox")
2316+ self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthSpinBox)
2317+ self.FontFooterHeightSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
2318+ self.FontFooterHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0))
2319+ self.FontFooterHeightSpinBox.setMaximum(9999)
2320+ self.FontFooterHeightSpinBox.setObjectName("FontFooterHeightSpinBox")
2321+ self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontFooterHeightSpinBox)
2322+ self.FooterRightLayout.addWidget(self.LocationFooterGroupBox)
2323+ spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
2324+ self.FooterRightLayout.addItem(spacerItem4)
2325+ self.FontFooterLayout.addWidget(self.FooterRightWidget)
2326+ self.ThemeTabWidget.addTab(self.FontFooterTab, "")
2327+ self.OtherOptionsTab = QtGui.QWidget()
2328+ self.OtherOptionsTab.setObjectName("OtherOptionsTab")
2329+ self.OtherOptionsLayout = QtGui.QHBoxLayout(self.OtherOptionsTab)
2330+ self.OtherOptionsLayout.setSpacing(8)
2331+ self.OtherOptionsLayout.setMargin(8)
2332+ self.OtherOptionsLayout.setObjectName("OtherOptionsLayout")
2333+ self.OptionsLeftWidget = QtGui.QWidget(self.OtherOptionsTab)
2334+ self.OptionsLeftWidget.setObjectName("OptionsLeftWidget")
2335+ self.OptionsLeftLayout = QtGui.QVBoxLayout(self.OptionsLeftWidget)
2336+ self.OptionsLeftLayout.setSpacing(8)
2337+ self.OptionsLeftLayout.setMargin(0)
2338+ self.OptionsLeftLayout.setObjectName("OptionsLeftLayout")
2339+ self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsLeftWidget)
2340 self.ShadowGroupBox.setObjectName("ShadowGroupBox")
2341- self.layoutWidget2 = QtGui.QWidget(self.ShadowGroupBox)
2342- self.layoutWidget2.setGeometry(QtCore.QRect(10, 20, 281, 58))
2343- self.layoutWidget2.setObjectName("layoutWidget2")
2344- self.formLayout = QtGui.QFormLayout(self.layoutWidget2)
2345- self.formLayout.setObjectName("formLayout")
2346- self.ShadowCheckBox = QtGui.QCheckBox(self.layoutWidget2)
2347+ self.verticalLayout = QtGui.QVBoxLayout(self.ShadowGroupBox)
2348+ self.verticalLayout.setSpacing(8)
2349+ self.verticalLayout.setMargin(8)
2350+ self.verticalLayout.setObjectName("verticalLayout")
2351+ self.OutlineWidget = QtGui.QWidget(self.ShadowGroupBox)
2352+ self.OutlineWidget.setObjectName("OutlineWidget")
2353+ self.OutlineLayout = QtGui.QFormLayout(self.OutlineWidget)
2354+ self.OutlineLayout.setMargin(0)
2355+ self.OutlineLayout.setSpacing(8)
2356+ self.OutlineLayout.setObjectName("OutlineLayout")
2357+ self.OutlineCheckBox = QtGui.QCheckBox(self.OutlineWidget)
2358+ self.OutlineCheckBox.setObjectName("OutlineCheckBox")
2359+ self.OutlineLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.OutlineCheckBox)
2360+ self.OutlineColorLabel = QtGui.QLabel(self.OutlineWidget)
2361+ self.OutlineColorLabel.setObjectName("OutlineColorLabel")
2362+ self.OutlineLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel)
2363+ self.OutlineColorPushButton = QtGui.QPushButton(self.OutlineWidget)
2364+ self.OutlineColorPushButton.setObjectName("OutlineColorPushButton")
2365+ self.OutlineLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton)
2366+ self.OutlineEnabledLabel = QtGui.QLabel(self.OutlineWidget)
2367+ self.OutlineEnabledLabel.setObjectName("OutlineEnabledLabel")
2368+ self.OutlineLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.OutlineEnabledLabel)
2369+ self.verticalLayout.addWidget(self.OutlineWidget)
2370+ self.ShadowWidget = QtGui.QWidget(self.ShadowGroupBox)
2371+ self.ShadowWidget.setObjectName("ShadowWidget")
2372+ self.ShadowLayout = QtGui.QFormLayout(self.ShadowWidget)
2373+ self.ShadowLayout.setMargin(0)
2374+ self.ShadowLayout.setSpacing(8)
2375+ self.ShadowLayout.setObjectName("ShadowLayout")
2376+ self.ShadowCheckBox = QtGui.QCheckBox(self.ShadowWidget)
2377 self.ShadowCheckBox.setObjectName("ShadowCheckBox")
2378- self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowCheckBox)
2379- self.ShadowColorLabel = QtGui.QLabel(self.layoutWidget2)
2380+ self.ShadowLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.ShadowCheckBox)
2381+ self.ShadowColorLabel = QtGui.QLabel(self.ShadowWidget)
2382 self.ShadowColorLabel.setObjectName("ShadowColorLabel")
2383- self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel)
2384- self.ShadowColorPushButton = QtGui.QPushButton(self.layoutWidget2)
2385+ self.ShadowLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel)
2386+ self.ShadowColorPushButton = QtGui.QPushButton(self.ShadowWidget)
2387 self.ShadowColorPushButton.setObjectName("ShadowColorPushButton")
2388- self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton)
2389- self.AlignmentGroupBox = QtGui.QGroupBox(self.OptionsTab)
2390- self.AlignmentGroupBox.setGeometry(QtCore.QRect(10, 200, 321, 161))
2391+ self.ShadowLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton)
2392+ self.ShadowEnabledLabel = QtGui.QLabel(self.ShadowWidget)
2393+ self.ShadowEnabledLabel.setObjectName("ShadowEnabledLabel")
2394+ self.ShadowLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowEnabledLabel)
2395+ self.verticalLayout.addWidget(self.ShadowWidget)
2396+ self.OptionsLeftLayout.addWidget(self.ShadowGroupBox)
2397+ spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
2398+ self.OptionsLeftLayout.addItem(spacerItem5)
2399+ self.OtherOptionsLayout.addWidget(self.OptionsLeftWidget)
2400+ self.OptionsRightWidget = QtGui.QWidget(self.OtherOptionsTab)
2401+ self.OptionsRightWidget.setObjectName("OptionsRightWidget")
2402+ self.OptionsRightLayout = QtGui.QVBoxLayout(self.OptionsRightWidget)
2403+ self.OptionsRightLayout.setSpacing(8)
2404+ self.OptionsRightLayout.setMargin(0)
2405+ self.OptionsRightLayout.setObjectName("OptionsRightLayout")
2406+ self.AlignmentGroupBox = QtGui.QGroupBox(self.OptionsRightWidget)
2407 self.AlignmentGroupBox.setObjectName("AlignmentGroupBox")
2408 self.gridLayout_4 = QtGui.QGridLayout(self.AlignmentGroupBox)
2409 self.gridLayout_4.setObjectName("gridLayout_4")
2410@@ -299,43 +443,82 @@
2411 self.VerticalComboBox.addItem(QtCore.QString())
2412 self.VerticalComboBox.addItem(QtCore.QString())
2413 self.gridLayout_4.addWidget(self.VerticalComboBox, 1, 1, 1, 1)
2414- self.OutlineGroupBox = QtGui.QGroupBox(self.OptionsTab)
2415- self.OutlineGroupBox.setGeometry(QtCore.QRect(20, 110, 301, 80))
2416- self.OutlineGroupBox.setObjectName("OutlineGroupBox")
2417- self.layoutWidget_3 = QtGui.QWidget(self.OutlineGroupBox)
2418- self.layoutWidget_3.setGeometry(QtCore.QRect(10, 20, 281, 58))
2419- self.layoutWidget_3.setObjectName("layoutWidget_3")
2420- self.OutlineformLayout = QtGui.QFormLayout(self.layoutWidget_3)
2421- self.OutlineformLayout.setObjectName("OutlineformLayout")
2422- self.OutlineCheckBox = QtGui.QCheckBox(self.layoutWidget_3)
2423- self.OutlineCheckBox.setObjectName("OutlineCheckBox")
2424- self.OutlineformLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.OutlineCheckBox)
2425- self.OutlineColorLabel = QtGui.QLabel(self.layoutWidget_3)
2426- self.OutlineColorLabel.setObjectName("OutlineColorLabel")
2427- self.OutlineformLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel)
2428- self.OutlineColorPushButton = QtGui.QPushButton(self.layoutWidget_3)
2429- self.OutlineColorPushButton.setObjectName("OutlineColorPushButton")
2430- self.OutlineformLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton)
2431- self.tabWidget.addTab(self.OptionsTab, "")
2432- self.horizontalLayout_2.addWidget(self.LeftSide)
2433- self.RightSide = QtGui.QWidget(self.widget)
2434- self.RightSide.setObjectName("RightSide")
2435- self.ThemePreview = QtGui.QLabel(self.RightSide)
2436- self.ThemePreview.setGeometry(QtCore.QRect(20, 60, 311, 271))
2437- self.ThemePreview.setFrameShape(QtGui.QFrame.Box)
2438- self.ThemePreview.setFrameShadow(QtGui.QFrame.Raised)
2439- self.ThemePreview.setLineWidth(2)
2440+ self.OptionsRightLayout.addWidget(self.AlignmentGroupBox)
2441+ spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
2442+ self.OptionsRightLayout.addItem(spacerItem6)
2443+ self.OtherOptionsLayout.addWidget(self.OptionsRightWidget)
2444+ self.ThemeTabWidget.addTab(self.OtherOptionsTab, "")
2445+ self.ContentLayout.addWidget(self.ThemeTabWidget)
2446+ self.AmendThemeLayout.addWidget(self.ContentWidget)
2447+ self.PreviewGroupBox = QtGui.QGroupBox(AmendThemeDialog)
2448+ self.PreviewGroupBox.setObjectName("PreviewGroupBox")
2449+ self.ThemePreviewLayout = QtGui.QHBoxLayout(self.PreviewGroupBox)
2450+ self.ThemePreviewLayout.setSpacing(8)
2451+ self.ThemePreviewLayout.setMargin(8)
2452+ self.ThemePreviewLayout.setObjectName("ThemePreviewLayout")
2453+ spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
2454+ self.ThemePreviewLayout.addItem(spacerItem7)
2455+ self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox)
2456+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
2457+ sizePolicy.setHorizontalStretch(0)
2458+ sizePolicy.setVerticalStretch(0)
2459+ sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth())
2460+ self.ThemePreview.setSizePolicy(sizePolicy)
2461+ self.ThemePreview.setMinimumSize(QtCore.QSize(300, 225))
2462+ self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel)
2463+ self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken)
2464+ self.ThemePreview.setLineWidth(1)
2465 self.ThemePreview.setScaledContents(True)
2466 self.ThemePreview.setObjectName("ThemePreview")
2467- self.horizontalLayout_2.addWidget(self.RightSide)
2468+ self.ThemePreviewLayout.addWidget(self.ThemePreview)
2469+ spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
2470+ self.ThemePreviewLayout.addItem(spacerItem8)
2471+ self.AmendThemeLayout.addWidget(self.PreviewGroupBox)
2472+ self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog)
2473+ self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
2474+ self.ThemeButtonBox.setObjectName("ThemeButtonBox")
2475+ self.AmendThemeLayout.addWidget(self.ThemeButtonBox)
2476
2477 self.retranslateUi(AmendThemeDialog)
2478- self.tabWidget.setCurrentIndex(0)
2479+ self.ThemeTabWidget.setCurrentIndex(0)
2480+ QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("accepted()"), AmendThemeDialog.accept)
2481+ QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("rejected()"), AmendThemeDialog.reject)
2482 QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog)
2483+ AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit)
2484+ AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget)
2485+ AmendThemeDialog.setTabOrder(self.ThemeTabWidget, self.BackgroundComboBox)
2486+ AmendThemeDialog.setTabOrder(self.BackgroundComboBox, self.BackgroundTypeComboBox)
2487+ AmendThemeDialog.setTabOrder(self.BackgroundTypeComboBox, self.Color1PushButton)
2488+ AmendThemeDialog.setTabOrder(self.Color1PushButton, self.Color2PushButton)
2489+ AmendThemeDialog.setTabOrder(self.Color2PushButton, self.ImageLineEdit)
2490+ AmendThemeDialog.setTabOrder(self.ImageLineEdit, self.ImageToolButton)
2491+ AmendThemeDialog.setTabOrder(self.ImageToolButton, self.GradientComboBox)
2492+ AmendThemeDialog.setTabOrder(self.GradientComboBox, self.FontMainComboBox)
2493+ AmendThemeDialog.setTabOrder(self.FontMainComboBox, self.FontMainColorPushButton)
2494+ AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, self.FontMainSizeSpinBox)
2495+ AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainDefaultCheckBox)
2496+ AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, self.FontMainXSpinBox)
2497+ AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, self.FontMainYSpinBox)
2498+ AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, self.FontMainWidthSpinBox)
2499+ AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox, self.FontMainHeightSpinBox)
2500+ AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox, self.FontFooterComboBox)
2501+ AmendThemeDialog.setTabOrder(self.FontFooterComboBox, self.FontFooterColorPushButton)
2502+ AmendThemeDialog.setTabOrder(self.FontFooterColorPushButton, self.FontFooterSizeSpinBox)
2503+ AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterDefaultCheckBox)
2504+ AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox)
2505+ AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, self.FontFooterYSpinBox)
2506+ AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthSpinBox)
2507+ AmendThemeDialog.setTabOrder(self.FontFooterWidthSpinBox, self.FontFooterHeightSpinBox)
2508+ AmendThemeDialog.setTabOrder(self.FontFooterHeightSpinBox, self.OutlineCheckBox)
2509+ AmendThemeDialog.setTabOrder(self.OutlineCheckBox, self.OutlineColorPushButton)
2510+ AmendThemeDialog.setTabOrder(self.OutlineColorPushButton, self.ShadowCheckBox)
2511+ AmendThemeDialog.setTabOrder(self.ShadowCheckBox, self.ShadowColorPushButton)
2512+ AmendThemeDialog.setTabOrder(self.ShadowColorPushButton, self.HorizontalComboBox)
2513+ AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox)
2514
2515 def retranslateUi(self, AmendThemeDialog):
2516 AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintance", None, QtGui.QApplication.UnicodeUTF8))
2517- self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name", None, QtGui.QApplication.UnicodeUTF8))
2518+ self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name:", None, QtGui.QApplication.UnicodeUTF8))
2519 self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8))
2520 self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8))
2521 self.BackgroundComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Transparent", None, QtGui.QApplication.UnicodeUTF8))
2522@@ -350,32 +533,44 @@
2523 self.GradientComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Horizontal", None, QtGui.QApplication.UnicodeUTF8))
2524 self.GradientComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Vertical", None, QtGui.QApplication.UnicodeUTF8))
2525 self.GradientComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Circular", None, QtGui.QApplication.UnicodeUTF8))
2526- self.tabWidget.setTabText(self.tabWidget.indexOf(self.BackgroundTab), QtGui.QApplication.translate("AmendThemeDialog", "Background", None, QtGui.QApplication.UnicodeUTF8))
2527- self.MainFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8))
2528- self.MainFontlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8))
2529- self.MainFontColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color", None, QtGui.QApplication.UnicodeUTF8))
2530- self.MainFontSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8))
2531- self.FooterFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8))
2532- self.FontMainUseDefault.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use default location", None, QtGui.QApplication.UnicodeUTF8))
2533+ self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.BackgroundTab), QtGui.QApplication.translate("AmendThemeDialog", "Background", None, QtGui.QApplication.UnicodeUTF8))
2534+ self.FontMainGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8))
2535+ self.FontMainlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8))
2536+ self.FontMainColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8))
2537+ self.FontMainSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8))
2538+ self.FontMainSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8))
2539+ self.MainLocationGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8))
2540+ self.DefaultLocationLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Default Location:", None, QtGui.QApplication.UnicodeUTF8))
2541 self.FontMainXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8))
2542 self.FontMainYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8))
2543- self.FontMainWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width", None, QtGui.QApplication.UnicodeUTF8))
2544- self.FontMainHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height", None, QtGui.QApplication.UnicodeUTF8))
2545- self.tabWidget.setTabText(self.tabWidget.indexOf(self.FontMainTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Main", None, QtGui.QApplication.UnicodeUTF8))
2546- self.FooterFontGroupBox_2.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8))
2547- self.FontMainUseDefault_2.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use default location", None, QtGui.QApplication.UnicodeUTF8))
2548+ self.FontMainWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width:", None, QtGui.QApplication.UnicodeUTF8))
2549+ self.FontMainHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8))
2550+ self.FontMainXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
2551+ self.FontMainYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
2552+ self.FontMainWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
2553+ self.FontMainHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
2554+ self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontMainTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Main", None, QtGui.QApplication.UnicodeUTF8))
2555+ self.FooterFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Footer Font", None, QtGui.QApplication.UnicodeUTF8))
2556+ self.FontFooterLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8))
2557+ self.FontFooterColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8))
2558+ self.FontFooterSizeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8))
2559+ self.FontFooterSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8))
2560+ self.LocationFooterGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8))
2561+ self.FontFooterDefaultLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Default Location:", None, QtGui.QApplication.UnicodeUTF8))
2562 self.FontFooterXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8))
2563 self.FontFooterYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8))
2564- self.FontFooterWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width", None, QtGui.QApplication.UnicodeUTF8))
2565- self.FontFooterHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height", None, QtGui.QApplication.UnicodeUTF8))
2566- self.FooterFontGroupBox_3.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Footer Font", None, QtGui.QApplication.UnicodeUTF8))
2567- self.FontFooterlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8))
2568- self.FontFooterColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color", None, QtGui.QApplication.UnicodeUTF8))
2569- self.FontFooterSizeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8))
2570- self.tabWidget.setTabText(self.tabWidget.indexOf(self.FontFooterTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Footer", None, QtGui.QApplication.UnicodeUTF8))
2571- self.ShadowGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Shadow", None, QtGui.QApplication.UnicodeUTF8))
2572- self.ShadowCheckBox.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Shadow", None, QtGui.QApplication.UnicodeUTF8))
2573+ self.FontFooterWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width:", None, QtGui.QApplication.UnicodeUTF8))
2574+ self.FontFooterHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8))
2575+ self.FontFooterXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
2576+ self.FontFooterYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
2577+ self.FontFooterWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
2578+ self.FontFooterHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
2579+ self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontFooterTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Footer", None, QtGui.QApplication.UnicodeUTF8))
2580+ self.ShadowGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Shadow && Outline", None, QtGui.QApplication.UnicodeUTF8))
2581+ self.OutlineColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Outline Color:", None, QtGui.QApplication.UnicodeUTF8))
2582+ self.OutlineEnabledLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Show Outline:", None, QtGui.QApplication.UnicodeUTF8))
2583 self.ShadowColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Shadow Color:", None, QtGui.QApplication.UnicodeUTF8))
2584+ self.ShadowEnabledLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Show Shadow:", None, QtGui.QApplication.UnicodeUTF8))
2585 self.AlignmentGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Alignment", None, QtGui.QApplication.UnicodeUTF8))
2586 self.HorizontalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Horizontal Align:", None, QtGui.QApplication.UnicodeUTF8))
2587 self.HorizontalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Left", None, QtGui.QApplication.UnicodeUTF8))
2588@@ -385,8 +580,6 @@
2589 self.VerticalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Top", None, QtGui.QApplication.UnicodeUTF8))
2590 self.VerticalComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Middle", None, QtGui.QApplication.UnicodeUTF8))
2591 self.VerticalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Bottom", None, QtGui.QApplication.UnicodeUTF8))
2592- self.OutlineGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Outline", None, QtGui.QApplication.UnicodeUTF8))
2593- self.OutlineCheckBox.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Outline", None, QtGui.QApplication.UnicodeUTF8))
2594- self.OutlineColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Outline Color:", None, QtGui.QApplication.UnicodeUTF8))
2595- self.tabWidget.setTabText(self.tabWidget.indexOf(self.OptionsTab), QtGui.QApplication.translate("AmendThemeDialog", "Alignment", None, QtGui.QApplication.UnicodeUTF8))
2596+ self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.OtherOptionsTab), QtGui.QApplication.translate("AmendThemeDialog", "Other Options", None, QtGui.QApplication.UnicodeUTF8))
2597+ self.PreviewGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Preview", None, QtGui.QApplication.UnicodeUTF8))
2598
2599
2600=== modified file 'openlp/core/ui/amendthemeform.py'
2601--- openlp/core/ui/amendthemeform.py 2009-04-11 15:16:02 +0000
2602+++ openlp/core/ui/amendthemeform.py 2009-04-23 18:12:36 +0000
2603@@ -23,8 +23,8 @@
2604 from PyQt4 import QtCore, QtGui
2605 from PyQt4.QtGui import QColor, QFont
2606 from openlp.core.lib import ThemeXML
2607+from openlp.core.lib import Renderer
2608 from openlp.core import fileToXML
2609-from openlp.core import Renderer
2610 from openlp.core import translate
2611
2612 from amendthemedialog import Ui_AmendThemeDialog
2613@@ -33,23 +33,27 @@
2614
2615 class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
2616
2617- def __init__(self, parent=None):
2618+ def __init__(self, thememanager, parent=None):
2619 QtGui.QDialog.__init__(self, parent)
2620+ self.thememanager = thememanager
2621+ self.theme = ThemeXML() # Needed here as UI setup generates Events
2622 self.setupUi(self)
2623
2624 #define signals
2625- #Exits
2626- QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("accepted()"), self.accept)
2627- QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("rejected()"), self.close)
2628 #Buttons
2629 QtCore.QObject.connect(self.Color1PushButton ,
2630 QtCore.SIGNAL("pressed()"), self.onColor1PushButtonClicked)
2631 QtCore.QObject.connect(self.Color2PushButton ,
2632 QtCore.SIGNAL("pressed()"), self.onColor2PushButtonClicked)
2633- QtCore.QObject.connect(self.MainFontColorPushButton,
2634- QtCore.SIGNAL("pressed()"), self.onMainFontColorPushButtonClicked)
2635+ QtCore.QObject.connect(self.FontMainColorPushButton,
2636+ QtCore.SIGNAL("pressed()"), self.onFontMainColorPushButtonClicked)
2637 QtCore.QObject.connect(self.FontFooterColorPushButton,
2638 QtCore.SIGNAL("pressed()"), self.onFontFooterColorPushButtonClicked)
2639+ QtCore.QObject.connect(self.OutlineColorPushButton,
2640+ QtCore.SIGNAL("pressed()"), self.onOutlineColorPushButtonClicked)
2641+ QtCore.QObject.connect(self.ShadowColorPushButton,
2642+ QtCore.SIGNAL("pressed()"), self.onShadowColorPushButtonClicked)
2643+
2644 #Combo boxes
2645 QtCore.QObject.connect(self.BackgroundComboBox,
2646 QtCore.SIGNAL("activated(int)"), self.onBackgroundComboBoxSelected)
2647@@ -57,16 +61,69 @@
2648 QtCore.SIGNAL("activated(int)"), self.onBackgroundTypeComboBoxSelected)
2649 QtCore.QObject.connect(self.GradientComboBox,
2650 QtCore.SIGNAL("activated(int)"), self.onGradientComboBoxSelected)
2651+ QtCore.QObject.connect(self.FontMainComboBox,
2652+ QtCore.SIGNAL("activated(int)"), self.onFontMainComboBoxSelected)
2653+ QtCore.QObject.connect(self.FontFooterComboBox,
2654+ QtCore.SIGNAL("activated(int)"), self.onFontFooterComboBoxSelected)
2655+ QtCore.QObject.connect(self.HorizontalComboBox,
2656+ QtCore.SIGNAL("activated(int)"), self.onHorizontalComboBoxSelected)
2657+ QtCore.QObject.connect(self.VerticalComboBox,
2658+ QtCore.SIGNAL("activated(int)"), self.onVerticalComboBoxSelected)
2659+
2660+ QtCore.QObject.connect(self.FontMainSizeSpinBox,
2661+ QtCore.SIGNAL("valueChanged(int)"), self.onFontMainSizeSpinBoxChanged)
2662+ QtCore.QObject.connect(self.FontFooterSizeSpinBox,
2663+ QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterSizeSpinBoxChanged)
2664+ QtCore.QObject.connect(self.FontMainDefaultCheckBox,
2665+ QtCore.SIGNAL("stateChanged(int)"), self.onFontMainDefaultCheckBoxChanged)
2666+ QtCore.QObject.connect(self.FontMainXSpinBox,
2667+ QtCore.SIGNAL("valueChanged(int)"), self.onFontMainXSpinBoxChanged)
2668+ QtCore.QObject.connect(self.FontMainYSpinBox,
2669+ QtCore.SIGNAL("valueChanged(int)"), self.onFontMainYSpinBoxChanged)
2670+ QtCore.QObject.connect(self.FontMainWidthSpinBox,
2671+ QtCore.SIGNAL("valueChanged(int)"), self.onFontMainWidthSpinBoxChanged)
2672+ QtCore.QObject.connect(self.FontMainHeightSpinBox,
2673+ QtCore.SIGNAL("valueChanged(int)"), self.onFontMainHeightSpinBoxChanged)
2674+ QtCore.QObject.connect(self.FontFooterDefaultCheckBox,
2675+ QtCore.SIGNAL("stateChanged(int)"), self.onFontFooterDefaultCheckBoxChanged)
2676+ QtCore.QObject.connect(self.FontFooterXSpinBox,
2677+ QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterXSpinBoxChanged)
2678+ QtCore.QObject.connect(self.FontFooterYSpinBox,
2679+ QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterYSpinBoxChanged)
2680+ QtCore.QObject.connect(self.FontFooterWidthSpinBox,
2681+ QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterWidthSpinBoxChanged)
2682+ QtCore.QObject.connect(self.FontFooterHeightSpinBox,
2683+ QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterHeightSpinBoxChanged)
2684+ QtCore.QObject.connect(self.OutlineCheckBox,
2685+ QtCore.SIGNAL("stateChanged(int)"), self.onOutlineCheckBoxChanged)
2686+ QtCore.QObject.connect(self.ShadowCheckBox,
2687+ QtCore.SIGNAL("stateChanged(int)"), self.onShadowCheckBoxChanged)
2688
2689
2690 def accept(self):
2691+ new_theme = ThemeXML()
2692+ theme_name = str(self.ThemeNameEdit.displayText())
2693+ new_theme.new_document(theme_name)
2694+ if self.theme.background_type == u'solid':
2695+ new_theme.add_background_solid(str(self.theme.background_color))
2696+ elif self.theme.theme.background_type == u'gradient':
2697+ new_theme.add_background_gradient(str(self.theme.background_startColor), str(self.theme.background_endColor), self.theme.background_direction)
2698+ #else:
2699+ #newtheme.add_background_image(str(self.theme.))
2700+
2701+ new_theme.add_font(str(self.theme.font_main_name), str(self.theme.font_main_color), str(self.theme.font_main_proportion), u'False')
2702+ new_theme.add_font(str(self.theme.font_footer_name), str(self.theme.font_footer_color), str(self.theme.font_footer_proportion), u'False', u'footer')
2703+ new_theme.add_display(str(self.theme.display_shadow), str(self.theme.display_shadow_color), str(self.theme.display_outline), str(self.theme.display_outline_color),
2704+ str(self.theme.display_horizontalAlign), str(self.theme.display_verticalAlign), str(self.theme.display_wrapStyle))
2705+
2706+ theme = new_theme.extract_xml()
2707+ self.thememanager.saveTheme(theme_name, theme)
2708 return QtGui.QDialog.accept(self)
2709
2710 def themePath(self, path):
2711 self.path = path
2712
2713 def loadTheme(self, theme):
2714- self.theme = ThemeXML()
2715 if theme == None:
2716 self.theme.parse(self.baseTheme())
2717 else:
2718@@ -74,78 +131,235 @@
2719 xml = fileToXML(xml_file)
2720 self.theme.parse(xml)
2721 self.paintUi(self.theme)
2722- self.generateImage(self.theme)
2723-
2724- def onGradientComboBoxSelected(self):
2725- if self.GradientComboBox.currentIndex() == 0: # Horizontal
2726- self.theme.background_direction = u'horizontal'
2727- elif self.GradientComboBox.currentIndex() == 1: # vertical
2728- self.theme.background_direction = u'vertical'
2729- else:
2730- self.theme.background_direction = u'circular'
2731- self.stateChanging(self.theme)
2732- self.generateImage(self.theme)
2733-
2734- def onBackgroundComboBoxSelected(self):
2735- if self.BackgroundComboBox.currentIndex() == 0: # Opaque
2736+ self.previewTheme(self.theme)
2737+
2738+ #
2739+ #Main Font Tab
2740+ #
2741+ def onFontMainComboBoxSelected(self):
2742+ self.theme.font_main_name = self.FontMainComboBox.currentFont().family()
2743+ self.previewTheme(self.theme)
2744+
2745+ def onFontMainColorPushButtonClicked(self):
2746+ self.theme.font_main_color = QtGui.QColorDialog.getColor(
2747+ QColor(self.theme.font_main_color), self).name()
2748+
2749+ self.FontMainColorPushButton.setStyleSheet(
2750+ 'background-color: %s' % str(self.theme.font_main_color))
2751+ self.previewTheme(self.theme)
2752+
2753+ def onFontMainSizeSpinBoxChanged(self, value):
2754+ self.theme.font_main_proportion = value
2755+ self.previewTheme(self.theme)
2756+
2757+ def onFontMainDefaultCheckBoxChanged(self, value):
2758+ if value == 2: # checked
2759+ self.theme.font_main_override = False
2760+ else:
2761+ self.theme.font_main_override = True
2762+
2763+ if int(self.theme.font_main_x) == 0 and int(self.theme.font_main_y) == 0 and \
2764+ int(self.theme.font_main_width) == 0 and int(self.theme.font_main_height) == 0:
2765+ self.theme.font_main_x = u'10'
2766+ self.theme.font_main_y = u'10'
2767+ self.theme.font_main_width = u'1024'
2768+ self.theme.font_main_height = u'730'
2769+ self.FontMainXSpinBox.setValue(int(self.theme.font_main_x))
2770+ self.FontMainYSpinBox.setValue(int(self.theme.font_main_y))
2771+ self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width))
2772+ self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height))
2773+ self.stateChanging(self.theme)
2774+ self.previewTheme(self.theme)
2775+
2776+ def onFontMainXSpinBoxChanged(self, value):
2777+ self.theme.font_main_x = value
2778+ self.previewTheme(self.theme)
2779+
2780+ def onFontMainYSpinBoxChanged(self, value):
2781+ self.theme.font_main_y = value
2782+ self.previewTheme(self.theme)
2783+
2784+ def onFontMainWidthSpinBoxChanged(self, value):
2785+ self.theme.font_main_width = value
2786+ self.previewTheme(self.theme)
2787+
2788+ def onFontMainHeightSpinBoxChanged(self, value):
2789+ self.theme.font_main_height = value
2790+ self.previewTheme(self.theme)
2791+
2792+
2793+ #
2794+ #Footer Font Tab
2795+ #
2796+ def onFontFooterComboBoxSelected(self):
2797+ self.theme.font_footer_name = self.FontFooterComboBox.currentFont().family()
2798+ self.previewTheme(self.theme)
2799+
2800+ def onFontFooterColorPushButtonClicked(self):
2801+ self.theme.font_footer_color = QtGui.QColorDialog.getColor(
2802+ QColor(self.theme.font_footer_color), self).name()
2803+
2804+ self.FontFooterColorPushButton.setStyleSheet(
2805+ 'background-color: %s' % str(self.theme.font_footer_color))
2806+ self.previewTheme(self.theme)
2807+
2808+ def onFontFooterSizeSpinBoxChanged(self, value):
2809+ self.theme.font_footer_proportion = value
2810+ self.previewTheme(self.theme)
2811+
2812+ def onFontFooterDefaultCheckBoxChanged(self):
2813+ self.stateChanging(self.theme)
2814+ self.previewTheme(self.theme)
2815+
2816+ def onFontFooterDefaultCheckBoxChanged(self, value):
2817+ if value == 2: # checked
2818+ self.theme.font_footer_override = False
2819+ else:
2820+ self.theme.font_footer_override = True
2821+ if int(self.theme.font_footer_x) == 0 and int(self.theme.font_footer_y) == 0 and \
2822+ int(self.theme.font_footer_width) == 0 and int(self.theme.font_footer_height) == 0:
2823+ self.theme.font_footer_x = u'10'
2824+ self.theme.font_footer_y = u'730'
2825+ self.theme.font_footer_width = u'1024'
2826+ self.theme.font_footer_height = u'38'
2827+
2828+ self.FontFooterXSpinBox.setValue(int(self.theme.font_footer_x))
2829+ self.FontFooterYSpinBox.setValue(int(self.theme.font_footer_y))
2830+ self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width))
2831+ self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))
2832+
2833+
2834+ self.stateChanging(self.theme)
2835+ self.previewTheme(self.theme)
2836+
2837+ def onFontFooterXSpinBoxChanged(self, value):
2838+ self.theme.font_footer_x = value
2839+ self.previewTheme(self.theme)
2840+
2841+ def onFontFooterYSpinBoxChanged(self, value):
2842+ self.theme.font_footer_y = value
2843+ self.previewTheme(self.theme)
2844+
2845+ def onFontFooterWidthSpinBoxChanged(self, value):
2846+ self.theme.font_footer_width = value
2847+ self.previewTheme(self.theme)
2848+
2849+ def onFontFooterHeightSpinBoxChanged(self, value):
2850+ self.theme.font_footer_height = value
2851+ self.previewTheme(self.theme)
2852+
2853+ #
2854+ #Background Tab
2855+ #
2856+ def onGradientComboBoxSelected(self, currentIndex):
2857+ self.setBackground(self.BackgroundTypeComboBox.currentIndex(), currentIndex)
2858+
2859+ def onBackgroundComboBoxSelected(self, currentIndex):
2860+ if currentIndex == 0: # Opaque
2861 self.theme.background_mode = u'opaque'
2862 else:
2863 self.theme.background_mode = u'transparent'
2864 self.stateChanging(self.theme)
2865- self.generateImage(self.theme)
2866-
2867- def onBackgroundTypeComboBoxSelected(self):
2868- if self.BackgroundTypeComboBox.currentIndex() == 0: # Solid
2869+ self.previewTheme(self.theme)
2870+
2871+ def onBackgroundTypeComboBoxSelected(self, currentIndex):
2872+ self.setBackground(currentIndex, self.GradientComboBox.currentIndex())
2873+
2874+ def setBackground(self, background, gradient):
2875+ if background == 0: # Solid
2876 self.theme.background_type = u'solid'
2877- elif self.BackgroundTypeComboBox.currentIndex() == 1: # Gradient
2878+ if self.theme.background_color is None :
2879+ self.theme.background_color = u'#000000'
2880+ elif background == 1: # Gradient
2881 self.theme.background_type = u'gradient'
2882- if self.theme.background_direction == None: # never defined
2883+ if gradient == 0: # Horizontal
2884 self.theme.background_direction = u'horizontal'
2885- self.theme.background_color2 = u'#000000'
2886+ elif gradient == 1: # vertical
2887+ self.theme.background_direction = u'vertical'
2888+ else:
2889+ self.theme.background_direction = u'circular'
2890+ if self.theme.background_startColor is None :
2891+ self.theme.background_startColor = u'#000000'
2892+ if self.theme.background_endColor is None :
2893+ self.theme.background_endColor = u'#ff0000'
2894 else:
2895 self.theme.background_type = u'image'
2896 self.stateChanging(self.theme)
2897- self.generateImage(self.theme)
2898+ self.previewTheme(self.theme)
2899
2900 def onColor1PushButtonClicked(self):
2901- self.theme.background_color1 = QtGui.QColorDialog.getColor(
2902- QColor(self.theme.background_color1), self).name()
2903- self.Color1PushButton.setStyleSheet(
2904- 'background-color: %s' % str(self.theme.background_color1))
2905+ if self.theme.background_type == u'solid':
2906+ self.theme.background_color = QtGui.QColorDialog.getColor(
2907+ QColor(self.theme.background_color), self).name()
2908+ self.Color1PushButton.setStyleSheet(
2909+ 'background-color: %s' % str(self.theme.background_color))
2910+ else:
2911+ self.theme.background_startColor = QtGui.QColorDialog.getColor(
2912+ QColor(self.theme.background_startColor), self).name()
2913+ self.Color1PushButton.setStyleSheet(
2914+ 'background-color: %s' % str(self.theme.background_startColor))
2915
2916- self.generateImage(self.theme)
2917+ self.previewTheme(self.theme)
2918
2919 def onColor2PushButtonClicked(self):
2920- self.theme.background_color2 = QtGui.QColorDialog.getColor(
2921- QColor(self.theme.background_color2), self).name()
2922+ self.theme.background_endColor = QtGui.QColorDialog.getColor(
2923+ QColor(self.theme.background_endColor), self).name()
2924 self.Color2PushButton.setStyleSheet(
2925- 'background-color: %s' % str(self.theme.background_color2))
2926-
2927- self.generateImage(self.theme)
2928-
2929- def onMainFontColorPushButtonClicked(self):
2930- self.theme.font_main_color = QtGui.QColorDialog.getColor(
2931- QColor(self.theme.font_main_color), self).name()
2932-
2933- self.MainFontColorPushButton.setStyleSheet(
2934- 'background-color: %s' % str(self.theme.font_main_color))
2935- self.generateImage(self.theme)
2936-
2937- def onFontFooterColorPushButtonClicked(self):
2938- self.theme.font_footer_color = QtGui.QColorDialog.getColor(
2939- QColor(self.theme.font_footer_color), self).name()
2940-
2941- self.FontFooterColorPushButton.setStyleSheet(
2942- 'background-color: %s' % str(self.theme.font_footer_color))
2943- self.generateImage(self.theme)
2944-
2945+ 'background-color: %s' % str(self.theme.background_endColor))
2946+
2947+ self.previewTheme(self.theme)
2948+ #
2949+ #Other Tab
2950+ #
2951+ def onOutlineCheckBoxChanged(self, value):
2952+ if value == 2: # checked
2953+ self.theme.display_outline = True
2954+ else:
2955+ self.theme.display_outline = False
2956+ self.stateChanging(self.theme)
2957+ self.previewTheme(self.theme)
2958+
2959+ def onOutlineColorPushButtonClicked(self):
2960+ self.theme.display_outline_color = QtGui.QColorDialog.getColor(
2961+ QColor(self.theme.display_outline_color), self).name()
2962+ self.OutlineColorPushButton.setStyleSheet(
2963+ 'background-color: %s' % str(self.theme.display_outline_color))
2964+ self.previewTheme(self.theme)
2965+
2966+ def onShadowCheckBoxChanged(self, value):
2967+ if value == 2: # checked
2968+ self.theme.display_shadow = True
2969+ else:
2970+ self.theme.display_shadow = False
2971+ self.stateChanging(self.theme)
2972+ self.previewTheme(self.theme)
2973+
2974+ def onShadowColorPushButtonClicked(self):
2975+ self.theme.display_shadow_color = QtGui.QColorDialog.getColor(
2976+ QColor(self.theme.display_shadow_color), self).name()
2977+ self.ShadowColorPushButton.setStyleSheet(
2978+ 'background-color: %s' % str(self.theme.display_shadow_color))
2979+ self.previewTheme(self.theme)
2980+
2981+ def onHorizontalComboBoxSelected(self, currentIndex):
2982+ self.theme.display_horizontalAlign = currentIndex
2983+ self.stateChanging(self.theme)
2984+ self.previewTheme(self.theme)
2985+
2986+ def onVerticalComboBoxSelected(self, currentIndex):
2987+ self.theme.display_verticalAlign = currentIndex
2988+ self.stateChanging(self.theme)
2989+ self.previewTheme(self.theme)
2990+ #
2991+ #Local Methods
2992+ #
2993 def baseTheme(self):
2994 log.debug(u'base Theme')
2995 newtheme = ThemeXML()
2996 newtheme.new_document(u'New Theme')
2997 newtheme.add_background_solid(str(u'#000000'))
2998- newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), u'False')
2999- newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer')
3000+ newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), False)
3001+ newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), False, u'footer')
3002 newtheme.add_display(str(False), str(u'#FFFFFF'), str(False), str(u'#FFFFFF'),
3003 str(0), str(0), str(0))
3004
3005@@ -154,76 +368,147 @@
3006 def paintUi(self, theme):
3007 print theme # leave as helpful for initial development
3008 self.stateChanging(theme)
3009- self.BackgroundTypeComboBox.setCurrentIndex(0)
3010- self.BackgroundComboBox.setCurrentIndex(0)
3011- self.GradientComboBox.setCurrentIndex(0)
3012- self.MainFontColorPushButton.setStyleSheet(
3013+ self.ThemeNameEdit.setText(self.theme.theme_name)
3014+ if self.theme.background_mode == u'opaque':
3015+ self.BackgroundComboBox.setCurrentIndex(0)
3016+ else:
3017+ self.BackgroundComboBox.setCurrentIndex(1)
3018+
3019+ if theme.background_type == u'solid':
3020+ self.BackgroundTypeComboBox.setCurrentIndex(0)
3021+ elif theme.background_type == u'gradient':
3022+ self.BackgroundTypeComboBox.setCurrentIndex(1)
3023+ else:
3024+ self.BackgroundTypeComboBox.setCurrentIndex(2)
3025+
3026+ if self.theme.background_direction == u'horizontal':
3027+ self.GradientComboBox.setCurrentIndex(0)
3028+ elif self.theme.background_direction == u'vertical':
3029+ self.GradientComboBox.setCurrentIndex(1)
3030+ else:
3031+ self.GradientComboBox.setCurrentIndex(2)
3032+
3033+ self.FontMainSizeSpinBox.setValue(int(self.theme.font_main_proportion))
3034+ self.FontMainXSpinBox.setValue(int(self.theme.font_main_x))
3035+ self.FontMainYSpinBox.setValue(int(self.theme.font_main_y))
3036+ self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width))
3037+ self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height))
3038+ self.FontFooterSizeSpinBox.setValue(int(self.theme.font_footer_proportion))
3039+ self.FontFooterXSpinBox.setValue(int(self.theme.font_footer_x))
3040+ self.FontFooterYSpinBox.setValue(int(self.theme.font_footer_y))
3041+ self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width))
3042+ self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))
3043+ self.FontMainColorPushButton.setStyleSheet(
3044 'background-color: %s' % str(theme.font_main_color))
3045 self.FontFooterColorPushButton.setStyleSheet(
3046 'background-color: %s' % str(theme.font_footer_color))
3047
3048+ if self.theme.font_main_override == False:
3049+ self.FontMainDefaultCheckBox.setChecked(True)
3050+ else:
3051+ self.FontMainDefaultCheckBox.setChecked(False)
3052+
3053+ if self.theme.font_footer_override == False:
3054+ self.FontFooterDefaultCheckBox.setChecked(True)
3055+ else:
3056+ self.FontFooterDefaultCheckBox.setChecked(False)
3057+
3058+ self.OutlineColorPushButton.setStyleSheet(
3059+ 'background-color: %s' % str(theme.display_outline_color))
3060+ self.ShadowColorPushButton.setStyleSheet(
3061+ 'background-color: %s' % str(theme.display_shadow_color))
3062+
3063+ if self.theme.display_outline:
3064+ self.OutlineCheckBox.setChecked(True)
3065+ self.OutlineColorPushButton.setEnabled(True)
3066+ else:
3067+ self.OutlineCheckBox.setChecked(False)
3068+ self.OutlineColorPushButton.setEnabled(False)
3069+
3070+ if self.theme.display_shadow:
3071+ self.ShadowCheckBox.setChecked(True)
3072+ self.ShadowColorPushButton.setEnabled(True)
3073+ else:
3074+ self.ShadowCheckBox.setChecked(False)
3075+ self.ShadowColorPushButton.setEnabled(False)
3076+
3077+ self.HorizontalComboBox.setCurrentIndex(int(self.theme.display_horizontalAlign))
3078+ self.VerticalComboBox.setCurrentIndex(int(self.theme.display_verticalAlign))
3079+
3080 def stateChanging(self, theme):
3081 if theme.background_type == u'solid':
3082 self.Color1PushButton.setStyleSheet(
3083- 'background-color: %s' % str(theme.background_color1))
3084- self.Color1Label.setText(translate(u'ThemeManager', u'Background Font:'))
3085+ 'background-color: %s' % str(theme.background_color))
3086+ self.Color1Label.setText(translate(u'ThemeManager', u'Background Color:'))
3087 self.Color1Label.setVisible(True)
3088 self.Color1PushButton.setVisible(True)
3089 self.Color2Label.setVisible(False)
3090 self.Color2PushButton.setVisible(False)
3091+ self.ImageLabel.setVisible(False)
3092+ self.ImageLineEdit.setVisible(False)
3093+ self.ImageFilenameWidget.setVisible(False)
3094+ self.GradientLabel.setVisible(False)
3095+ self.GradientComboBox.setVisible(False)
3096 elif theme.background_type == u'gradient':
3097 self.Color1PushButton.setStyleSheet(
3098- 'background-color: %s' % str(theme.background_color1))
3099+ 'background-color: %s' % str(theme.background_startColor))
3100 self.Color2PushButton.setStyleSheet(
3101- 'background-color: %s' % str(theme.background_color2))
3102+ 'background-color: %s' % str(theme.background_endColor))
3103 self.Color1Label.setText(translate(u'ThemeManager', u'First Color:'))
3104 self.Color2Label.setText(translate(u'ThemeManager', u'Second Color:'))
3105 self.Color1Label.setVisible(True)
3106 self.Color1PushButton.setVisible(True)
3107 self.Color2Label.setVisible(True)
3108 self.Color2PushButton.setVisible(True)
3109+ self.ImageLabel.setVisible(False)
3110+ self.ImageLineEdit.setVisible(False)
3111+ self.ImageFilenameWidget.setVisible(False)
3112+ self.GradientLabel.setVisible(True)
3113+ self.GradientComboBox.setVisible(True)
3114 else: # must be image
3115 self.Color1Label.setVisible(False)
3116 self.Color1PushButton.setVisible(False)
3117 self.Color2Label.setVisible(False)
3118 self.Color2PushButton.setVisible(False)
3119-
3120- def generateImage(self, theme):
3121- log.debug(u'generateImage %s ', theme)
3122- #theme = ThemeXML()
3123- #theme.parse(theme_xml)
3124- #print theme
3125- size=QtCore.QSize(800,600)
3126- frame=TstFrame(size)
3127- frame=frame
3128- paintdest=frame.GetPixmap()
3129- r=Renderer()
3130- r.set_paint_dest(paintdest)
3131-
3132- r.set_theme(theme) # set default theme
3133- r._render_background()
3134- r.set_text_rectangle(QtCore.QRect(0,0, size.width()-1, size.height()-1), QtCore.QRect(10,560, size.width()-1, size.height()-1))
3135-
3136- lines=[]
3137- lines.append(u'Amazing Grace!')
3138- lines.append(u'How sweet the sound')
3139- lines.append(u'To save a wretch like me;')
3140- lines.append(u'I once was lost but now am found,')
3141- lines.append(u'Was blind, but now I see.')
3142- lines1=[]
3143- lines1.append(u'Amazing Grace (John Newton)' )
3144- lines1.append(u'CCLI xxx (c)Openlp.org')
3145-
3146- answer=r._render_lines(lines, lines1)
3147-
3148- self.ThemePreview.setPixmap(frame.GetPixmap())
3149-
3150-class TstFrame:
3151- def __init__(self, size):
3152- """Create the DemoPanel."""
3153- self.width=size.width();
3154- self.height=size.height();
3155- # create something to be painted into
3156- self._Buffer = QtGui.QPixmap(self.width, self.height)
3157- def GetPixmap(self):
3158- return self._Buffer
3159+ self.ImageLabel.setVisible(True)
3160+ self.ImageLineEdit.setVisible(True)
3161+ self.ImageFilenameWidget.setVisible(True)
3162+ self.GradientLabel.setVisible(False)
3163+ self.GradientComboBox.setVisible(False)
3164+
3165+ if theme.font_main_override == False:
3166+ self.FontMainXSpinBox.setEnabled(False)
3167+ self.FontMainYSpinBox.setEnabled(False)
3168+ self.FontMainWidthSpinBox.setEnabled(False)
3169+ self.FontMainHeightSpinBox.setEnabled(False)
3170+ else:
3171+ self.FontMainXSpinBox.setEnabled(True)
3172+ self.FontMainYSpinBox.setEnabled(True)
3173+ self.FontMainWidthSpinBox.setEnabled(True)
3174+ self.FontMainHeightSpinBox.setEnabled(True)
3175+
3176+ if theme.font_footer_override == False:
3177+ self.FontFooterXSpinBox.setEnabled(False)
3178+ self.FontFooterYSpinBox.setEnabled(False)
3179+ self.FontFooterWidthSpinBox.setEnabled(False)
3180+ self.FontFooterHeightSpinBox.setEnabled(False)
3181+ else:
3182+ self.FontFooterXSpinBox.setEnabled(True)
3183+ self.FontFooterYSpinBox.setEnabled(True)
3184+ self.FontFooterWidthSpinBox.setEnabled(True)
3185+ self.FontFooterHeightSpinBox.setEnabled(True)
3186+
3187+ if self.theme.display_outline:
3188+ self.OutlineColorPushButton.setEnabled(True)
3189+ else:
3190+ self.OutlineColorPushButton.setEnabled(False)
3191+
3192+ if self.theme.display_shadow:
3193+ self.ShadowColorPushButton.setEnabled(True)
3194+ else:
3195+ self.ShadowColorPushButton.setEnabled(False)
3196+
3197+
3198+ def previewTheme(self, theme):
3199+ frame = self.thememanager.generateImage(theme)
3200+ self.ThemePreview.setPixmap(frame)
3201
3202=== modified file 'openlp/core/ui/mainwindow.py'
3203--- openlp/core/ui/mainwindow.py 2009-04-09 18:50:20 +0000
3204+++ openlp/core/ui/mainwindow.py 2009-04-25 06:11:15 +0000
3205@@ -28,7 +28,7 @@
3206
3207 from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \
3208 SlideController, ServiceManager, ThemeManager
3209-from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager
3210+from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager, RenderManager
3211
3212 from openlp.core import PluginManager
3213
3214@@ -52,11 +52,17 @@
3215
3216 self.setupUi()
3217
3218+ #warning cyclic dependency
3219+ #RenderManager needs to call ThemeManager and
3220+ #ThemeManager needs to call RenderManager
3221+ self.RenderManager = RenderManager(self.ThemeManagerContents, self.screen_list)
3222+
3223 log.info(u'Load Plugins')
3224 self.plugin_helpers[u'preview'] = self.PreviewController
3225 self.plugin_helpers[u'live'] = self.LiveController
3226 self.plugin_helpers[u'event'] = self.EventManager
3227 self.plugin_helpers[u'theme'] = self.ThemeManagerContents # Theme manger
3228+ self.plugin_helpers[u'render'] = self.RenderManager
3229
3230 self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers, self.EventManager)
3231 # hook methods have to happen after find_plugins. Find plugins needs the controllers
3232@@ -84,6 +90,9 @@
3233 # Once all components are initialised load the Themes
3234 log.info(u'Load Themes')
3235 self.ThemeManagerContents.setEventManager(self.EventManager)
3236+ self.ThemeManagerContents.setRenderManager(self.RenderManager)
3237+ self.ServiceManagerContents.setRenderManager(self.RenderManager)
3238+ self.ThemeManagerContents.setServiceManager(self.ServiceManagerContents)
3239 self.ThemeManagerContents.loadThemes()
3240
3241 def setupUi(self):
3242
3243=== modified file 'openlp/core/ui/servicemanager.py'
3244--- openlp/core/ui/servicemanager.py 2009-03-23 19:17:07 +0000
3245+++ openlp/core/ui/servicemanager.py 2009-04-25 06:11:15 +0000
3246@@ -29,6 +29,7 @@
3247 # from openlp.core.ui import AboutForm, AlertForm, SettingsForm, SlideController
3248 from openlp.core.lib import OpenLPToolbar
3249 from openlp.core.lib import ServiceItem
3250+from openlp.core.lib import RenderManager
3251
3252 # from openlp.core import PluginManager
3253 import logging
3254@@ -61,7 +62,7 @@
3255 self.endRemoveRows()
3256 def addRow(self, item):
3257 self.insertRow(len(self.items), item)
3258-
3259+
3260 def index(self, row, col, parent = QModelIndex()):
3261 return self.createIndex(row,col)
3262
3263@@ -90,7 +91,7 @@
3264 return QVariant(retval)
3265 else:
3266 return retval
3267-
3268+
3269 def __iter__(self):
3270 for i in self.items:
3271 yield i
3272@@ -99,7 +100,7 @@
3273 log.info("Get Item:%d -> %s" %(row, str(self.items)))
3274 return self.items[row]
3275
3276-
3277+
3278 class ServiceManager(QWidget):
3279
3280 """Manages the orders of service. Currently this involves taking
3281@@ -109,7 +110,7 @@
3282 Also handles the UI tasks of moving things up and down etc.
3283 """
3284 global log
3285- log=logging.getLogger(u'ServiceManager')
3286+ log=logging.getLogger(u'ServiceManager')
3287
3288 def __init__(self, parent):
3289 QWidget.__init__(self)
3290@@ -128,9 +129,6 @@
3291 self.Toolbar.addSeparator()
3292 self.ThemeComboBox = QtGui.QComboBox(self.Toolbar)
3293 self.ThemeComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
3294- self.ThemeComboBox.addItem(QtCore.QString())
3295- self.ThemeComboBox.addItem(QtCore.QString())
3296- self.ThemeComboBox.addItem(QtCore.QString())
3297 self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
3298 self.ThemeWidget.setDefaultWidget(self.ThemeComboBox)
3299 self.Toolbar.addAction(self.ThemeWidget)
3300@@ -141,7 +139,15 @@
3301 self.service_data=ServiceData()
3302 self.TreeView.setModel(self.service_data)
3303 self.Layout.addWidget(self.TreeView)
3304-
3305+ QtCore.QObject.connect(self.ThemeComboBox,
3306+ QtCore.SIGNAL("activated(int)"), self.onThemeComboBoxSelected)
3307+
3308+ def setRenderManager(self, renderManager):
3309+ self.renderManager = renderManager
3310+
3311+ def onThemeComboBoxSelected(self, currentIndex):
3312+ self.renderManager.set_default_theme(self.ThemeComboBox.currentText())
3313+
3314 def addServiceItem(self, item):
3315 """Adds service item"""
3316 log.info("addServiceItem")
3317@@ -165,7 +171,7 @@
3318 self.service_data.addRow(item)
3319 else:
3320 self.service_data.insertRow(row+1, item)
3321-
3322+
3323 def removeServiceItem(self):
3324 """Remove currently selected item"""
3325 pass
3326@@ -189,3 +195,10 @@
3327 oosfile.write(self.oos_as_text)
3328 oosfile.write("# END OOS\n")
3329 oosfile.close()
3330+
3331+ def updateThemeList(self, theme_list):
3332+ self.ThemeComboBox.clear()
3333+ for theme in theme_list:
3334+ self.ThemeComboBox.addItem(theme)
3335+ self.renderManager.set_default_theme(self.ThemeComboBox.currentText())
3336+
3337
3338=== modified file 'openlp/core/ui/slidecontroller.py'
3339--- openlp/core/ui/slidecontroller.py 2009-02-20 21:13:04 +0000
3340+++ openlp/core/ui/slidecontroller.py 2009-04-25 06:11:15 +0000
3341@@ -3,7 +3,7 @@
3342 """
3343 OpenLP - Open Source Lyrics Projection
3344 Copyright (c) 2008 Raoul Snyman
3345-Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
3346+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
3347
3348 This program is free software; you can redistribute it and/or modify it under
3349 the terms of the GNU General Public License as published by the Free Software
3350@@ -27,7 +27,7 @@
3351 self.Pane = QtGui.QWidget(control_splitter)
3352 self.Splitter = QtGui.QSplitter(self.Pane)
3353 self.Splitter.setOrientation(QtCore.Qt.Vertical)
3354-
3355+
3356 self.PaneLayout = QtGui.QVBoxLayout(self.Pane)
3357 self.PaneLayout.addWidget(self.Splitter)
3358 self.PaneLayout.setSpacing(50)
3359@@ -41,6 +41,23 @@
3360 self.Controller.setGeometry(QtCore.QRect(0, 0, 828, 536))
3361 self.Controller.setWidget(self.ControllerContents)
3362
3363- self.Screen = QtGui.QGraphicsView(self.Splitter)
3364- self.Screen.setMaximumSize(QtCore.QSize(16777215, 250))
3365-
3366+ #self.Screen = QtGui.QGraphicsView(self.Splitter)
3367+ #self.Screen.setMaximumSize(QtCore.QSize(16777215, 250))
3368+
3369+
3370+ self.ThemePreview = QtGui.QLabel(self.Splitter)
3371+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
3372+ sizePolicy.setHorizontalStretch(0)
3373+ sizePolicy.setVerticalStretch(0)
3374+ sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth())
3375+ self.ThemePreview.setSizePolicy(sizePolicy)
3376+ self.ThemePreview.setMinimumSize(QtCore.QSize(250, 190))
3377+ self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel)
3378+ self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken)
3379+ self.ThemePreview.setLineWidth(1)
3380+ self.ThemePreview.setScaledContents(True)
3381+ self.ThemePreview.setObjectName("ThemePreview")
3382+
3383+
3384+ def previewFrame(self, frame):
3385+ self.ThemePreview.setPixmap(frame)
3386
3387=== modified file 'openlp/core/ui/splashscreen.py'
3388--- openlp/core/ui/splashscreen.py 2008-11-28 14:05:41 +0000
3389+++ openlp/core/ui/splashscreen.py 2009-04-25 06:11:15 +0000
3390@@ -20,12 +20,15 @@
3391
3392 from PyQt4 import QtCore, QtGui
3393
3394-from openlp.core.resources import *
3395+#from openlp.core.resources import *
3396+from openlp.core import translate
3397
3398 class SplashScreen(object):
3399- def __init__(self):
3400+ def __init__(self, version):
3401 self.splash_screen = QtGui.QSplashScreen()
3402 self.setupUi()
3403+ starting = translate('SplashScreen',u'Starting')
3404+ self.message=starting+u'..... '+version
3405
3406 def setupUi(self):
3407 self.splash_screen.setObjectName("splash_screen")
3408@@ -60,7 +63,7 @@
3409
3410 def show(self):
3411 self.splash_screen.show()
3412- self.splash_screen.showMessage(u'Starting...', QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtCore.Qt.black)
3413+ self.splash_screen.showMessage(self.message, QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtCore.Qt.black)
3414 self.splash_screen.repaint()
3415
3416 def finish(self, widget):
3417
3418=== modified file 'openlp/core/ui/thememanager.py'
3419--- openlp/core/ui/thememanager.py 2009-04-11 15:16:02 +0000
3420+++ openlp/core/ui/thememanager.py 2009-04-25 06:38:21 +0000
3421@@ -20,6 +20,7 @@
3422 import os,os.path
3423 import sys
3424 import zipfile
3425+import shutil
3426
3427 from time import sleep
3428 from copy import deepcopy
3429@@ -30,17 +31,18 @@
3430 from PyQt4.QtGui import *
3431
3432 from openlp.core.ui import AmendThemeForm
3433+from openlp.core.ui import ServiceManager
3434 from openlp.core import translate
3435-from openlp.core import Renderer
3436+from openlp.core import fileToXML
3437 from openlp.core.theme import Theme
3438 from openlp.core.lib import Event
3439 from openlp.core.lib import EventType
3440 from openlp.core.lib import EventManager
3441 from openlp.core.lib import OpenLPToolbar
3442 from openlp.core.lib import ThemeXML
3443+from openlp.core.lib import Renderer
3444 from openlp.core.utils import ConfigHelper
3445
3446-
3447 import logging
3448
3449 class ThemeData(QAbstractItemModel):
3450@@ -153,7 +155,7 @@
3451 self.Layout = QtGui.QVBoxLayout(self)
3452 self.Layout.setSpacing(0)
3453 self.Layout.setMargin(0)
3454- self.amendThemeForm = AmendThemeForm()
3455+ self.amendThemeForm = AmendThemeForm(self)
3456 self.Toolbar = OpenLPToolbar(self)
3457 self.Toolbar.addToolbarButton(translate('ThemeManager',u'New Theme'), ":/themes/theme_new.png",
3458 translate('ThemeManager',u'Allows a Theme to be created'), self.onAddTheme)
3459@@ -186,6 +188,12 @@
3460 def setEventManager(self, eventManager):
3461 self.eventManager = eventManager
3462
3463+ def setRenderManager(self, renderManager):
3464+ self.renderManager = renderManager
3465+
3466+ def setServiceManager(self, serviceManager):
3467+ self.serviceManager = serviceManager
3468+
3469 def onAddTheme(self):
3470 self.amendThemeForm.loadTheme(None)
3471 self.amendThemeForm.exec_()
3472@@ -198,7 +206,19 @@
3473 self.amendThemeForm.exec_()
3474
3475 def onDeleteTheme(self):
3476- pass
3477+ items = self.ThemeListView.selectedIndexes()
3478+ theme = ''
3479+ for item in items:
3480+ data = self.Theme_data.getValue(item)
3481+ theme = data[3]
3482+ th = theme + u'.png'
3483+ try:
3484+ os.remove(os.path.join(self.path, th))
3485+ except:
3486+ pass #if not present do not worry
3487+ shutil.rmtree(os.path.join(self.path, theme))
3488+ self.Theme_data.clearItems()
3489+ self.loadThemes()
3490
3491 def onExportTheme(self):
3492 pass
3493@@ -224,18 +244,33 @@
3494 self.Theme_data.addRow(os.path.join(self.path, name))
3495
3496 self.eventManager.post_event(Event(EventType.ThemeListChanged))
3497+ self.serviceManager.updateThemeList(self.getThemes())
3498
3499 def getThemes(self):
3500 return self.Theme_data.getList()
3501
3502+ def getThemeData(self, themename):
3503+ xml_file = os.path.join(self.path, str(themename), str(themename)+u'.xml')
3504+ xml = fileToXML(xml_file)
3505+ theme = ThemeXML()
3506+ theme.parse(xml)
3507+ return theme
3508+
3509 def checkThemesExists(self, dir):
3510 log.debug(u'check themes')
3511 if os.path.exists(dir) == False:
3512 os.mkdir(dir)
3513
3514 def unzipTheme(self, filename, dir):
3515+ """
3516+ Unzip the theme , remove the preview file if stored
3517+ Generate a new preview fileCheck the XML theme version and upgrade if
3518+ necessary.
3519+ """
3520 log.debug(u'Unzipping theme %s', filename)
3521 zip = zipfile.ZipFile(str(filename))
3522+ filexml = None
3523+ themename = None
3524 for file in zip.namelist():
3525 if file.endswith('/'):
3526 theme_dir = os.path.join(dir, file)
3527@@ -244,20 +279,23 @@
3528 else:
3529 fullpath = os.path.join(dir, file)
3530 names = file.split(u'/')
3531- xml_data = zip.read(file)
3532- if os.path.splitext (file) [1].lower () in [u'.xml']:
3533- if self.checkVersion1(xml_data):
3534- filexml = self.migrateVersion122(filename, fullpath, xml_data)
3535+ if len(names) > 1: # not preview file
3536+ if themename is None:
3537+ themename = names[0]
3538+ xml_data = zip.read(file)
3539+ if os.path.splitext (file) [1].lower () in [u'.xml']:
3540+ if self.checkVersion1(xml_data):
3541+ filexml = self.migrateVersion122(filename, fullpath, xml_data) # upgrade theme xml
3542+ else:
3543+ filexml = xml_data
3544 outfile = open(fullpath, 'w')
3545 outfile.write(filexml)
3546 outfile.close()
3547- self.generateImage(dir,names[0], filexml)
3548- else:
3549- if os.path.splitext (file) [1].lower () in [u'.bmp']:
3550- if fullpath is not os.path.join(dir, file):
3551- outfile = open(fullpath, 'w')
3552- outfile.write(zip.read(file))
3553- outfile.close()
3554+ else:
3555+ outfile = open(fullpath, 'w')
3556+ outfile.write(zip.read(file))
3557+ outfile.close()
3558+ self.generateAndSaveImage(dir,themename, filexml)
3559
3560 def checkVersion1(self, xmlfile):
3561 log.debug(u'checkVersion1 ')
3562@@ -278,7 +316,7 @@
3563 newtheme.add_background_solid(str(t.BackgroundParameter1.name()))
3564 elif t.BackgroundType == 1:
3565 direction = "vertical"
3566- if t.BackgroundParameter1.name() == 1:
3567+ if t.BackgroundParameter3.name() == 1:
3568 direction = "horizontal"
3569 newtheme.add_background_gradient(str(t.BackgroundParameter1.name()), str(t.BackgroundParameter2.name()), direction)
3570 else:
3571@@ -296,48 +334,37 @@
3572 str(t.HorizontalAlign), str(t.VerticalAlign), str(t.WrapStyle))
3573 return newtheme.extract_xml()
3574
3575- def generateImage(self, dir, name, theme_xml):
3576- log.debug(u'generateImage %s %s ', dir, theme_xml)
3577+ def saveTheme(self, name, theme_xml) :
3578+ log.debug(u'saveTheme %s %s', name, theme_xml)
3579+ self.generateAndSaveImage(self.path, name, theme_xml)
3580+ theme_dir = os.path.join(self.path, name)
3581+ if os.path.exists(theme_dir) == False:
3582+ os.mkdir(os.path.join(self.path, name))
3583+
3584+ theme_file = os.path.join(theme_dir, name+u'.xml')
3585+ outfile = open(theme_file, 'w')
3586+ outfile.write(theme_xml)
3587+ outfile.close()
3588+ self.Theme_data.clearItems()
3589+ self.loadThemes()
3590+
3591+ def generateAndSaveImage(self, dir, name, theme_xml):
3592+ log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml)
3593 theme = ThemeXML()
3594 theme.parse(theme_xml)
3595- #print theme
3596- size=QtCore.QSize(800,600)
3597- frame=TstFrame(size)
3598- frame=frame
3599- paintdest=frame.GetPixmap()
3600- r=Renderer()
3601- r.set_paint_dest(paintdest)
3602-
3603- r.set_theme(theme) # set default theme
3604- r._render_background()
3605- r.set_text_rectangle(QtCore.QRect(0,0, size.width()-1, size.height()-1), QtCore.QRect(10,560, size.width()-1, size.height()-1))
3606-
3607- lines=[]
3608- lines.append(u'Amazing Grace!')
3609- lines.append(u'How sweet the sound')
3610- lines.append(u'To save a wretch like me;')
3611- lines.append(u'I once was lost but now am found,')
3612- lines.append(u'Was blind, but now I see.')
3613- lines1=[]
3614- lines1.append(u'Amazing Grace (John Newton)' )
3615- lines1.append(u'CCLI xxx (c)Openlp.org')
3616-
3617- answer=r._render_lines(lines, lines1)
3618-
3619- im=frame.GetPixmap().toImage()
3620- samplepathname=os.path.join(dir, name+u'.png')
3621+
3622+ frame = self.generateImage(theme)
3623+
3624+ im=frame.toImage()
3625+ samplepathname=os.path.join(self.path, name+u'.png')
3626 if os.path.exists(samplepathname):
3627 os.unlink(samplepathname)
3628 im.save(samplepathname, u'png')
3629 log.debug(u'Theme image written to %s',samplepathname)
3630
3631+ def generateImage(self, theme):
3632+ log.debug(u'generateImage %s ', theme)
3633+ self.renderManager.set_theme(theme)
3634+ frame = self.renderManager.generate_preview()
3635+ return frame
3636
3637-class TstFrame:
3638- def __init__(self, size):
3639- """Create the DemoPanel."""
3640- self.width=size.width();
3641- self.height=size.height();
3642- # create something to be painted into
3643- self._Buffer = QtGui.QPixmap(self.width, self.height)
3644- def GetPixmap(self):
3645- return self._Buffer
3646
3647=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
3648--- openlp/plugins/bibles/lib/biblestab.py 2009-04-06 18:45:45 +0000
3649+++ openlp/plugins/bibles/lib/biblestab.py 2009-04-15 04:58:51 +0000
3650@@ -21,8 +21,8 @@
3651 from PyQt4 import QtCore, QtGui
3652
3653 from openlp.core import translate
3654+from openlp import convertStringToBoolean
3655 from openlp.core.lib import SettingsTab
3656-from openlp.core.resources import *
3657
3658 class BiblesTab(SettingsTab):
3659 """
3660@@ -182,11 +182,11 @@
3661 self.bible_search = True
3662
3663 def load(self):
3664- self.paragraph_style = self.convertStringToBoolean(self.config.get_config('paragraph style', u'True'))
3665- self.show_new_chapters = self.convertStringToBoolean(self.config.get_config('display new chapter', u"False"))
3666+ self.paragraph_style = convertStringToBoolean(self.config.get_config('paragraph style', u'True'))
3667+ self.show_new_chapters = convertStringToBoolean(self.config.get_config('display new chapter', u"False"))
3668 self.display_style = int(self.config.get_config('display brackets', '0'))
3669 self.bible_theme = int(self.config.get_config('bible theme', '0'))
3670- self.bible_search = self.convertStringToBoolean(self.config.get_config('search as type', u'True'))
3671+ self.bible_search = convertStringToBoolean(self.config.get_config('search as type', u'True'))
3672 if self.paragraph_style:
3673 self.ParagraphRadioButton.setChecked(True)
3674 else:
3675
3676=== modified file 'openlp/plugins/bibles/lib/manager.py'
3677--- openlp/plugins/bibles/lib/manager.py 2009-02-24 20:24:01 +0000
3678+++ openlp/plugins/bibles/lib/manager.py 2009-04-25 06:09:47 +0000
3679@@ -52,16 +52,16 @@
3680 self.proxyname = self.config.get_config("proxy name") #get proxy name for screen
3681 self.bibleSuffix = "sqlite"
3682 self.dialogobject = None
3683-
3684+
3685 self.reload_bibles()
3686-
3687+
3688 def reload_bibles(self):
3689 log.debug("Reload bibles")
3690-
3691+
3692 files = self.config.get_files(self.bibleSuffix)
3693 log.debug("Bible Files %s", files )
3694-
3695- self.bible_db_cache = {}
3696+
3697+ self.bible_db_cache = {}
3698 self.bible_http_cache = {}
3699
3700 self.book_testaments = {} # books of the bible with testaments
3701@@ -88,17 +88,17 @@
3702 nhttp.set_bibleid(bibleid) # tell The Server where to get the verses from.
3703 else:
3704 self.bible_http_cache [bname] = None # makes the Full / partial code easier.
3705-
3706+
3707 if self.web_bibles_present:
3708 self.book_testaments = {} # books of the bible linked to bibleid {osis , name}
3709 self.book_abbreviations = {} # books of the bible linked to bibleid {osis ,Abbrev }
3710-
3711+
3712 filepath = os.path.split(os.path.abspath(__file__))[0]
3713- filepath = os.path.abspath(os.path.join(filepath, '..', 'resources','httpbooks.csv'))
3714+ filepath = os.path.abspath(os.path.join(filepath, '..', 'resources','httpbooks.csv'))
3715 fbibles=open(filepath, 'r')
3716 for line in fbibles:
3717 p = line.split(",")
3718- self.book_abbreviations[p[0]] = p[1].replace('\n', '')
3719+ self.book_abbreviations[p[0]] = p[1].replace('\n', '')
3720 self.book_testaments[p[0]] = p[2].replace('\n', '')
3721 log.debug( "Bible Initialised")
3722
3723@@ -136,7 +136,7 @@
3724 If the database exists it is deleted and the database is reloaded
3725 from scratch.
3726 """
3727- log.debug( "register_CSV_file_bible %s,%s,%s", biblename, booksfile, versefile)
3728+ log.debug( "register_CSV_file_bible %s,%s,%s", biblename, booksfile, versefile)
3729 if self._is_new_bible(biblename):
3730 nbible = BibleDBImpl(self.biblePath, biblename, self.config) # Create new Bible
3731 nbible.create_tables() # Create Database
3732@@ -150,7 +150,7 @@
3733 If the database exists it is deleted and the database is reloaded
3734 from scratch.
3735 """
3736- log.debug( "register_OSIS_file_bible %s , %s", biblename, osisfile)
3737+ log.debug( "register_OSIS_file_bible %s , %s", biblename, osisfile)
3738 if self._is_new_bible(biblename):
3739 nbible = BibleDBImpl(self.biblePath, biblename, self.config) # Create new Bible
3740 nbible.create_tables() # Create Database
3741@@ -170,7 +170,7 @@
3742 if mode == "full":
3743 r.append(b)
3744 else:
3745- if self.bible_http_cache [b] == None: # we do not have an http bible
3746+ if self.bible_http_cache [b] == None: # we do not have an http bible
3747 r.append(b)
3748 return r
3749
3750@@ -250,16 +250,16 @@
3751 log.debug("New http book %s , %s, %s", book, book.id, book.name)
3752 self.bible_db_cache[bible].create_chapter(book.id, \
3753 search_results.get_chapter(),\
3754- search_results.get_verselist())
3755+ search_results.get_verselist())
3756 else:
3757 ## Book exists check chapter and texts only.
3758 v = self.bible_db_cache[bible].get_bible_chapter(book.id, chapter)
3759 if v == None:
3760 self.bible_db_cache[bible].create_chapter(book.id, \
3761- book_chapter, \
3762+ chapter, \
3763 search_results.get_verselist())
3764 else:
3765- log.debug("get_verse_text : old book")
3766+ log.debug("get_verse_text : old book")
3767 for chapter in range(schapter, echapter+1):
3768 v = self.bible_db_cache[bible].get_bible_chapter(book.id, chapter)
3769 if v == None:
3770@@ -267,9 +267,9 @@
3771 search_results = self.bible_http_cache [bible].get_bible_chapter(bible, book.id, bookname, chapter)
3772 self.bible_db_cache[bible].create_chapter(book.id, \
3773 search_results.get_chapter(),\
3774- search_results.get_verselist())
3775+ search_results.get_verselist())
3776 except :
3777- log.error("Errow thrown %s", sys.exc_info()[1])
3778+ log.error("Errow thrown %s", sys.exc_info()[1])
3779
3780 if schapter == echapter:
3781 text = self.bible_db_cache[bible].get_bible_text(bookname, schapter, sverse, everse)
3782
3783=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
3784--- openlp/plugins/bibles/lib/mediaitem.py 2009-03-19 17:31:33 +0000
3785+++ openlp/plugins/bibles/lib/mediaitem.py 2009-04-25 06:11:15 +0000
3786@@ -48,19 +48,19 @@
3787 # Create buttons for the toolbar
3788 ## New Bible Button ##
3789 self.addToolbarButton(
3790- translate(u'BibleMediaItem','New Bible'),
3791+ translate(u'BibleMediaItem','New Bible'),
3792 translate(u'BibleMediaItem','Register a new Bible'),
3793 ':/themes/theme_import.png', self.onBibleNewClick, 'BibleNewItem')
3794 ## Separator Line ##
3795 self.addToolbarSeparator()
3796 ## Preview Bible Button ##
3797 self.addToolbarButton(
3798- translate(u'BibleMediaItem','Preview Bible'),
3799+ translate(u'BibleMediaItem','Preview Bible'),
3800 translate(u'BibleMediaItem','Preview the selected Bible Verse'),
3801 ':/system/system_preview.png', self.onBiblePreviewClick, 'BiblePreviewItem')
3802 ## Live Bible Button ##
3803 self.addToolbarButton(
3804- translate(u'BibleMediaItem','Go Live'),
3805+ translate(u'BibleMediaItem','Go Live'),
3806 translate(u'BibleMediaItem','Send the selected Bible Verse(s) live'),
3807 ':/system/system_live.png', self.onBibleLiveClick, 'BibleLiveItem')
3808 ## Add Bible Button ##
3809@@ -183,9 +183,10 @@
3810 self.BibleListView.setAlternatingRowColors(True)
3811 self.BibleListData = TextListData()
3812 self.BibleListView.setModel(self.BibleListData)
3813-
3814+ self.BibleListView.setSelectionMode(2)
3815+
3816 self.PageLayout.addWidget(self.BibleListView)
3817-
3818+
3819 # Combo Boxes
3820 QtCore.QObject.connect(self.AdvancedVersionComboBox,
3821 QtCore.SIGNAL("activated(int)"), self.onAdvancedVersionComboBox)
3822@@ -215,7 +216,7 @@
3823 translate(u'BibleMediaItem',u'&Add to Service'), self.onBibleAddClick))
3824
3825 def retranslateUi(self):
3826- log.debug(u'retranslateUi')
3827+ log.debug(u'retranslateUi')
3828 self.QuickVersionLabel.setText(translate(u'BibleMediaItem', u'Version:'))
3829 self.QuickSearchLabel.setText(translate(u'BibleMediaItem', u'Search Type:'))
3830 self.QuickSearchLabel.setText(translate(u'BibleMediaItem', u'Find:'))
3831@@ -241,15 +242,15 @@
3832 self.loadBibles()
3833
3834 def loadBibles(self):
3835- log.debug(u'Loading Bibles')
3836+ log.debug(u'Loading Bibles')
3837 self.QuickVersionComboBox.clear()
3838 self.AdvancedVersionComboBox.clear()
3839-
3840+
3841 bibles = self.parent.biblemanager.get_bibles(u'full')
3842-
3843+
3844 for bible in bibles: # load bibles into the combo boxes
3845 self.QuickVersionComboBox.addItem(bible)
3846-
3847+
3848 bibles = self.parent.biblemanager.get_bibles(u'partial') # Without HTTP
3849 first = True
3850 for bible in bibles: # load bibles into the combo boxes
3851@@ -328,6 +329,8 @@
3852 log.debug(u'Bible Preview Button pressed')
3853 items = self.BibleListView.selectedIndexes()
3854 old_chapter = ''
3855+ main_lines=[]
3856+ footer_lines = []
3857 for item in items:
3858 text = self.BibleListData.getValue(item)
3859 verse = text[:text.find("(")]
3860@@ -348,16 +351,19 @@
3861 else:
3862 loc = self.formatVerse(old_chapter, chapter, verse, u'', u'')
3863 old_chapter = chapter
3864- print book
3865- print loc
3866- print text
3867+ main_lines.append(loc + u' '+text)
3868+ if len(footer_lines) <= 1:
3869+ footer_lines.append(book)
3870+
3871+ frame=self.parent.render_manager.generate_slide(main_lines, footer_lines)
3872+ self.parent.preview_controller.previewFrame(frame)
3873
3874 def formatVerse(self, old_chapter, chapter, verse, opening, closing):
3875 loc = opening
3876 if old_chapter != chapter:
3877 loc += chapter + u':'
3878- elif not self.parent.bibles_tab.new_chapter_check:
3879- loc += chapter + u':'
3880+ elif not self.parent.bibles_tab.show_new_chapters:
3881+ loc += chapter + u':'
3882 loc += verse
3883 loc += closing
3884 return loc
3885
3886=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
3887--- openlp/plugins/custom/lib/mediaitem.py 2009-03-15 19:31:33 +0000
3888+++ openlp/plugins/custom/lib/mediaitem.py 2009-04-25 06:11:15 +0000
3889@@ -23,7 +23,7 @@
3890
3891 from openlp.core import translate
3892 from openlp.core.lib import MediaManagerItem
3893-from openlp.core.resources import *
3894+from openlp.core.lib import SongXMLParser
3895
3896 from openlp.plugins.custom.lib import TextListData
3897
3898@@ -44,7 +44,7 @@
3899 # Create buttons for the toolbar
3900 ## New Custom Button ##
3901 self.addToolbarButton(
3902- translate('CustomMediaItem',u'New Custom Item'),
3903+ translate('CustomMediaItem',u'New Custom Item'),
3904 translate('CustomMediaItem',u'Add a new Custom Item'),
3905 ':/custom/custom_new.png', self.onCustomNewClick, 'CustomNewItem')
3906 ## Edit Custom Button ##
3907@@ -72,7 +72,7 @@
3908 ## Add Custom Button ##
3909 self.addToolbarButton(
3910 translate('CustomMediaItem',u'Add Custom To Service'),
3911- translate('CustomMediaItem',u'Add the selected Custom(s) to the service'),
3912+ translate('CustomMediaItem',u'Add the selected Custom(s) to the service'),
3913 ':/system/system_add.png', self.onCustomAddClick, 'CustomAddItem')
3914 # Add the Customlist widget
3915 self.CustomWidget = QtGui.QWidget(self)
3916@@ -82,7 +82,7 @@
3917 sizePolicy.setHeightForWidth(self.CustomWidget.sizePolicy().hasHeightForWidth())
3918 self.CustomWidget.setSizePolicy(sizePolicy)
3919 self.CustomWidget.setObjectName(u'CustomWidget')
3920-
3921+
3922 # self.SearchLayout = QtGui.QGridLayout(self.CustomWidget)
3923 # self.SearchLayout.setObjectName('SearchLayout')
3924 # self.SearchTextLabel = QtGui.QLabel(self.CustomWidget)
3925@@ -92,7 +92,7 @@
3926 # self.SearchTextEdit = QtGui.QLineEdit(self.CustomWidget)
3927 # self.SearchTextEdit.setObjectName('SearchTextEdit')
3928 # self.SearchLayout.addWidget(self.SearchTextEdit, 2, 1, 1, 2)
3929-#
3930+#
3931 # self.ClearTextButton = QtGui.QPushButton(self.CustomWidget)
3932 # self.ClearTextButton.setObjectName('ClearTextButton')
3933 #
3934@@ -102,22 +102,22 @@
3935 # self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1)
3936 # Add the Custom widget to the page layout
3937 self.PageLayout.addWidget(self.CustomWidget)
3938-
3939+
3940 self.CustomListView = QtGui.QListView()
3941 self.CustomListView.setAlternatingRowColors(True)
3942 self.CustomListData = TextListData()
3943 self.CustomListView.setModel(self.CustomListData)
3944-
3945+
3946 self.PageLayout.addWidget(self.CustomListView)
3947
3948 # Signals
3949-# QtCore.QObject.connect(self.SearchTextButton,
3950+# QtCore.QObject.connect(self.SearchTextButton,
3951 # QtCore.SIGNAL("pressed()"), self.onSearchTextButtonClick)
3952-# QtCore.QObject.connect(self.ClearTextButton,
3953+# QtCore.QObject.connect(self.ClearTextButton,
3954 # QtCore.SIGNAL("pressed()"), self.onClearTextButtonClick)
3955-# QtCore.QObject.connect(self.SearchTextEdit,
3956+# QtCore.QObject.connect(self.SearchTextEdit,
3957 # QtCore.SIGNAL("textChanged(const QString&)"), self.onSearchTextEditChanged)
3958-# QtCore.QObject.connect(self.CustomListView,
3959+# QtCore.QObject.connect(self.CustomListView,
3960 # QtCore.SIGNAL("itemPressed(QTableWidgetItem * item)"), self.onCustomSelected)
3961
3962 #define and add the context menu
3963@@ -135,14 +135,14 @@
3964 self.CustomListView.addAction(self.contextMenuAction(
3965 self.CustomListView, ':/system/system_add.png',
3966 translate('CustomMediaItem',u'&Add to Service'), self.onCustomEditClick))
3967-
3968+
3969 # def retranslateUi(self):
3970 # self.ClearTextButton.setText(translate('CustomMediaItem', u'Clear'))
3971-# self.SearchTextButton.setText(translate('CustomMediaItem', u'Search'))
3972-
3973+# self.SearchTextButton.setText(translate('CustomMediaItem', u'Search'))
3974+
3975 def initialise(self):
3976 self.loadCustomList(self.parent.custommanager.get_all_slides())
3977-
3978+
3979 def loadCustomList(self, list):
3980 self.CustomListData.resetStore()
3981 for CustomSlide in list:
3982@@ -166,9 +166,9 @@
3983 self._display_results(search_results)
3984
3985 def onCustomNewClick(self):
3986- self.parent.edit_custom_form.loadCustom(0)
3987+ self.parent.edit_custom_form.loadCustom(0)
3988 self.parent.edit_custom_form.exec_()
3989- self.initialise()
3990+ self.initialise()
3991
3992 def onCustomEditClick(self):
3993 indexes = self.CustomListView.selectedIndexes()
3994@@ -185,7 +185,25 @@
3995 self.CustomListData.deleteRow(index)
3996
3997 def onCustomPreviewClick(self):
3998- pass
3999+ indexes = self.CustomListView.selectedIndexes()
4000+ main_lines=[]
4001+ footer_lines = []
4002+ slide = None
4003+ for index in indexes:
4004+ id = self.CustomListData.getId(index)
4005+ customSlide = self.parent.custommanager.get_custom(id)
4006+ title = customSlide.title
4007+ credit = customSlide.title
4008+
4009+ songXML=SongXMLParser(customSlide.text)
4010+ verseList = songXML.get_verses()
4011+ for verse in verseList:
4012+ slide = self.parent.render_manager.format_slide(verse[1], False)
4013+
4014+ footer_lines.append(title + u' '+ credit)
4015+
4016+ frame=self.parent.render_manager.generate_slide(slide, footer_lines)
4017+ self.parent.preview_controller.previewFrame(frame)
4018
4019 def onCustomLiveClick(self):
4020 pass
4021
4022=== modified file 'openlp/plugins/videos/lib/filelistdata.py'
4023--- openlp/plugins/videos/lib/filelistdata.py 2009-03-15 19:31:33 +0000
4024+++ openlp/plugins/videos/lib/filelistdata.py 2009-04-25 06:11:15 +0000
4025@@ -80,3 +80,7 @@
4026 def getFilename(self, index):
4027 row = index.row()
4028 return self.items[row][0]
4029+
4030+ def getValue(self, index):
4031+ row = index.row()
4032+ return self.items[row][0]
4033
4034=== modified file 'openlp/plugins/videos/lib/mediaitem.py'
4035--- openlp/plugins/videos/lib/mediaitem.py 2009-03-19 17:31:33 +0000
4036+++ openlp/plugins/videos/lib/mediaitem.py 2009-04-25 06:11:15 +0000
4037@@ -24,7 +24,6 @@
4038
4039 from openlp.core import translate
4040 from openlp.core.lib import MediaManagerItem
4041-from openlp.core.resources import *
4042
4043 from openlp.plugins.videos.lib import VideoTab
4044 from openlp.plugins.videos.lib import FileListData
4045@@ -40,93 +39,97 @@
4046 def __init__(self, parent, icon, title):
4047 MediaManagerItem.__init__(self, parent, icon, title)
4048
4049- def setupUi(self):
4050+ def setupUi(self):
4051 # Add a toolbar
4052 self.addToolbar()
4053 # Create buttons for the toolbar
4054 ## New Video Button ##
4055 self.addToolbarButton(
4056- translate('VideoMediaItem',u'New Video'),
4057+ translate('VideoMediaItem',u'New Video'),
4058 translate('VideoMediaItem',u'Load videos into openlp.org'),
4059 ':/videos/video_load.png', self.onVideoNewClick, 'VideoNewItem')
4060 ## Delete Video Button ##
4061 self.addToolbarButton(
4062- translate('VideoMediaItem',u'Delete Video'),
4063+ translate('VideoMediaItem',u'Delete Video'),
4064 translate('VideoMediaItem',u'Delete the selected video'),
4065 ':/videos/video_delete.png', self.onVideoDeleteClick, 'VideoDeleteItem')
4066 ## Separator Line ##
4067 self.addToolbarSeparator()
4068 ## Preview Video Button ##
4069 self.addToolbarButton(
4070- translate('VideoMediaItem',u'Preview Video'),
4071+ translate('VideoMediaItem',u'Preview Video'),
4072 translate('VideoMediaItem',u'Preview the selected video'),
4073 ':/system/system_preview.png', self.onVideoPreviewClick, 'VideoPreviewItem')
4074 ## Live Video Button ##
4075 self.addToolbarButton(
4076- translate('VideoMediaItem',u'Go Live'),
4077+ translate('VideoMediaItem',u'Go Live'),
4078 translate('VideoMediaItem',u'Send the selected video live'),
4079 ':/system/system_live.png', self.onVideoLiveClick, 'VideoLiveItem')
4080 ## Add Video Button ##
4081 self.addToolbarButton(
4082 translate('VideoMediaItem',u'Add Video To Service'),
4083- translate('VideoMediaItem',u'Add the selected video(s) to the service'),
4084+ translate('VideoMediaItem',u'Add the selected video(s) to the service'),
4085 ':/system/system_add.png',self.onVideoAddClick, 'VideoAddItem')
4086 ## Add the videolist widget ##
4087-
4088+
4089 self.VideoListView = QtGui.QListView()
4090 self.VideoListView.setAlternatingRowColors(True)
4091 self.VideoListData = FileListData()
4092 self.VideoListView.setModel(self.VideoListData)
4093-
4094+
4095 self.PageLayout.addWidget(self.VideoListView)
4096-
4097+
4098 #define and add the context menu
4099 self.VideoListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
4100
4101 self.VideoListView.addAction(self.contextMenuAction(
4102- self.VideoListView, ':/system/system_preview.png',
4103+ self.VideoListView, ':/system/system_preview.png',
4104 translate('VideoMediaItem',u'&Preview Video'), self.onVideoPreviewClick))
4105 self.VideoListView.addAction(self.contextMenuAction(
4106- self.VideoListView, ':/system/system_live.png',
4107+ self.VideoListView, ':/system/system_live.png',
4108 translate('VideoMediaItem',u'&Show Live'), self.onVideoLiveClick))
4109 self.VideoListView.addAction(self.contextMenuAction(
4110- self.VideoListView, ':/system/system_add.png',
4111+ self.VideoListView, ':/system/system_add.png',
4112 translate('VideoMediaItem',u'&Add to Service'), self.onVideoAddClick))
4113-
4114+
4115 def initialise(self):
4116 list = self.parent.config.load_list(u'videos')
4117 self.loadVideoList(list)
4118
4119 def onVideoNewClick(self):
4120- files = QtGui.QFileDialog.getOpenFileNames(None,
4121- translate('VideoMediaItem', u'Select Video(s)'),
4122+ files = QtGui.QFileDialog.getOpenFileNames(None,
4123+ translate('VideoMediaItem', u'Select Video(s)'),
4124 self.parent.config.get_last_dir(), u'Images (*.avi *.mpeg)')
4125 if len(files) > 0:
4126 self.loadVideoList(files)
4127 dir, filename = os.path.split(str(files[0]))
4128 self.parent.config.set_last_dir(dir)
4129 self.parent.config.set_list(u'videos', self.VideoListData.getFileList())
4130-
4131+
4132 def getFileList(self):
4133 filelist = [item[0] for item in self.VideoListView];
4134- return filelist
4135+ return filelist
4136
4137 def loadVideoList(self, list):
4138 for files in list:
4139 self.VideoListData.addRow(files)
4140-
4141+
4142 def onVideoDeleteClick(self):
4143 indexes = self.VideoListView.selectedIndexes()
4144 for index in indexes:
4145 current_row = int(index.row())
4146 self.VideoListData.removeRow(current_row)
4147- self.parent.config.set_list(u'videos', self.VideoListData.getFileList())
4148+ self.parent.config.set_list(u'videos', self.VideoListData.getFileList())
4149
4150 def onVideoPreviewClick(self):
4151- pass
4152+ log.debug(u'Video Preview Button pressed')
4153+ items = self.VideoListView.selectedIndexes()
4154+ for item in items:
4155+ text = self.VideoListData.getValue(item)
4156+ print text
4157
4158 def onVideoLiveClick(self):
4159 pass
4160
4161 def onVideoAddClick(self):
4162- pass
4163+ pass
4164
4165=== modified file 'openlp/plugins/videos/lib/videotab.py'
4166--- openlp/plugins/videos/lib/videotab.py 2009-03-15 19:31:33 +0000
4167+++ openlp/plugins/videos/lib/videotab.py 2009-04-15 04:58:51 +0000
4168@@ -21,8 +21,8 @@
4169 from PyQt4 import QtCore, QtGui
4170
4171 from openlp.core import translate
4172+from openlp import convertStringToBoolean
4173 from openlp.core.lib import SettingsTab
4174-from openlp.core.resources import *
4175
4176 class VideoTab(SettingsTab):
4177 """
4178@@ -49,12 +49,12 @@
4179 self.UseVMRLabel = QtGui.QLabel(self.VideoModeGroupBox)
4180 self.UseVMRLabel.setObjectName("UseVMRLabel")
4181 self.VideoModeLayout.addWidget(self.UseVMRLabel)
4182-
4183+
4184 self.VideoLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.VideoModeGroupBox)
4185- # Signals and slots
4186+ # Signals and slots
4187 QtCore.QObject.connect(self.UseVMRCheckBox,
4188- QtCore.SIGNAL("stateChanged(int)"), self.onVMRCheckBoxChanged)
4189-
4190+ QtCore.SIGNAL("stateChanged(int)"), self.onVMRCheckBoxChanged)
4191+
4192 def retranslateUi(self):
4193 self.VideoModeGroupBox.setTitle(translate("SettingsForm", "Video Mode"))
4194 self.UseVMRCheckBox.setText(translate("SettingsForm", "Use Video Mode Rendering"))
4195@@ -69,11 +69,11 @@
4196 self.use_vmr_mode = False
4197 if use_vmr_mode == 2: # we have a set value convert to True/False
4198 self.use_vmr_mode = True
4199-
4200+
4201 def load(self):
4202- self.use_vmr_mode = self.convertStringToBoolean(self.config.get_config(u'use mode layout', u'False'))
4203+ self.use_vmr_mode = convertStringToBoolean(self.config.get_config(u'use mode layout', u'False'))
4204 if self.use_vmr_mode :
4205 self.UseVMRCheckBox.setChecked(True)
4206-
4207+
4208 def save(self):
4209- self.config.set_config(u'use mode layout', str(self.use_vmr_mode))
4210+ self.config.set_config(u'use mode layout', str(self.use_vmr_mode))
4211
4212=== modified file 'resources/forms/amendthemedialog.ui'
4213--- resources/forms/amendthemedialog.ui 2009-04-11 05:43:52 +0000
4214+++ resources/forms/amendthemedialog.ui 2009-04-21 19:45:50 +0000
4215@@ -1,13 +1,16 @@
4216 <?xml version="1.0" encoding="UTF-8"?>
4217 <ui version="4.0">
4218 <class>AmendThemeDialog</class>
4219- <widget class="QWidget" name="AmendThemeDialog">
4220+ <widget class="QDialog" name="AmendThemeDialog">
4221+ <property name="windowModality">
4222+ <enum>Qt::ApplicationModal</enum>
4223+ </property>
4224 <property name="geometry">
4225 <rect>
4226 <x>0</x>
4227 <y>0</y>
4228- <width>752</width>
4229- <height>533</height>
4230+ <width>586</width>
4231+ <height>651</height>
4232 </rect>
4233 </property>
4234 <property name="windowTitle">
4235@@ -17,87 +20,74 @@
4236 <iconset resource="../images/openlp-2.qrc">
4237 <normaloff>:/icon/openlp.org-icon-32.bmp</normaloff>:/icon/openlp.org-icon-32.bmp</iconset>
4238 </property>
4239- <widget class="QDialogButtonBox" name="ThemeButtonBox">
4240- <property name="geometry">
4241- <rect>
4242- <x>580</x>
4243- <y>500</y>
4244- <width>156</width>
4245- <height>26</height>
4246- </rect>
4247- </property>
4248- <property name="standardButtons">
4249- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
4250- </property>
4251- </widget>
4252- <widget class="QWidget" name="layoutWidget">
4253- <property name="geometry">
4254- <rect>
4255- <x>50</x>
4256- <y>20</y>
4257- <width>441</width>
4258- <height>41</height>
4259- </rect>
4260- </property>
4261- <layout class="QHBoxLayout" name="horizontalLayout">
4262- <item>
4263- <widget class="QLabel" name="ThemeNameLabel">
4264- <property name="text">
4265- <string>Theme Name</string>
4266- </property>
4267- </widget>
4268- </item>
4269- <item>
4270- <widget class="QLineEdit" name="ThemeNameEdit"/>
4271- </item>
4272- </layout>
4273- </widget>
4274- <widget class="QWidget" name="">
4275- <property name="geometry">
4276- <rect>
4277- <x>31</x>
4278- <y>71</y>
4279- <width>721</width>
4280- <height>411</height>
4281- </rect>
4282- </property>
4283- <layout class="QHBoxLayout" name="horizontalLayout_2">
4284- <item>
4285- <widget class="QWidget" name="LeftSide" native="true">
4286- <widget class="QTabWidget" name="tabWidget">
4287- <property name="geometry">
4288- <rect>
4289- <x>0</x>
4290- <y>0</y>
4291- <width>341</width>
4292- <height>401</height>
4293- </rect>
4294- </property>
4295- <property name="currentIndex">
4296- <number>0</number>
4297- </property>
4298- <widget class="QWidget" name="BackgroundTab">
4299- <attribute name="title">
4300- <string>Background</string>
4301- </attribute>
4302- <widget class="QWidget" name="layoutWidget">
4303- <property name="geometry">
4304- <rect>
4305- <x>10</x>
4306- <y>10</y>
4307- <width>321</width>
4308- <height>351</height>
4309- </rect>
4310- </property>
4311- <layout class="QGridLayout" name="gridLayout">
4312- <item row="0" column="0" colspan="2">
4313+ <property name="modal">
4314+ <bool>true</bool>
4315+ </property>
4316+ <layout class="QVBoxLayout" name="AmendThemeLayout">
4317+ <property name="spacing">
4318+ <number>8</number>
4319+ </property>
4320+ <property name="margin">
4321+ <number>8</number>
4322+ </property>
4323+ <item>
4324+ <widget class="QWidget" name="ThemeNameWidget" native="true">
4325+ <layout class="QHBoxLayout" name="ThemeNameLayout">
4326+ <property name="spacing">
4327+ <number>8</number>
4328+ </property>
4329+ <property name="margin">
4330+ <number>0</number>
4331+ </property>
4332+ <item>
4333+ <widget class="QLabel" name="ThemeNameLabel">
4334+ <property name="text">
4335+ <string>Theme Name:</string>
4336+ </property>
4337+ </widget>
4338+ </item>
4339+ <item>
4340+ <widget class="QLineEdit" name="ThemeNameEdit"/>
4341+ </item>
4342+ </layout>
4343+ </widget>
4344+ </item>
4345+ <item>
4346+ <widget class="QWidget" name="ContentWidget" native="true">
4347+ <layout class="QHBoxLayout" name="ContentLayout">
4348+ <property name="spacing">
4349+ <number>8</number>
4350+ </property>
4351+ <property name="margin">
4352+ <number>0</number>
4353+ </property>
4354+ <item>
4355+ <widget class="QTabWidget" name="ThemeTabWidget">
4356+ <property name="currentIndex">
4357+ <number>0</number>
4358+ </property>
4359+ <widget class="QWidget" name="BackgroundTab">
4360+ <attribute name="title">
4361+ <string>Background</string>
4362+ </attribute>
4363+ <layout class="QFormLayout" name="BackgroundLayout">
4364+ <property name="horizontalSpacing">
4365+ <number>8</number>
4366+ </property>
4367+ <property name="verticalSpacing">
4368+ <number>8</number>
4369+ </property>
4370+ <property name="margin">
4371+ <number>8</number>
4372+ </property>
4373+ <item row="0" column="0">
4374 <widget class="QLabel" name="BackgroundLabel">
4375 <property name="text">
4376 <string>Background:</string>
4377 </property>
4378 </widget>
4379 </item>
4380- <item row="0" column="2" colspan="2">
4381+ <item row="0" column="1">
4382 <widget class="QComboBox" name="BackgroundComboBox">
4383 <item>
4384 <property name="text">
4385@@ -111,14 +101,14 @@
4386 </item>
4387 </widget>
4388 </item>
4389- <item row="1" column="0" colspan="2">
4390+ <item row="1" column="0">
4391 <widget class="QLabel" name="BackgroundTypeLabel">
4392 <property name="text">
4393 <string>Background Type:</string>
4394 </property>
4395 </widget>
4396 </item>
4397- <item row="1" column="2" colspan="2">
4398+ <item row="1" column="1">
4399 <widget class="QComboBox" name="BackgroundTypeComboBox">
4400 <item>
4401 <property name="text">
4402@@ -144,7 +134,7 @@
4403 </property>
4404 </widget>
4405 </item>
4406- <item row="2" column="2" colspan="2">
4407+ <item row="2" column="1">
4408 <widget class="QPushButton" name="Color1PushButton">
4409 <property name="text">
4410 <string/>
4411@@ -158,7 +148,7 @@
4412 </property>
4413 </widget>
4414 </item>
4415- <item row="3" column="2" colspan="2">
4416+ <item row="3" column="1">
4417 <widget class="QPushButton" name="Color2PushButton">
4418 <property name="text">
4419 <string/>
4420@@ -172,28 +162,14 @@
4421 </property>
4422 </widget>
4423 </item>
4424- <item row="4" column="1" colspan="2">
4425- <widget class="QLineEdit" name="ImageLineEdit"/>
4426- </item>
4427- <item row="4" column="3">
4428- <widget class="QPushButton" name="ImagePushButton">
4429- <property name="text">
4430- <string/>
4431- </property>
4432- <property name="icon">
4433- <iconset resource="../images/openlp-2.qrc">
4434- <normaloff>:/services/service_open.png</normaloff>:/services/service_open.png</iconset>
4435- </property>
4436- </widget>
4437- </item>
4438- <item row="5" column="0">
4439+ <item row="6" column="0">
4440 <widget class="QLabel" name="GradientLabel">
4441 <property name="text">
4442 <string>Gradient :</string>
4443 </property>
4444 </widget>
4445 </item>
4446- <item row="5" column="2" colspan="2">
4447+ <item row="6" column="1">
4448 <widget class="QComboBox" name="GradientComboBox">
4449 <item>
4450 <property name="text">
4451@@ -212,518 +188,1015 @@
4452 </item>
4453 </widget>
4454 </item>
4455- </layout>
4456- </widget>
4457- </widget>
4458- <widget class="QWidget" name="FontMainTab">
4459- <attribute name="title">
4460- <string>Font Main</string>
4461- </attribute>
4462- <widget class="QGroupBox" name="MainFontGroupBox">
4463- <property name="geometry">
4464- <rect>
4465- <x>20</x>
4466- <y>10</y>
4467- <width>307</width>
4468- <height>119</height>
4469- </rect>
4470- </property>
4471- <property name="title">
4472- <string>Main Font</string>
4473- </property>
4474- <layout class="QGridLayout" name="gridLayout_2">
4475- <item row="0" column="0">
4476- <widget class="QLabel" name="MainFontlabel">
4477- <property name="text">
4478- <string>Font:</string>
4479- </property>
4480- </widget>
4481- </item>
4482- <item row="0" column="1" colspan="2">
4483- <widget class="QFontComboBox" name="MainFontComboBox"/>
4484- </item>
4485- <item row="1" column="0">
4486- <widget class="QLabel" name="MainFontColorLabel">
4487- <property name="text">
4488- <string>Font Color</string>
4489- </property>
4490- </widget>
4491- </item>
4492- <item row="1" column="2">
4493- <widget class="QPushButton" name="MainFontColorPushButton">
4494- <property name="text">
4495- <string/>
4496- </property>
4497- </widget>
4498- </item>
4499- <item row="2" column="0">
4500- <widget class="QLabel" name="MainFontSize">
4501- <property name="text">
4502- <string>Size:</string>
4503- </property>
4504- </widget>
4505- </item>
4506- <item row="2" column="1">
4507- <widget class="QLineEdit" name="MainFontSizeLineEdit"/>
4508- </item>
4509- <item row="2" column="2">
4510- <widget class="QSlider" name="MainFontlSlider">
4511- <property name="value">
4512- <number>15</number>
4513- </property>
4514- <property name="maximum">
4515- <number>40</number>
4516- </property>
4517- <property name="orientation">
4518- <enum>Qt::Horizontal</enum>
4519- </property>
4520- <property name="tickPosition">
4521- <enum>QSlider::TicksBelow</enum>
4522- </property>
4523- <property name="tickInterval">
4524- <number>5</number>
4525- </property>
4526- </widget>
4527- </item>
4528- </layout>
4529- </widget>
4530- <widget class="QGroupBox" name="FooterFontGroupBox">
4531- <property name="geometry">
4532- <rect>
4533- <x>20</x>
4534- <y>160</y>
4535- <width>301</width>
4536- <height>190</height>
4537- </rect>
4538- </property>
4539- <property name="title">
4540- <string>Display Location</string>
4541- </property>
4542- <layout class="QVBoxLayout" name="verticalLayout">
4543- <item>
4544- <widget class="QCheckBox" name="FontMainUseDefault">
4545- <property name="text">
4546- <string>Use default location</string>
4547- </property>
4548- <property name="tristate">
4549- <bool>false</bool>
4550- </property>
4551- </widget>
4552- </item>
4553- <item>
4554- <layout class="QHBoxLayout" name="horizontalLayout_3">
4555- <item>
4556- <widget class="QLabel" name="FontMainXLabel">
4557- <property name="text">
4558- <string>X Position:</string>
4559- </property>
4560- </widget>
4561- </item>
4562- <item>
4563- <widget class="QLineEdit" name="FontMainXEdit"/>
4564- </item>
4565- </layout>
4566- </item>
4567- <item>
4568- <layout class="QHBoxLayout" name="horizontalLayout_4">
4569- <item>
4570- <widget class="QLabel" name="FontMainYLabel">
4571- <property name="text">
4572- <string>Y Position:</string>
4573- </property>
4574- </widget>
4575- </item>
4576- <item>
4577- <widget class="QLineEdit" name="FontMainYEdit"/>
4578- </item>
4579- </layout>
4580- </item>
4581- <item>
4582- <layout class="QHBoxLayout" name="horizontalLayout_5">
4583- <item>
4584- <widget class="QLabel" name="FontMainWidthLabel">
4585- <property name="text">
4586- <string>Width</string>
4587- </property>
4588- </widget>
4589- </item>
4590- <item>
4591- <widget class="QLineEdit" name="FontMainWidthEdit"/>
4592- </item>
4593- </layout>
4594- </item>
4595- <item>
4596- <layout class="QHBoxLayout" name="horizontalLayout_6">
4597- <item>
4598- <widget class="QLabel" name="FontMainHeightLabel">
4599- <property name="text">
4600- <string>Height</string>
4601- </property>
4602- </widget>
4603- </item>
4604- <item>
4605- <widget class="QLineEdit" name="FontMainHeightEdit"/>
4606- </item>
4607- </layout>
4608- </item>
4609- </layout>
4610- </widget>
4611- </widget>
4612- <widget class="QWidget" name="FontFooterTab">
4613- <attribute name="title">
4614- <string>Font Footer</string>
4615- </attribute>
4616- <widget class="QGroupBox" name="FooterFontGroupBox_2">
4617- <property name="geometry">
4618- <rect>
4619- <x>20</x>
4620- <y>160</y>
4621- <width>301</width>
4622- <height>190</height>
4623- </rect>
4624- </property>
4625- <property name="title">
4626- <string>Display Location</string>
4627- </property>
4628- <layout class="QVBoxLayout" name="verticalLayout_2">
4629- <item>
4630- <widget class="QCheckBox" name="FontMainUseDefault_2">
4631- <property name="text">
4632- <string>Use default location</string>
4633- </property>
4634- <property name="tristate">
4635- <bool>false</bool>
4636- </property>
4637- </widget>
4638- </item>
4639- <item>
4640- <layout class="QHBoxLayout" name="horizontalLayout_7">
4641- <item>
4642- <widget class="QLabel" name="FontFooterXLabel">
4643- <property name="text">
4644- <string>X Position:</string>
4645- </property>
4646- </widget>
4647- </item>
4648- <item>
4649- <widget class="QLineEdit" name="FontFooterXEdit"/>
4650- </item>
4651- </layout>
4652- </item>
4653- <item>
4654- <layout class="QHBoxLayout" name="horizontalLayout_8">
4655- <item>
4656- <widget class="QLabel" name="FontFooterYLabel">
4657- <property name="text">
4658- <string>Y Position:</string>
4659- </property>
4660- </widget>
4661- </item>
4662- <item>
4663- <widget class="QLineEdit" name="FontFooterYEdit"/>
4664- </item>
4665- </layout>
4666- </item>
4667- <item>
4668- <layout class="QHBoxLayout" name="horizontalLayout_9">
4669- <item>
4670- <widget class="QLabel" name="FontFooterWidthLabel">
4671- <property name="text">
4672- <string>Width</string>
4673- </property>
4674- </widget>
4675- </item>
4676- <item>
4677- <widget class="QLineEdit" name="FontFooterWidthEdit"/>
4678- </item>
4679- </layout>
4680- </item>
4681- <item>
4682- <layout class="QHBoxLayout" name="horizontalLayout_10">
4683- <item>
4684- <widget class="QLabel" name="FontFooterHeightLabel">
4685- <property name="text">
4686- <string>Height</string>
4687- </property>
4688- </widget>
4689- </item>
4690- <item>
4691- <widget class="QLineEdit" name="FontFooterHeightEdit"/>
4692- </item>
4693- </layout>
4694- </item>
4695- </layout>
4696- </widget>
4697- <widget class="QGroupBox" name="FooterFontGroupBox_3">
4698- <property name="geometry">
4699- <rect>
4700- <x>20</x>
4701- <y>10</y>
4702- <width>307</width>
4703- <height>119</height>
4704- </rect>
4705- </property>
4706- <property name="title">
4707- <string>Footer Font</string>
4708- </property>
4709- <layout class="QGridLayout" name="gridLayout_3">
4710- <item row="0" column="0">
4711- <widget class="QLabel" name="FontFooterlabel">
4712- <property name="text">
4713- <string>Font:</string>
4714- </property>
4715- </widget>
4716- </item>
4717- <item row="0" column="1" colspan="2">
4718- <widget class="QFontComboBox" name="FontFooterComboBox"/>
4719- </item>
4720- <item row="1" column="0">
4721- <widget class="QLabel" name="FontFooterColorLabel">
4722- <property name="text">
4723- <string>Font Color</string>
4724- </property>
4725- </widget>
4726- </item>
4727- <item row="1" column="2">
4728- <widget class="QPushButton" name="FontFooterColorPushButton">
4729- <property name="text">
4730- <string/>
4731- </property>
4732- </widget>
4733- </item>
4734- <item row="2" column="0">
4735- <widget class="QLabel" name="FontFooterSizeLabel">
4736- <property name="text">
4737- <string>Size:</string>
4738- </property>
4739- </widget>
4740- </item>
4741- <item row="2" column="1">
4742- <widget class="QLineEdit" name="FontFooterSizeLineEdit"/>
4743- </item>
4744- <item row="2" column="2">
4745- <widget class="QSlider" name="FontFooterSlider">
4746- <property name="value">
4747- <number>15</number>
4748- </property>
4749- <property name="maximum">
4750- <number>40</number>
4751- </property>
4752- <property name="orientation">
4753- <enum>Qt::Horizontal</enum>
4754- </property>
4755- <property name="tickPosition">
4756- <enum>QSlider::TicksBelow</enum>
4757- </property>
4758- <property name="tickInterval">
4759- <number>5</number>
4760- </property>
4761- </widget>
4762- </item>
4763- </layout>
4764- </widget>
4765- </widget>
4766- <widget class="QWidget" name="OptionsTab">
4767- <attribute name="title">
4768- <string>Alignment</string>
4769- </attribute>
4770- <widget class="QGroupBox" name="ShadowGroupBox">
4771- <property name="geometry">
4772- <rect>
4773- <x>20</x>
4774- <y>10</y>
4775- <width>301</width>
4776- <height>80</height>
4777- </rect>
4778- </property>
4779- <property name="title">
4780- <string>Shadow</string>
4781- </property>
4782- <widget class="QWidget" name="layoutWidget">
4783- <property name="geometry">
4784- <rect>
4785- <x>10</x>
4786- <y>20</y>
4787- <width>281</width>
4788- <height>58</height>
4789- </rect>
4790- </property>
4791- <layout class="QFormLayout" name="formLayout">
4792- <item row="0" column="0">
4793- <widget class="QCheckBox" name="ShadowCheckBox">
4794- <property name="text">
4795- <string>Use Shadow</string>
4796- </property>
4797- </widget>
4798- </item>
4799- <item row="1" column="0">
4800- <widget class="QLabel" name="ShadowColorLabel">
4801- <property name="text">
4802- <string>Shadow Color:</string>
4803- </property>
4804- </widget>
4805- </item>
4806- <item row="1" column="1">
4807- <widget class="QPushButton" name="ShadowColorPushButton">
4808- <property name="text">
4809- <string/>
4810- </property>
4811- </widget>
4812- </item>
4813- </layout>
4814- </widget>
4815- </widget>
4816- <widget class="QGroupBox" name="AlignmentGroupBox">
4817- <property name="geometry">
4818- <rect>
4819- <x>10</x>
4820- <y>200</y>
4821- <width>321</width>
4822- <height>161</height>
4823- </rect>
4824- </property>
4825- <property name="title">
4826- <string>Alignment</string>
4827- </property>
4828- <layout class="QGridLayout" name="gridLayout_4">
4829- <item row="0" column="0">
4830- <widget class="QLabel" name="HorizontalLabel">
4831- <property name="text">
4832- <string>Horizontal Align:</string>
4833- </property>
4834- </widget>
4835- </item>
4836- <item row="0" column="1">
4837- <widget class="QComboBox" name="HorizontalComboBox">
4838- <item>
4839- <property name="text">
4840- <string>Left</string>
4841- </property>
4842- </item>
4843- <item>
4844- <property name="text">
4845- <string>Right</string>
4846- </property>
4847- </item>
4848- <item>
4849- <property name="text">
4850- <string>Center</string>
4851- </property>
4852- </item>
4853- </widget>
4854- </item>
4855- <item row="1" column="0">
4856- <widget class="QLabel" name="VerticalLabel">
4857- <property name="text">
4858- <string>Vertical Align:</string>
4859- </property>
4860- </widget>
4861- </item>
4862- <item row="1" column="1">
4863- <widget class="QComboBox" name="VerticalComboBox">
4864- <item>
4865- <property name="text">
4866- <string>Top</string>
4867- </property>
4868- </item>
4869- <item>
4870- <property name="text">
4871- <string>Middle</string>
4872- </property>
4873- </item>
4874- <item>
4875- <property name="text">
4876- <string>Bottom</string>
4877- </property>
4878- </item>
4879- </widget>
4880- </item>
4881- </layout>
4882- </widget>
4883- <widget class="QGroupBox" name="OutlineGroupBox">
4884- <property name="geometry">
4885- <rect>
4886- <x>20</x>
4887- <y>110</y>
4888- <width>301</width>
4889- <height>80</height>
4890- </rect>
4891- </property>
4892- <property name="title">
4893- <string>Outline</string>
4894- </property>
4895- <widget class="QWidget" name="layoutWidget_3">
4896- <property name="geometry">
4897- <rect>
4898- <x>10</x>
4899- <y>20</y>
4900- <width>281</width>
4901- <height>58</height>
4902- </rect>
4903- </property>
4904- <layout class="QFormLayout" name="OutlineformLayout">
4905- <item row="0" column="0">
4906- <widget class="QCheckBox" name="OutlineCheckBox">
4907- <property name="text">
4908- <string>Use Outline</string>
4909- </property>
4910- </widget>
4911- </item>
4912- <item row="1" column="0">
4913- <widget class="QLabel" name="OutlineColorLabel">
4914- <property name="text">
4915- <string>Outline Color:</string>
4916- </property>
4917- </widget>
4918- </item>
4919- <item row="1" column="1">
4920- <widget class="QPushButton" name="OutlineColorPushButton">
4921- <property name="text">
4922- <string/>
4923- </property>
4924- </widget>
4925- </item>
4926- </layout>
4927- </widget>
4928- </widget>
4929- </widget>
4930- </widget>
4931- </widget>
4932- </item>
4933- <item>
4934- <widget class="QWidget" name="RightSide" native="true">
4935- <widget class="QLabel" name="ThemePreview">
4936- <property name="geometry">
4937- <rect>
4938- <x>20</x>
4939- <y>60</y>
4940- <width>311</width>
4941- <height>271</height>
4942- </rect>
4943- </property>
4944- <property name="frameShape">
4945- <enum>QFrame::Box</enum>
4946- </property>
4947- <property name="frameShadow">
4948- <enum>QFrame::Raised</enum>
4949- </property>
4950- <property name="lineWidth">
4951- <number>2</number>
4952- </property>
4953- <property name="text">
4954- <string/>
4955- </property>
4956- <property name="scaledContents">
4957- <bool>true</bool>
4958- </property>
4959- </widget>
4960- </widget>
4961- </item>
4962- </layout>
4963- </widget>
4964+ <item row="4" column="1">
4965+ <widget class="QWidget" name="ImageFilenameWidget" native="true">
4966+ <layout class="QHBoxLayout" name="horizontalLayout_2">
4967+ <property name="spacing">
4968+ <number>0</number>
4969+ </property>
4970+ <property name="margin">
4971+ <number>0</number>
4972+ </property>
4973+ <item>
4974+ <widget class="QLineEdit" name="ImageLineEdit"/>
4975+ </item>
4976+ <item>
4977+ <widget class="QToolButton" name="ImageToolButton">
4978+ <property name="text">
4979+ <string/>
4980+ </property>
4981+ <property name="icon">
4982+ <iconset resource="../images/openlp-2.qrc">
4983+ <normaloff>:/images/image_load.png</normaloff>:/images/image_load.png</iconset>
4984+ </property>
4985+ </widget>
4986+ </item>
4987+ </layout>
4988+ </widget>
4989+ </item>
4990+ <item row="7" column="1">
4991+ <spacer name="BackgroundSpacer">
4992+ <property name="orientation">
4993+ <enum>Qt::Vertical</enum>
4994+ </property>
4995+ <property name="sizeHint" stdset="0">
4996+ <size>
4997+ <width>20</width>
4998+ <height>40</height>
4999+ </size>
5000+ </property>
The diff has been truncated for viewing.