bzr-revno: 432
This commit is contained in:
Tim Bentley 2009-04-28 20:05:29 +01:00
commit d01159c8e6
27 changed files with 2443 additions and 1264 deletions

View File

@ -46,15 +46,15 @@ class OpenLP(QtGui.QApplication):
self.setApplicationName(u'openlp.org') self.setApplicationName(u'openlp.org')
self.setApplicationVersion(u'1.9.0') self.setApplicationVersion(u'1.9.0')
self.splash = SplashScreen() self.splash = SplashScreen(self.applicationVersion())
self.splash.show() self.splash.show()
# make sure Qt really display the splash screen # make sure Qt really display the splash screen
self.processEvents() self.processEvents()
screens = [] screens = []
# Decide how many screens we have and their size # Decide how many screens we have and their size
for i in range (0 , self.desktop().numScreens()): for screen in xrange (0 , self.desktop().numScreens()):
screens.insert(i, (i+1, self.desktop().availableGeometry(i+1))) screens.insert(screen, (screen+1, self.desktop().availableGeometry(screen+1)))
log.info(u'Screen %d found with resolution %s', i+1, self.desktop().availableGeometry(i+1)) log.info(u'Screen %d found with resolution %s', screen+1, self.desktop().availableGeometry(screen+1))
# start the main app window # start the main app window
self.main_window = MainWindow(screens) self.main_window = MainWindow(screens)
self.main_window.show() self.main_window.show()

View File

@ -15,3 +15,10 @@ You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA Place, Suite 330, Boston, MA 02111-1307 USA
""" """
__all__ = ['convertStringToBoolean']
def convertStringToBoolean(stringvalue):
if stringvalue.lower() == 'true':
return True
else:
return False

View File

@ -3,7 +3,7 @@
""" """
OpenLP - Open Source Lyrics Projection OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -19,15 +19,14 @@ Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from render import Renderer
from settingsmanager import SettingsManager from settingsmanager import SettingsManager
from pluginmanager import PluginManager from openlp.core.lib.pluginmanager import PluginManager
__all__ = ['Renderer', 'SettingsManager', 'PluginManager', 'translate', 'fileToXML'] __all__ = ['SettingsManager', 'PluginManager', 'translate',
'fileToXML' ]
def translate(context, text): def translate(context, text):
return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8) return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8)
def fileToXML(xmlfile): def fileToXML(xmlfile):
return open(xmlfile).read() return open(xmlfile).read()

View File

@ -1,41 +0,0 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
# useful linear interpolation routines
def interp1(val1, val2, fraction):
"""return a linear 1d interpolation between val1 and val2 by fraction
if fraction=0.0, returns val1
if fraction=1.0, returns val2"""
return val1+((val2-val1)*fraction)
def interpolate(val1, val2, fraction):
"vals can be list/tuples - if so, will return a tuple of interpolated values for each element."
assert (fraction >= 0.0)
assert (fraction <= 1.0)
assert (type(val1) == type(val2))
if (type(val1) == type(()) or
type (val1) == type([])):
assert(len(val1) == len(val2))
retval=[]
for i in range(len(val1)):
retval.append(interp1(val1[i], val2[i], fraction))
return tuple(retval)
else:
return interp1(val1, val2, fraction)

View File

@ -3,7 +3,7 @@
""" """
OpenLP - Open Source Lyrics Projection OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -32,7 +32,9 @@ from toolbar import OpenLPToolbar
from songxmlhandler import SongXMLBuilder from songxmlhandler import SongXMLBuilder
from songxmlhandler import SongXMLParser from songxmlhandler import SongXMLParser
from themexmlhandler import ThemeXML from themexmlhandler import ThemeXML
from renderer import Renderer
from rendermanager import RenderManager
__all__ = ['PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType' __all__ = ['Renderer','PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType'
'XmlRootClass', 'ServiceItem', 'Receiver', 'OpenLPToolbar', 'SongXMLBuilder', 'XmlRootClass', 'ServiceItem', 'Receiver', 'OpenLPToolbar', 'SongXMLBuilder',
'SongXMLParser', 'EventManager', 'ThemeXML'] 'SongXMLParser', 'EventManager', 'ThemeXML', 'RenderManager']

View File

@ -92,6 +92,7 @@ class Plugin(object):
self.live_controller=plugin_helpers[u'live'] self.live_controller=plugin_helpers[u'live']
self.theme_manager=plugin_helpers[u'theme'] self.theme_manager=plugin_helpers[u'theme']
self.event_manager=plugin_helpers[u'event'] self.event_manager=plugin_helpers[u'event']
self.render_manager=plugin_helpers[u'render']
def check_pre_conditions(self): def check_pre_conditions(self):
""" """

View File

@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA Place, Suite 330, Boston, MA 02111-1307 USA
""" """
import os import os
import sys import sys
import logging import logging

View File

@ -3,7 +3,7 @@
""" """
OpenLP - Open Source Lyrics Projection OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -18,12 +18,12 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA Place, Suite 330, Boston, MA 02111-1307 USA
""" """
import logging import logging
import os, os.path
import sys import sys
from PyQt4 import QtGui, QtCore, Qt from PyQt4 import QtGui, QtCore, Qt
from copy import copy from copy import copy
#from interpolate import interpolate
class Renderer: class Renderer:
@ -40,7 +40,7 @@ class Renderer:
tell it to render a particular screenfull with render_screen(n) tell it to render a particular screenfull with render_screen(n)
""" """
def __init__(self): def __init__(self, path=None):
self._rect=None self._rect=None
self._debug=0 self._debug=0
self.words=None self.words=None
@ -50,6 +50,7 @@ class Renderer:
self._theme=None self._theme=None
self._bg_image_filename=None self._bg_image_filename=None
self._paint=None self._paint=None
self._path = path
def set_debug(self, debug): def set_debug(self, debug):
self._debug=debug self._debug=debug
@ -61,7 +62,9 @@ class Renderer:
def set_bg_image(self, filename): def set_bg_image(self, filename):
log.debug(u'set bg image %s', filename) log.debug(u'set bg image %s', filename)
self._bg_image_filename=filename
self._bg_image_filename=os.path.join(self._path, self._theme.theme_name, filename)
print self._bg_image_filename
if self._paint is not None: if self._paint is not None:
self.scale_bg_image() self.scale_bg_image()
@ -71,6 +74,7 @@ class Renderer:
# rescale and offset # rescale and offset
imw=i.width() imw=i.width()
imh=i.height() imh=i.height()
print imw, imh
dcw=self._paint.width()+1 dcw=self._paint.width()+1
dch=self._paint.height() dch=self._paint.height()
imratio=imw/float(imh) imratio=imw/float(imh)
@ -93,19 +97,18 @@ class Renderer:
if self._bg_image_filename is not None: if self._bg_image_filename is not None:
self.scale_bg_image() self.scale_bg_image()
def set_words_openlp(self, words): def format_slide(self, words, footer):
# log.debug(u" "set words openlp", words log.debug(u'format_slide %s', words)
verses=[] verses=[]
words=words.replace(u'\r\n', u'\n') words=words.replace(u'\r\n', u'\n')
verses_text=words.split(u'\n\n') verses_text = words.split(u'\n')
for v in verses_text: for v in verses_text:
lines=v.split(u'\n') lines=v.split(u'\n')
verses.append(self.split_set_of_lines(lines)[0]) verses.append(self.split_set_of_lines(lines, footer)[0])
self.words=verses self.words = verses
verses_text=[] verses_text=[]
for v in verses: for v in verses:
verses_text.append(u'\n'.join(v).lstrip()) # remove first \n verses_text.append(u'\n'.join(v).lstrip()) # remove first \n
return verses_text return verses_text
def render_screen(self, screennum): def render_screen(self, screennum):
@ -128,13 +131,13 @@ class Renderer:
p=QtGui.QPainter() p=QtGui.QPainter()
p.begin(self._paint) p.begin(self._paint)
if self._theme.background_type == u'solid': if self._theme.background_type == u'solid':
p.fillRect(self._paint.rect(), QtGui.QColor(self._theme.background_color1)) p.fillRect(self._paint.rect(), QtGui.QColor(self._theme.background_color))
elif self._theme.background_type == u'gradient' : # gradient elif self._theme.background_type == u'gradient' : # gradient
gradient = None gradient = None
if self._theme.background_direction == u'vertical': if self._theme.background_direction == u'horizontal':
w = int(self._paint.width())/2 w = int(self._paint.width())/2
gradient = QtGui.QLinearGradient(w, 0, w, self._paint.height()) # vertical gradient = QtGui.QLinearGradient(w, 0, w, self._paint.height()) # vertical
elif self._theme.background_direction == u'horizontal': elif self._theme.background_direction == u'vertical':
h = int(self._paint.height())/2 h = int(self._paint.height())/2
gradient = QtGui.QLinearGradient(0, h, self._paint.width(), h) # Horizontal gradient = QtGui.QLinearGradient(0, h, self._paint.width(), h) # Horizontal
else: else:
@ -142,8 +145,8 @@ class Renderer:
h = int(self._paint.height())/2 h = int(self._paint.height())/2
gradient = QtGui.QRadialGradient(w, h, w) # Circular gradient = QtGui.QRadialGradient(w, h, w) # Circular
gradient.setColorAt(0, QtGui.QColor(self._theme.background_color1)) gradient.setColorAt(0, QtGui.QColor(self._theme.background_startColor))
gradient.setColorAt(1, QtGui.QColor(self._theme.background_color2)) gradient.setColorAt(1, QtGui.QColor(self._theme.background_endColor))
p.setBrush(QtGui.QBrush(gradient)) p.setBrush(QtGui.QBrush(gradient))
rectPath = QtGui.QPainterPath() rectPath = QtGui.QPainterPath()
@ -161,29 +164,29 @@ class Renderer:
elif self._theme.background_type== u'image': # image elif self._theme.background_type== u'image': # image
r=self._paint.rect() r=self._paint.rect()
log.debug(u'Image size details %d %d %d %d ', r.x(), r.y(), r.width(),r.height()) log.debug(u'Image size details %d %d %d %d ', r.x(), r.y(), r.width(),r.height())
log.debug(u' Background Parameter %d ', self._theme.background_borderColor) #log.debug(u' Background Parameter %d ', self._theme.background_color1)
if self._theme.Bbackground_borderColor is not None: #if self._theme.background_color1 is not None:
p.fillRect(self._paint.rect(), self._theme.background_borderColor) # p.fillRect(self._paint.rect(), self._theme.background_borderColor)
p.drawPixmap(self.background_offsetx,self.background_offsety, self.img) p.drawPixmap(self.background_offsetx,self.background_offsety, self.img)
p.end() p.end()
log.debug(u'render background done') log.debug(u'render background done')
def split_set_of_lines(self, lines): def split_set_of_lines(self, lines, footer):
"""Given a list of lines, decide how to split them best if they don't all fit on the screen """Given a list of lines, decide how to split them best if they don't all fit on the screen
- this is done by splitting at 1/2, 1/3 or 1/4 of the set - this is done by splitting at 1/2, 1/3 or 1/4 of the set
If it doesn't fit, even at this size, just split at each opportunity If it doesn't fit, even at this size, just split at each opportunity
We'll do this by getting the bounding box of each line, and then summing them appropriately We'll do this by getting the bounding box of each lline, and then summing them appropriately
Returns a list of [lists of lines], one set for each screenful Returns a list of [lists of lines], one set for each screenful
""" """
# log.debug(u" "Split set of lines" log.debug(u'Split set of lines')
# Probably ought to save the rendering results to a pseudoDC for redrawing efficiency. But let's not optimse prematurely! # Probably ought to save the rendering results to a pseudoDC for redrawing efficiency. But let's not optimse prematurely!
bboxes = [] bboxes = []
for line in lines: for line in lines:
bboxes.append(self._render_single_line(line)) bboxes.append(self._render_single_line(line, footer))
numlines=len(lines) numlines=len(lines)
bottom=self._rect.bottom() bottom=self._rect.bottom()
for ratio in (numlines, numlines/2, numlines/3, numlines/4): for ratio in (numlines, numlines/2, numlines/3, numlines/4):
@ -192,7 +195,7 @@ class Renderer:
endline=startline+ratio endline=startline+ratio
while (endline<=numlines): while (endline<=numlines):
by=0 by=0
for (x,y) in bboxes[startline:endline]: for (x, y) in bboxes[startline:endline]:
by+=y by+=y
if by > bottom: if by > bottom:
good=0 good=0
@ -220,7 +223,7 @@ class Renderer:
endline=startline+1 endline=startline+1
while (endline<=numlines): while (endline<=numlines):
by=0 by=0
for (x,y) in bboxes[startline:endline]: for (x, y) in bboxes[startline:endline]:
by+=y by+=y
if by > bottom: if by > bottom:
retval.append(lines[startline:endline-1]) retval.append(lines[startline:endline-1])
@ -235,15 +238,15 @@ class Renderer:
x=rect.left() x=rect.left()
if int(self._theme.display_verticalAlign) == 0: # top align if int(self._theme.display_verticalAlign) == 0: # top align
y = rect.top() y = rect.top()
elif int(self._theme.display_verticalAlign) == 1: # bottom align elif int(self._theme.display_verticalAlign) == 2: # bottom align
y=rect.bottom()-bbox.height() y=rect.bottom()-bbox.height()
elif int(t.display_verticalAlign) == 2: # centre align elif int(self._theme.display_verticalAlign) == 1: # centre align
y=rect.top()+(rect.height()-bbox.height())/2 y=rect.top()+(rect.height()-bbox.height())/2
else: else:
assert(0, u'Invalid value for theme.VerticalAlign:%s' % self._theme.display_verticalAlign) assert(0, u'Invalid value for theme.VerticalAlign:%s' % self._theme.display_verticalAlign)
return x, y return x, y
def _render_lines(self, lines, lines1=None): def render_lines(self, lines, lines1=None):
"""render a set of lines according to the theme, return bounding box""" """render a set of lines according to the theme, return bounding box"""
#log.debug(u'_render_lines %s', lines) #log.debug(u'_render_lines %s', lines)
@ -254,11 +257,11 @@ class Renderer:
# put stuff on background so need to reset before doing the job properly. # put stuff on background so need to reset before doing the job properly.
self._render_background() self._render_background()
x, y = self._correctAlignment(self._rect, bbox) x, y = self._correctAlignment(self._rect, bbox)
bbox=self._render_lines_unaligned(lines, False, (x,y)) bbox=self._render_lines_unaligned(lines, False, (x, y))
if lines1 is not None: if lines1 is not None:
x, y = self._correctAlignment(self._rect_footer, bbox1) #x, y = self._correctAlignment(self._rect_footer, bbox1)
bbox=self._render_lines_unaligned(lines1, True, (x,y) ) bbox=self._render_lines_unaligned(lines1, True, (self._rect_footer.left(), self._rect_footer.top()) )
log.debug(u'render lines DONE') log.debug(u'render lines DONE')
@ -273,18 +276,18 @@ class Renderer:
Returns the bounding box of the text as QRect""" Returns the bounding box of the text as QRect"""
log.debug(u'render unaligned %s', lines) log.debug(u'render unaligned %s', lines)
x,y=tlcorner x, y=tlcorner
brx=x brx=x
bry=y bry=y
for line in lines: for line in lines:
if (line == ''): #if (line == ''):
continue # continue
# render after current bottom, but at original left edge # render after current bottom, but at original left edge
# keep track of right edge to see which is biggest # keep track of right edge to see which is biggest
(thisx, bry) = self._render_single_line(line, footer, (x,bry)) (thisx, bry) = self._render_single_line(line, footer, (x,bry))
if (thisx > brx): if (thisx > brx):
brx=thisx brx=thisx
retval=QtCore.QRect(x,y,brx-x, bry-y) retval=QtCore.QRect(x, y,brx-x, bry-y)
if self._debug: if self._debug:
p=QtGui.QPainter() p=QtGui.QPainter()
p.begin(self._paint) p.begin(self._paint)
@ -303,10 +306,10 @@ class Renderer:
If the line is too wide for the context, it wraps, but If the line is too wide for the context, it wraps, but
right-aligns the surplus words in the manner of song lyrics right-aligns the surplus words in the manner of song lyrics
Returns the bottom-right corner (of what was rendered) as a tuple(x,y). Returns the bottom-right corner (of what was rendered) as a tuple(x, y).
""" """
#log.debug(u'Render single line %s @ %s '%( line, tlcorner)) log.debug(u'Render single line %s @ %s '%( line, tlcorner))
x,y=tlcorner x, y=tlcorner
# We draw the text to see how big it is and then iterate to make it fit # We draw the text to see how big it is and then iterate to make it fit
# when we line wrap we do in in the "lyrics" style, so the second line is # when we line wrap we do in in the "lyrics" style, so the second line is
# right aligned with a "hanging indent" # right aligned with a "hanging indent"
@ -333,13 +336,17 @@ class Renderer:
starty=y starty=y
rightextent=None rightextent=None
t=self._theme t=self._theme
if footer: # dont allow alignment messing with footers
align = 0
else:
align=t.display_horizontalAlign align=t.display_horizontalAlign
wrapstyle=t.display_wrapStyle wrapstyle=t.display_wrapStyle
for linenum in range(len(lines)): for linenum in range(len(lines)):
line=lines[linenum] line=lines[linenum]
#find out how wide line is #find out how wide line is
w,h=self._get_extent_and_render(line, footer, tlcorner=(x,y), draw=False) w,h=self._get_extent_and_render(line, footer, tlcorner=(x, y), draw=False)
if t.display_shadow: if t.display_shadow:
w+=self._shadow_offset w+=self._shadow_offset
@ -367,8 +374,8 @@ class Renderer:
draw=True, color = t.display_shadow_color) draw=True, color = t.display_shadow_color)
if t.display_outline: if t.display_outline:
self._get_extent_and_render(line, footer,(x+self._outline_offset,y), draw=True, color = t.display_outline_color) self._get_extent_and_render(line, footer,(x+self._outline_offset,y), draw=True, color = t.display_outline_color)
self._get_extent_and_render(line, footer,(x,y+self._outline_offset), draw=True, color = t.display_outline_color) self._get_extent_and_render(line, footer,(x, y+self._outline_offset), draw=True, color = t.display_outline_color)
self._get_extent_and_render(line, footer,(x,y-self._outline_offset), draw=True, color = t.display_outline_color) self._get_extent_and_render(line, footer,(x, y-self._outline_offset), draw=True, color = t.display_outline_color)
self._get_extent_and_render(line, footer,(x-self._outline_offset,y), draw=True, color = t.display_outline_color) self._get_extent_and_render(line, footer,(x-self._outline_offset,y), draw=True, color = t.display_outline_color)
if self._outline_offset > 1: if self._outline_offset > 1:
self._get_extent_and_render(line, footer,(x+self._outline_offset,y+self._outline_offset), draw=True, color = t.display_outline_color) self._get_extent_and_render(line, footer,(x+self._outline_offset,y+self._outline_offset), draw=True, color = t.display_outline_color)
@ -376,7 +383,7 @@ class Renderer:
self._get_extent_and_render(line, footer,(x+self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color) self._get_extent_and_render(line, footer,(x+self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color)
self._get_extent_and_render(line, footer,(x-self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color) self._get_extent_and_render(line, footer,(x-self._outline_offset,y-self._outline_offset), draw=True, color = t.display_outline_color)
self._get_extent_and_render(line, footer,tlcorner=(x,y), draw=True) self._get_extent_and_render(line, footer,tlcorner=(x, y), draw=True)
# log.debug(u'Line %2d: Render '%s' at (%d, %d) wh=(%d,%d)' % ( linenum, line, x, y,w,h) # log.debug(u'Line %2d: Render '%s' at (%d, %d) wh=(%d,%d)' % ( linenum, line, x, y,w,h)
y += h y += h
if linenum == 0: if linenum == 0:
@ -386,7 +393,7 @@ class Renderer:
p=QtGui.QPainter() p=QtGui.QPainter()
p.begin(self._paint) p.begin(self._paint)
p.setPen(QtGui.QPen(QtGui.QColor(0,255,0))) p.setPen(QtGui.QPen(QtGui.QColor(0,255,0)))
p.drawRect(startx,starty,rightextent-startx,y-starty) p.drawRect(startx,starty,rightextent-startx, y-starty)
p.end() p.end()
brcorner=(rightextent,y) brcorner=(rightextent,y)
@ -429,12 +436,12 @@ class Renderer:
p.setPen(QtGui.QColor(self._theme.font_main_color)) p.setPen(QtGui.QColor(self._theme.font_main_color))
else: else:
p.setPen(QtGui.QColor(color)) p.setPen(QtGui.QColor(color))
x,y=tlcorner x, y=tlcorner
metrics=QtGui.QFontMetrics(font) metrics=QtGui.QFontMetrics(font)
# xxx some fudges to make it exactly like wx! Take 'em out later # xxx some fudges to make it exactly like wx! Take 'em out later
w=metrics.width(line) w=metrics.width(line)
h=metrics.height()-2 h=metrics.height()-2
if draw: if draw:
p.drawText(x,y+metrics.height()-metrics.descent()-1, line) p.drawText(x, y+metrics.height()-metrics.descent()-1, line)
p.end() p.end()
return (w, h) return (w, h)

View File

@ -0,0 +1,115 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 - 2009Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
import logging
import os, os.path
import sys
from PyQt4 import QtGui, QtCore, Qt
from renderer import Renderer
class RenderManager:
"""
Class to pull all Renderer interactions into one place.
The plugins will call helper methods to do the rendering but
this class will provide display defense code.
"""
global log
log=logging.getLogger(u'RenderManager')
log.info(u'RenderManager Loaded')
def __init__(self, theme_manager, screen_list):
log.debug(u'Initilisation started')
self.screen_list = screen_list
self.theme_manager = theme_manager
self.displays = len(screen_list)
self.current_display = 1
self.renderer = Renderer(None)
self.calculate_default(self.screen_list[self.current_display-1][1])
self.frame = None
def set_default_theme(self, theme):
log.debug("default theme set to %s", theme)
self.default_theme = self.theme_manager.getThemeData(theme)
self.renderer.set_theme(self.default_theme)
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
def set_theme(self, theme):
log.debug("theme set to %s", theme)
self.theme = theme
self.renderer.set_theme(self.theme)
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
if theme.font_main_override == False:
pass
if theme.font_footer_override == False:
pass
def generate_preview(self):
self.calculate_default(QtCore.QSize(800,600))
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
frame = QtGui.QPixmap(self.width, self.height)
self.renderer.set_paint_dest(frame)
lines=[]
lines.append(u'Amazing Grace!')
lines.append(u'How sweet the sound')
lines.append(u'To save a wretch like me;')
lines.append(u'I once was lost but now am found,')
lines.append(u'Was blind, but now I see.')
lines1=[]
lines1.append(u'Amazing Grace (John Newton)' )
lines1.append(u'CCLI xxx (c)Openlp.org')
answer=self.renderer.render_lines(lines, lines1)
return frame
def format_slide(self, words, footer):
self.calculate_default(QtCore.QSize(800,600))
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
return self.renderer.format_slide(words, footer)
def generate_slide(self,main_text, footer_text, preview=True):
if preview == True:
self.calculate_default(QtCore.QSize(800,600))
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
#frame = QtGui.QPixmap(self.width, self.height)
#self.renderer.set_paint_dest(frame)
#print main_text
answer=self.renderer.render_lines(main_text, footer_text)
return self.frame
def calculate_default(self, screen):
self.width = screen.width()
self.height = screen.height()
self.footer_start = int(self.height*0.95) # 95% is start of footer
#update the rederer frame
self.frame = QtGui.QPixmap(self.width, self.height)
self.renderer.set_paint_dest(self.frame)

View File

@ -19,7 +19,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.resources import *
from openlp.core.lib import PluginConfig from openlp.core.lib import PluginConfig
class SettingsTab(QtGui.QWidget): class SettingsTab(QtGui.QWidget):
@ -57,9 +56,3 @@ class SettingsTab(QtGui.QWidget):
def save(self): def save(self):
pass pass
def convertStringToBoolean(self, stringvalue):
if stringvalue.lower() == 'true':
return True
else:
return False

View File

@ -21,9 +21,49 @@ from xml.etree.ElementTree import ElementTree, XML, dump
For XML Schema see wiki.openlp.org For XML Schema see wiki.openlp.org
""" """
from openlp import convertStringToBoolean
from xml.dom.minidom import Document from xml.dom.minidom import Document
from xml.etree.ElementTree import ElementTree, XML, dump from xml.etree.ElementTree import ElementTree, XML, dump
blankthemexml=\
'''<?xml version="1.0" encoding="iso-8859-1"?>
<theme version="1.0">
<name>BlankStyle</name>
<background mode="transparent"/>
<background type="solid" mode="opaque">
<color>#000000</color>
</background>
<background type="gradient" mode="opaque">
<startColor>#000000</startColor>
<endColor>#000000</endColor>
<direction>vertical</direction>
</background>
<background type="image" mode="opaque">
<filename>fred.bmp</filename>
</background>
<font type="main">
<name>Arial</name>
<color>#000000</color>
<proportion>30</proportion>
<location override="False" x="0" y="0" width="0" height="0"/>
</font>
<font type="footer">
<name>Arial</name>
<color>#000000</color>
<proportion>12</proportion>
<location override="False" x="0" y="0" width="0" height="0"/>
</font>
<display>
<shadow color="#000000">True</shadow>
<outline color="#000000">False</outline>
<horizontalAlign>0</horizontalAlign>
<verticalAlign>0</verticalAlign>
<wrapStyle>0</wrapStyle>
</display>
</theme>
'''
class ThemeXML(): class ThemeXML():
def __init__(self): def __init__(self):
# Create the minidom document # Create the minidom document
@ -31,11 +71,11 @@ class ThemeXML():
def new_document(self, name): def new_document(self, name):
# Create the <song> base element # Create the <song> base element
self.theme = self.theme_xml.createElement(u'Theme') self.theme = self.theme_xml.createElement(u'theme')
self.theme_xml.appendChild(self.theme) self.theme_xml.appendChild(self.theme)
self.theme.setAttribute(u'version', u'1.0') self.theme.setAttribute(u'version', u'1.0')
self.name = self.theme_xml.createElement(u'Name') self.name = self.theme_xml.createElement(u'name')
ctn = self.theme_xml.createTextNode(name) ctn = self.theme_xml.createTextNode(name)
self.name.appendChild(ctn) self.name.appendChild(ctn)
self.theme.appendChild(self.name) self.theme.appendChild(self.name)
@ -52,30 +92,23 @@ class ThemeXML():
background.setAttribute(u'type', u'solid') background.setAttribute(u'type', u'solid')
self.theme.appendChild(background) self.theme.appendChild(background)
color = self.theme_xml.createElement(u'color1') color = self.theme_xml.createElement(u'color')
bkc = self.theme_xml.createTextNode(bkcolor) bkc = self.theme_xml.createTextNode(bkcolor)
color.appendChild(bkc) color.appendChild(bkc)
background.appendChild(color) background.appendChild(color)
color = self.theme_xml.createElement(u'color2')
background.appendChild(color)
color = self.theme_xml.createElement(u'direction')
background.appendChild(color)
def add_background_gradient(self, startcolor, endcolor, direction): def add_background_gradient(self, startcolor, endcolor, direction):
background = self.theme_xml.createElement(u'background') background = self.theme_xml.createElement(u'background')
background.setAttribute(u'mode', u'opaque') background.setAttribute(u'mode', u'opaque')
background.setAttribute(u'type', u'gradient') background.setAttribute(u'type', u'gradient')
self.theme.appendChild(background) self.theme.appendChild(background)
color = self.theme_xml.createElement(u'color1') color = self.theme_xml.createElement(u'startColor')
bkc = self.theme_xml.createTextNode(startcolor) bkc = self.theme_xml.createTextNode(startcolor)
color.appendChild(bkc) color.appendChild(bkc)
background.appendChild(color) background.appendChild(color)
color = self.theme_xml.createElement(u'color2') color = self.theme_xml.createElement(u'endColor')
bkc = self.theme_xml.createTextNode(endcolor) bkc = self.theme_xml.createTextNode(endcolor)
color.appendChild(bkc) color.appendChild(bkc)
background.appendChild(color) background.appendChild(color)
@ -96,33 +129,34 @@ class ThemeXML():
color.appendChild(bkc) color.appendChild(bkc)
background.appendChild(color) background.appendChild(color)
def add_font(self, fontname, fontcolor, fontproportion, override, fonttype=u'main', xpos=0, ypos=0 ,width=0, height=0): def add_font(self, name, color, proportion, override, fonttype=u'main', xpos=0, ypos=0 ,width=0, height=0):
background = self.theme_xml.createElement(u'font') background = self.theme_xml.createElement(u'font')
background.setAttribute(u'type',fonttype) background.setAttribute(u'type',fonttype)
self.theme.appendChild(background) self.theme.appendChild(background)
name = self.theme_xml.createElement(u'name') element = self.theme_xml.createElement(u'name')
fn = self.theme_xml.createTextNode(fontname) fn = self.theme_xml.createTextNode(name)
name.appendChild(fn) element.appendChild(fn)
background.appendChild(name) background.appendChild(element)
name = self.theme_xml.createElement(u'color') element = self.theme_xml.createElement(u'color')
fn = self.theme_xml.createTextNode(fontcolor) fn = self.theme_xml.createTextNode(color)
name.appendChild(fn) element.appendChild(fn)
background.appendChild(name) background.appendChild(element)
name = self.theme_xml.createElement(u'proportion') element = self.theme_xml.createElement(u'proportion')
fn = self.theme_xml.createTextNode(fontproportion) fn = self.theme_xml.createTextNode(proportion)
name.appendChild(fn) element.appendChild(fn)
background.appendChild(name) background.appendChild(element)
name = self.theme_xml.createElement(u'location') element = self.theme_xml.createElement(u'location')
name.setAttribute(u'override',override) element.setAttribute(u'override',override)
name.setAttribute(u'x',str(xpos)) if override == True:
name.setAttribute(u'y',str(ypos)) element.setAttribute(u'x',str(xpos))
name.setAttribute(u'width',str(width)) element.setAttribute(u'y',str(ypos))
name.setAttribute(u'height',str(height)) element.setAttribute(u'width',str(width))
background.appendChild(name) element.setAttribute(u'height',str(height))
background.appendChild(element)
def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap): def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap):
background = self.theme_xml.createElement(u'display') background = self.theme_xml.createElement(u'display')
@ -170,6 +204,13 @@ class ThemeXML():
return self.theme_xml.toxml() return self.theme_xml.toxml()
def parse(self, xml): def parse(self, xml):
self.baseParseXml()
self.parse_xml(xml)
def baseParseXml(self):
self.parse_xml(blankthemexml)
def parse_xml(self, xml):
theme_xml = ElementTree(element=XML(xml)) theme_xml = ElementTree(element=XML(xml))
iter=theme_xml.getiterator() iter=theme_xml.getiterator()
master = u'' master = u''
@ -185,13 +226,17 @@ class ThemeXML():
master += e[1] + u'_' master += e[1] + u'_'
elif master == u'display_' and (element.tag == u'shadow' or element.tag == u'outline'): elif master == u'display_' and (element.tag == u'shadow' or element.tag == u'outline'):
#print "b", master, element.tag, element.text, e[0], e[1] #print "b", master, element.tag, element.text, e[0], e[1]
setattr(self, master + element.tag , element.text) et = convertStringToBoolean(element.text)
setattr(self, master + element.tag , et)
setattr(self, master + element.tag +u'_'+ e[0], e[1]) setattr(self, master + element.tag +u'_'+ e[0], e[1])
else: else:
field = master + e[0] field = master + e[0]
setattr(self, field, e[1]) e1 = e[1]
if e[1] == u'True' or e[1] == u'False':
e1 = convertStringToBoolean(e[1])
setattr(self, field, e1)
else: else:
#print "c", element.tag #print "c", element.tag, element.text
if element.tag is not None : if element.tag is not None :
field = master + element.tag field = master + element.tag
setattr(self, field, element.text) setattr(self, field, element.text)

View File

@ -1,4 +1,7 @@
import logging import logging
import os, sys
from openlp.core.lib.pluginmanager import PluginManager
logging.basicConfig(level=logging.DEBUG, logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M', datefmt='%m-%d %H:%M',
@ -14,11 +17,9 @@ logging.getLogger('').addHandler(console)
log=logging.getLogger('') log=logging.getLogger('')
logging.info("Logging started") logging.info("Logging started")
import os, sys
mypath=os.path.split(os.path.abspath(__file__))[0] mypath=os.path.split(os.path.abspath(__file__))[0]
sys.path.insert(0,(os.path.join(mypath, '..' ,'..', '..'))) sys.path.insert(0,(os.path.join(mypath, '..' ,'..', '..')))
from openlp.core.pluginmanager import PluginManager
# test the plugin manager with some plugins in the test_plugins directory # test the plugin manager with some plugins in the test_plugins directory
class TestPluginManager: class TestPluginManager:

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'amendthemedialog.ui' # Form implementation generated from reading ui file 'amendthemedialog.ui'
# #
# Created: Fri Apr 10 20:38:33 2009 # Created: Tue Apr 21 06:06:56 2009
# by: PyQt4 UI code generator 4.4.4 # by: PyQt4 UI code generator 4.4.4
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
@ -12,272 +12,416 @@ from PyQt4 import QtCore, QtGui
class Ui_AmendThemeDialog(object): class Ui_AmendThemeDialog(object):
def setupUi(self, AmendThemeDialog): def setupUi(self, AmendThemeDialog):
AmendThemeDialog.setObjectName("AmendThemeDialog") AmendThemeDialog.setObjectName("AmendThemeDialog")
AmendThemeDialog.resize(752, 533) AmendThemeDialog.setWindowModality(QtCore.Qt.ApplicationModal)
AmendThemeDialog.resize(586, 651)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
AmendThemeDialog.setWindowIcon(icon) AmendThemeDialog.setWindowIcon(icon)
self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog) AmendThemeDialog.setModal(True)
self.ThemeButtonBox.setGeometry(QtCore.QRect(580, 500, 156, 26)) self.AmendThemeLayout = QtGui.QVBoxLayout(AmendThemeDialog)
self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.AmendThemeLayout.setSpacing(8)
self.ThemeButtonBox.setObjectName("ThemeButtonBox") self.AmendThemeLayout.setMargin(8)
self.layoutWidget = QtGui.QWidget(AmendThemeDialog) self.AmendThemeLayout.setObjectName("AmendThemeLayout")
self.layoutWidget.setGeometry(QtCore.QRect(50, 20, 441, 41)) self.ThemeNameWidget = QtGui.QWidget(AmendThemeDialog)
self.layoutWidget.setObjectName("layoutWidget") self.ThemeNameWidget.setObjectName("ThemeNameWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget) self.ThemeNameLayout = QtGui.QHBoxLayout(self.ThemeNameWidget)
self.horizontalLayout.setObjectName("horizontalLayout") self.ThemeNameLayout.setSpacing(8)
self.ThemeNameLabel = QtGui.QLabel(self.layoutWidget) self.ThemeNameLayout.setMargin(0)
self.ThemeNameLayout.setObjectName("ThemeNameLayout")
self.ThemeNameLabel = QtGui.QLabel(self.ThemeNameWidget)
self.ThemeNameLabel.setObjectName("ThemeNameLabel") self.ThemeNameLabel.setObjectName("ThemeNameLabel")
self.horizontalLayout.addWidget(self.ThemeNameLabel) self.ThemeNameLayout.addWidget(self.ThemeNameLabel)
self.ThemeNameEdit = QtGui.QLineEdit(self.layoutWidget) self.ThemeNameEdit = QtGui.QLineEdit(self.ThemeNameWidget)
self.ThemeNameEdit.setObjectName("ThemeNameEdit") self.ThemeNameEdit.setObjectName("ThemeNameEdit")
self.horizontalLayout.addWidget(self.ThemeNameEdit) self.ThemeNameLayout.addWidget(self.ThemeNameEdit)
self.widget = QtGui.QWidget(AmendThemeDialog) self.AmendThemeLayout.addWidget(self.ThemeNameWidget)
self.widget.setGeometry(QtCore.QRect(31, 71, 721, 411)) self.ContentWidget = QtGui.QWidget(AmendThemeDialog)
self.widget.setObjectName("widget") self.ContentWidget.setObjectName("ContentWidget")
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.widget) self.ContentLayout = QtGui.QHBoxLayout(self.ContentWidget)
self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.ContentLayout.setSpacing(8)
self.LeftSide = QtGui.QWidget(self.widget) self.ContentLayout.setMargin(0)
self.LeftSide.setObjectName("LeftSide") self.ContentLayout.setObjectName("ContentLayout")
self.tabWidget = QtGui.QTabWidget(self.LeftSide) self.ThemeTabWidget = QtGui.QTabWidget(self.ContentWidget)
self.tabWidget.setGeometry(QtCore.QRect(0, 0, 341, 401)) self.ThemeTabWidget.setObjectName("ThemeTabWidget")
self.tabWidget.setObjectName("tabWidget")
self.BackgroundTab = QtGui.QWidget() self.BackgroundTab = QtGui.QWidget()
self.BackgroundTab.setObjectName("BackgroundTab") self.BackgroundTab.setObjectName("BackgroundTab")
self.layoutWidget1 = QtGui.QWidget(self.BackgroundTab) self.BackgroundLayout = QtGui.QFormLayout(self.BackgroundTab)
self.layoutWidget1.setGeometry(QtCore.QRect(10, 10, 321, 351)) self.BackgroundLayout.setMargin(8)
self.layoutWidget1.setObjectName("layoutWidget1") self.BackgroundLayout.setSpacing(8)
self.gridLayout = QtGui.QGridLayout(self.layoutWidget1) self.BackgroundLayout.setObjectName("BackgroundLayout")
self.gridLayout.setObjectName("gridLayout") self.BackgroundLabel = QtGui.QLabel(self.BackgroundTab)
self.BackgroundLabel = QtGui.QLabel(self.layoutWidget1)
self.BackgroundLabel.setObjectName("BackgroundLabel") self.BackgroundLabel.setObjectName("BackgroundLabel")
self.gridLayout.addWidget(self.BackgroundLabel, 0, 0, 1, 2) self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.BackgroundLabel)
self.BackgroundComboBox = QtGui.QComboBox(self.layoutWidget1) self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab)
self.BackgroundComboBox.setObjectName("BackgroundComboBox") self.BackgroundComboBox.setObjectName("BackgroundComboBox")
self.BackgroundComboBox.addItem(QtCore.QString()) self.BackgroundComboBox.addItem(QtCore.QString())
self.BackgroundComboBox.addItem(QtCore.QString()) self.BackgroundComboBox.addItem(QtCore.QString())
self.gridLayout.addWidget(self.BackgroundComboBox, 0, 2, 1, 2) self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.BackgroundComboBox)
self.BackgroundTypeLabel = QtGui.QLabel(self.layoutWidget1) self.BackgroundTypeLabel = QtGui.QLabel(self.BackgroundTab)
self.BackgroundTypeLabel.setObjectName("BackgroundTypeLabel") self.BackgroundTypeLabel.setObjectName("BackgroundTypeLabel")
self.gridLayout.addWidget(self.BackgroundTypeLabel, 1, 0, 1, 2) self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.BackgroundTypeLabel)
self.BackgroundTypeComboBox = QtGui.QComboBox(self.layoutWidget1) self.BackgroundTypeComboBox = QtGui.QComboBox(self.BackgroundTab)
self.BackgroundTypeComboBox.setObjectName("BackgroundTypeComboBox") self.BackgroundTypeComboBox.setObjectName("BackgroundTypeComboBox")
self.BackgroundTypeComboBox.addItem(QtCore.QString()) self.BackgroundTypeComboBox.addItem(QtCore.QString())
self.BackgroundTypeComboBox.addItem(QtCore.QString()) self.BackgroundTypeComboBox.addItem(QtCore.QString())
self.BackgroundTypeComboBox.addItem(QtCore.QString()) self.BackgroundTypeComboBox.addItem(QtCore.QString())
self.gridLayout.addWidget(self.BackgroundTypeComboBox, 1, 2, 1, 2) self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.BackgroundTypeComboBox)
self.Color1Label = QtGui.QLabel(self.layoutWidget1) self.Color1Label = QtGui.QLabel(self.BackgroundTab)
self.Color1Label.setObjectName("Color1Label") self.Color1Label.setObjectName("Color1Label")
self.gridLayout.addWidget(self.Color1Label, 2, 0, 1, 1) self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.Color1Label)
self.Color1PushButton = QtGui.QPushButton(self.layoutWidget1) self.Color1PushButton = QtGui.QPushButton(self.BackgroundTab)
self.Color1PushButton.setObjectName("Color1PushButton") self.Color1PushButton.setObjectName("Color1PushButton")
self.gridLayout.addWidget(self.Color1PushButton, 2, 2, 1, 2) self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.Color1PushButton)
self.Color2Label = QtGui.QLabel(self.layoutWidget1) self.Color2Label = QtGui.QLabel(self.BackgroundTab)
self.Color2Label.setObjectName("Color2Label") self.Color2Label.setObjectName("Color2Label")
self.gridLayout.addWidget(self.Color2Label, 3, 0, 1, 1) self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.Color2Label)
self.Color2PushButton = QtGui.QPushButton(self.layoutWidget1) self.Color2PushButton = QtGui.QPushButton(self.BackgroundTab)
self.Color2PushButton.setObjectName("Color2PushButton") self.Color2PushButton.setObjectName("Color2PushButton")
self.gridLayout.addWidget(self.Color2PushButton, 3, 2, 1, 2) self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.Color2PushButton)
self.ImageLabel = QtGui.QLabel(self.layoutWidget1) self.ImageLabel = QtGui.QLabel(self.BackgroundTab)
self.ImageLabel.setObjectName("ImageLabel") self.ImageLabel.setObjectName("ImageLabel")
self.gridLayout.addWidget(self.ImageLabel, 4, 0, 1, 1) self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.ImageLabel)
self.ImageLineEdit = QtGui.QLineEdit(self.layoutWidget1) self.GradientLabel = QtGui.QLabel(self.BackgroundTab)
self.ImageLineEdit.setObjectName("ImageLineEdit")
self.gridLayout.addWidget(self.ImageLineEdit, 4, 1, 1, 2)
self.ImagePushButton = QtGui.QPushButton(self.layoutWidget1)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/services/service_open.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImagePushButton.setIcon(icon1)
self.ImagePushButton.setObjectName("ImagePushButton")
self.gridLayout.addWidget(self.ImagePushButton, 4, 3, 1, 1)
self.GradientLabel = QtGui.QLabel(self.layoutWidget1)
self.GradientLabel.setObjectName("GradientLabel") self.GradientLabel.setObjectName("GradientLabel")
self.gridLayout.addWidget(self.GradientLabel, 5, 0, 1, 1) self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.GradientLabel)
self.GradientComboBox = QtGui.QComboBox(self.layoutWidget1) self.GradientComboBox = QtGui.QComboBox(self.BackgroundTab)
self.GradientComboBox.setObjectName("GradientComboBox") self.GradientComboBox.setObjectName("GradientComboBox")
self.GradientComboBox.addItem(QtCore.QString()) self.GradientComboBox.addItem(QtCore.QString())
self.GradientComboBox.addItem(QtCore.QString()) self.GradientComboBox.addItem(QtCore.QString())
self.GradientComboBox.addItem(QtCore.QString()) self.GradientComboBox.addItem(QtCore.QString())
self.gridLayout.addWidget(self.GradientComboBox, 5, 2, 1, 2) self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.FieldRole, self.GradientComboBox)
self.tabWidget.addTab(self.BackgroundTab, "") self.ImageFilenameWidget = QtGui.QWidget(self.BackgroundTab)
self.ImageFilenameWidget.setObjectName("ImageFilenameWidget")
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImageFilenameWidget)
self.horizontalLayout_2.setSpacing(0)
self.horizontalLayout_2.setMargin(0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.ImageLineEdit = QtGui.QLineEdit(self.ImageFilenameWidget)
self.ImageLineEdit.setObjectName("ImageLineEdit")
self.horizontalLayout_2.addWidget(self.ImageLineEdit)
self.ImageToolButton = QtGui.QToolButton(self.ImageFilenameWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/images/image_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImageToolButton.setIcon(icon1)
self.ImageToolButton.setObjectName("ImageToolButton")
self.horizontalLayout_2.addWidget(self.ImageToolButton)
self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
#self.BackgroundLayout.addItem(spacerItem, 7, 1, 1, 1)
self.ThemeTabWidget.addTab(self.BackgroundTab, "")
self.FontMainTab = QtGui.QWidget() self.FontMainTab = QtGui.QWidget()
self.FontMainTab.setObjectName("FontMainTab") self.FontMainTab.setObjectName("FontMainTab")
self.MainFontGroupBox = QtGui.QGroupBox(self.FontMainTab) self.FontMainLayout = QtGui.QHBoxLayout(self.FontMainTab)
self.MainFontGroupBox.setGeometry(QtCore.QRect(20, 10, 307, 119)) self.FontMainLayout.setSpacing(8)
self.MainFontGroupBox.setObjectName("MainFontGroupBox") self.FontMainLayout.setMargin(8)
self.gridLayout_2 = QtGui.QGridLayout(self.MainFontGroupBox) self.FontMainLayout.setObjectName("FontMainLayout")
self.gridLayout_2.setObjectName("gridLayout_2") self.MainLeftWidget = QtGui.QWidget(self.FontMainTab)
self.MainFontlabel = QtGui.QLabel(self.MainFontGroupBox) self.MainLeftWidget.setObjectName("MainLeftWidget")
self.MainFontlabel.setObjectName("MainFontlabel") self.MainLeftLayout = QtGui.QVBoxLayout(self.MainLeftWidget)
self.gridLayout_2.addWidget(self.MainFontlabel, 0, 0, 1, 1) self.MainLeftLayout.setSpacing(8)
self.MainFontComboBox = QtGui.QFontComboBox(self.MainFontGroupBox) self.MainLeftLayout.setMargin(0)
self.MainFontComboBox.setObjectName("MainFontComboBox") self.MainLeftLayout.setObjectName("MainLeftLayout")
self.gridLayout_2.addWidget(self.MainFontComboBox, 0, 1, 1, 2) self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget)
self.MainFontColorLabel = QtGui.QLabel(self.MainFontGroupBox) self.FontMainGroupBox.setObjectName("FontMainGroupBox")
self.MainFontColorLabel.setObjectName("MainFontColorLabel") self.MainFontLayout = QtGui.QFormLayout(self.FontMainGroupBox)
self.gridLayout_2.addWidget(self.MainFontColorLabel, 1, 0, 1, 1) self.MainFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.MainFontColorPushButton = QtGui.QPushButton(self.MainFontGroupBox) self.MainFontLayout.setMargin(8)
self.MainFontColorPushButton.setObjectName("MainFontColorPushButton") self.MainFontLayout.setSpacing(8)
self.gridLayout_2.addWidget(self.MainFontColorPushButton, 1, 2, 1, 1) self.MainFontLayout.setObjectName("MainFontLayout")
self.MainFontSize = QtGui.QLabel(self.MainFontGroupBox) self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox)
self.MainFontSize.setObjectName("MainFontSize") self.FontMainlabel.setObjectName("FontMainlabel")
self.gridLayout_2.addWidget(self.MainFontSize, 2, 0, 1, 1) self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontMainlabel)
self.MainFontSizeLineEdit = QtGui.QLineEdit(self.MainFontGroupBox) self.FontMainComboBox = QtGui.QFontComboBox(self.FontMainGroupBox)
self.MainFontSizeLineEdit.setObjectName("MainFontSizeLineEdit") self.FontMainComboBox.setObjectName("FontMainComboBox")
self.gridLayout_2.addWidget(self.MainFontSizeLineEdit, 2, 1, 1, 1) self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainComboBox)
self.MainFontlSlider = QtGui.QSlider(self.MainFontGroupBox) self.FontMainColorLabel = QtGui.QLabel(self.FontMainGroupBox)
self.MainFontlSlider.setProperty("value", QtCore.QVariant(15)) self.FontMainColorLabel.setObjectName("FontMainColorLabel")
self.MainFontlSlider.setMaximum(40) self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainColorLabel)
self.MainFontlSlider.setOrientation(QtCore.Qt.Horizontal) self.FontMainColorPushButton = QtGui.QPushButton(self.FontMainGroupBox)
self.MainFontlSlider.setTickPosition(QtGui.QSlider.TicksBelow) self.FontMainColorPushButton.setObjectName("FontMainColorPushButton")
self.MainFontlSlider.setTickInterval(5) self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainColorPushButton)
self.MainFontlSlider.setObjectName("MainFontlSlider") self.FontMainSize = QtGui.QLabel(self.FontMainGroupBox)
self.gridLayout_2.addWidget(self.MainFontlSlider, 2, 2, 1, 1) self.FontMainSize.setObjectName("FontMainSize")
self.FooterFontGroupBox = QtGui.QGroupBox(self.FontMainTab) self.MainFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainSize)
self.FooterFontGroupBox.setGeometry(QtCore.QRect(20, 160, 301, 190)) self.FontMainSizeSpinBox = QtGui.QSpinBox(self.FontMainGroupBox)
self.FooterFontGroupBox.setObjectName("FooterFontGroupBox") sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
self.verticalLayout = QtGui.QVBoxLayout(self.FooterFontGroupBox) sizePolicy.setHorizontalStretch(0)
self.verticalLayout.setObjectName("verticalLayout") sizePolicy.setVerticalStretch(0)
self.FontMainUseDefault = QtGui.QCheckBox(self.FooterFontGroupBox) sizePolicy.setHeightForWidth(self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth())
self.FontMainUseDefault.setTristate(False) self.FontMainSizeSpinBox.setSizePolicy(sizePolicy)
self.FontMainUseDefault.setObjectName("FontMainUseDefault") self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
self.verticalLayout.addWidget(self.FontMainUseDefault) self.FontMainSizeSpinBox.setProperty("value", QtCore.QVariant(16))
self.horizontalLayout_3 = QtGui.QHBoxLayout() self.FontMainSizeSpinBox.setMaximum(999)
self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.FontMainSizeSpinBox.setObjectName("FontMainSizeSpinBox")
self.FontMainXLabel = QtGui.QLabel(self.FooterFontGroupBox) self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox)
self.MainLeftLayout.addWidget(self.FontMainGroupBox)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.MainLeftLayout.addItem(spacerItem1)
self.FontMainLayout.addWidget(self.MainLeftWidget)
self.MainRightWidget = QtGui.QWidget(self.FontMainTab)
self.MainRightWidget.setObjectName("MainRightWidget")
self.MainRightLayout = QtGui.QVBoxLayout(self.MainRightWidget)
self.MainRightLayout.setSpacing(8)
self.MainRightLayout.setMargin(0)
self.MainRightLayout.setObjectName("MainRightLayout")
self.MainLocationGroupBox = QtGui.QGroupBox(self.MainRightWidget)
self.MainLocationGroupBox.setObjectName("MainLocationGroupBox")
self.MainLocationLayout = QtGui.QFormLayout(self.MainLocationGroupBox)
self.MainLocationLayout.setMargin(8)
self.MainLocationLayout.setSpacing(8)
self.MainLocationLayout.setObjectName("MainLocationLayout")
self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox)
self.DefaultLocationLabel.setObjectName("DefaultLocationLabel")
self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.DefaultLocationLabel)
self.FontMainDefaultCheckBox = QtGui.QCheckBox(self.MainLocationGroupBox)
self.FontMainDefaultCheckBox.setTristate(False)
self.FontMainDefaultCheckBox.setObjectName("FontMainDefaultCheckBox")
self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainDefaultCheckBox)
self.FontMainXLabel = QtGui.QLabel(self.MainLocationGroupBox)
self.FontMainXLabel.setObjectName("FontMainXLabel") self.FontMainXLabel.setObjectName("FontMainXLabel")
self.horizontalLayout_3.addWidget(self.FontMainXLabel) self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainXLabel)
self.FontMainXEdit = QtGui.QLineEdit(self.FooterFontGroupBox) self.FontMainYLabel = QtGui.QLabel(self.MainLocationGroupBox)
self.FontMainXEdit.setObjectName("FontMainXEdit")
self.horizontalLayout_3.addWidget(self.FontMainXEdit)
self.verticalLayout.addLayout(self.horizontalLayout_3)
self.horizontalLayout_4 = QtGui.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.FontMainYLabel = QtGui.QLabel(self.FooterFontGroupBox)
self.FontMainYLabel.setObjectName("FontMainYLabel") self.FontMainYLabel.setObjectName("FontMainYLabel")
self.horizontalLayout_4.addWidget(self.FontMainYLabel) self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainYLabel)
self.FontMainYEdit = QtGui.QLineEdit(self.FooterFontGroupBox) self.FontMainWidthLabel = QtGui.QLabel(self.MainLocationGroupBox)
self.FontMainYEdit.setObjectName("FontMainYEdit")
self.horizontalLayout_4.addWidget(self.FontMainYEdit)
self.verticalLayout.addLayout(self.horizontalLayout_4)
self.horizontalLayout_5 = QtGui.QHBoxLayout()
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.FontMainWidthLabel = QtGui.QLabel(self.FooterFontGroupBox)
self.FontMainWidthLabel.setObjectName("FontMainWidthLabel") self.FontMainWidthLabel.setObjectName("FontMainWidthLabel")
self.horizontalLayout_5.addWidget(self.FontMainWidthLabel) self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWidthLabel)
self.FontMainWidthEdit = QtGui.QLineEdit(self.FooterFontGroupBox) self.FontMainHeightLabel = QtGui.QLabel(self.MainLocationGroupBox)
self.FontMainWidthEdit.setObjectName("FontMainWidthEdit")
self.horizontalLayout_5.addWidget(self.FontMainWidthEdit)
self.verticalLayout.addLayout(self.horizontalLayout_5)
self.horizontalLayout_6 = QtGui.QHBoxLayout()
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.FontMainHeightLabel = QtGui.QLabel(self.FooterFontGroupBox)
self.FontMainHeightLabel.setObjectName("FontMainHeightLabel") self.FontMainHeightLabel.setObjectName("FontMainHeightLabel")
self.horizontalLayout_6.addWidget(self.FontMainHeightLabel) self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainHeightLabel)
self.FontMainHeightEdit = QtGui.QLineEdit(self.FooterFontGroupBox) self.FontMainXSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox)
self.FontMainHeightEdit.setObjectName("FontMainHeightEdit") sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
self.horizontalLayout_6.addWidget(self.FontMainHeightEdit) sizePolicy.setHorizontalStretch(0)
self.verticalLayout.addLayout(self.horizontalLayout_6) sizePolicy.setVerticalStretch(0)
self.tabWidget.addTab(self.FontMainTab, "") sizePolicy.setHeightForWidth(self.FontMainXSpinBox.sizePolicy().hasHeightForWidth())
self.FontMainXSpinBox.setSizePolicy(sizePolicy)
self.FontMainXSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontMainXSpinBox.setProperty("value", QtCore.QVariant(0))
self.FontMainXSpinBox.setMaximum(9999)
self.FontMainXSpinBox.setObjectName("FontMainXSpinBox")
self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainXSpinBox)
self.FontMainYSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.FontMainYSpinBox.sizePolicy().hasHeightForWidth())
self.FontMainYSpinBox.setSizePolicy(sizePolicy)
self.FontMainYSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontMainYSpinBox.setMaximum(9999)
self.FontMainYSpinBox.setObjectName("FontMainYSpinBox")
self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainYSpinBox)
self.FontMainWidthSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth())
self.FontMainWidthSpinBox.setSizePolicy(sizePolicy)
self.FontMainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontMainWidthSpinBox.setMaximum(9999)
self.FontMainWidthSpinBox.setObjectName("FontMainWidthSpinBox")
self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWidthSpinBox)
self.FontMainHeightSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth())
self.FontMainHeightSpinBox.setSizePolicy(sizePolicy)
self.FontMainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontMainHeightSpinBox.setMaximum(9999)
self.FontMainHeightSpinBox.setObjectName("FontMainHeightSpinBox")
self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainHeightSpinBox)
self.MainRightLayout.addWidget(self.MainLocationGroupBox)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.MainRightLayout.addItem(spacerItem2)
self.FontMainLayout.addWidget(self.MainRightWidget)
self.ThemeTabWidget.addTab(self.FontMainTab, "")
self.FontFooterTab = QtGui.QWidget() self.FontFooterTab = QtGui.QWidget()
self.FontFooterTab.setObjectName("FontFooterTab") self.FontFooterTab.setObjectName("FontFooterTab")
self.FooterFontGroupBox_2 = QtGui.QGroupBox(self.FontFooterTab) self.FontFooterLayout = QtGui.QHBoxLayout(self.FontFooterTab)
self.FooterFontGroupBox_2.setGeometry(QtCore.QRect(20, 160, 301, 190)) self.FontFooterLayout.setSpacing(8)
self.FooterFontGroupBox_2.setObjectName("FooterFontGroupBox_2") self.FontFooterLayout.setMargin(8)
self.verticalLayout_2 = QtGui.QVBoxLayout(self.FooterFontGroupBox_2) self.FontFooterLayout.setObjectName("FontFooterLayout")
self.verticalLayout_2.setObjectName("verticalLayout_2") self.FooterLeftWidget = QtGui.QWidget(self.FontFooterTab)
self.FontMainUseDefault_2 = QtGui.QCheckBox(self.FooterFontGroupBox_2) self.FooterLeftWidget.setObjectName("FooterLeftWidget")
self.FontMainUseDefault_2.setTristate(False) self.FooterLeftLayout = QtGui.QVBoxLayout(self.FooterLeftWidget)
self.FontMainUseDefault_2.setObjectName("FontMainUseDefault_2") self.FooterLeftLayout.setSpacing(8)
self.verticalLayout_2.addWidget(self.FontMainUseDefault_2) self.FooterLeftLayout.setMargin(0)
self.horizontalLayout_7 = QtGui.QHBoxLayout() self.FooterLeftLayout.setObjectName("FooterLeftLayout")
self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.FooterFontGroupBox = QtGui.QGroupBox(self.FooterLeftWidget)
self.FontFooterXLabel = QtGui.QLabel(self.FooterFontGroupBox_2) self.FooterFontGroupBox.setObjectName("FooterFontGroupBox")
self.FontFooterXLabel.setObjectName("FontFooterXLabel") self.FooterFontLayout = QtGui.QFormLayout(self.FooterFontGroupBox)
self.horizontalLayout_7.addWidget(self.FontFooterXLabel) self.FooterFontLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow)
self.FontFooterXEdit = QtGui.QLineEdit(self.FooterFontGroupBox_2) self.FooterFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.FontFooterXEdit.setObjectName("FontFooterXEdit") self.FooterFontLayout.setMargin(8)
self.horizontalLayout_7.addWidget(self.FontFooterXEdit) self.FooterFontLayout.setSpacing(8)
self.verticalLayout_2.addLayout(self.horizontalLayout_7) self.FooterFontLayout.setObjectName("FooterFontLayout")
self.horizontalLayout_8 = QtGui.QHBoxLayout() self.FontFooterLabel = QtGui.QLabel(self.FooterFontGroupBox)
self.horizontalLayout_8.setObjectName("horizontalLayout_8") self.FontFooterLabel.setObjectName("FontFooterLabel")
self.FontFooterYLabel = QtGui.QLabel(self.FooterFontGroupBox_2) self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterLabel)
self.FontFooterYLabel.setObjectName("FontFooterYLabel") self.FontFooterComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox)
self.horizontalLayout_8.addWidget(self.FontFooterYLabel)
self.FontFooterYEdit = QtGui.QLineEdit(self.FooterFontGroupBox_2)
self.FontFooterYEdit.setObjectName("FontFooterYEdit")
self.horizontalLayout_8.addWidget(self.FontFooterYEdit)
self.verticalLayout_2.addLayout(self.horizontalLayout_8)
self.horizontalLayout_9 = QtGui.QHBoxLayout()
self.horizontalLayout_9.setObjectName("horizontalLayout_9")
self.FontFooterWidthLabel = QtGui.QLabel(self.FooterFontGroupBox_2)
self.FontFooterWidthLabel.setObjectName("FontFooterWidthLabel")
self.horizontalLayout_9.addWidget(self.FontFooterWidthLabel)
self.FontFooterWidthEdit = QtGui.QLineEdit(self.FooterFontGroupBox_2)
self.FontFooterWidthEdit.setObjectName("FontFooterWidthEdit")
self.horizontalLayout_9.addWidget(self.FontFooterWidthEdit)
self.verticalLayout_2.addLayout(self.horizontalLayout_9)
self.horizontalLayout_10 = QtGui.QHBoxLayout()
self.horizontalLayout_10.setObjectName("horizontalLayout_10")
self.FontFooterHeightLabel = QtGui.QLabel(self.FooterFontGroupBox_2)
self.FontFooterHeightLabel.setObjectName("FontFooterHeightLabel")
self.horizontalLayout_10.addWidget(self.FontFooterHeightLabel)
self.FontFooterHeightEdit = QtGui.QLineEdit(self.FooterFontGroupBox_2)
self.FontFooterHeightEdit.setObjectName("FontFooterHeightEdit")
self.horizontalLayout_10.addWidget(self.FontFooterHeightEdit)
self.verticalLayout_2.addLayout(self.horizontalLayout_10)
self.FooterFontGroupBox_3 = QtGui.QGroupBox(self.FontFooterTab)
self.FooterFontGroupBox_3.setGeometry(QtCore.QRect(20, 10, 307, 119))
self.FooterFontGroupBox_3.setObjectName("FooterFontGroupBox_3")
self.gridLayout_3 = QtGui.QGridLayout(self.FooterFontGroupBox_3)
self.gridLayout_3.setObjectName("gridLayout_3")
self.FontFooterlabel = QtGui.QLabel(self.FooterFontGroupBox_3)
self.FontFooterlabel.setObjectName("FontFooterlabel")
self.gridLayout_3.addWidget(self.FontFooterlabel, 0, 0, 1, 1)
self.FontFooterComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox_3)
self.FontFooterComboBox.setObjectName("FontFooterComboBox") self.FontFooterComboBox.setObjectName("FontFooterComboBox")
self.gridLayout_3.addWidget(self.FontFooterComboBox, 0, 1, 1, 2) self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterComboBox)
self.FontFooterColorLabel = QtGui.QLabel(self.FooterFontGroupBox_3) self.FontFooterColorLabel = QtGui.QLabel(self.FooterFontGroupBox)
self.FontFooterColorLabel.setObjectName("FontFooterColorLabel") self.FontFooterColorLabel.setObjectName("FontFooterColorLabel")
self.gridLayout_3.addWidget(self.FontFooterColorLabel, 1, 0, 1, 1) self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterColorLabel)
self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox_3) self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox)
self.FontFooterColorPushButton.setObjectName("FontFooterColorPushButton") self.FontFooterColorPushButton.setObjectName("FontFooterColorPushButton")
self.gridLayout_3.addWidget(self.FontFooterColorPushButton, 1, 2, 1, 1) self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterColorPushButton)
self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox_3) self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox)
self.FontFooterSizeLabel.setObjectName("FontFooterSizeLabel") self.FontFooterSizeLabel.setObjectName("FontFooterSizeLabel")
self.gridLayout_3.addWidget(self.FontFooterSizeLabel, 2, 0, 1, 1) self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterSizeLabel)
self.FontFooterSizeLineEdit = QtGui.QLineEdit(self.FooterFontGroupBox_3) self.FontFooterSizeSpinBox = QtGui.QSpinBox(self.FooterFontGroupBox)
self.FontFooterSizeLineEdit.setObjectName("FontFooterSizeLineEdit") sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
self.gridLayout_3.addWidget(self.FontFooterSizeLineEdit, 2, 1, 1, 1) sizePolicy.setHorizontalStretch(0)
self.FontFooterSlider = QtGui.QSlider(self.FooterFontGroupBox_3) sizePolicy.setVerticalStretch(0)
self.FontFooterSlider.setProperty("value", QtCore.QVariant(15)) sizePolicy.setHeightForWidth(self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth())
self.FontFooterSlider.setMaximum(40) self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy)
self.FontFooterSlider.setOrientation(QtCore.Qt.Horizontal) self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
self.FontFooterSlider.setTickPosition(QtGui.QSlider.TicksBelow) self.FontFooterSizeSpinBox.setProperty("value", QtCore.QVariant(10))
self.FontFooterSlider.setTickInterval(5) self.FontFooterSizeSpinBox.setMaximum(999)
self.FontFooterSlider.setObjectName("FontFooterSlider") self.FontFooterSizeSpinBox.setObjectName("FontFooterSizeSpinBox")
self.gridLayout_3.addWidget(self.FontFooterSlider, 2, 2, 1, 1) self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox)
self.tabWidget.addTab(self.FontFooterTab, "") self.FooterLeftLayout.addWidget(self.FooterFontGroupBox)
self.OptionsTab = QtGui.QWidget() spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.OptionsTab.setObjectName("OptionsTab") self.FooterLeftLayout.addItem(spacerItem3)
self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsTab) self.FontFooterLayout.addWidget(self.FooterLeftWidget)
self.ShadowGroupBox.setGeometry(QtCore.QRect(20, 10, 301, 80)) self.FooterRightWidget = QtGui.QWidget(self.FontFooterTab)
self.FooterRightWidget.setObjectName("FooterRightWidget")
self.FooterRightLayout = QtGui.QVBoxLayout(self.FooterRightWidget)
self.FooterRightLayout.setSpacing(8)
self.FooterRightLayout.setMargin(0)
self.FooterRightLayout.setObjectName("FooterRightLayout")
self.LocationFooterGroupBox = QtGui.QGroupBox(self.FooterRightWidget)
self.LocationFooterGroupBox.setObjectName("LocationFooterGroupBox")
self.LocationFooterLayout = QtGui.QFormLayout(self.LocationFooterGroupBox)
self.LocationFooterLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow)
self.LocationFooterLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.LocationFooterLayout.setMargin(8)
self.LocationFooterLayout.setSpacing(8)
self.LocationFooterLayout.setObjectName("LocationFooterLayout")
self.FontFooterDefaultLabel = QtGui.QLabel(self.LocationFooterGroupBox)
self.FontFooterDefaultLabel.setObjectName("FontFooterDefaultLabel")
self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterDefaultLabel)
self.FontFooterDefaultCheckBox = QtGui.QCheckBox(self.LocationFooterGroupBox)
self.FontFooterDefaultCheckBox.setTristate(False)
self.FontFooterDefaultCheckBox.setObjectName("FontFooterDefaultCheckBox")
self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterDefaultCheckBox)
self.FontFooterXLabel = QtGui.QLabel(self.LocationFooterGroupBox)
self.FontFooterXLabel.setObjectName("FontFooterXLabel")
self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterXLabel)
self.FontFooterYLabel = QtGui.QLabel(self.LocationFooterGroupBox)
self.FontFooterYLabel.setObjectName("FontFooterYLabel")
self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterYLabel)
self.FontFooterWidthLabel = QtGui.QLabel(self.LocationFooterGroupBox)
self.FontFooterWidthLabel.setObjectName("FontFooterWidthLabel")
self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWidthLabel)
self.FontFooterHeightLabel = QtGui.QLabel(self.LocationFooterGroupBox)
self.FontFooterHeightLabel.setObjectName("FontFooterHeightLabel")
self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontFooterHeightLabel)
self.FontFooterXSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth())
self.FontFooterXSpinBox.setSizePolicy(sizePolicy)
self.FontFooterXSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontFooterXSpinBox.setProperty("value", QtCore.QVariant(0))
self.FontFooterXSpinBox.setMaximum(9999)
self.FontFooterXSpinBox.setObjectName("FontFooterXSpinBox")
self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterXSpinBox)
self.FontFooterYSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth())
self.FontFooterYSpinBox.setSizePolicy(sizePolicy)
self.FontFooterYSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontFooterYSpinBox.setProperty("value", QtCore.QVariant(0))
self.FontFooterYSpinBox.setMaximum(9999)
self.FontFooterYSpinBox.setObjectName("FontFooterYSpinBox")
self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterYSpinBox)
self.FontFooterWidthSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
self.FontFooterWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontFooterWidthSpinBox.setMaximum(9999)
self.FontFooterWidthSpinBox.setObjectName("FontFooterWidthSpinBox")
self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthSpinBox)
self.FontFooterHeightSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
self.FontFooterHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontFooterHeightSpinBox.setMaximum(9999)
self.FontFooterHeightSpinBox.setObjectName("FontFooterHeightSpinBox")
self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontFooterHeightSpinBox)
self.FooterRightLayout.addWidget(self.LocationFooterGroupBox)
spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.FooterRightLayout.addItem(spacerItem4)
self.FontFooterLayout.addWidget(self.FooterRightWidget)
self.ThemeTabWidget.addTab(self.FontFooterTab, "")
self.OtherOptionsTab = QtGui.QWidget()
self.OtherOptionsTab.setObjectName("OtherOptionsTab")
self.OtherOptionsLayout = QtGui.QHBoxLayout(self.OtherOptionsTab)
self.OtherOptionsLayout.setSpacing(8)
self.OtherOptionsLayout.setMargin(8)
self.OtherOptionsLayout.setObjectName("OtherOptionsLayout")
self.OptionsLeftWidget = QtGui.QWidget(self.OtherOptionsTab)
self.OptionsLeftWidget.setObjectName("OptionsLeftWidget")
self.OptionsLeftLayout = QtGui.QVBoxLayout(self.OptionsLeftWidget)
self.OptionsLeftLayout.setSpacing(8)
self.OptionsLeftLayout.setMargin(0)
self.OptionsLeftLayout.setObjectName("OptionsLeftLayout")
self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsLeftWidget)
self.ShadowGroupBox.setObjectName("ShadowGroupBox") self.ShadowGroupBox.setObjectName("ShadowGroupBox")
self.layoutWidget2 = QtGui.QWidget(self.ShadowGroupBox) self.verticalLayout = QtGui.QVBoxLayout(self.ShadowGroupBox)
self.layoutWidget2.setGeometry(QtCore.QRect(10, 20, 281, 58)) self.verticalLayout.setSpacing(8)
self.layoutWidget2.setObjectName("layoutWidget2") self.verticalLayout.setMargin(8)
self.formLayout = QtGui.QFormLayout(self.layoutWidget2) self.verticalLayout.setObjectName("verticalLayout")
self.formLayout.setObjectName("formLayout") self.OutlineWidget = QtGui.QWidget(self.ShadowGroupBox)
self.ShadowCheckBox = QtGui.QCheckBox(self.layoutWidget2) self.OutlineWidget.setObjectName("OutlineWidget")
self.OutlineLayout = QtGui.QFormLayout(self.OutlineWidget)
self.OutlineLayout.setMargin(0)
self.OutlineLayout.setSpacing(8)
self.OutlineLayout.setObjectName("OutlineLayout")
self.OutlineCheckBox = QtGui.QCheckBox(self.OutlineWidget)
self.OutlineCheckBox.setObjectName("OutlineCheckBox")
self.OutlineLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.OutlineCheckBox)
self.OutlineColorLabel = QtGui.QLabel(self.OutlineWidget)
self.OutlineColorLabel.setObjectName("OutlineColorLabel")
self.OutlineLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel)
self.OutlineColorPushButton = QtGui.QPushButton(self.OutlineWidget)
self.OutlineColorPushButton.setObjectName("OutlineColorPushButton")
self.OutlineLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton)
self.OutlineEnabledLabel = QtGui.QLabel(self.OutlineWidget)
self.OutlineEnabledLabel.setObjectName("OutlineEnabledLabel")
self.OutlineLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.OutlineEnabledLabel)
self.verticalLayout.addWidget(self.OutlineWidget)
self.ShadowWidget = QtGui.QWidget(self.ShadowGroupBox)
self.ShadowWidget.setObjectName("ShadowWidget")
self.ShadowLayout = QtGui.QFormLayout(self.ShadowWidget)
self.ShadowLayout.setMargin(0)
self.ShadowLayout.setSpacing(8)
self.ShadowLayout.setObjectName("ShadowLayout")
self.ShadowCheckBox = QtGui.QCheckBox(self.ShadowWidget)
self.ShadowCheckBox.setObjectName("ShadowCheckBox") self.ShadowCheckBox.setObjectName("ShadowCheckBox")
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowCheckBox) self.ShadowLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.ShadowCheckBox)
self.ShadowColorLabel = QtGui.QLabel(self.layoutWidget2) self.ShadowColorLabel = QtGui.QLabel(self.ShadowWidget)
self.ShadowColorLabel.setObjectName("ShadowColorLabel") self.ShadowColorLabel.setObjectName("ShadowColorLabel")
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel) self.ShadowLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel)
self.ShadowColorPushButton = QtGui.QPushButton(self.layoutWidget2) self.ShadowColorPushButton = QtGui.QPushButton(self.ShadowWidget)
self.ShadowColorPushButton.setObjectName("ShadowColorPushButton") self.ShadowColorPushButton.setObjectName("ShadowColorPushButton")
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton) self.ShadowLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton)
self.AlignmentGroupBox = QtGui.QGroupBox(self.OptionsTab) self.ShadowEnabledLabel = QtGui.QLabel(self.ShadowWidget)
self.AlignmentGroupBox.setGeometry(QtCore.QRect(10, 200, 321, 161)) self.ShadowEnabledLabel.setObjectName("ShadowEnabledLabel")
self.ShadowLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowEnabledLabel)
self.verticalLayout.addWidget(self.ShadowWidget)
self.OptionsLeftLayout.addWidget(self.ShadowGroupBox)
spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.OptionsLeftLayout.addItem(spacerItem5)
self.OtherOptionsLayout.addWidget(self.OptionsLeftWidget)
self.OptionsRightWidget = QtGui.QWidget(self.OtherOptionsTab)
self.OptionsRightWidget.setObjectName("OptionsRightWidget")
self.OptionsRightLayout = QtGui.QVBoxLayout(self.OptionsRightWidget)
self.OptionsRightLayout.setSpacing(8)
self.OptionsRightLayout.setMargin(0)
self.OptionsRightLayout.setObjectName("OptionsRightLayout")
self.AlignmentGroupBox = QtGui.QGroupBox(self.OptionsRightWidget)
self.AlignmentGroupBox.setObjectName("AlignmentGroupBox") self.AlignmentGroupBox.setObjectName("AlignmentGroupBox")
self.gridLayout_4 = QtGui.QGridLayout(self.AlignmentGroupBox) self.gridLayout_4 = QtGui.QGridLayout(self.AlignmentGroupBox)
self.gridLayout_4.setObjectName("gridLayout_4") self.gridLayout_4.setObjectName("gridLayout_4")
@ -299,43 +443,82 @@ class Ui_AmendThemeDialog(object):
self.VerticalComboBox.addItem(QtCore.QString()) self.VerticalComboBox.addItem(QtCore.QString())
self.VerticalComboBox.addItem(QtCore.QString()) self.VerticalComboBox.addItem(QtCore.QString())
self.gridLayout_4.addWidget(self.VerticalComboBox, 1, 1, 1, 1) self.gridLayout_4.addWidget(self.VerticalComboBox, 1, 1, 1, 1)
self.OutlineGroupBox = QtGui.QGroupBox(self.OptionsTab) self.OptionsRightLayout.addWidget(self.AlignmentGroupBox)
self.OutlineGroupBox.setGeometry(QtCore.QRect(20, 110, 301, 80)) spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.OutlineGroupBox.setObjectName("OutlineGroupBox") self.OptionsRightLayout.addItem(spacerItem6)
self.layoutWidget_3 = QtGui.QWidget(self.OutlineGroupBox) self.OtherOptionsLayout.addWidget(self.OptionsRightWidget)
self.layoutWidget_3.setGeometry(QtCore.QRect(10, 20, 281, 58)) self.ThemeTabWidget.addTab(self.OtherOptionsTab, "")
self.layoutWidget_3.setObjectName("layoutWidget_3") self.ContentLayout.addWidget(self.ThemeTabWidget)
self.OutlineformLayout = QtGui.QFormLayout(self.layoutWidget_3) self.AmendThemeLayout.addWidget(self.ContentWidget)
self.OutlineformLayout.setObjectName("OutlineformLayout") self.PreviewGroupBox = QtGui.QGroupBox(AmendThemeDialog)
self.OutlineCheckBox = QtGui.QCheckBox(self.layoutWidget_3) self.PreviewGroupBox.setObjectName("PreviewGroupBox")
self.OutlineCheckBox.setObjectName("OutlineCheckBox") self.ThemePreviewLayout = QtGui.QHBoxLayout(self.PreviewGroupBox)
self.OutlineformLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.OutlineCheckBox) self.ThemePreviewLayout.setSpacing(8)
self.OutlineColorLabel = QtGui.QLabel(self.layoutWidget_3) self.ThemePreviewLayout.setMargin(8)
self.OutlineColorLabel.setObjectName("OutlineColorLabel") self.ThemePreviewLayout.setObjectName("ThemePreviewLayout")
self.OutlineformLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel) spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.OutlineColorPushButton = QtGui.QPushButton(self.layoutWidget_3) self.ThemePreviewLayout.addItem(spacerItem7)
self.OutlineColorPushButton.setObjectName("OutlineColorPushButton") self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox)
self.OutlineformLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
self.tabWidget.addTab(self.OptionsTab, "") sizePolicy.setHorizontalStretch(0)
self.horizontalLayout_2.addWidget(self.LeftSide) sizePolicy.setVerticalStretch(0)
self.RightSide = QtGui.QWidget(self.widget) sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth())
self.RightSide.setObjectName("RightSide") self.ThemePreview.setSizePolicy(sizePolicy)
self.ThemePreview = QtGui.QLabel(self.RightSide) self.ThemePreview.setMinimumSize(QtCore.QSize(300, 225))
self.ThemePreview.setGeometry(QtCore.QRect(20, 60, 311, 271)) self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel)
self.ThemePreview.setFrameShape(QtGui.QFrame.Box) self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken)
self.ThemePreview.setFrameShadow(QtGui.QFrame.Raised) self.ThemePreview.setLineWidth(1)
self.ThemePreview.setLineWidth(2)
self.ThemePreview.setScaledContents(True) self.ThemePreview.setScaledContents(True)
self.ThemePreview.setObjectName("ThemePreview") self.ThemePreview.setObjectName("ThemePreview")
self.horizontalLayout_2.addWidget(self.RightSide) self.ThemePreviewLayout.addWidget(self.ThemePreview)
spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.ThemePreviewLayout.addItem(spacerItem8)
self.AmendThemeLayout.addWidget(self.PreviewGroupBox)
self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog)
self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.ThemeButtonBox.setObjectName("ThemeButtonBox")
self.AmendThemeLayout.addWidget(self.ThemeButtonBox)
self.retranslateUi(AmendThemeDialog) self.retranslateUi(AmendThemeDialog)
self.tabWidget.setCurrentIndex(0) self.ThemeTabWidget.setCurrentIndex(0)
QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("accepted()"), AmendThemeDialog.accept)
QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("rejected()"), AmendThemeDialog.reject)
QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog) QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog)
AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit)
AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget)
AmendThemeDialog.setTabOrder(self.ThemeTabWidget, self.BackgroundComboBox)
AmendThemeDialog.setTabOrder(self.BackgroundComboBox, self.BackgroundTypeComboBox)
AmendThemeDialog.setTabOrder(self.BackgroundTypeComboBox, self.Color1PushButton)
AmendThemeDialog.setTabOrder(self.Color1PushButton, self.Color2PushButton)
AmendThemeDialog.setTabOrder(self.Color2PushButton, self.ImageLineEdit)
AmendThemeDialog.setTabOrder(self.ImageLineEdit, self.ImageToolButton)
AmendThemeDialog.setTabOrder(self.ImageToolButton, self.GradientComboBox)
AmendThemeDialog.setTabOrder(self.GradientComboBox, self.FontMainComboBox)
AmendThemeDialog.setTabOrder(self.FontMainComboBox, self.FontMainColorPushButton)
AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, self.FontMainSizeSpinBox)
AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainDefaultCheckBox)
AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, self.FontMainXSpinBox)
AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, self.FontMainYSpinBox)
AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, self.FontMainWidthSpinBox)
AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox, self.FontMainHeightSpinBox)
AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox, self.FontFooterComboBox)
AmendThemeDialog.setTabOrder(self.FontFooterComboBox, self.FontFooterColorPushButton)
AmendThemeDialog.setTabOrder(self.FontFooterColorPushButton, self.FontFooterSizeSpinBox)
AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterDefaultCheckBox)
AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox)
AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, self.FontFooterYSpinBox)
AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthSpinBox)
AmendThemeDialog.setTabOrder(self.FontFooterWidthSpinBox, self.FontFooterHeightSpinBox)
AmendThemeDialog.setTabOrder(self.FontFooterHeightSpinBox, self.OutlineCheckBox)
AmendThemeDialog.setTabOrder(self.OutlineCheckBox, self.OutlineColorPushButton)
AmendThemeDialog.setTabOrder(self.OutlineColorPushButton, self.ShadowCheckBox)
AmendThemeDialog.setTabOrder(self.ShadowCheckBox, self.ShadowColorPushButton)
AmendThemeDialog.setTabOrder(self.ShadowColorPushButton, self.HorizontalComboBox)
AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox)
def retranslateUi(self, AmendThemeDialog): def retranslateUi(self, AmendThemeDialog):
AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintance", None, QtGui.QApplication.UnicodeUTF8)) AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintance", None, QtGui.QApplication.UnicodeUTF8))
self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name", None, QtGui.QApplication.UnicodeUTF8)) self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name:", None, QtGui.QApplication.UnicodeUTF8))
self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8)) self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8))
self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8)) self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8))
self.BackgroundComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Transparent", None, QtGui.QApplication.UnicodeUTF8)) self.BackgroundComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Transparent", None, QtGui.QApplication.UnicodeUTF8))
@ -350,32 +533,44 @@ class Ui_AmendThemeDialog(object):
self.GradientComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Horizontal", None, QtGui.QApplication.UnicodeUTF8)) self.GradientComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Horizontal", None, QtGui.QApplication.UnicodeUTF8))
self.GradientComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Vertical", None, QtGui.QApplication.UnicodeUTF8)) self.GradientComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Vertical", None, QtGui.QApplication.UnicodeUTF8))
self.GradientComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Circular", None, QtGui.QApplication.UnicodeUTF8)) self.GradientComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Circular", None, QtGui.QApplication.UnicodeUTF8))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.BackgroundTab), QtGui.QApplication.translate("AmendThemeDialog", "Background", None, QtGui.QApplication.UnicodeUTF8)) self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.BackgroundTab), QtGui.QApplication.translate("AmendThemeDialog", "Background", None, QtGui.QApplication.UnicodeUTF8))
self.MainFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8))
self.MainFontlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8))
self.MainFontColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8))
self.MainFontSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8))
self.FooterFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8))
self.FontMainUseDefault.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use default location", None, QtGui.QApplication.UnicodeUTF8)) self.MainLocationGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8))
self.DefaultLocationLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Default Location:", None, QtGui.QApplication.UnicodeUTF8))
self.FontMainXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8))
self.FontMainYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8))
self.FontMainWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width:", None, QtGui.QApplication.UnicodeUTF8))
self.FontMainHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.FontMainTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Main", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
self.FooterFontGroupBox_2.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
self.FontMainUseDefault_2.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use default location", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
self.FontMainHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontMainTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Main", None, QtGui.QApplication.UnicodeUTF8))
self.FooterFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Footer Font", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterSizeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8))
self.LocationFooterGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterDefaultLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Default Location:", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterYLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Y Position:", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterWidthLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Width:", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8))
self.FooterFontGroupBox_3.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Footer Font", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
self.FontFooterSizeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.FontFooterTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Footer", None, QtGui.QApplication.UnicodeUTF8)) self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontFooterTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Footer", None, QtGui.QApplication.UnicodeUTF8))
self.ShadowGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Shadow", None, QtGui.QApplication.UnicodeUTF8)) self.ShadowGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Shadow && Outline", None, QtGui.QApplication.UnicodeUTF8))
self.ShadowCheckBox.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Shadow", None, QtGui.QApplication.UnicodeUTF8)) self.OutlineColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Outline Color:", None, QtGui.QApplication.UnicodeUTF8))
self.OutlineEnabledLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Show Outline:", None, QtGui.QApplication.UnicodeUTF8))
self.ShadowColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Shadow Color:", None, QtGui.QApplication.UnicodeUTF8)) self.ShadowColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Shadow Color:", None, QtGui.QApplication.UnicodeUTF8))
self.ShadowEnabledLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Show Shadow:", None, QtGui.QApplication.UnicodeUTF8))
self.AlignmentGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Alignment", None, QtGui.QApplication.UnicodeUTF8)) self.AlignmentGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Alignment", None, QtGui.QApplication.UnicodeUTF8))
self.HorizontalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Horizontal Align:", None, QtGui.QApplication.UnicodeUTF8)) self.HorizontalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Horizontal Align:", None, QtGui.QApplication.UnicodeUTF8))
self.HorizontalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Left", None, QtGui.QApplication.UnicodeUTF8)) self.HorizontalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Left", None, QtGui.QApplication.UnicodeUTF8))
@ -385,8 +580,6 @@ class Ui_AmendThemeDialog(object):
self.VerticalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Top", None, QtGui.QApplication.UnicodeUTF8)) self.VerticalComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Top", None, QtGui.QApplication.UnicodeUTF8))
self.VerticalComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Middle", None, QtGui.QApplication.UnicodeUTF8)) self.VerticalComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Middle", None, QtGui.QApplication.UnicodeUTF8))
self.VerticalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Bottom", None, QtGui.QApplication.UnicodeUTF8)) self.VerticalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Bottom", None, QtGui.QApplication.UnicodeUTF8))
self.OutlineGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Outline", None, QtGui.QApplication.UnicodeUTF8)) self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.OtherOptionsTab), QtGui.QApplication.translate("AmendThemeDialog", "Other Options", None, QtGui.QApplication.UnicodeUTF8))
self.OutlineCheckBox.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Outline", None, QtGui.QApplication.UnicodeUTF8)) self.PreviewGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Preview", None, QtGui.QApplication.UnicodeUTF8))
self.OutlineColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Outline Color:", None, QtGui.QApplication.UnicodeUTF8))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.OptionsTab), QtGui.QApplication.translate("AmendThemeDialog", "Alignment", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -23,8 +23,8 @@ import os, os.path
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import QColor, QFont from PyQt4.QtGui import QColor, QFont
from openlp.core.lib import ThemeXML from openlp.core.lib import ThemeXML
from openlp.core.lib import Renderer
from openlp.core import fileToXML from openlp.core import fileToXML
from openlp.core import Renderer
from openlp.core import translate from openlp.core import translate
from amendthemedialog import Ui_AmendThemeDialog from amendthemedialog import Ui_AmendThemeDialog
@ -33,23 +33,27 @@ log = logging.getLogger(u'AmendThemeForm')
class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
def __init__(self, parent=None): def __init__(self, thememanager, parent=None):
QtGui.QDialog.__init__(self, parent) QtGui.QDialog.__init__(self, parent)
self.thememanager = thememanager
self.theme = ThemeXML() # Needed here as UI setup generates Events
self.setupUi(self) self.setupUi(self)
#define signals #define signals
#Exits
QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("accepted()"), self.accept)
QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL("rejected()"), self.close)
#Buttons #Buttons
QtCore.QObject.connect(self.Color1PushButton , QtCore.QObject.connect(self.Color1PushButton ,
QtCore.SIGNAL("pressed()"), self.onColor1PushButtonClicked) QtCore.SIGNAL("pressed()"), self.onColor1PushButtonClicked)
QtCore.QObject.connect(self.Color2PushButton , QtCore.QObject.connect(self.Color2PushButton ,
QtCore.SIGNAL("pressed()"), self.onColor2PushButtonClicked) QtCore.SIGNAL("pressed()"), self.onColor2PushButtonClicked)
QtCore.QObject.connect(self.MainFontColorPushButton, QtCore.QObject.connect(self.FontMainColorPushButton,
QtCore.SIGNAL("pressed()"), self.onMainFontColorPushButtonClicked) QtCore.SIGNAL("pressed()"), self.onFontMainColorPushButtonClicked)
QtCore.QObject.connect(self.FontFooterColorPushButton, QtCore.QObject.connect(self.FontFooterColorPushButton,
QtCore.SIGNAL("pressed()"), self.onFontFooterColorPushButtonClicked) QtCore.SIGNAL("pressed()"), self.onFontFooterColorPushButtonClicked)
QtCore.QObject.connect(self.OutlineColorPushButton,
QtCore.SIGNAL("pressed()"), self.onOutlineColorPushButtonClicked)
QtCore.QObject.connect(self.ShadowColorPushButton,
QtCore.SIGNAL("pressed()"), self.onShadowColorPushButtonClicked)
#Combo boxes #Combo boxes
QtCore.QObject.connect(self.BackgroundComboBox, QtCore.QObject.connect(self.BackgroundComboBox,
QtCore.SIGNAL("activated(int)"), self.onBackgroundComboBoxSelected) QtCore.SIGNAL("activated(int)"), self.onBackgroundComboBoxSelected)
@ -57,16 +61,69 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
QtCore.SIGNAL("activated(int)"), self.onBackgroundTypeComboBoxSelected) QtCore.SIGNAL("activated(int)"), self.onBackgroundTypeComboBoxSelected)
QtCore.QObject.connect(self.GradientComboBox, QtCore.QObject.connect(self.GradientComboBox,
QtCore.SIGNAL("activated(int)"), self.onGradientComboBoxSelected) QtCore.SIGNAL("activated(int)"), self.onGradientComboBoxSelected)
QtCore.QObject.connect(self.FontMainComboBox,
QtCore.SIGNAL("activated(int)"), self.onFontMainComboBoxSelected)
QtCore.QObject.connect(self.FontFooterComboBox,
QtCore.SIGNAL("activated(int)"), self.onFontFooterComboBoxSelected)
QtCore.QObject.connect(self.HorizontalComboBox,
QtCore.SIGNAL("activated(int)"), self.onHorizontalComboBoxSelected)
QtCore.QObject.connect(self.VerticalComboBox,
QtCore.SIGNAL("activated(int)"), self.onVerticalComboBoxSelected)
QtCore.QObject.connect(self.FontMainSizeSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontMainSizeSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterSizeSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterSizeSpinBoxChanged)
QtCore.QObject.connect(self.FontMainDefaultCheckBox,
QtCore.SIGNAL("stateChanged(int)"), self.onFontMainDefaultCheckBoxChanged)
QtCore.QObject.connect(self.FontMainXSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontMainXSpinBoxChanged)
QtCore.QObject.connect(self.FontMainYSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontMainYSpinBoxChanged)
QtCore.QObject.connect(self.FontMainWidthSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontMainWidthSpinBoxChanged)
QtCore.QObject.connect(self.FontMainHeightSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontMainHeightSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterDefaultCheckBox,
QtCore.SIGNAL("stateChanged(int)"), self.onFontFooterDefaultCheckBoxChanged)
QtCore.QObject.connect(self.FontFooterXSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterXSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterYSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterYSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterWidthSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterWidthSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterHeightSpinBox,
QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterHeightSpinBoxChanged)
QtCore.QObject.connect(self.OutlineCheckBox,
QtCore.SIGNAL("stateChanged(int)"), self.onOutlineCheckBoxChanged)
QtCore.QObject.connect(self.ShadowCheckBox,
QtCore.SIGNAL("stateChanged(int)"), self.onShadowCheckBoxChanged)
def accept(self): def accept(self):
new_theme = ThemeXML()
theme_name = str(self.ThemeNameEdit.displayText())
new_theme.new_document(theme_name)
if self.theme.background_type == u'solid':
new_theme.add_background_solid(str(self.theme.background_color))
elif self.theme.theme.background_type == u'gradient':
new_theme.add_background_gradient(str(self.theme.background_startColor), str(self.theme.background_endColor), self.theme.background_direction)
#else:
#newtheme.add_background_image(str(self.theme.))
new_theme.add_font(str(self.theme.font_main_name), str(self.theme.font_main_color), str(self.theme.font_main_proportion), u'False')
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')
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),
str(self.theme.display_horizontalAlign), str(self.theme.display_verticalAlign), str(self.theme.display_wrapStyle))
theme = new_theme.extract_xml()
self.thememanager.saveTheme(theme_name, theme)
return QtGui.QDialog.accept(self) return QtGui.QDialog.accept(self)
def themePath(self, path): def themePath(self, path):
self.path = path self.path = path
def loadTheme(self, theme): def loadTheme(self, theme):
self.theme = ThemeXML()
if theme == None: if theme == None:
self.theme.parse(self.baseTheme()) self.theme.parse(self.baseTheme())
else: else:
@ -74,62 +131,69 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
xml = fileToXML(xml_file) xml = fileToXML(xml_file)
self.theme.parse(xml) self.theme.parse(xml)
self.paintUi(self.theme) self.paintUi(self.theme)
self.generateImage(self.theme) self.previewTheme(self.theme)
def onGradientComboBoxSelected(self): #
if self.GradientComboBox.currentIndex() == 0: # Horizontal #Main Font Tab
self.theme.background_direction = u'horizontal' #
elif self.GradientComboBox.currentIndex() == 1: # vertical def onFontMainComboBoxSelected(self):
self.theme.background_direction = u'vertical' self.theme.font_main_name = self.FontMainComboBox.currentFont().family()
else: self.previewTheme(self.theme)
self.theme.background_direction = u'circular'
self.stateChanging(self.theme)
self.generateImage(self.theme)
def onBackgroundComboBoxSelected(self): def onFontMainColorPushButtonClicked(self):
if self.BackgroundComboBox.currentIndex() == 0: # Opaque
self.theme.background_mode = u'opaque'
else:
self.theme.background_mode = u'transparent'
self.stateChanging(self.theme)
self.generateImage(self.theme)
def onBackgroundTypeComboBoxSelected(self):
if self.BackgroundTypeComboBox.currentIndex() == 0: # Solid
self.theme.background_type = u'solid'
elif self.BackgroundTypeComboBox.currentIndex() == 1: # Gradient
self.theme.background_type = u'gradient'
if self.theme.background_direction == None: # never defined
self.theme.background_direction = u'horizontal'
self.theme.background_color2 = u'#000000'
else:
self.theme.background_type = u'image'
self.stateChanging(self.theme)
self.generateImage(self.theme)
def onColor1PushButtonClicked(self):
self.theme.background_color1 = QtGui.QColorDialog.getColor(
QColor(self.theme.background_color1), self).name()
self.Color1PushButton.setStyleSheet(
'background-color: %s' % str(self.theme.background_color1))
self.generateImage(self.theme)
def onColor2PushButtonClicked(self):
self.theme.background_color2 = QtGui.QColorDialog.getColor(
QColor(self.theme.background_color2), self).name()
self.Color2PushButton.setStyleSheet(
'background-color: %s' % str(self.theme.background_color2))
self.generateImage(self.theme)
def onMainFontColorPushButtonClicked(self):
self.theme.font_main_color = QtGui.QColorDialog.getColor( self.theme.font_main_color = QtGui.QColorDialog.getColor(
QColor(self.theme.font_main_color), self).name() QColor(self.theme.font_main_color), self).name()
self.MainFontColorPushButton.setStyleSheet( self.FontMainColorPushButton.setStyleSheet(
'background-color: %s' % str(self.theme.font_main_color)) 'background-color: %s' % str(self.theme.font_main_color))
self.generateImage(self.theme) self.previewTheme(self.theme)
def onFontMainSizeSpinBoxChanged(self, value):
self.theme.font_main_proportion = value
self.previewTheme(self.theme)
def onFontMainDefaultCheckBoxChanged(self, value):
if value == 2: # checked
self.theme.font_main_override = False
else:
self.theme.font_main_override = True
if int(self.theme.font_main_x) == 0 and int(self.theme.font_main_y) == 0 and \
int(self.theme.font_main_width) == 0 and int(self.theme.font_main_height) == 0:
self.theme.font_main_x = u'10'
self.theme.font_main_y = u'10'
self.theme.font_main_width = u'1024'
self.theme.font_main_height = u'730'
self.FontMainXSpinBox.setValue(int(self.theme.font_main_x))
self.FontMainYSpinBox.setValue(int(self.theme.font_main_y))
self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width))
self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height))
self.stateChanging(self.theme)
self.previewTheme(self.theme)
def onFontMainXSpinBoxChanged(self, value):
self.theme.font_main_x = value
self.previewTheme(self.theme)
def onFontMainYSpinBoxChanged(self, value):
self.theme.font_main_y = value
self.previewTheme(self.theme)
def onFontMainWidthSpinBoxChanged(self, value):
self.theme.font_main_width = value
self.previewTheme(self.theme)
def onFontMainHeightSpinBoxChanged(self, value):
self.theme.font_main_height = value
self.previewTheme(self.theme)
#
#Footer Font Tab
#
def onFontFooterComboBoxSelected(self):
self.theme.font_footer_name = self.FontFooterComboBox.currentFont().family()
self.previewTheme(self.theme)
def onFontFooterColorPushButtonClicked(self): def onFontFooterColorPushButtonClicked(self):
self.theme.font_footer_color = QtGui.QColorDialog.getColor( self.theme.font_footer_color = QtGui.QColorDialog.getColor(
@ -137,15 +201,165 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.FontFooterColorPushButton.setStyleSheet( self.FontFooterColorPushButton.setStyleSheet(
'background-color: %s' % str(self.theme.font_footer_color)) 'background-color: %s' % str(self.theme.font_footer_color))
self.generateImage(self.theme) self.previewTheme(self.theme)
def onFontFooterSizeSpinBoxChanged(self, value):
self.theme.font_footer_proportion = value
self.previewTheme(self.theme)
def onFontFooterDefaultCheckBoxChanged(self):
self.stateChanging(self.theme)
self.previewTheme(self.theme)
def onFontFooterDefaultCheckBoxChanged(self, value):
if value == 2: # checked
self.theme.font_footer_override = False
else:
self.theme.font_footer_override = True
if int(self.theme.font_footer_x) == 0 and int(self.theme.font_footer_y) == 0 and \
int(self.theme.font_footer_width) == 0 and int(self.theme.font_footer_height) == 0:
self.theme.font_footer_x = u'10'
self.theme.font_footer_y = u'730'
self.theme.font_footer_width = u'1024'
self.theme.font_footer_height = u'38'
self.FontFooterXSpinBox.setValue(int(self.theme.font_footer_x))
self.FontFooterYSpinBox.setValue(int(self.theme.font_footer_y))
self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width))
self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))
self.stateChanging(self.theme)
self.previewTheme(self.theme)
def onFontFooterXSpinBoxChanged(self, value):
self.theme.font_footer_x = value
self.previewTheme(self.theme)
def onFontFooterYSpinBoxChanged(self, value):
self.theme.font_footer_y = value
self.previewTheme(self.theme)
def onFontFooterWidthSpinBoxChanged(self, value):
self.theme.font_footer_width = value
self.previewTheme(self.theme)
def onFontFooterHeightSpinBoxChanged(self, value):
self.theme.font_footer_height = value
self.previewTheme(self.theme)
#
#Background Tab
#
def onGradientComboBoxSelected(self, currentIndex):
self.setBackground(self.BackgroundTypeComboBox.currentIndex(), currentIndex)
def onBackgroundComboBoxSelected(self, currentIndex):
if currentIndex == 0: # Opaque
self.theme.background_mode = u'opaque'
else:
self.theme.background_mode = u'transparent'
self.stateChanging(self.theme)
self.previewTheme(self.theme)
def onBackgroundTypeComboBoxSelected(self, currentIndex):
self.setBackground(currentIndex, self.GradientComboBox.currentIndex())
def setBackground(self, background, gradient):
if background == 0: # Solid
self.theme.background_type = u'solid'
if self.theme.background_color is None :
self.theme.background_color = u'#000000'
elif background == 1: # Gradient
self.theme.background_type = u'gradient'
if gradient == 0: # Horizontal
self.theme.background_direction = u'horizontal'
elif gradient == 1: # vertical
self.theme.background_direction = u'vertical'
else:
self.theme.background_direction = u'circular'
if self.theme.background_startColor is None :
self.theme.background_startColor = u'#000000'
if self.theme.background_endColor is None :
self.theme.background_endColor = u'#ff0000'
else:
self.theme.background_type = u'image'
self.stateChanging(self.theme)
self.previewTheme(self.theme)
def onColor1PushButtonClicked(self):
if self.theme.background_type == u'solid':
self.theme.background_color = QtGui.QColorDialog.getColor(
QColor(self.theme.background_color), self).name()
self.Color1PushButton.setStyleSheet(
'background-color: %s' % str(self.theme.background_color))
else:
self.theme.background_startColor = QtGui.QColorDialog.getColor(
QColor(self.theme.background_startColor), self).name()
self.Color1PushButton.setStyleSheet(
'background-color: %s' % str(self.theme.background_startColor))
self.previewTheme(self.theme)
def onColor2PushButtonClicked(self):
self.theme.background_endColor = QtGui.QColorDialog.getColor(
QColor(self.theme.background_endColor), self).name()
self.Color2PushButton.setStyleSheet(
'background-color: %s' % str(self.theme.background_endColor))
self.previewTheme(self.theme)
#
#Other Tab
#
def onOutlineCheckBoxChanged(self, value):
if value == 2: # checked
self.theme.display_outline = True
else:
self.theme.display_outline = False
self.stateChanging(self.theme)
self.previewTheme(self.theme)
def onOutlineColorPushButtonClicked(self):
self.theme.display_outline_color = QtGui.QColorDialog.getColor(
QColor(self.theme.display_outline_color), self).name()
self.OutlineColorPushButton.setStyleSheet(
'background-color: %s' % str(self.theme.display_outline_color))
self.previewTheme(self.theme)
def onShadowCheckBoxChanged(self, value):
if value == 2: # checked
self.theme.display_shadow = True
else:
self.theme.display_shadow = False
self.stateChanging(self.theme)
self.previewTheme(self.theme)
def onShadowColorPushButtonClicked(self):
self.theme.display_shadow_color = QtGui.QColorDialog.getColor(
QColor(self.theme.display_shadow_color), self).name()
self.ShadowColorPushButton.setStyleSheet(
'background-color: %s' % str(self.theme.display_shadow_color))
self.previewTheme(self.theme)
def onHorizontalComboBoxSelected(self, currentIndex):
self.theme.display_horizontalAlign = currentIndex
self.stateChanging(self.theme)
self.previewTheme(self.theme)
def onVerticalComboBoxSelected(self, currentIndex):
self.theme.display_verticalAlign = currentIndex
self.stateChanging(self.theme)
self.previewTheme(self.theme)
#
#Local Methods
#
def baseTheme(self): def baseTheme(self):
log.debug(u'base Theme') log.debug(u'base Theme')
newtheme = ThemeXML() newtheme = ThemeXML()
newtheme.new_document(u'New Theme') newtheme.new_document(u'New Theme')
newtheme.add_background_solid(str(u'#000000')) newtheme.add_background_solid(str(u'#000000'))
newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), u'False') newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), False)
newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer') newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), False, u'footer')
newtheme.add_display(str(False), str(u'#FFFFFF'), str(False), str(u'#FFFFFF'), newtheme.add_display(str(False), str(u'#FFFFFF'), str(False), str(u'#FFFFFF'),
str(0), str(0), str(0)) str(0), str(0), str(0))
@ -154,76 +368,147 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
def paintUi(self, theme): def paintUi(self, theme):
print theme # leave as helpful for initial development print theme # leave as helpful for initial development
self.stateChanging(theme) self.stateChanging(theme)
self.BackgroundTypeComboBox.setCurrentIndex(0) self.ThemeNameEdit.setText(self.theme.theme_name)
if self.theme.background_mode == u'opaque':
self.BackgroundComboBox.setCurrentIndex(0) self.BackgroundComboBox.setCurrentIndex(0)
else:
self.BackgroundComboBox.setCurrentIndex(1)
if theme.background_type == u'solid':
self.BackgroundTypeComboBox.setCurrentIndex(0)
elif theme.background_type == u'gradient':
self.BackgroundTypeComboBox.setCurrentIndex(1)
else:
self.BackgroundTypeComboBox.setCurrentIndex(2)
if self.theme.background_direction == u'horizontal':
self.GradientComboBox.setCurrentIndex(0) self.GradientComboBox.setCurrentIndex(0)
self.MainFontColorPushButton.setStyleSheet( elif self.theme.background_direction == u'vertical':
self.GradientComboBox.setCurrentIndex(1)
else:
self.GradientComboBox.setCurrentIndex(2)
self.FontMainSizeSpinBox.setValue(int(self.theme.font_main_proportion))
self.FontMainXSpinBox.setValue(int(self.theme.font_main_x))
self.FontMainYSpinBox.setValue(int(self.theme.font_main_y))
self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width))
self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height))
self.FontFooterSizeSpinBox.setValue(int(self.theme.font_footer_proportion))
self.FontFooterXSpinBox.setValue(int(self.theme.font_footer_x))
self.FontFooterYSpinBox.setValue(int(self.theme.font_footer_y))
self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width))
self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))
self.FontMainColorPushButton.setStyleSheet(
'background-color: %s' % str(theme.font_main_color)) 'background-color: %s' % str(theme.font_main_color))
self.FontFooterColorPushButton.setStyleSheet( self.FontFooterColorPushButton.setStyleSheet(
'background-color: %s' % str(theme.font_footer_color)) 'background-color: %s' % str(theme.font_footer_color))
if self.theme.font_main_override == False:
self.FontMainDefaultCheckBox.setChecked(True)
else:
self.FontMainDefaultCheckBox.setChecked(False)
if self.theme.font_footer_override == False:
self.FontFooterDefaultCheckBox.setChecked(True)
else:
self.FontFooterDefaultCheckBox.setChecked(False)
self.OutlineColorPushButton.setStyleSheet(
'background-color: %s' % str(theme.display_outline_color))
self.ShadowColorPushButton.setStyleSheet(
'background-color: %s' % str(theme.display_shadow_color))
if self.theme.display_outline:
self.OutlineCheckBox.setChecked(True)
self.OutlineColorPushButton.setEnabled(True)
else:
self.OutlineCheckBox.setChecked(False)
self.OutlineColorPushButton.setEnabled(False)
if self.theme.display_shadow:
self.ShadowCheckBox.setChecked(True)
self.ShadowColorPushButton.setEnabled(True)
else:
self.ShadowCheckBox.setChecked(False)
self.ShadowColorPushButton.setEnabled(False)
self.HorizontalComboBox.setCurrentIndex(int(self.theme.display_horizontalAlign))
self.VerticalComboBox.setCurrentIndex(int(self.theme.display_verticalAlign))
def stateChanging(self, theme): def stateChanging(self, theme):
if theme.background_type == u'solid': if theme.background_type == u'solid':
self.Color1PushButton.setStyleSheet( self.Color1PushButton.setStyleSheet(
'background-color: %s' % str(theme.background_color1)) 'background-color: %s' % str(theme.background_color))
self.Color1Label.setText(translate(u'ThemeManager', u'Background Font:')) self.Color1Label.setText(translate(u'ThemeManager', u'Background Color:'))
self.Color1Label.setVisible(True) self.Color1Label.setVisible(True)
self.Color1PushButton.setVisible(True) self.Color1PushButton.setVisible(True)
self.Color2Label.setVisible(False) self.Color2Label.setVisible(False)
self.Color2PushButton.setVisible(False) self.Color2PushButton.setVisible(False)
self.ImageLabel.setVisible(False)
self.ImageLineEdit.setVisible(False)
self.ImageFilenameWidget.setVisible(False)
self.GradientLabel.setVisible(False)
self.GradientComboBox.setVisible(False)
elif theme.background_type == u'gradient': elif theme.background_type == u'gradient':
self.Color1PushButton.setStyleSheet( self.Color1PushButton.setStyleSheet(
'background-color: %s' % str(theme.background_color1)) 'background-color: %s' % str(theme.background_startColor))
self.Color2PushButton.setStyleSheet( self.Color2PushButton.setStyleSheet(
'background-color: %s' % str(theme.background_color2)) 'background-color: %s' % str(theme.background_endColor))
self.Color1Label.setText(translate(u'ThemeManager', u'First Color:')) self.Color1Label.setText(translate(u'ThemeManager', u'First Color:'))
self.Color2Label.setText(translate(u'ThemeManager', u'Second Color:')) self.Color2Label.setText(translate(u'ThemeManager', u'Second Color:'))
self.Color1Label.setVisible(True) self.Color1Label.setVisible(True)
self.Color1PushButton.setVisible(True) self.Color1PushButton.setVisible(True)
self.Color2Label.setVisible(True) self.Color2Label.setVisible(True)
self.Color2PushButton.setVisible(True) self.Color2PushButton.setVisible(True)
self.ImageLabel.setVisible(False)
self.ImageLineEdit.setVisible(False)
self.ImageFilenameWidget.setVisible(False)
self.GradientLabel.setVisible(True)
self.GradientComboBox.setVisible(True)
else: # must be image else: # must be image
self.Color1Label.setVisible(False) self.Color1Label.setVisible(False)
self.Color1PushButton.setVisible(False) self.Color1PushButton.setVisible(False)
self.Color2Label.setVisible(False) self.Color2Label.setVisible(False)
self.Color2PushButton.setVisible(False) self.Color2PushButton.setVisible(False)
self.ImageLabel.setVisible(True)
self.ImageLineEdit.setVisible(True)
self.ImageFilenameWidget.setVisible(True)
self.GradientLabel.setVisible(False)
self.GradientComboBox.setVisible(False)
def generateImage(self, theme): if theme.font_main_override == False:
log.debug(u'generateImage %s ', theme) self.FontMainXSpinBox.setEnabled(False)
#theme = ThemeXML() self.FontMainYSpinBox.setEnabled(False)
#theme.parse(theme_xml) self.FontMainWidthSpinBox.setEnabled(False)
#print theme self.FontMainHeightSpinBox.setEnabled(False)
size=QtCore.QSize(800,600) else:
frame=TstFrame(size) self.FontMainXSpinBox.setEnabled(True)
frame=frame self.FontMainYSpinBox.setEnabled(True)
paintdest=frame.GetPixmap() self.FontMainWidthSpinBox.setEnabled(True)
r=Renderer() self.FontMainHeightSpinBox.setEnabled(True)
r.set_paint_dest(paintdest)
r.set_theme(theme) # set default theme if theme.font_footer_override == False:
r._render_background() self.FontFooterXSpinBox.setEnabled(False)
r.set_text_rectangle(QtCore.QRect(0,0, size.width()-1, size.height()-1), QtCore.QRect(10,560, size.width()-1, size.height()-1)) self.FontFooterYSpinBox.setEnabled(False)
self.FontFooterWidthSpinBox.setEnabled(False)
self.FontFooterHeightSpinBox.setEnabled(False)
else:
self.FontFooterXSpinBox.setEnabled(True)
self.FontFooterYSpinBox.setEnabled(True)
self.FontFooterWidthSpinBox.setEnabled(True)
self.FontFooterHeightSpinBox.setEnabled(True)
lines=[] if self.theme.display_outline:
lines.append(u'Amazing Grace!') self.OutlineColorPushButton.setEnabled(True)
lines.append(u'How sweet the sound') else:
lines.append(u'To save a wretch like me;') self.OutlineColorPushButton.setEnabled(False)
lines.append(u'I once was lost but now am found,')
lines.append(u'Was blind, but now I see.')
lines1=[]
lines1.append(u'Amazing Grace (John Newton)' )
lines1.append(u'CCLI xxx (c)Openlp.org')
answer=r._render_lines(lines, lines1) if self.theme.display_shadow:
self.ShadowColorPushButton.setEnabled(True)
else:
self.ShadowColorPushButton.setEnabled(False)
self.ThemePreview.setPixmap(frame.GetPixmap())
class TstFrame: def previewTheme(self, theme):
def __init__(self, size): frame = self.thememanager.generateImage(theme)
"""Create the DemoPanel.""" self.ThemePreview.setPixmap(frame)
self.width=size.width();
self.height=size.height();
# create something to be painted into
self._Buffer = QtGui.QPixmap(self.width, self.height)
def GetPixmap(self):
return self._Buffer

View File

@ -28,7 +28,7 @@ from openlp.core.resources import *
from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \ from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \
SlideController, ServiceManager, ThemeManager SlideController, ServiceManager, ThemeManager
from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager, RenderManager
from openlp.core import PluginManager from openlp.core import PluginManager
@ -52,11 +52,17 @@ class MainWindow(object):
self.setupUi() self.setupUi()
#warning cyclic dependency
#RenderManager needs to call ThemeManager and
#ThemeManager needs to call RenderManager
self.RenderManager = RenderManager(self.ThemeManagerContents, self.screen_list)
log.info(u'Load Plugins') log.info(u'Load Plugins')
self.plugin_helpers[u'preview'] = self.PreviewController self.plugin_helpers[u'preview'] = self.PreviewController
self.plugin_helpers[u'live'] = self.LiveController self.plugin_helpers[u'live'] = self.LiveController
self.plugin_helpers[u'event'] = self.EventManager self.plugin_helpers[u'event'] = self.EventManager
self.plugin_helpers[u'theme'] = self.ThemeManagerContents # Theme manger self.plugin_helpers[u'theme'] = self.ThemeManagerContents # Theme manger
self.plugin_helpers[u'render'] = self.RenderManager
self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers, self.EventManager) self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers, self.EventManager)
# hook methods have to happen after find_plugins. Find plugins needs the controllers # hook methods have to happen after find_plugins. Find plugins needs the controllers
@ -84,6 +90,9 @@ class MainWindow(object):
# Once all components are initialised load the Themes # Once all components are initialised load the Themes
log.info(u'Load Themes') log.info(u'Load Themes')
self.ThemeManagerContents.setEventManager(self.EventManager) self.ThemeManagerContents.setEventManager(self.EventManager)
self.ThemeManagerContents.setRenderManager(self.RenderManager)
self.ServiceManagerContents.setRenderManager(self.RenderManager)
self.ThemeManagerContents.setServiceManager(self.ServiceManagerContents)
self.ThemeManagerContents.loadThemes() self.ThemeManagerContents.loadThemes()
def setupUi(self): def setupUi(self):

View File

@ -29,6 +29,7 @@ from PyQt4.QtGui import *
# from openlp.core.ui import AboutForm, AlertForm, SettingsForm, SlideController # from openlp.core.ui import AboutForm, AlertForm, SettingsForm, SlideController
from openlp.core.lib import OpenLPToolbar from openlp.core.lib import OpenLPToolbar
from openlp.core.lib import ServiceItem from openlp.core.lib import ServiceItem
from openlp.core.lib import RenderManager
# from openlp.core import PluginManager # from openlp.core import PluginManager
import logging import logging
@ -128,9 +129,6 @@ class ServiceManager(QWidget):
self.Toolbar.addSeparator() self.Toolbar.addSeparator()
self.ThemeComboBox = QtGui.QComboBox(self.Toolbar) self.ThemeComboBox = QtGui.QComboBox(self.Toolbar)
self.ThemeComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents) self.ThemeComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
self.ThemeComboBox.addItem(QtCore.QString())
self.ThemeComboBox.addItem(QtCore.QString())
self.ThemeComboBox.addItem(QtCore.QString())
self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar) self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
self.ThemeWidget.setDefaultWidget(self.ThemeComboBox) self.ThemeWidget.setDefaultWidget(self.ThemeComboBox)
self.Toolbar.addAction(self.ThemeWidget) self.Toolbar.addAction(self.ThemeWidget)
@ -141,6 +139,14 @@ class ServiceManager(QWidget):
self.service_data=ServiceData() self.service_data=ServiceData()
self.TreeView.setModel(self.service_data) self.TreeView.setModel(self.service_data)
self.Layout.addWidget(self.TreeView) self.Layout.addWidget(self.TreeView)
QtCore.QObject.connect(self.ThemeComboBox,
QtCore.SIGNAL("activated(int)"), self.onThemeComboBoxSelected)
def setRenderManager(self, renderManager):
self.renderManager = renderManager
def onThemeComboBoxSelected(self, currentIndex):
self.renderManager.set_default_theme(self.ThemeComboBox.currentText())
def addServiceItem(self, item): def addServiceItem(self, item):
"""Adds service item""" """Adds service item"""
@ -189,3 +195,10 @@ class ServiceManager(QWidget):
oosfile.write(self.oos_as_text) oosfile.write(self.oos_as_text)
oosfile.write("# END OOS\n") oosfile.write("# END OOS\n")
oosfile.close() oosfile.close()
def updateThemeList(self, theme_list):
self.ThemeComboBox.clear()
for theme in theme_list:
self.ThemeComboBox.addItem(theme)
self.renderManager.set_default_theme(self.ThemeComboBox.currentText())

View File

@ -3,7 +3,7 @@
""" """
OpenLP - Open Source Lyrics Projection OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -41,6 +41,23 @@ class SlideController(QtGui.QWidget):
self.Controller.setGeometry(QtCore.QRect(0, 0, 828, 536)) self.Controller.setGeometry(QtCore.QRect(0, 0, 828, 536))
self.Controller.setWidget(self.ControllerContents) self.Controller.setWidget(self.ControllerContents)
self.Screen = QtGui.QGraphicsView(self.Splitter) #self.Screen = QtGui.QGraphicsView(self.Splitter)
self.Screen.setMaximumSize(QtCore.QSize(16777215, 250)) #self.Screen.setMaximumSize(QtCore.QSize(16777215, 250))
self.ThemePreview = QtGui.QLabel(self.Splitter)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth())
self.ThemePreview.setSizePolicy(sizePolicy)
self.ThemePreview.setMinimumSize(QtCore.QSize(250, 190))
self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel)
self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken)
self.ThemePreview.setLineWidth(1)
self.ThemePreview.setScaledContents(True)
self.ThemePreview.setObjectName("ThemePreview")
def previewFrame(self, frame):
self.ThemePreview.setPixmap(frame)

View File

@ -20,12 +20,15 @@ Place, Suite 330, Boston, MA 02111-1307 USA
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.resources import * #from openlp.core.resources import *
from openlp.core import translate
class SplashScreen(object): class SplashScreen(object):
def __init__(self): def __init__(self, version):
self.splash_screen = QtGui.QSplashScreen() self.splash_screen = QtGui.QSplashScreen()
self.setupUi() self.setupUi()
starting = translate('SplashScreen',u'Starting')
self.message=starting+u'..... '+version
def setupUi(self): def setupUi(self):
self.splash_screen.setObjectName("splash_screen") self.splash_screen.setObjectName("splash_screen")
@ -60,7 +63,7 @@ class SplashScreen(object):
def show(self): def show(self):
self.splash_screen.show() self.splash_screen.show()
self.splash_screen.showMessage(u'Starting...', QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtCore.Qt.black) self.splash_screen.showMessage(self.message, QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtCore.Qt.black)
self.splash_screen.repaint() self.splash_screen.repaint()
def finish(self, widget): def finish(self, widget):

View File

@ -20,6 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
import os,os.path import os,os.path
import sys import sys
import zipfile import zipfile
import shutil
from time import sleep from time import sleep
from copy import deepcopy from copy import deepcopy
@ -30,17 +31,18 @@ from PyQt4.QtCore import *
from PyQt4.QtGui import * from PyQt4.QtGui import *
from openlp.core.ui import AmendThemeForm from openlp.core.ui import AmendThemeForm
from openlp.core.ui import ServiceManager
from openlp.core import translate from openlp.core import translate
from openlp.core import Renderer from openlp.core import fileToXML
from openlp.core.theme import Theme from openlp.core.theme import Theme
from openlp.core.lib import Event from openlp.core.lib import Event
from openlp.core.lib import EventType from openlp.core.lib import EventType
from openlp.core.lib import EventManager from openlp.core.lib import EventManager
from openlp.core.lib import OpenLPToolbar from openlp.core.lib import OpenLPToolbar
from openlp.core.lib import ThemeXML from openlp.core.lib import ThemeXML
from openlp.core.lib import Renderer
from openlp.core.utils import ConfigHelper from openlp.core.utils import ConfigHelper
import logging import logging
class ThemeData(QAbstractItemModel): class ThemeData(QAbstractItemModel):
@ -153,7 +155,7 @@ class ThemeManager(QWidget):
self.Layout = QtGui.QVBoxLayout(self) self.Layout = QtGui.QVBoxLayout(self)
self.Layout.setSpacing(0) self.Layout.setSpacing(0)
self.Layout.setMargin(0) self.Layout.setMargin(0)
self.amendThemeForm = AmendThemeForm() self.amendThemeForm = AmendThemeForm(self)
self.Toolbar = OpenLPToolbar(self) self.Toolbar = OpenLPToolbar(self)
self.Toolbar.addToolbarButton(translate('ThemeManager',u'New Theme'), ":/themes/theme_new.png", self.Toolbar.addToolbarButton(translate('ThemeManager',u'New Theme'), ":/themes/theme_new.png",
translate('ThemeManager',u'Allows a Theme to be created'), self.onAddTheme) translate('ThemeManager',u'Allows a Theme to be created'), self.onAddTheme)
@ -186,6 +188,12 @@ class ThemeManager(QWidget):
def setEventManager(self, eventManager): def setEventManager(self, eventManager):
self.eventManager = eventManager self.eventManager = eventManager
def setRenderManager(self, renderManager):
self.renderManager = renderManager
def setServiceManager(self, serviceManager):
self.serviceManager = serviceManager
def onAddTheme(self): def onAddTheme(self):
self.amendThemeForm.loadTheme(None) self.amendThemeForm.loadTheme(None)
self.amendThemeForm.exec_() self.amendThemeForm.exec_()
@ -198,7 +206,19 @@ class ThemeManager(QWidget):
self.amendThemeForm.exec_() self.amendThemeForm.exec_()
def onDeleteTheme(self): def onDeleteTheme(self):
pass items = self.ThemeListView.selectedIndexes()
theme = ''
for item in items:
data = self.Theme_data.getValue(item)
theme = data[3]
th = theme + u'.png'
try:
os.remove(os.path.join(self.path, th))
except:
pass #if not present do not worry
shutil.rmtree(os.path.join(self.path, theme))
self.Theme_data.clearItems()
self.loadThemes()
def onExportTheme(self): def onExportTheme(self):
pass pass
@ -224,18 +244,33 @@ class ThemeManager(QWidget):
self.Theme_data.addRow(os.path.join(self.path, name)) self.Theme_data.addRow(os.path.join(self.path, name))
self.eventManager.post_event(Event(EventType.ThemeListChanged)) self.eventManager.post_event(Event(EventType.ThemeListChanged))
self.serviceManager.updateThemeList(self.getThemes())
def getThemes(self): def getThemes(self):
return self.Theme_data.getList() return self.Theme_data.getList()
def getThemeData(self, themename):
xml_file = os.path.join(self.path, str(themename), str(themename)+u'.xml')
xml = fileToXML(xml_file)
theme = ThemeXML()
theme.parse(xml)
return theme
def checkThemesExists(self, dir): def checkThemesExists(self, dir):
log.debug(u'check themes') log.debug(u'check themes')
if os.path.exists(dir) == False: if os.path.exists(dir) == False:
os.mkdir(dir) os.mkdir(dir)
def unzipTheme(self, filename, dir): def unzipTheme(self, filename, dir):
"""
Unzip the theme , remove the preview file if stored
Generate a new preview fileCheck the XML theme version and upgrade if
necessary.
"""
log.debug(u'Unzipping theme %s', filename) log.debug(u'Unzipping theme %s', filename)
zip = zipfile.ZipFile(str(filename)) zip = zipfile.ZipFile(str(filename))
filexml = None
themename = None
for file in zip.namelist(): for file in zip.namelist():
if file.endswith('/'): if file.endswith('/'):
theme_dir = os.path.join(dir, file) theme_dir = os.path.join(dir, file)
@ -244,20 +279,23 @@ class ThemeManager(QWidget):
else: else:
fullpath = os.path.join(dir, file) fullpath = os.path.join(dir, file)
names = file.split(u'/') names = file.split(u'/')
if len(names) > 1: # not preview file
if themename is None:
themename = names[0]
xml_data = zip.read(file) xml_data = zip.read(file)
if os.path.splitext (file) [1].lower () in [u'.xml']: if os.path.splitext (file) [1].lower () in [u'.xml']:
if self.checkVersion1(xml_data): if self.checkVersion1(xml_data):
filexml = self.migrateVersion122(filename, fullpath, xml_data) filexml = self.migrateVersion122(filename, fullpath, xml_data) # upgrade theme xml
else:
filexml = xml_data
outfile = open(fullpath, 'w') outfile = open(fullpath, 'w')
outfile.write(filexml) outfile.write(filexml)
outfile.close() outfile.close()
self.generateImage(dir,names[0], filexml)
else: else:
if os.path.splitext (file) [1].lower () in [u'.bmp']:
if fullpath is not os.path.join(dir, file):
outfile = open(fullpath, 'w') outfile = open(fullpath, 'w')
outfile.write(zip.read(file)) outfile.write(zip.read(file))
outfile.close() outfile.close()
self.generateAndSaveImage(dir,themename, filexml)
def checkVersion1(self, xmlfile): def checkVersion1(self, xmlfile):
log.debug(u'checkVersion1 ') log.debug(u'checkVersion1 ')
@ -278,7 +316,7 @@ class ThemeManager(QWidget):
newtheme.add_background_solid(str(t.BackgroundParameter1.name())) newtheme.add_background_solid(str(t.BackgroundParameter1.name()))
elif t.BackgroundType == 1: elif t.BackgroundType == 1:
direction = "vertical" direction = "vertical"
if t.BackgroundParameter1.name() == 1: if t.BackgroundParameter3.name() == 1:
direction = "horizontal" direction = "horizontal"
newtheme.add_background_gradient(str(t.BackgroundParameter1.name()), str(t.BackgroundParameter2.name()), direction) newtheme.add_background_gradient(str(t.BackgroundParameter1.name()), str(t.BackgroundParameter2.name()), direction)
else: else:
@ -296,48 +334,37 @@ class ThemeManager(QWidget):
str(t.HorizontalAlign), str(t.VerticalAlign), str(t.WrapStyle)) str(t.HorizontalAlign), str(t.VerticalAlign), str(t.WrapStyle))
return newtheme.extract_xml() return newtheme.extract_xml()
def generateImage(self, dir, name, theme_xml): def saveTheme(self, name, theme_xml) :
log.debug(u'generateImage %s %s ', dir, theme_xml) log.debug(u'saveTheme %s %s', name, theme_xml)
self.generateAndSaveImage(self.path, name, theme_xml)
theme_dir = os.path.join(self.path, name)
if os.path.exists(theme_dir) == False:
os.mkdir(os.path.join(self.path, name))
theme_file = os.path.join(theme_dir, name+u'.xml')
outfile = open(theme_file, 'w')
outfile.write(theme_xml)
outfile.close()
self.Theme_data.clearItems()
self.loadThemes()
def generateAndSaveImage(self, dir, name, theme_xml):
log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml)
theme = ThemeXML() theme = ThemeXML()
theme.parse(theme_xml) theme.parse(theme_xml)
#print theme
size=QtCore.QSize(800,600)
frame=TstFrame(size)
frame=frame
paintdest=frame.GetPixmap()
r=Renderer()
r.set_paint_dest(paintdest)
r.set_theme(theme) # set default theme frame = self.generateImage(theme)
r._render_background()
r.set_text_rectangle(QtCore.QRect(0,0, size.width()-1, size.height()-1), QtCore.QRect(10,560, size.width()-1, size.height()-1))
lines=[] im=frame.toImage()
lines.append(u'Amazing Grace!') samplepathname=os.path.join(self.path, name+u'.png')
lines.append(u'How sweet the sound')
lines.append(u'To save a wretch like me;')
lines.append(u'I once was lost but now am found,')
lines.append(u'Was blind, but now I see.')
lines1=[]
lines1.append(u'Amazing Grace (John Newton)' )
lines1.append(u'CCLI xxx (c)Openlp.org')
answer=r._render_lines(lines, lines1)
im=frame.GetPixmap().toImage()
samplepathname=os.path.join(dir, name+u'.png')
if os.path.exists(samplepathname): if os.path.exists(samplepathname):
os.unlink(samplepathname) os.unlink(samplepathname)
im.save(samplepathname, u'png') im.save(samplepathname, u'png')
log.debug(u'Theme image written to %s',samplepathname) log.debug(u'Theme image written to %s',samplepathname)
def generateImage(self, theme):
log.debug(u'generateImage %s ', theme)
self.renderManager.set_theme(theme)
frame = self.renderManager.generate_preview()
return frame
class TstFrame:
def __init__(self, size):
"""Create the DemoPanel."""
self.width=size.width();
self.height=size.height();
# create something to be painted into
self._Buffer = QtGui.QPixmap(self.width, self.height)
def GetPixmap(self):
return self._Buffer

View File

@ -21,8 +21,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core import translate from openlp.core import translate
from openlp import convertStringToBoolean
from openlp.core.lib import SettingsTab from openlp.core.lib import SettingsTab
from openlp.core.resources import *
class BiblesTab(SettingsTab): class BiblesTab(SettingsTab):
""" """
@ -182,11 +182,11 @@ class BiblesTab(SettingsTab):
self.bible_search = True self.bible_search = True
def load(self): def load(self):
self.paragraph_style = self.convertStringToBoolean(self.config.get_config('paragraph style', u'True')) self.paragraph_style = convertStringToBoolean(self.config.get_config('paragraph style', u'True'))
self.show_new_chapters = self.convertStringToBoolean(self.config.get_config('display new chapter', u"False")) self.show_new_chapters = convertStringToBoolean(self.config.get_config('display new chapter', u"False"))
self.display_style = int(self.config.get_config('display brackets', '0')) self.display_style = int(self.config.get_config('display brackets', '0'))
self.bible_theme = int(self.config.get_config('bible theme', '0')) self.bible_theme = int(self.config.get_config('bible theme', '0'))
self.bible_search = self.convertStringToBoolean(self.config.get_config('search as type', u'True')) self.bible_search = convertStringToBoolean(self.config.get_config('search as type', u'True'))
if self.paragraph_style: if self.paragraph_style:
self.ParagraphRadioButton.setChecked(True) self.ParagraphRadioButton.setChecked(True)
else: else:

View File

@ -256,7 +256,7 @@ class BibleManager():
v = self.bible_db_cache[bible].get_bible_chapter(book.id, chapter) v = self.bible_db_cache[bible].get_bible_chapter(book.id, chapter)
if v == None: if v == None:
self.bible_db_cache[bible].create_chapter(book.id, \ self.bible_db_cache[bible].create_chapter(book.id, \
book_chapter, \ chapter, \
search_results.get_verselist()) search_results.get_verselist())
else: else:
log.debug("get_verse_text : old book") log.debug("get_verse_text : old book")

View File

@ -183,6 +183,7 @@ class BibleMediaItem(MediaManagerItem):
self.BibleListView.setAlternatingRowColors(True) self.BibleListView.setAlternatingRowColors(True)
self.BibleListData = TextListData() self.BibleListData = TextListData()
self.BibleListView.setModel(self.BibleListData) self.BibleListView.setModel(self.BibleListData)
self.BibleListView.setSelectionMode(2)
self.PageLayout.addWidget(self.BibleListView) self.PageLayout.addWidget(self.BibleListView)
@ -328,6 +329,8 @@ class BibleMediaItem(MediaManagerItem):
log.debug(u'Bible Preview Button pressed') log.debug(u'Bible Preview Button pressed')
items = self.BibleListView.selectedIndexes() items = self.BibleListView.selectedIndexes()
old_chapter = '' old_chapter = ''
main_lines=[]
footer_lines = []
for item in items: for item in items:
text = self.BibleListData.getValue(item) text = self.BibleListData.getValue(item)
verse = text[:text.find("(")] verse = text[:text.find("(")]
@ -348,15 +351,18 @@ class BibleMediaItem(MediaManagerItem):
else: else:
loc = self.formatVerse(old_chapter, chapter, verse, u'', u'') loc = self.formatVerse(old_chapter, chapter, verse, u'', u'')
old_chapter = chapter old_chapter = chapter
print book main_lines.append(loc + u' '+text)
print loc if len(footer_lines) <= 1:
print text footer_lines.append(book)
frame=self.parent.render_manager.generate_slide(main_lines, footer_lines)
self.parent.preview_controller.previewFrame(frame)
def formatVerse(self, old_chapter, chapter, verse, opening, closing): def formatVerse(self, old_chapter, chapter, verse, opening, closing):
loc = opening loc = opening
if old_chapter != chapter: if old_chapter != chapter:
loc += chapter + u':' loc += chapter + u':'
elif not self.parent.bibles_tab.new_chapter_check: elif not self.parent.bibles_tab.show_new_chapters:
loc += chapter + u':' loc += chapter + u':'
loc += verse loc += verse
loc += closing loc += closing

View File

@ -23,7 +23,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core import translate from openlp.core import translate
from openlp.core.lib import MediaManagerItem from openlp.core.lib import MediaManagerItem
from openlp.core.resources import * from openlp.core.lib import SongXMLParser
from openlp.plugins.custom.lib import TextListData from openlp.plugins.custom.lib import TextListData
@ -185,7 +185,25 @@ class CustomMediaItem(MediaManagerItem):
self.CustomListData.deleteRow(index) self.CustomListData.deleteRow(index)
def onCustomPreviewClick(self): def onCustomPreviewClick(self):
pass indexes = self.CustomListView.selectedIndexes()
main_lines=[]
footer_lines = []
slide = None
for index in indexes:
id = self.CustomListData.getId(index)
customSlide = self.parent.custommanager.get_custom(id)
title = customSlide.title
credit = customSlide.title
songXML=SongXMLParser(customSlide.text)
verseList = songXML.get_verses()
for verse in verseList:
slide = self.parent.render_manager.format_slide(verse[1], False)
footer_lines.append(title + u' '+ credit)
frame=self.parent.render_manager.generate_slide(slide, footer_lines)
self.parent.preview_controller.previewFrame(frame)
def onCustomLiveClick(self): def onCustomLiveClick(self):
pass pass

View File

@ -80,3 +80,7 @@ class FileListData(QAbstractListModel):
def getFilename(self, index): def getFilename(self, index):
row = index.row() row = index.row()
return self.items[row][0] return self.items[row][0]
def getValue(self, index):
row = index.row()
return self.items[row][0]

View File

@ -24,7 +24,6 @@ from PyQt4 import QtCore, QtGui
from openlp.core import translate from openlp.core import translate
from openlp.core.lib import MediaManagerItem from openlp.core.lib import MediaManagerItem
from openlp.core.resources import *
from openlp.plugins.videos.lib import VideoTab from openlp.plugins.videos.lib import VideoTab
from openlp.plugins.videos.lib import FileListData from openlp.plugins.videos.lib import FileListData
@ -123,7 +122,11 @@ class VideoMediaItem(MediaManagerItem):
self.parent.config.set_list(u'videos', self.VideoListData.getFileList()) self.parent.config.set_list(u'videos', self.VideoListData.getFileList())
def onVideoPreviewClick(self): def onVideoPreviewClick(self):
pass log.debug(u'Video Preview Button pressed')
items = self.VideoListView.selectedIndexes()
for item in items:
text = self.VideoListData.getValue(item)
print text
def onVideoLiveClick(self): def onVideoLiveClick(self):
pass pass

View File

@ -21,8 +21,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core import translate from openlp.core import translate
from openlp import convertStringToBoolean
from openlp.core.lib import SettingsTab from openlp.core.lib import SettingsTab
from openlp.core.resources import *
class VideoTab(SettingsTab): class VideoTab(SettingsTab):
""" """
@ -71,7 +71,7 @@ class VideoTab(SettingsTab):
self.use_vmr_mode = True self.use_vmr_mode = True
def load(self): def load(self):
self.use_vmr_mode = self.convertStringToBoolean(self.config.get_config(u'use mode layout', u'False')) self.use_vmr_mode = convertStringToBoolean(self.config.get_config(u'use mode layout', u'False'))
if self.use_vmr_mode : if self.use_vmr_mode :
self.UseVMRCheckBox.setChecked(True) self.UseVMRCheckBox.setChecked(True)

File diff suppressed because it is too large Load Diff