openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00109
[Merge] lp:~trb143/openlp/songs into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/songs into lp:openlp.
Requested reviews:
openlp.org Core (openlp-core)
Mass Unicode conversion
Bug fixing afterwards
--
https://code.launchpad.net/~trb143/openlp/songs/+merge/7514
Your team openlp.org Core is subscribed to branch lp:openlp.
=== modified file 'demo.py'
--- demo.py 2008-10-23 19:50:52 +0000
+++ demo.py 2009-06-16 18:21:24 +0000
@@ -40,7 +40,7 @@
self.size=(1024,768)
self.v=0
- self._font=QtGui.QFont('Decorative', 32)
+ self._font=QtGui.QFont(u'Decorative', 32)
self.framecount=0
self.totaltime = 0
self.dir=1
@@ -49,7 +49,7 @@
self.frame=QtGui.QFrame()
self.setCentralWidget(self.frame)
self.r=Renderer()
- self.r.set_theme(Theme('demo_theme.xml'))
+ self.r.set_theme(Theme(u'demo_theme.xml'))
self.r.set_text_rectangle(self.frame.frameRect())
self.r.set_paint_dest(self)
@@ -79,4 +79,3 @@
if __name__=="__main__":
t=Demo()
-
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py 2009-05-22 18:30:25 +0000
+++ openlp/core/lib/__init__.py 2009-06-16 18:21:24 +0000
@@ -49,7 +49,7 @@
"""
action = QtGui.QAction(text, base)
action .setIcon(buildIcon(icon))
- QtCore.QObject.connect(action, QtCore.SIGNAL("triggered()"), slot)
+ QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), slot)
return action
def contextMenuSeparator(base):
@@ -75,11 +75,4 @@
from renderer import Renderer
from rendermanager import RenderManager
-#__all__ = ['Renderer','PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType'
-# 'XmlRootClass', 'ServiceItem', 'Receiver', 'OpenLPToolbar', 'SongXMLBuilder',
-# 'SongXMLParser', 'EventManager', 'ThemeXML', 'RenderManager']
-
__all__ = [ 'translate', 'file_to_xml', 'str_to_bool', 'contextMenuAction', 'contextMenuSeparator']
-
-
-
=== modified file 'openlp/core/lib/eventreceiver.py'
--- openlp/core/lib/eventreceiver.py 2009-06-05 05:13:34 +0000
+++ openlp/core/lib/eventreceiver.py 2009-06-16 18:21:24 +0000
@@ -41,10 +41,10 @@
As there is only one instance of it in the systems the QT signal/slot architecture
can send messages across the system
Send message
- Receiver().send_message("messageid",data)
+ Receiver().send_message(u'messageid",data)
Receive Message
- QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL("openlprepaint"),<<ACTION>>)
+ QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL(u'openlprepaint'),<<ACTION>>)
"""
eventreceiver = EventReceiver()
@@ -58,4 +58,4 @@
@staticmethod
def get_receiver():
- return Receiver.eventreceiver
+ return Receiver.eventreceiver
\ No newline at end of file
=== modified file 'openlp/core/lib/pluginconfig.py'
--- openlp/core/lib/pluginconfig.py 2009-06-05 18:53:50 +0000
+++ openlp/core/lib/pluginconfig.py 2009-06-16 18:21:24 +0000
@@ -64,7 +64,7 @@
return self.set_config(u'data path', os.path.basename(path))
def get_files(self, suffix=None):
- #suffix = self.get_config("suffix name", default_suffixes)
+ #suffix = self.get_config(u'suffix name", default_suffixes)
try:
files = os.listdir(self.get_data_path())
except:
@@ -97,7 +97,7 @@
list = []
if list_count > 0:
for counter in range(0 , list_count):
- item = str(self.get_config(u'%s %d' % (name, counter)))
+ item = unicode(self.get_config(u'%s %d' % (name, counter)))
list.append(item)
return list
@@ -136,4 +136,4 @@
name = u'last directory %d' % num
else:
name = u'last directory'
- self.set_config(name, directory)
+ self.set_config(name, directory)
\ No newline at end of file
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py 2009-05-20 20:17:20 +0000
+++ openlp/core/lib/pluginmanager.py 2009-06-16 18:21:24 +0000
@@ -39,7 +39,7 @@
"""
log.info(u'Plugin manager initing')
if not dir in sys.path:
- log.debug("Inserting %s into sys.path", dir)
+ log.debug(u'Inserting %s into sys.path', dir)
sys.path.insert(0, dir)
self.basepath = os.path.abspath(dir)
log.debug(u'Base path %s ', self.basepath)
@@ -53,7 +53,7 @@
"""
self.plugin_helpers = plugin_helpers
startdepth = len(os.path.abspath(dir).split(os.sep))
- log.debug(u'find plugins %s at depth %d' %( str(dir), startdepth))
+ log.debug(u'find plugins %s at depth %d' %( unicode(dir), startdepth))
for root, dirs, files in os.walk(dir):
for name in files:
@@ -80,14 +80,14 @@
for p in self.plugin_classes:
try:
plugin = p(self.plugin_helpers)
- log.debug(u'loaded plugin %s with helpers'%str(p))
- log.debug(u'Plugin: %s', str(p))
+ log.debug(u'loaded plugin %s with helpers'%unicode(p))
+ log.debug(u'Plugin: %s', unicode(p))
if plugin.check_pre_conditions():
- log.debug(u'Appending %s ', str(p))
+ log.debug(u'Appending %s ', unicode(p))
plugin_objects.append(plugin)
eventmanager.register(plugin)
except TypeError:
- log.error(u'loaded plugin %s has no helpers'%str(p))
+ log.error(u'loaded plugin %s has no helpers'%unicode(p))
self.plugins = sorted(plugin_objects, self.order_by_weight)
def order_by_weight(self, x, y):
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py 2009-06-10 16:20:57 +0000
+++ openlp/core/lib/renderer.py 2009-06-16 18:21:24 +0000
@@ -67,7 +67,7 @@
def set_bg_image(self, filename):
log.debug(u'set bg image %s', filename)
- self._bg_image_filename = str(filename)
+ self._bg_image_filename = unicode(filename)
if self._frame is not None:
self.scale_bg_image()
@@ -447,4 +447,4 @@
im.save(u'renderer.png', u'png')
if image2 is not None:
im = image2.toImage()
- im.save(u'renderer2.png', u'png')
+ im.save(u'renderer2.png', u'png')
\ No newline at end of file
=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py 2009-06-10 15:54:46 +0000
+++ openlp/core/lib/rendermanager.py 2009-06-16 18:21:24 +0000
@@ -35,12 +35,12 @@
if event == "line":
lineno = frame.f_lineno
filename = frame.f_globals["__file__"]
- if (filename.endswith(".pyc") or
- filename.endswith(".pyo")):
+ if (filename.endswith(u'.pyc') or
+ filename.endswith(u'.pyo')):
filename = filename[:-1]
name = frame.f_globals["__name__"]
line = linecache.getline(filename, lineno)
- if name.startswith("openlp"):
+ if name.startswith(u'openlp'):
print "%s:%s: %s" % (name, lineno, line.rstrip())
return traceit
@@ -163,4 +163,4 @@
self.width = 1024
self.height = 768
log.debug(u'calculate default %d,%d' , self.width, self.height)
- self.footer_start = int(self.height*0.90) # 90% is start of footer
+ self.footer_start = int(self.height*0.90) # 90% is start of footer
\ No newline at end of file
=== modified file 'openlp/core/lib/songxmlhandler.py'
--- openlp/core/lib/songxmlhandler.py 2009-04-30 21:02:28 +0000
+++ openlp/core/lib/songxmlhandler.py 2009-06-16 18:21:24 +0000
@@ -66,7 +66,7 @@
def dump_xml(self):
# Debugging aid to see what we have
- print self.song_xml.toprettyxml(indent=" ")
+ print self.song_xml.toprettyxml(indent=u' ')
def extract_xml(self):
# Print our newly created XML
=== modified file 'openlp/core/lib/toolbar.py'
--- openlp/core/lib/toolbar.py 2009-05-01 22:26:43 +0000
+++ openlp/core/lib/toolbar.py 2009-06-16 18:21:24 +0000
@@ -54,12 +54,12 @@
if tooltip is not None:
ToolbarButton.setToolTip(tooltip)
if slot is not None:
- QtCore.QObject.connect(ToolbarButton, QtCore.SIGNAL('triggered()'), slot)
+ QtCore.QObject.connect(ToolbarButton, QtCore.SIGNAL(u'triggered()'), slot)
self.icons[title] = ButtonIcon
def getIconFromTitle(self, title):
if self.icons.has_key(title):
return self.icons[title]
else:
- self.log.error("getIconFromTitle - no icon for %s" % title)
+ self.log.error(u'getIconFromTitle - no icon for %s' % title)
return QtGui.QIcon()
=== modified file 'openlp/core/test/test_mediamanageritem.py'
--- openlp/core/test/test_mediamanageritem.py 2009-03-12 20:19:24 +0000
+++ openlp/core/test/test_mediamanageritem.py 2009-06-16 18:21:24 +0000
@@ -8,13 +8,13 @@
console=logging.StreamHandler()
# set a format which is simpler for console use
-formatter = logging.Formatter('%(name)24s: %(levelname)-8s %(message)s')
+formatter = logging.Formatter(u'%(name)24s: %(levelname)-8s %(message)s')
# tell the handler to use this format
console.setFormatter(formatter)
-logging.getLogger('').addHandler(console)
-log=logging.getLogger('')
+logging.getLogger(u'').addHandler(console)
+log=logging.getLogger(u'')
-logging.info("Logging started")
+logging.info(u'Logging started')
import os, sys
mypath=os.path.split(os.path.abspath(__file__))[0]
@@ -23,7 +23,7 @@
class TestMediaManager:
def setup_class(self):
self.app = QtGui.QApplication([])
- logging.info ("App is " + str(self.app))
+ logging.info (u'App is " + unicode(self.app))
self.main_window = QtGui.QMainWindow()
self.main_window.resize(200, 600)
self.MediaManagerDock = QtGui.QDockWidget(self.main_window)
@@ -33,7 +33,7 @@
sizePolicy.setHeightForWidth(self.MediaManagerDock.sizePolicy().hasHeightForWidth())
self.MediaManagerDock.setSizePolicy(sizePolicy)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/system/system_mediamanager.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap(u':/system/system_mediamanager.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MediaManagerDock.setWindowIcon(icon)
self.MediaManagerDock.setFloating(False)
self.MediaManagerContents = QtGui.QWidget()
@@ -49,26 +49,26 @@
self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock)
self.MediaManagerLayout.addWidget(self.MediaToolBox)
def test1(self):
- log=logging.getLogger("test1")
- log.info("Start")
+ log=logging.getLogger(u'test1')
+ log.info(u'Start')
i1=MediaManagerItem(self.MediaToolBox)
i2=MediaManagerItem(self.MediaToolBox)
- log.info("i1"+str(i1))
- log.info("i2"+str(i2))
+ log.info(u'i1"+unicode(i1))
+ log.info(u'i2"+unicode(i2))
i1.addToolbar()
- i1.addToolbarButton("Test1", "Test1", None)
+ i1.addToolbarButton(u'Test1", u'Test1", None)
i2.addToolbar()
- i2.addToolbarButton("Test2", "Test2", None)
- self.MediaToolBox.setItemText(self.MediaToolBox.indexOf(i1), QtGui.QApplication.translate("main_window", "Item1", None, QtGui.QApplication.UnicodeUTF8))
- self.MediaToolBox.setItemText(self.MediaToolBox.indexOf(i2), QtGui.QApplication.translate("main_window", "Item2", None, QtGui.QApplication.UnicodeUTF8))
- log.info("Show window")
+ i2.addToolbarButton(u'Test2", u'Test2", None)
+ self.MediaToolBox.setItemText(self.MediaToolBox.indexOf(i1), translate(u'main_window", u'Item1"))
+ self.MediaToolBox.setItemText(self.MediaToolBox.indexOf(i2), translate(u'main_window", u'Item2"))
+ log.info(u'Show window')
self.main_window.show()
- log.info("End")
+ log.info(u'End')
return 1
if __name__=="__main__":
t=TestMediaManager()
t.setup_class()
t.test1()
- log.info("exec")
- sys.exit(t.app.exec_())
+ log.info(u'exec')
+ sys.exit(t.app.exec_())
\ No newline at end of file
=== modified file 'openlp/core/test/test_plugin_manager.py'
--- openlp/core/test/test_plugin_manager.py 2009-04-20 18:22:42 +0000
+++ openlp/core/test/test_plugin_manager.py 2009-06-16 18:21:24 +0000
@@ -10,13 +10,13 @@
console=logging.StreamHandler()
# set a format which is simpler for console use
-formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
+formatter = logging.Formatter(u'%(name)-12s: %(levelname)-8s %(message)s')
# tell the handler to use this format
console.setFormatter(formatter)
-logging.getLogger('').addHandler(console)
-log=logging.getLogger('')
+logging.getLogger(u'').addHandler(console)
+log=logging.getLogger(u'')
-logging.info("Logging started")
+logging.info(u'Logging started')
mypath=os.path.split(os.path.abspath(__file__))[0]
sys.path.insert(0,(os.path.join(mypath, '..' ,'..', '..')))
@@ -24,24 +24,24 @@
# test the plugin manager with some plugins in the test_plugins directory
class TestPluginManager:
def test_init(self):
- self.p=PluginManager("./testplugins")
+ self.p=PluginManager(u'./testplugins')
p=self.p
- p.find_plugins('./testplugins', None, None)
+ p.find_plugins(u'./testplugins', None, None)
assert (len(p.plugins)==2);
# get list of the names of the plugins
names=[plugin.name for plugin in p.plugins]
# see which ones we've got
- assert ("testplugin1" in names)
- assert ("testplugin2" in names)
+ assert (u'testplugin1" in names)
+ assert (u'testplugin2" in names)
# and not got - it's too deep in the hierarchy!
- assert ("testplugin3" not in names)
+ assert (u'testplugin3" not in names)
# test that the weighting is done right
assert p.plugins[0].name=="testplugin2"
assert p.plugins[1].name=="testplugin1"
if __name__=="__main__":
- log.debug("Starting")
+ log.debug(u'Starting')
t=TestPluginManager()
t.test_init()
- log.debug("List of plugins found:")
+ log.debug(u'List of plugins found:')
for plugin in t.p.plugins:
- log.debug("Plugin %s, name=%s (version=%d)"%(str(plugin), plugin.name, plugin.version))
+ log.debug(u'Plugin %s, name=%s (version=%d)"%(unicode(plugin), plugin.name, plugin.version))
\ No newline at end of file
=== modified file 'openlp/core/test/test_render.py'
--- openlp/core/test/test_render.py 2009-03-29 14:38:23 +0000
+++ openlp/core/test/test_render.py 2009-06-16 18:21:24 +0000
@@ -45,15 +45,15 @@
class TestRender_base:
def __init__(self):
- if not os.path.exists("test_results"):
- os.mkdir("test_results")
+ if not os.path.exists(u'test_results'):
+ os.mkdir(u'test_results')
self.app=None
def write_to_file(self, pixmap, name):
im=pixmap.toImage()
- testpathname=os.path.join("test_results", name+".bmp")
+ testpathname=os.path.join(u'test_results", name+".bmp')
if os.path.exists(testpathname):
os.unlink(testpathname)
- im.save(testpathname, "bmp")
+ im.save(testpathname, "bmp')
return im
# xxx quitting the app still leaves it hanging aroudn so we die
# when trying to start another one. Not quitting doesn't help
@@ -84,7 +84,7 @@
def setup_method(self, method):
print "SSsetup", method
- if not hasattr(self, "app"):
+ if not hasattr(self, "app'):
self.app=None
try: # see if we already have an app for some reason.
# have to try and so something, cant just test against None
@@ -109,7 +109,7 @@
print "--------------- Setup Done -------------"
def teardown_method(self, method):
- self.write_to_file(self.frame.GetPixmap(), "test_render")
+ self.write_to_file(self.frame.GetPixmap(), "test_render')
class TestRender(TestRender_base):
def __init__(self):
@@ -118,29 +118,29 @@
def setup_method(self, method):
TestRender_base.setup_method(self, method)
self.r.set_debug(1)
- themefile=os.path.abspath("data_for_tests/render_theme.xml")
+ themefile=os.path.abspath(u'data_for_tests/render_theme.xml')
self.r.set_theme(Theme(themefile)) # set default theme
self.r._render_background()
self.r.set_text_rectangle(QtCore.QRect(0,0, self.size.width()-1, self.size.height()-1))
self.msg=None
def test_easy(self):
- answer=self.r._render_single_line("Test line", tlcorner=(0,100))
+ answer=self.r._render_single_line(u'Test line", tlcorner=(0,100))
assert (answer==(219,163))
def test_longer(self):
- answer=self.r._render_single_line("Test line with more words than fit on one line",
+ answer=self.r._render_single_line(u'Test line with more words than fit on one line",
tlcorner=(10,10))
assert (answer==(753,136))
def test_even_longer(self):
- answer=self.r._render_single_line("Test line with more words than fit on either one or two lines",
+ answer=self.r._render_single_line(u'Test line with more words than fit on either one or two lines",
tlcorner=(10,10))
assert(answer==(753,199))
def test_lines(self):
lines=[]
- lines.append("Line One")
- lines.append("Line Two")
- lines.append("Line Three and should be long enough to wrap")
- lines.append("Line Four and should be long enough to wrap also")
+ lines.append(u'Line One')
+ lines.append(u'Line Two')
+ lines.append(u'Line Three and should be long enough to wrap')
+ lines.append(u'Line Four and should be long enough to wrap also')
answer=self.r._render_lines(lines)
assert(answer==QtCore.QRect(0,0,741,378))
@@ -187,7 +187,7 @@
extra=""
if i == 51: # make an extra long line on line 51 to test wrapping
extra="Some more words to make it wrap around don't you know until it wraps so many times we don't know what to do"
- lines.append("Line %d %s" % (i, extra))
+ lines.append(u'Line %d %s" % (i, extra))
result=self.r.split_set_of_lines(lines)
print "results---------------__", result
for i in range(len(result)):
@@ -218,5 +218,4 @@
t.setup_method(None)
t.test_easy()
t.test_splits()
- t.teardown_method(None)
-
+ t.teardown_method(None)
\ No newline at end of file
=== modified file 'openlp/core/test/test_render_theme.py'
--- openlp/core/test/test_render_theme.py 2009-03-12 20:19:24 +0000
+++ openlp/core/test/test_render_theme.py 2009-06-16 18:21:24 +0000
@@ -57,7 +57,7 @@
TestRender_base.setup_method(self, method)
print "Theme setup", method
# print "setup theme"
- self.r.set_theme(Theme('blank_theme.xml')) # set "blank" theme
+ self.r.set_theme(Theme(u'blank_theme.xml')) # set "blank" theme
self.r.set_text_rectangle(QtCore.QRect(0,0, self.size.width(), self.size.height()))
words="""How sweet the name of Jesus sounds
In a believer's ear!
@@ -87,7 +87,7 @@
p=self.frame.GetPixmap()
im=self.write_to_file(p, name)
print "Compare"
- goldenfilename=os.path.join("golden_bitmaps",name+".bmp")
+ goldenfilename=os.path.join(u'golden_bitmaps",name+".bmp')
if os.path.exists(goldenfilename):
goldenim=QtGui.QImage(goldenfilename)
else:
@@ -129,9 +129,9 @@
# }}}
# {{{ backgrounds
def test_bg_stretch_y(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 2
- t.BackgroundParameter1 = os.path.join('data_for_tests', "snowsmall.jpg");
+ t.BackgroundParameter1 = os.path.join(u'data_for_tests', "snowsmall.jpg');
t.BackgroundParameter2 = QtGui.QColor(0,0,64);
t.BackgroundParameter3 = 0
t.Name="stretch y"
@@ -142,9 +142,9 @@
self.bmpname=whoami()
print "fone"
def test_bg_shrink_y(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 2
- t.BackgroundParameter1 = os.path.join('data_for_tests', "snowbig.jpg");
+ t.BackgroundParameter1 = os.path.join(u'data_for_tests', "snowbig.jpg');
t.BackgroundParameter2 = QtGui.QColor(0,0,64);
t.BackgroundParameter3 = 0
t.Name="shrink y"
@@ -153,9 +153,9 @@
self.bmpname=whoami()
def test_bg_stretch_x(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 2
- t.BackgroundParameter1 = os.path.join('data_for_tests', "treessmall.jpg");
+ t.BackgroundParameter1 = os.path.join(u'data_for_tests', "treessmall.jpg');
t.BackgroundParameter2 = QtGui.QColor(0,0,64);
t.BackgroundParameter3 = 0
t.VerticalAlign = 2
@@ -166,9 +166,9 @@
self.bmpname=whoami()
def test_bg_shrink_x(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 2
- t.BackgroundParameter1 = os.path.join('data_for_tests', "treesbig.jpg");
+ t.BackgroundParameter1 = os.path.join(u'data_for_tests', "treesbig.jpg');
t.BackgroundParameter2 = QtGui.QColor(0,0,64);
t.BackgroundParameter3 = 0
t.VerticalAlign = 2
@@ -180,7 +180,7 @@
# }}}
# {{{ Vertical alignment
def test_theme_vertical_align_top(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 0
t.BackgroundParameter1 = QtGui.QColor(0,0,64);
t.VerticalAlign = 0
@@ -190,7 +190,7 @@
self.bmpname=whoami()
def test_theme_vertical_align_bot(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 0
t.BackgroundParameter1 = QtGui.QColor(0,0,64);
t.VerticalAlign = 1
@@ -201,7 +201,7 @@
self.bmpname=whoami()
def test_theme_vertical_align_cen(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 0
t.BackgroundParameter1 = QtGui.QColor(0,0,64);
t.VerticalAlign = 2
@@ -213,7 +213,7 @@
# }}}
# {{{ Horzontal alignment
def test_theme_horizontal_align_left(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 0
t.BackgroundParameter1 = QtGui.QColor(0,0,64);
t.VerticalAlign = 0
@@ -224,7 +224,7 @@
self.bmpname=whoami()
def test_theme_horizontal_align_right(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 0
t.BackgroundParameter1 = QtGui.QColor(0,0,64);
t.VerticalAlign = 0
@@ -236,7 +236,7 @@
self.bmpname=whoami()
def test_theme_horizontal_align_centre(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 0
t.BackgroundParameter1 = QtGui.QColor(0,0,64);
t.VerticalAlign = 0
@@ -248,7 +248,7 @@
self.bmpname=whoami()
def test_theme_horizontal_align_left_lyric(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 0
t.BackgroundParameter1 = QtGui.QColor(0,0,64);
t.VerticalAlign = 0
@@ -263,7 +263,7 @@
# }}}
# {{{ Shadows and outlines
def test_theme_shadow_outline(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 0
t.BackgroundParameter1 = QtGui.QColor(0,0,0);
@@ -282,7 +282,7 @@
self.bmpname=whoami()
# }}}
def test_theme_font(self):
- t=Theme('blank_theme.xml')
+ t=Theme(u'blank_theme.xml')
t.BackgroundType = 0
t.BackgroundParameter1 = QtGui.QColor(0,0,64);
t.Name="font"
@@ -298,4 +298,4 @@
t.setup_class()
t.setup_method(None)
t.test_bg_stretch_y()
- t.teardown_method(None)
+ t.teardown_method(None)
\ No newline at end of file
=== modified file 'openlp/core/test/testplugins/deeper/toodeep/plugin3toodeep.py'
--- openlp/core/test/testplugins/deeper/toodeep/plugin3toodeep.py 2009-01-20 21:20:05 +0000
+++ openlp/core/test/testplugins/deeper/toodeep/plugin3toodeep.py 2009-06-16 18:21:24 +0000
@@ -5,9 +5,9 @@
name="testplugin3"
version=0
global log
- log=logging.getLogger("testplugin1")
- log.info("Started")
+ log=logging.getLogger(u'testplugin1')
+ log.info(u'Started')
weight=10
def __init__(self):
pass
-
+
\ No newline at end of file
=== modified file 'openlp/core/test/testplugins/testplugin1.py'
--- openlp/core/test/testplugins/testplugin1.py 2009-01-20 21:20:05 +0000
+++ openlp/core/test/testplugins/testplugin1.py 2009-06-16 18:21:24 +0000
@@ -5,9 +5,9 @@
name="testplugin1"
version=0
global log
- log=logging.getLogger("testplugin1")
- log.info("Started")
+ log=logging.getLogger(u'testplugin1')
+ log.info(u'Started')
weight=10
def __init__(self):
pass
-
+
\ No newline at end of file
=== modified file 'openlp/core/theme/test/test_theme.py'
--- openlp/core/theme/test/test_theme.py 2009-03-12 20:19:24 +0000
+++ openlp/core/theme/test/test_theme.py 2009-06-16 18:21:24 +0000
@@ -11,18 +11,18 @@
def test_read_theme():
dir=os.path.split(__file__)[0]
# test we can read a theme
- t=Theme(os.path.join(dir, "test_theme.xml"))
+ t=Theme(os.path.join(dir, "test_theme.xml'))
print t
- assert(t.BackgroundParameter1 == "sunset1.jpg")
+ assert(t.BackgroundParameter1 == "sunset1.jpg')
assert(t.BackgroundParameter2 == None)
assert(t.BackgroundParameter3 == None)
assert(t.BackgroundType == 2)
assert(t.FontColor == QtGui.QColor(255,255,255))
- assert(t.FontName == "Tahoma")
+ assert(t.FontName == "Tahoma')
assert(t.FontProportion == 16)
- assert(t.FontUnits == "pixels")
+ assert(t.FontUnits == "pixels')
assert(t.HorizontalAlign == 2)
- assert(t.Name == "openlp.org Packaged Theme")
+ assert(t.Name == "openlp.org Packaged Theme')
assert(t.Outline == -1)
assert(t.OutlineColor == QtGui.QColor(255,0,0))
assert(t.Shadow == -1)
@@ -37,11 +37,11 @@
assert(t.BackgroundParameter3 == None)
assert(t.BackgroundType == 0)
assert(t.FontColor == QtGui.QColor(255,255,255))
- assert(t.FontName == "Arial")
+ assert(t.FontName == "Arial')
assert(t.FontProportion == 30)
assert(t.HorizontalAlign == 0)
- assert(t.FontUnits == "pixels")
- assert(t.Name == "BlankStyle")
+ assert(t.FontUnits == "pixels')
+ assert(t.Name == "BlankStyle')
assert(t.Outline == 0)
assert(t.Shadow == 0)
assert(t.VerticalAlign == 0)
@@ -52,4 +52,4 @@
if __name__=="__main__":
test_read_theme()
- test_theme()
+ test_theme()
\ No newline at end of file
=== modified file 'openlp/core/theme/theme.py'
--- openlp/core/theme/theme.py 2009-04-06 18:45:45 +0000
+++ openlp/core/theme/theme.py 2009-06-16 18:21:24 +0000
@@ -96,7 +96,7 @@
# print element.tag, t, type(t)
if type(t) == type(None): # easy!
val=t
- if type(t) == type(" "): # strings need special handling to sort the colours out
+ if type(t) == type(u' '): # strings need special handling to sort the colours out
# print "str",
if t[0] == "$": # might be a hex number
# print "hex",
@@ -113,8 +113,8 @@
val=int(t)
except ValueError:
val=t
- if (element.tag.find("Color") > 0 or
- (element.tag.find("BackgroundParameter") == 0 and type(val) == type(0))):
+ if (element.tag.find(u'Color') > 0 or
+ (element.tag.find(u'BackgroundParameter') == 0 and type(val) == type(0))):
# convert to a wx.Colour
val= QtGui.QColor((val>>16) & 0xFF, (val>>8)&0xFF, val&0xFF)
# print [val]
@@ -126,5 +126,4 @@
for k in dir(self):
if k[0:1] != "_":
s+= "%30s : %s\n" %(k,getattr(self,k))
- return s
-
+ return s
\ No newline at end of file
=== modified file 'openlp/core/ui/alertform.py'
--- openlp/core/ui/alertform.py 2009-06-01 17:50:37 +0000
+++ openlp/core/ui/alertform.py 2009-06-16 18:21:24 +0000
@@ -18,7 +18,6 @@
Place, Suite 330, Boston, MA 02111-1307 USA
"""
import logging
-
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
@@ -33,22 +32,22 @@
log.debug(u'Defined')
def setupUi(self, AlertForm):
- AlertForm.setObjectName("AlertForm")
+ AlertForm.setObjectName(u'AlertForm')
AlertForm.resize(370, 110)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
AlertForm.setWindowIcon(icon)
self.AlertFormLayout = QtGui.QVBoxLayout(AlertForm)
self.AlertFormLayout.setSpacing(8)
self.AlertFormLayout.setMargin(8)
- self.AlertFormLayout.setObjectName("AlertFormLayout")
+ self.AlertFormLayout.setObjectName(u'AlertFormLayout')
self.AlertEntryWidget = QtGui.QWidget(AlertForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AlertEntryWidget.sizePolicy().hasHeightForWidth())
self.AlertEntryWidget.setSizePolicy(sizePolicy)
- self.AlertEntryWidget.setObjectName("AlertEntryWidget")
+ self.AlertEntryWidget.setObjectName(u'AlertEntryWidget')
self.AlertEntryLabel = QtGui.QLabel(self.AlertEntryWidget)
self.AlertEntryLabel.setGeometry(QtCore.QRect(0, 0, 353, 16))
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
@@ -56,10 +55,10 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AlertEntryLabel.sizePolicy().hasHeightForWidth())
self.AlertEntryLabel.setSizePolicy(sizePolicy)
- self.AlertEntryLabel.setObjectName("AlertEntryLabel")
+ self.AlertEntryLabel.setObjectName(u'AlertEntryLabel')
self.AlertEntryEditItem = QtGui.QLineEdit(self.AlertEntryWidget)
self.AlertEntryEditItem.setGeometry(QtCore.QRect(0, 20, 353, 26))
- self.AlertEntryEditItem.setObjectName("AlertEntryEditItem")
+ self.AlertEntryEditItem.setObjectName(u'AlertEntryEditItem')
self.AlertFormLayout.addWidget(self.AlertEntryWidget)
self.ButtonBoxWidget = QtGui.QWidget(AlertForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
@@ -67,32 +66,32 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ButtonBoxWidget.sizePolicy().hasHeightForWidth())
self.ButtonBoxWidget.setSizePolicy(sizePolicy)
- self.ButtonBoxWidget.setObjectName("ButtonBoxWidget")
+ self.ButtonBoxWidget.setObjectName(u'ButtonBoxWidget')
self.horizontalLayout = QtGui.QHBoxLayout(self.ButtonBoxWidget)
self.horizontalLayout.setSpacing(8)
self.horizontalLayout.setMargin(0)
- self.horizontalLayout.setObjectName("horizontalLayout")
+ self.horizontalLayout.setObjectName(u'horizontalLayout')
spacerItem = QtGui.QSpacerItem(267, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.DisplayButton = QtGui.QPushButton(self.ButtonBoxWidget)
- self.DisplayButton.setObjectName("DisplayButton")
+ self.DisplayButton.setObjectName(u'DisplayButton')
self.horizontalLayout.addWidget(self.DisplayButton)
self.CancelButton = QtGui.QPushButton(self.ButtonBoxWidget)
- self.CancelButton.setObjectName("CancelButton")
+ self.CancelButton.setObjectName(u'CancelButton')
self.horizontalLayout.addWidget(self.CancelButton)
self.AlertFormLayout.addWidget(self.ButtonBoxWidget)
self.retranslateUi(AlertForm)
- QtCore.QObject.connect(self.CancelButton, QtCore.SIGNAL("clicked()"), AlertForm.close)
- QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL("clicked()"), self.onDisplayClicked)
+ QtCore.QObject.connect(self.CancelButton, QtCore.SIGNAL(u'clicked()'), AlertForm.close)
+ QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL(u'clicked()'), self.onDisplayClicked)
QtCore.QMetaObject.connectSlotsByName(AlertForm)
def retranslateUi(self, AlertForm):
- AlertForm.setWindowTitle(translate("AlertForm", u'Alert Message'))
- self.AlertEntryLabel.setText(translate("AlertForm", u'Alert Text:'))
- self.DisplayButton.setText(translate("AlertForm", u'Display'))
- self.CancelButton.setText(translate("AlertForm", u'Cancel'))
+ AlertForm.setWindowTitle(translate(u'AlertForm', u'Alert Message'))
+ self.AlertEntryLabel.setText(translate(u'AlertForm', u'Alert Text:'))
+ self.DisplayButton.setText(translate(u'AlertForm', u'Display'))
+ self.CancelButton.setText(translate(u'AlertForm', u'Cancel'))
def load_settings(self):
pass
=== modified file 'openlp/core/ui/alertstab.py'
--- openlp/core/ui/alertstab.py 2009-06-05 18:53:50 +0000
+++ openlp/core/ui/alertstab.py 2009-06-16 18:21:24 +0000
@@ -65,7 +65,7 @@
self.FontColorLabel.setObjectName(u'FontColorLabel')
self.ColorLayout.addWidget(self.FontColorLabel)
self.FontColorButton = QtGui.QPushButton(self.ColorWidget)
- self.FontColorButton.setObjectName("FontColorButton")
+ self.FontColorButton.setObjectName(u'FontColorButton')
self.ColorLayout.addWidget(self.FontColorButton)
self.ColorSpacerItem = QtGui.QSpacerItem(40, 20,
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
@@ -74,7 +74,7 @@
self.BackgroundColorLabel.setObjectName(u'BackgroundColorLabel')
self.ColorLayout.addWidget(self.BackgroundColorLabel)
self.BackgroundColorButton = QtGui.QPushButton(self.ColorWidget)
- self.BackgroundColorButton.setObjectName("BackgroundColorButton")
+ self.BackgroundColorButton.setObjectName(u'BackgroundColorButton')
self.ColorLayout.addWidget(self.BackgroundColorButton)
self.FontLayout.addWidget(self.ColorWidget)
self.TimeoutWidget = QtGui.QWidget(self.FontGroupBox)
@@ -170,9 +170,9 @@
def load(self):
self.timeout = int(self.config.get_config(u'timeout', 5))
- self.font_color = str(self.config.get_config(u'font color', u'#ffffff'))
- self.bg_color = str(self.config.get_config(u'background color', u'#660000'))
- self.font_face = str(self.config.get_config(u'font face', QtGui.QFont().family()))
+ self.font_color = unicode(self.config.get_config(u'font color', u'#ffffff'))
+ self.bg_color = unicode(self.config.get_config(u'background color', u'#660000'))
+ self.font_face = unicode(self.config.get_config(u'font face', QtGui.QFont().family()))
self.TimeoutSpinBox.setValue(self.timeout)
self.FontColorButton.setStyleSheet(u'background-color: %s' % self.font_color)
self.BackgroundColorButton.setStyleSheet(u'background-color: %s' % self.bg_color)
@@ -183,10 +183,10 @@
def save(self):
self.font_face = self.FontComboBox.currentFont().family()
- self.config.set_config(u'background color', str(self.bg_color))
- self.config.set_config(u'font color', str(self.font_color))
- self.config.set_config(u'font face', str(self.font_face))
- self.config.set_config(u'timeout', str(self.timeout))
+ self.config.set_config(u'background color', unicode(self.bg_color))
+ self.config.set_config(u'font color', unicode(self.font_color))
+ self.config.set_config(u'font face', unicode(self.font_face))
+ self.config.set_config(u'timeout', unicode(self.timeout))
def updateDisplay(self):
font = QtGui.QFont()
@@ -195,4 +195,4 @@
font.setPointSize(16)
self.FontPreview.setFont(font)
self.FontPreview.setStyleSheet(
- u'background-color: %s; color: %s' % (self.bg_color, self.font_color))
+ u'background-color: %s; color: %s' % (self.bg_color, self.font_color))
\ No newline at end of file
=== modified file 'openlp/core/ui/amendthemedialog.py'
--- openlp/core/ui/amendthemedialog.py 2009-05-22 18:30:25 +0000
+++ openlp/core/ui/amendthemedialog.py 2009-06-16 18:21:24 +0000
@@ -1,147 +1,158 @@
# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'amendthemedialog.ui'
-#
-# Created: Tue Apr 21 06:06:56 2009
-# by: PyQt4 UI code generator 4.4.4
-#
-# WARNING! All changes made in this file will be lost!
-
+# 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-2009 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
+"""
from PyQt4 import QtCore, QtGui
+from openlp.core.lib import translate
class Ui_AmendThemeDialog(object):
def setupUi(self, AmendThemeDialog):
- AmendThemeDialog.setObjectName("AmendThemeDialog")
+ AmendThemeDialog.setObjectName(u'AmendThemeDialog')
AmendThemeDialog.setWindowModality(QtCore.Qt.ApplicationModal)
AmendThemeDialog.resize(586, 651)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
AmendThemeDialog.setWindowIcon(icon)
AmendThemeDialog.setModal(True)
self.AmendThemeLayout = QtGui.QVBoxLayout(AmendThemeDialog)
self.AmendThemeLayout.setSpacing(8)
self.AmendThemeLayout.setMargin(8)
- self.AmendThemeLayout.setObjectName("AmendThemeLayout")
+ self.AmendThemeLayout.setObjectName(u'AmendThemeLayout')
self.ThemeNameWidget = QtGui.QWidget(AmendThemeDialog)
- self.ThemeNameWidget.setObjectName("ThemeNameWidget")
+ self.ThemeNameWidget.setObjectName(u'ThemeNameWidget')
self.ThemeNameLayout = QtGui.QHBoxLayout(self.ThemeNameWidget)
self.ThemeNameLayout.setSpacing(8)
self.ThemeNameLayout.setMargin(0)
- self.ThemeNameLayout.setObjectName("ThemeNameLayout")
+ self.ThemeNameLayout.setObjectName(u'ThemeNameLayout')
self.ThemeNameLabel = QtGui.QLabel(self.ThemeNameWidget)
- self.ThemeNameLabel.setObjectName("ThemeNameLabel")
+ self.ThemeNameLabel.setObjectName(u'ThemeNameLabel')
self.ThemeNameLayout.addWidget(self.ThemeNameLabel)
self.ThemeNameEdit = QtGui.QLineEdit(self.ThemeNameWidget)
- self.ThemeNameEdit.setObjectName("ThemeNameEdit")
+ self.ThemeNameEdit.setObjectName(u'ThemeNameEdit')
self.ThemeNameLayout.addWidget(self.ThemeNameEdit)
self.AmendThemeLayout.addWidget(self.ThemeNameWidget)
self.ContentWidget = QtGui.QWidget(AmendThemeDialog)
- self.ContentWidget.setObjectName("ContentWidget")
+ self.ContentWidget.setObjectName(u'ContentWidget')
self.ContentLayout = QtGui.QHBoxLayout(self.ContentWidget)
self.ContentLayout.setSpacing(8)
self.ContentLayout.setMargin(0)
- self.ContentLayout.setObjectName("ContentLayout")
+ self.ContentLayout.setObjectName(u'ContentLayout')
self.ThemeTabWidget = QtGui.QTabWidget(self.ContentWidget)
- self.ThemeTabWidget.setObjectName("ThemeTabWidget")
+ self.ThemeTabWidget.setObjectName(u'ThemeTabWidget')
self.BackgroundTab = QtGui.QWidget()
- self.BackgroundTab.setObjectName("BackgroundTab")
+ self.BackgroundTab.setObjectName(u'BackgroundTab')
self.BackgroundLayout = QtGui.QFormLayout(self.BackgroundTab)
self.BackgroundLayout.setMargin(8)
self.BackgroundLayout.setSpacing(8)
- self.BackgroundLayout.setObjectName("BackgroundLayout")
+ self.BackgroundLayout.setObjectName(u'BackgroundLayout')
self.BackgroundLabel = QtGui.QLabel(self.BackgroundTab)
- self.BackgroundLabel.setObjectName("BackgroundLabel")
+ self.BackgroundLabel.setObjectName(u'BackgroundLabel')
self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.BackgroundLabel)
self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab)
- self.BackgroundComboBox.setObjectName("BackgroundComboBox")
+ self.BackgroundComboBox.setObjectName(u'BackgroundComboBox')
self.BackgroundComboBox.addItem(QtCore.QString())
self.BackgroundComboBox.addItem(QtCore.QString())
self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.BackgroundComboBox)
self.BackgroundTypeLabel = QtGui.QLabel(self.BackgroundTab)
- self.BackgroundTypeLabel.setObjectName("BackgroundTypeLabel")
+ self.BackgroundTypeLabel.setObjectName(u'BackgroundTypeLabel')
self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.BackgroundTypeLabel)
self.BackgroundTypeComboBox = QtGui.QComboBox(self.BackgroundTab)
- self.BackgroundTypeComboBox.setObjectName("BackgroundTypeComboBox")
+ self.BackgroundTypeComboBox.setObjectName(u'BackgroundTypeComboBox')
self.BackgroundTypeComboBox.addItem(QtCore.QString())
self.BackgroundTypeComboBox.addItem(QtCore.QString())
self.BackgroundTypeComboBox.addItem(QtCore.QString())
self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.BackgroundTypeComboBox)
self.Color1Label = QtGui.QLabel(self.BackgroundTab)
- self.Color1Label.setObjectName("Color1Label")
+ self.Color1Label.setObjectName(u'Color1Label')
self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.Color1Label)
self.Color1PushButton = QtGui.QPushButton(self.BackgroundTab)
- self.Color1PushButton.setObjectName("Color1PushButton")
+ self.Color1PushButton.setObjectName(u'Color1PushButton')
self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.Color1PushButton)
self.Color2Label = QtGui.QLabel(self.BackgroundTab)
- self.Color2Label.setObjectName("Color2Label")
+ self.Color2Label.setObjectName(u'Color2Label')
self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.Color2Label)
self.Color2PushButton = QtGui.QPushButton(self.BackgroundTab)
- self.Color2PushButton.setObjectName("Color2PushButton")
+ self.Color2PushButton.setObjectName(u'Color2PushButton')
self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.Color2PushButton)
self.ImageLabel = QtGui.QLabel(self.BackgroundTab)
- self.ImageLabel.setObjectName("ImageLabel")
+ self.ImageLabel.setObjectName(u'ImageLabel')
self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.ImageLabel)
self.GradientLabel = QtGui.QLabel(self.BackgroundTab)
- self.GradientLabel.setObjectName("GradientLabel")
+ self.GradientLabel.setObjectName(u'GradientLabel')
self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.GradientLabel)
self.GradientComboBox = QtGui.QComboBox(self.BackgroundTab)
- self.GradientComboBox.setObjectName("GradientComboBox")
+ self.GradientComboBox.setObjectName(u'GradientComboBox')
self.GradientComboBox.addItem(QtCore.QString())
self.GradientComboBox.addItem(QtCore.QString())
self.GradientComboBox.addItem(QtCore.QString())
self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.FieldRole, self.GradientComboBox)
self.ImageFilenameWidget = QtGui.QWidget(self.BackgroundTab)
- self.ImageFilenameWidget.setObjectName("ImageFilenameWidget")
+ self.ImageFilenameWidget.setObjectName(u'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.horizontalLayout_2.setObjectName(u'horizontalLayout_2')
self.ImageLineEdit = QtGui.QLineEdit(self.ImageFilenameWidget)
- self.ImageLineEdit.setObjectName("ImageLineEdit")
+ self.ImageLineEdit.setObjectName(u'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)
+ icon1.addPixmap(QtGui.QPixmap(u':/images/image_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImageToolButton.setIcon(icon1)
- self.ImageToolButton.setObjectName("ImageToolButton")
+ self.ImageToolButton.setObjectName(u'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.ThemeTabWidget.addTab(self.BackgroundTab, u'')
self.FontMainTab = QtGui.QWidget()
- self.FontMainTab.setObjectName("FontMainTab")
+ self.FontMainTab.setObjectName(u'FontMainTab')
self.FontMainLayout = QtGui.QHBoxLayout(self.FontMainTab)
self.FontMainLayout.setSpacing(8)
self.FontMainLayout.setMargin(8)
- self.FontMainLayout.setObjectName("FontMainLayout")
+ self.FontMainLayout.setObjectName(u'FontMainLayout')
self.MainLeftWidget = QtGui.QWidget(self.FontMainTab)
- self.MainLeftWidget.setObjectName("MainLeftWidget")
+ self.MainLeftWidget.setObjectName(u'MainLeftWidget')
self.MainLeftLayout = QtGui.QVBoxLayout(self.MainLeftWidget)
self.MainLeftLayout.setSpacing(8)
self.MainLeftLayout.setMargin(0)
- self.MainLeftLayout.setObjectName("MainLeftLayout")
+ self.MainLeftLayout.setObjectName(u'MainLeftLayout')
self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget)
- self.FontMainGroupBox.setObjectName("FontMainGroupBox")
+ self.FontMainGroupBox.setObjectName(u'FontMainGroupBox')
self.MainFontLayout = QtGui.QFormLayout(self.FontMainGroupBox)
self.MainFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.MainFontLayout.setMargin(8)
self.MainFontLayout.setSpacing(8)
- self.MainFontLayout.setObjectName("MainFontLayout")
+ self.MainFontLayout.setObjectName(u'MainFontLayout')
self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox)
- self.FontMainlabel.setObjectName("FontMainlabel")
+ self.FontMainlabel.setObjectName(u'FontMainlabel')
self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontMainlabel)
self.FontMainComboBox = QtGui.QFontComboBox(self.FontMainGroupBox)
- self.FontMainComboBox.setObjectName("FontMainComboBox")
+ self.FontMainComboBox.setObjectName(u'FontMainComboBox')
self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainComboBox)
self.FontMainColorLabel = QtGui.QLabel(self.FontMainGroupBox)
- self.FontMainColorLabel.setObjectName("FontMainColorLabel")
+ self.FontMainColorLabel.setObjectName(u'FontMainColorLabel')
self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainColorLabel)
self.FontMainColorPushButton = QtGui.QPushButton(self.FontMainGroupBox)
- self.FontMainColorPushButton.setObjectName("FontMainColorPushButton")
+ self.FontMainColorPushButton.setObjectName(u'FontMainColorPushButton')
self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainColorPushButton)
self.FontMainSize = QtGui.QLabel(self.FontMainGroupBox)
- self.FontMainSize.setObjectName("FontMainSize")
+ self.FontMainSize.setObjectName(u'FontMainSize')
self.MainFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainSize)
self.FontMainSizeSpinBox = QtGui.QSpinBox(self.FontMainGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
@@ -150,44 +161,44 @@
sizePolicy.setHeightForWidth(self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth())
self.FontMainSizeSpinBox.setSizePolicy(sizePolicy)
self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
- self.FontMainSizeSpinBox.setProperty("value", QtCore.QVariant(16))
+ self.FontMainSizeSpinBox.setProperty(u'value', QtCore.QVariant(16))
self.FontMainSizeSpinBox.setMaximum(999)
- self.FontMainSizeSpinBox.setObjectName("FontMainSizeSpinBox")
+ self.FontMainSizeSpinBox.setObjectName(u'FontMainSizeSpinBox')
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.MainRightWidget.setObjectName(u'MainRightWidget')
self.MainRightLayout = QtGui.QVBoxLayout(self.MainRightWidget)
self.MainRightLayout.setSpacing(8)
self.MainRightLayout.setMargin(0)
- self.MainRightLayout.setObjectName("MainRightLayout")
+ self.MainRightLayout.setObjectName(u'MainRightLayout')
self.MainLocationGroupBox = QtGui.QGroupBox(self.MainRightWidget)
- self.MainLocationGroupBox.setObjectName("MainLocationGroupBox")
+ self.MainLocationGroupBox.setObjectName(u'MainLocationGroupBox')
self.MainLocationLayout = QtGui.QFormLayout(self.MainLocationGroupBox)
self.MainLocationLayout.setMargin(8)
self.MainLocationLayout.setSpacing(8)
- self.MainLocationLayout.setObjectName("MainLocationLayout")
+ self.MainLocationLayout.setObjectName(u'MainLocationLayout')
self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox)
- self.DefaultLocationLabel.setObjectName("DefaultLocationLabel")
+ self.DefaultLocationLabel.setObjectName(u'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.FontMainDefaultCheckBox.setObjectName(u'FontMainDefaultCheckBox')
self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainDefaultCheckBox)
self.FontMainXLabel = QtGui.QLabel(self.MainLocationGroupBox)
- self.FontMainXLabel.setObjectName("FontMainXLabel")
+ self.FontMainXLabel.setObjectName(u'FontMainXLabel')
self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainXLabel)
self.FontMainYLabel = QtGui.QLabel(self.MainLocationGroupBox)
- self.FontMainYLabel.setObjectName("FontMainYLabel")
+ self.FontMainYLabel.setObjectName(u'FontMainYLabel')
self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainYLabel)
self.FontMainWidthLabel = QtGui.QLabel(self.MainLocationGroupBox)
- self.FontMainWidthLabel.setObjectName("FontMainWidthLabel")
+ self.FontMainWidthLabel.setObjectName(u'FontMainWidthLabel')
self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWidthLabel)
self.FontMainHeightLabel = QtGui.QLabel(self.MainLocationGroupBox)
- self.FontMainHeightLabel.setObjectName("FontMainHeightLabel")
+ self.FontMainHeightLabel.setObjectName(u'FontMainHeightLabel')
self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainHeightLabel)
self.FontMainXSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
@@ -196,9 +207,9 @@
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.setProperty(u'value', QtCore.QVariant(0))
self.FontMainXSpinBox.setMaximum(9999)
- self.FontMainXSpinBox.setObjectName("FontMainXSpinBox")
+ self.FontMainXSpinBox.setObjectName(u'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)
@@ -208,7 +219,7 @@
self.FontMainYSpinBox.setSizePolicy(sizePolicy)
self.FontMainYSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontMainYSpinBox.setMaximum(9999)
- self.FontMainYSpinBox.setObjectName("FontMainYSpinBox")
+ self.FontMainYSpinBox.setObjectName(u'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)
@@ -218,7 +229,7 @@
self.FontMainWidthSpinBox.setSizePolicy(sizePolicy)
self.FontMainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontMainWidthSpinBox.setMaximum(9999)
- self.FontMainWidthSpinBox.setObjectName("FontMainWidthSpinBox")
+ self.FontMainWidthSpinBox.setObjectName(u'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)
@@ -228,47 +239,47 @@
self.FontMainHeightSpinBox.setSizePolicy(sizePolicy)
self.FontMainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0))
self.FontMainHeightSpinBox.setMaximum(9999)
- self.FontMainHeightSpinBox.setObjectName("FontMainHeightSpinBox")
+ self.FontMainHeightSpinBox.setObjectName(u'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.ThemeTabWidget.addTab(self.FontMainTab, u'')
self.FontFooterTab = QtGui.QWidget()
- self.FontFooterTab.setObjectName("FontFooterTab")
+ self.FontFooterTab.setObjectName(u'FontFooterTab')
self.FontFooterLayout = QtGui.QHBoxLayout(self.FontFooterTab)
self.FontFooterLayout.setSpacing(8)
self.FontFooterLayout.setMargin(8)
- self.FontFooterLayout.setObjectName("FontFooterLayout")
+ self.FontFooterLayout.setObjectName(u'FontFooterLayout')
self.FooterLeftWidget = QtGui.QWidget(self.FontFooterTab)
- self.FooterLeftWidget.setObjectName("FooterLeftWidget")
+ self.FooterLeftWidget.setObjectName(u'FooterLeftWidget')
self.FooterLeftLayout = QtGui.QVBoxLayout(self.FooterLeftWidget)
self.FooterLeftLayout.setSpacing(8)
self.FooterLeftLayout.setMargin(0)
- self.FooterLeftLayout.setObjectName("FooterLeftLayout")
+ self.FooterLeftLayout.setObjectName(u'FooterLeftLayout')
self.FooterFontGroupBox = QtGui.QGroupBox(self.FooterLeftWidget)
- self.FooterFontGroupBox.setObjectName("FooterFontGroupBox")
+ self.FooterFontGroupBox.setObjectName(u'FooterFontGroupBox')
self.FooterFontLayout = QtGui.QFormLayout(self.FooterFontGroupBox)
self.FooterFontLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow)
self.FooterFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.FooterFontLayout.setMargin(8)
self.FooterFontLayout.setSpacing(8)
- self.FooterFontLayout.setObjectName("FooterFontLayout")
+ self.FooterFontLayout.setObjectName(u'FooterFontLayout')
self.FontFooterLabel = QtGui.QLabel(self.FooterFontGroupBox)
- self.FontFooterLabel.setObjectName("FontFooterLabel")
+ self.FontFooterLabel.setObjectName(u'FontFooterLabel')
self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterLabel)
self.FontFooterComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox)
- self.FontFooterComboBox.setObjectName("FontFooterComboBox")
+ self.FontFooterComboBox.setObjectName(u'FontFooterComboBox')
self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterComboBox)
self.FontFooterColorLabel = QtGui.QLabel(self.FooterFontGroupBox)
- self.FontFooterColorLabel.setObjectName("FontFooterColorLabel")
+ self.FontFooterColorLabel.setObjectName(u'FontFooterColorLabel')
self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterColorLabel)
self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox)
- self.FontFooterColorPushButton.setObjectName("FontFooterColorPushButton")
+ self.FontFooterColorPushButton.setObjectName(u'FontFooterColorPushButton')
self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterColorPushButton)
self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox)
- self.FontFooterSizeLabel.setObjectName("FontFooterSizeLabel")
+ self.FontFooterSizeLabel.setObjectName(u'FontFooterSizeLabel')
self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterSizeLabel)
self.FontFooterSizeSpinBox = QtGui.QSpinBox(self.FooterFontGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
@@ -277,46 +288,46 @@
sizePolicy.setHeightForWidth(self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth())
self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy)
self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
- self.FontFooterSizeSpinBox.setProperty("value", QtCore.QVariant(10))
+ self.FontFooterSizeSpinBox.setProperty(u'value', QtCore.QVariant(10))
self.FontFooterSizeSpinBox.setMaximum(999)
- self.FontFooterSizeSpinBox.setObjectName("FontFooterSizeSpinBox")
+ self.FontFooterSizeSpinBox.setObjectName(u'FontFooterSizeSpinBox')
self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox)
self.FooterLeftLayout.addWidget(self.FooterFontGroupBox)
spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.FooterLeftLayout.addItem(spacerItem3)
self.FontFooterLayout.addWidget(self.FooterLeftWidget)
self.FooterRightWidget = QtGui.QWidget(self.FontFooterTab)
- self.FooterRightWidget.setObjectName("FooterRightWidget")
+ self.FooterRightWidget.setObjectName(u'FooterRightWidget')
self.FooterRightLayout = QtGui.QVBoxLayout(self.FooterRightWidget)
self.FooterRightLayout.setSpacing(8)
self.FooterRightLayout.setMargin(0)
- self.FooterRightLayout.setObjectName("FooterRightLayout")
+ self.FooterRightLayout.setObjectName(u'FooterRightLayout')
self.LocationFooterGroupBox = QtGui.QGroupBox(self.FooterRightWidget)
- self.LocationFooterGroupBox.setObjectName("LocationFooterGroupBox")
+ self.LocationFooterGroupBox.setObjectName(u'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.LocationFooterLayout.setObjectName(u'LocationFooterLayout')
self.FontFooterDefaultLabel = QtGui.QLabel(self.LocationFooterGroupBox)
- self.FontFooterDefaultLabel.setObjectName("FontFooterDefaultLabel")
+ self.FontFooterDefaultLabel.setObjectName(u'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.FontFooterDefaultCheckBox.setObjectName(u'FontFooterDefaultCheckBox')
self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterDefaultCheckBox)
self.FontFooterXLabel = QtGui.QLabel(self.LocationFooterGroupBox)
- self.FontFooterXLabel.setObjectName("FontFooterXLabel")
+ self.FontFooterXLabel.setObjectName(u'FontFooterXLabel')
self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterXLabel)
self.FontFooterYLabel = QtGui.QLabel(self.LocationFooterGroupBox)
- self.FontFooterYLabel.setObjectName("FontFooterYLabel")
+ self.FontFooterYLabel.setObjectName(u'FontFooterYLabel')
self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterYLabel)
self.FontFooterWidthLabel = QtGui.QLabel(self.LocationFooterGroupBox)
- self.FontFooterWidthLabel.setObjectName("FontFooterWidthLabel")
+ self.FontFooterWidthLabel.setObjectName(u'FontFooterWidthLabel')
self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWidthLabel)
self.FontFooterHeightLabel = QtGui.QLabel(self.LocationFooterGroupBox)
- self.FontFooterHeightLabel.setObjectName("FontFooterHeightLabel")
+ self.FontFooterHeightLabel.setObjectName(u'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)
@@ -325,9 +336,9 @@
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.setProperty(u'value', QtCore.QVariant(0))
self.FontFooterXSpinBox.setMaximum(9999)
- self.FontFooterXSpinBox.setObjectName("FontFooterXSpinBox")
+ self.FontFooterXSpinBox.setObjectName(u'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)
@@ -336,79 +347,79 @@
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.setProperty(u'value', QtCore.QVariant(0))
self.FontFooterYSpinBox.setMaximum(9999)
- self.FontFooterYSpinBox.setObjectName("FontFooterYSpinBox")
+ self.FontFooterYSpinBox.setObjectName(u'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.FontFooterWidthSpinBox.setObjectName(u'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.FontFooterHeightSpinBox.setObjectName(u'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.ThemeTabWidget.addTab(self.FontFooterTab, u'')
self.OtherOptionsTab = QtGui.QWidget()
- self.OtherOptionsTab.setObjectName("OtherOptionsTab")
+ self.OtherOptionsTab.setObjectName(u'OtherOptionsTab')
self.OtherOptionsLayout = QtGui.QHBoxLayout(self.OtherOptionsTab)
self.OtherOptionsLayout.setSpacing(8)
self.OtherOptionsLayout.setMargin(8)
- self.OtherOptionsLayout.setObjectName("OtherOptionsLayout")
+ self.OtherOptionsLayout.setObjectName(u'OtherOptionsLayout')
self.OptionsLeftWidget = QtGui.QWidget(self.OtherOptionsTab)
- self.OptionsLeftWidget.setObjectName("OptionsLeftWidget")
+ self.OptionsLeftWidget.setObjectName(u'OptionsLeftWidget')
self.OptionsLeftLayout = QtGui.QVBoxLayout(self.OptionsLeftWidget)
self.OptionsLeftLayout.setSpacing(8)
self.OptionsLeftLayout.setMargin(0)
- self.OptionsLeftLayout.setObjectName("OptionsLeftLayout")
+ self.OptionsLeftLayout.setObjectName(u'OptionsLeftLayout')
self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsLeftWidget)
- self.ShadowGroupBox.setObjectName("ShadowGroupBox")
+ self.ShadowGroupBox.setObjectName(u'ShadowGroupBox')
self.verticalLayout = QtGui.QVBoxLayout(self.ShadowGroupBox)
self.verticalLayout.setSpacing(8)
self.verticalLayout.setMargin(8)
- self.verticalLayout.setObjectName("verticalLayout")
+ self.verticalLayout.setObjectName(u'verticalLayout')
self.OutlineWidget = QtGui.QWidget(self.ShadowGroupBox)
- self.OutlineWidget.setObjectName("OutlineWidget")
+ self.OutlineWidget.setObjectName(u'OutlineWidget')
self.OutlineLayout = QtGui.QFormLayout(self.OutlineWidget)
self.OutlineLayout.setMargin(0)
self.OutlineLayout.setSpacing(8)
- self.OutlineLayout.setObjectName("OutlineLayout")
+ self.OutlineLayout.setObjectName(u'OutlineLayout')
self.OutlineCheckBox = QtGui.QCheckBox(self.OutlineWidget)
- self.OutlineCheckBox.setObjectName("OutlineCheckBox")
+ self.OutlineCheckBox.setObjectName(u'OutlineCheckBox')
self.OutlineLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.OutlineCheckBox)
self.OutlineColorLabel = QtGui.QLabel(self.OutlineWidget)
- self.OutlineColorLabel.setObjectName("OutlineColorLabel")
+ self.OutlineColorLabel.setObjectName(u'OutlineColorLabel')
self.OutlineLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel)
self.OutlineColorPushButton = QtGui.QPushButton(self.OutlineWidget)
- self.OutlineColorPushButton.setObjectName("OutlineColorPushButton")
+ self.OutlineColorPushButton.setObjectName(u'OutlineColorPushButton')
self.OutlineLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton)
self.OutlineEnabledLabel = QtGui.QLabel(self.OutlineWidget)
- self.OutlineEnabledLabel.setObjectName("OutlineEnabledLabel")
+ self.OutlineEnabledLabel.setObjectName(u'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.ShadowWidget.setObjectName(u'ShadowWidget')
self.ShadowLayout = QtGui.QFormLayout(self.ShadowWidget)
self.ShadowLayout.setMargin(0)
self.ShadowLayout.setSpacing(8)
- self.ShadowLayout.setObjectName("ShadowLayout")
+ self.ShadowLayout.setObjectName(u'ShadowLayout')
self.ShadowCheckBox = QtGui.QCheckBox(self.ShadowWidget)
- self.ShadowCheckBox.setObjectName("ShadowCheckBox")
+ self.ShadowCheckBox.setObjectName(u'ShadowCheckBox')
self.ShadowLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.ShadowCheckBox)
self.ShadowColorLabel = QtGui.QLabel(self.ShadowWidget)
- self.ShadowColorLabel.setObjectName("ShadowColorLabel")
+ self.ShadowColorLabel.setObjectName(u'ShadowColorLabel')
self.ShadowLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel)
self.ShadowColorPushButton = QtGui.QPushButton(self.ShadowWidget)
- self.ShadowColorPushButton.setObjectName("ShadowColorPushButton")
+ self.ShadowColorPushButton.setObjectName(u'ShadowColorPushButton')
self.ShadowLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton)
self.ShadowEnabledLabel = QtGui.QLabel(self.ShadowWidget)
- self.ShadowEnabledLabel.setObjectName("ShadowEnabledLabel")
+ self.ShadowEnabledLabel.setObjectName(u'ShadowEnabledLabel')
self.ShadowLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowEnabledLabel)
self.verticalLayout.addWidget(self.ShadowWidget)
self.OptionsLeftLayout.addWidget(self.ShadowGroupBox)
@@ -416,29 +427,29 @@
self.OptionsLeftLayout.addItem(spacerItem5)
self.OtherOptionsLayout.addWidget(self.OptionsLeftWidget)
self.OptionsRightWidget = QtGui.QWidget(self.OtherOptionsTab)
- self.OptionsRightWidget.setObjectName("OptionsRightWidget")
+ self.OptionsRightWidget.setObjectName(u'OptionsRightWidget')
self.OptionsRightLayout = QtGui.QVBoxLayout(self.OptionsRightWidget)
self.OptionsRightLayout.setSpacing(8)
self.OptionsRightLayout.setMargin(0)
- self.OptionsRightLayout.setObjectName("OptionsRightLayout")
+ self.OptionsRightLayout.setObjectName(u'OptionsRightLayout')
self.AlignmentGroupBox = QtGui.QGroupBox(self.OptionsRightWidget)
- self.AlignmentGroupBox.setObjectName("AlignmentGroupBox")
+ self.AlignmentGroupBox.setObjectName(u'AlignmentGroupBox')
self.gridLayout_4 = QtGui.QGridLayout(self.AlignmentGroupBox)
- self.gridLayout_4.setObjectName("gridLayout_4")
+ self.gridLayout_4.setObjectName(u'gridLayout_4')
self.HorizontalLabel = QtGui.QLabel(self.AlignmentGroupBox)
- self.HorizontalLabel.setObjectName("HorizontalLabel")
+ self.HorizontalLabel.setObjectName(u'HorizontalLabel')
self.gridLayout_4.addWidget(self.HorizontalLabel, 0, 0, 1, 1)
self.HorizontalComboBox = QtGui.QComboBox(self.AlignmentGroupBox)
- self.HorizontalComboBox.setObjectName("HorizontalComboBox")
+ self.HorizontalComboBox.setObjectName(u'HorizontalComboBox')
self.HorizontalComboBox.addItem(QtCore.QString())
self.HorizontalComboBox.addItem(QtCore.QString())
self.HorizontalComboBox.addItem(QtCore.QString())
self.gridLayout_4.addWidget(self.HorizontalComboBox, 0, 1, 1, 1)
self.VerticalLabel = QtGui.QLabel(self.AlignmentGroupBox)
- self.VerticalLabel.setObjectName("VerticalLabel")
+ self.VerticalLabel.setObjectName(u'VerticalLabel')
self.gridLayout_4.addWidget(self.VerticalLabel, 1, 0, 1, 1)
self.VerticalComboBox = QtGui.QComboBox(self.AlignmentGroupBox)
- self.VerticalComboBox.setObjectName("VerticalComboBox")
+ self.VerticalComboBox.setObjectName(u'VerticalComboBox')
self.VerticalComboBox.addItem(QtCore.QString())
self.VerticalComboBox.addItem(QtCore.QString())
self.VerticalComboBox.addItem(QtCore.QString())
@@ -447,15 +458,15 @@
spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.OptionsRightLayout.addItem(spacerItem6)
self.OtherOptionsLayout.addWidget(self.OptionsRightWidget)
- self.ThemeTabWidget.addTab(self.OtherOptionsTab, "")
+ self.ThemeTabWidget.addTab(self.OtherOptionsTab, u'')
self.ContentLayout.addWidget(self.ThemeTabWidget)
self.AmendThemeLayout.addWidget(self.ContentWidget)
self.PreviewGroupBox = QtGui.QGroupBox(AmendThemeDialog)
- self.PreviewGroupBox.setObjectName("PreviewGroupBox")
+ self.PreviewGroupBox.setObjectName(u'PreviewGroupBox')
self.ThemePreviewLayout = QtGui.QHBoxLayout(self.PreviewGroupBox)
self.ThemePreviewLayout.setSpacing(8)
self.ThemePreviewLayout.setMargin(8)
- self.ThemePreviewLayout.setObjectName("ThemePreviewLayout")
+ self.ThemePreviewLayout.setObjectName(u'ThemePreviewLayout')
spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.ThemePreviewLayout.addItem(spacerItem7)
self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox)
@@ -469,20 +480,20 @@
self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken)
self.ThemePreview.setLineWidth(1)
self.ThemePreview.setScaledContents(True)
- self.ThemePreview.setObjectName("ThemePreview")
+ self.ThemePreview.setObjectName(u'ThemePreview')
self.ThemePreviewLayout.addWidget(self.ThemePreview)
spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
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.ThemeButtonBox.setObjectName(u'ThemeButtonBox')
self.AmendThemeLayout.addWidget(self.ThemeButtonBox)
self.retranslateUi(AmendThemeDialog)
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.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL(u'accepted()'), AmendThemeDialog.accept)
+ QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL(u'rejected()'), AmendThemeDialog.reject)
QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog)
AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit)
AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget)
@@ -517,69 +528,68 @@
AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox)
def retranslateUi(self, AmendThemeDialog):
- AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintenance", 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.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.BackgroundTypeLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background Type:", None, QtGui.QApplication.UnicodeUTF8))
- self.BackgroundTypeComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Solid Color", None, QtGui.QApplication.UnicodeUTF8))
- self.BackgroundTypeComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Gradient", None, QtGui.QApplication.UnicodeUTF8))
- self.BackgroundTypeComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Image", None, QtGui.QApplication.UnicodeUTF8))
- self.Color1Label.setText(QtGui.QApplication.translate("AmendThemeDialog", "<Color1>", None, QtGui.QApplication.UnicodeUTF8))
- self.Color2Label.setText(QtGui.QApplication.translate("AmendThemeDialog", "<Color2>", None, QtGui.QApplication.UnicodeUTF8))
- self.ImageLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Image:", None, QtGui.QApplication.UnicodeUTF8))
- self.GradientLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Gradient :", 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(2, QtGui.QApplication.translate("AmendThemeDialog", "Circular", None, QtGui.QApplication.UnicodeUTF8))
- self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.BackgroundTab), QtGui.QApplication.translate("AmendThemeDialog", "Background", None, QtGui.QApplication.UnicodeUTF8))
- self.FontMainGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8))
- self.FontMainlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8))
- self.FontMainColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8))
- self.FontMainSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8))
- self.FontMainSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", 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.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.FontMainHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8))
- self.FontMainXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
- self.FontMainYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", 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.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.FontFooterHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8))
- self.FontFooterXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
- self.FontFooterYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
- self.FontFooterWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8))
- self.FontFooterHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", 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 && Outline", 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.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.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(1, QtGui.QApplication.translate("AmendThemeDialog", "Right", None, QtGui.QApplication.UnicodeUTF8))
- self.HorizontalComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Center", None, QtGui.QApplication.UnicodeUTF8))
- self.VerticalLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Vertical Align:", 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(2, QtGui.QApplication.translate("AmendThemeDialog", "Bottom", None, QtGui.QApplication.UnicodeUTF8))
- self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.OtherOptionsTab), QtGui.QApplication.translate("AmendThemeDialog", "Other Options", None, QtGui.QApplication.UnicodeUTF8))
- self.PreviewGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Preview", None, QtGui.QApplication.UnicodeUTF8))
-
+ AmendThemeDialog.setWindowTitle(translate(u'AmendThemeDialog', u'Theme Maintenance'))
+ self.ThemeNameLabel.setText(translate(u'AmendThemeDialog', u'Theme Name:'))
+ self.BackgroundLabel.setText(translate(u'AmendThemeDialog', u'Background:'))
+ self.BackgroundComboBox.setItemText(0, translate(u'AmendThemeDialog', u'Opaque'))
+ self.BackgroundComboBox.setItemText(1, translate(u'AmendThemeDialog', u'Transparent'))
+ self.BackgroundTypeLabel.setText(translate(u'AmendThemeDialog', u'Background Type:'))
+ self.BackgroundTypeComboBox.setItemText(0, translate(u'AmendThemeDialog', u'Solid Color'))
+ self.BackgroundTypeComboBox.setItemText(1, translate(u'AmendThemeDialog', u'Gradient'))
+ self.BackgroundTypeComboBox.setItemText(2, translate(u'AmendThemeDialog', u'Image'))
+ self.Color1Label.setText(translate(u'AmendThemeDialog', u'<Color1>'))
+ self.Color2Label.setText(translate(u'AmendThemeDialog', u'<Color2>'))
+ self.ImageLabel.setText(translate(u'AmendThemeDialog', u'Image:'))
+ self.GradientLabel.setText(translate(u'AmendThemeDialog', u'Gradient :'))
+ self.GradientComboBox.setItemText(0, translate(u'AmendThemeDialog', u'Horizontal'))
+ self.GradientComboBox.setItemText(1, translate(u'AmendThemeDialog', u'Vertical'))
+ self.GradientComboBox.setItemText(2, translate(u'AmendThemeDialog', u'Circular'))
+ self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.BackgroundTab), translate(u'AmendThemeDialog', u'Background'))
+ self.FontMainGroupBox.setTitle(translate(u'AmendThemeDialog', u'Main Font'))
+ self.FontMainlabel.setText(translate(u'AmendThemeDialog', u'Font:'))
+ self.FontMainColorLabel.setText(translate(u'AmendThemeDialog', u'Font Color:'))
+ self.FontMainSize.setText(translate(u'AmendThemeDialog', u'Size:'))
+ self.FontMainSizeSpinBox.setSuffix(translate(u'AmendThemeDialog', u'pt'))
+ self.MainLocationGroupBox.setTitle(translate(u'AmendThemeDialog', u'Display Location'))
+ self.DefaultLocationLabel.setText(translate(u'AmendThemeDialog', u'Use Default Location:'))
+ self.FontMainXLabel.setText(translate(u'AmendThemeDialog', u'X Position:'))
+ self.FontMainYLabel.setText(translate(u'AmendThemeDialog', u'Y Position:'))
+ self.FontMainWidthLabel.setText(translate(u'AmendThemeDialog', u'Width:'))
+ self.FontMainHeightLabel.setText(translate(u'AmendThemeDialog', u'Height:'))
+ self.FontMainXSpinBox.setSuffix(translate(u'AmendThemeDialog', u'px'))
+ self.FontMainYSpinBox.setSuffix(translate(u'AmendThemeDialog', u'px'))
+ self.FontMainWidthSpinBox.setSuffix(translate(u'AmendThemeDialog', u'px'))
+ self.FontMainHeightSpinBox.setSuffix(translate(u'AmendThemeDialog', u'px'))
+ self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontMainTab), translate(u'AmendThemeDialog', u'Font Main'))
+ self.FooterFontGroupBox.setTitle(translate(u'AmendThemeDialog', u'Footer Font'))
+ self.FontFooterLabel.setText(translate(u'AmendThemeDialog', u'Font:'))
+ self.FontFooterColorLabel.setText(translate(u'AmendThemeDialog', u'Font Color:'))
+ self.FontFooterSizeLabel.setText(translate(u'AmendThemeDialog', u'Size:'))
+ self.FontFooterSizeSpinBox.setSuffix(translate(u'AmendThemeDialog', u'pt'))
+ self.LocationFooterGroupBox.setTitle(translate(u'AmendThemeDialog', u'Display Location'))
+ self.FontFooterDefaultLabel.setText(translate(u'AmendThemeDialog', u'Use Default Location:'))
+ self.FontFooterXLabel.setText(translate(u'AmendThemeDialog', u'X Position:'))
+ self.FontFooterYLabel.setText(translate(u'AmendThemeDialog', u'Y Position:'))
+ self.FontFooterWidthLabel.setText(translate(u'AmendThemeDialog', u'Width:'))
+ self.FontFooterHeightLabel.setText(translate(u'AmendThemeDialog', u'Height:'))
+ self.FontFooterXSpinBox.setSuffix(translate(u'AmendThemeDialog', u'px'))
+ self.FontFooterYSpinBox.setSuffix(translate(u'AmendThemeDialog', u'px'))
+ self.FontFooterWidthSpinBox.setSuffix(translate(u'AmendThemeDialog', u'px'))
+ self.FontFooterHeightSpinBox.setSuffix(translate(u'AmendThemeDialog', u'px'))
+ self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontFooterTab), translate(u'AmendThemeDialog', u'Font Footer'))
+ self.ShadowGroupBox.setTitle(translate(u'AmendThemeDialog', u'Shadow && Outline'))
+ self.OutlineColorLabel.setText(translate(u'AmendThemeDialog', u'Outline Color:'))
+ self.OutlineEnabledLabel.setText(translate(u'AmendThemeDialog', u'Show Outline:'))
+ self.ShadowColorLabel.setText(translate(u'AmendThemeDialog', u'Shadow Color:'))
+ self.ShadowEnabledLabel.setText(translate(u'AmendThemeDialog', u'Show Shadow:'))
+ self.AlignmentGroupBox.setTitle(translate(u'AmendThemeDialog', u'Alignment'))
+ self.HorizontalLabel.setText(translate(u'AmendThemeDialog', u'Horizontal Align:'))
+ self.HorizontalComboBox.setItemText(0, translate(u'AmendThemeDialog', u'Left'))
+ self.HorizontalComboBox.setItemText(1, translate(u'AmendThemeDialog', u'Right'))
+ self.HorizontalComboBox.setItemText(2, translate(u'AmendThemeDialog', u'Center'))
+ self.VerticalLabel.setText(translate(u'AmendThemeDialog', u'Vertical Align:'))
+ self.VerticalComboBox.setItemText(0, translate(u'AmendThemeDialog', u'Top'))
+ self.VerticalComboBox.setItemText(1, translate(u'AmendThemeDialog', u'Middle'))
+ self.VerticalComboBox.setItemText(2, translate(u'AmendThemeDialog', u'Bottom'))
+ self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.OtherOptionsTab), translate(u'AmendThemeDialog', u'Other Options'))
+ self.PreviewGroupBox.setTitle(translate(u'AmendThemeDialog', u'Preview'))
=== modified file 'openlp/core/ui/amendthemeform.py'
--- openlp/core/ui/amendthemeform.py 2009-06-10 15:37:33 +0000
+++ openlp/core/ui/amendthemeform.py 2009-06-16 18:21:24 +0000
@@ -40,94 +40,94 @@
#define signals
#Buttons
QtCore.QObject.connect(self.Color1PushButton ,
- QtCore.SIGNAL("pressed()"), self.onColor1PushButtonClicked)
+ QtCore.SIGNAL(u'pressed()'), self.onColor1PushButtonClicked)
QtCore.QObject.connect(self.Color2PushButton ,
- QtCore.SIGNAL("pressed()"), self.onColor2PushButtonClicked)
+ QtCore.SIGNAL(u'pressed()'), self.onColor2PushButtonClicked)
QtCore.QObject.connect(self.FontMainColorPushButton,
- QtCore.SIGNAL("pressed()"), self.onFontMainColorPushButtonClicked)
+ QtCore.SIGNAL(u'pressed()'), self.onFontMainColorPushButtonClicked)
QtCore.QObject.connect(self.FontFooterColorPushButton,
- QtCore.SIGNAL("pressed()"), self.onFontFooterColorPushButtonClicked)
+ QtCore.SIGNAL(u'pressed()'), self.onFontFooterColorPushButtonClicked)
QtCore.QObject.connect(self.OutlineColorPushButton,
- QtCore.SIGNAL("pressed()"), self.onOutlineColorPushButtonClicked)
+ QtCore.SIGNAL(u'pressed()'), self.onOutlineColorPushButtonClicked)
QtCore.QObject.connect(self.ShadowColorPushButton,
- QtCore.SIGNAL("pressed()"), self.onShadowColorPushButtonClicked)
+ QtCore.SIGNAL(u'pressed()'), self.onShadowColorPushButtonClicked)
QtCore.QObject.connect(self.ImageToolButton,
- QtCore.SIGNAL("pressed()"), self.onImageToolButtonClicked)
+ QtCore.SIGNAL(u'pressed()'), self.onImageToolButtonClicked)
#Combo boxes
QtCore.QObject.connect(self.BackgroundComboBox,
- QtCore.SIGNAL("activated(int)"), self.onBackgroundComboBoxSelected)
+ QtCore.SIGNAL(u'activated(int)'), self.onBackgroundComboBoxSelected)
QtCore.QObject.connect(self.BackgroundTypeComboBox,
- QtCore.SIGNAL("activated(int)"), self.onBackgroundTypeComboBoxSelected)
+ QtCore.SIGNAL(u'activated(int)'), self.onBackgroundTypeComboBoxSelected)
QtCore.QObject.connect(self.GradientComboBox,
- QtCore.SIGNAL("activated(int)"), self.onGradientComboBoxSelected)
+ QtCore.SIGNAL(u'activated(int)'), self.onGradientComboBoxSelected)
QtCore.QObject.connect(self.FontMainComboBox,
- QtCore.SIGNAL("activated(int)"), self.onFontMainComboBoxSelected)
+ QtCore.SIGNAL(u'activated(int)'), self.onFontMainComboBoxSelected)
QtCore.QObject.connect(self.FontFooterComboBox,
- QtCore.SIGNAL("activated(int)"), self.onFontFooterComboBoxSelected)
+ QtCore.SIGNAL(u'activated(int)'), self.onFontFooterComboBoxSelected)
QtCore.QObject.connect(self.HorizontalComboBox,
- QtCore.SIGNAL("activated(int)"), self.onHorizontalComboBoxSelected)
+ QtCore.SIGNAL(u'activated(int)'), self.onHorizontalComboBoxSelected)
QtCore.QObject.connect(self.VerticalComboBox,
- QtCore.SIGNAL("activated(int)"), self.onVerticalComboBoxSelected)
+ QtCore.SIGNAL(u'activated(int)'), self.onVerticalComboBoxSelected)
QtCore.QObject.connect(self.FontMainSizeSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontMainSizeSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontMainSizeSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterSizeSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterSizeSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontFooterSizeSpinBoxChanged)
QtCore.QObject.connect(self.FontMainDefaultCheckBox,
- QtCore.SIGNAL("stateChanged(int)"), self.onFontMainDefaultCheckBoxChanged)
+ QtCore.SIGNAL(u'stateChanged(int)'), self.onFontMainDefaultCheckBoxChanged)
QtCore.QObject.connect(self.FontMainXSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontMainXSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontMainXSpinBoxChanged)
QtCore.QObject.connect(self.FontMainYSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontMainYSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontMainYSpinBoxChanged)
QtCore.QObject.connect(self.FontMainWidthSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontMainWidthSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontMainWidthSpinBoxChanged)
QtCore.QObject.connect(self.FontMainHeightSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontMainHeightSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontMainHeightSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterDefaultCheckBox,
- QtCore.SIGNAL("stateChanged(int)"), self.onFontFooterDefaultCheckBoxChanged)
+ QtCore.SIGNAL(u'stateChanged(int)'), self.onFontFooterDefaultCheckBoxChanged)
QtCore.QObject.connect(self.FontFooterXSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterXSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontFooterXSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterYSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterYSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontFooterYSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterWidthSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterWidthSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontFooterWidthSpinBoxChanged)
QtCore.QObject.connect(self.FontFooterHeightSpinBox,
- QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterHeightSpinBoxChanged)
+ QtCore.SIGNAL(u'valueChanged(int)'), self.onFontFooterHeightSpinBoxChanged)
QtCore.QObject.connect(self.OutlineCheckBox,
- QtCore.SIGNAL("stateChanged(int)"), self.onOutlineCheckBoxChanged)
+ QtCore.SIGNAL(u'stateChanged(int)'), self.onOutlineCheckBoxChanged)
QtCore.QObject.connect(self.ShadowCheckBox,
- QtCore.SIGNAL("stateChanged(int)"), self.onShadowCheckBoxChanged)
+ QtCore.SIGNAL(u'stateChanged(int)'), self.onShadowCheckBoxChanged)
def accept(self):
new_theme = ThemeXML()
- theme_name = str(self.ThemeNameEdit.displayText())
+ theme_name = unicode(self.ThemeNameEdit.displayText())
new_theme.new_document(theme_name)
save_from = None
save_to = None
if self.theme.background_type == u'solid':
- new_theme.add_background_solid(str(self.theme.background_color))
+ new_theme.add_background_solid(unicode(self.theme.background_color))
elif self.theme.background_type == u'gradient':
- new_theme.add_background_gradient(str(self.theme.background_startColor),
- str(self.theme.background_endColor), self.theme.background_direction)
+ new_theme.add_background_gradient(unicode(self.theme.background_startColor),
+ unicode(self.theme.background_endColor), self.theme.background_direction)
else:
- (path, filename) =os.path.split(str(self.theme.background_filename))
+ (path, filename) =os.path.split(unicode(self.theme.background_filename))
new_theme.add_background_image(filename)
save_to= os.path.join(self.path, theme_name, filename )
save_from = self.theme.background_filename
- new_theme.add_font(str(self.theme.font_main_name), str(self.theme.font_main_color),
- str(self.theme.font_main_proportion), str(self.theme.font_main_override), u'main',
- str(self.theme.font_main_x), str(self.theme.font_main_y), str(self.theme.font_main_width),
- str(self.theme.font_main_height))
- new_theme.add_font(str(self.theme.font_footer_name), str(self.theme.font_footer_color),
- str(self.theme.font_footer_proportion), str(self.theme.font_footer_override), u'footer',
- str(self.theme.font_footer_x), str(self.theme.font_footer_y), str(self.theme.font_footer_width),
- str(self.theme.font_footer_height) )
- 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))
+ new_theme.add_font(unicode(self.theme.font_main_name), unicode(self.theme.font_main_color),
+ unicode(self.theme.font_main_proportion), unicode(self.theme.font_main_override), u'main',
+ unicode(self.theme.font_main_x), unicode(self.theme.font_main_y), unicode(self.theme.font_main_width),
+ unicode(self.theme.font_main_height))
+ new_theme.add_font(unicode(self.theme.font_footer_name), unicode(self.theme.font_footer_color),
+ unicode(self.theme.font_footer_proportion), unicode(self.theme.font_footer_override), u'footer',
+ unicode(self.theme.font_footer_x), unicode(self.theme.font_footer_y), unicode(self.theme.font_footer_width),
+ unicode(self.theme.font_footer_height) )
+ new_theme.add_display(unicode(self.theme.display_shadow), unicode(self.theme.display_shadow_color),
+ unicode(self.theme.display_outline), unicode(self.theme.display_outline_color),
+ unicode(self.theme.display_horizontalAlign), unicode(self.theme.display_verticalAlign),
+ unicode(self.theme.display_wrapStyle))
theme = new_theme.extract_xml()
@@ -166,7 +166,7 @@
QtGui.QColor(self.theme.font_main_color), self).name()
self.FontMainColorPushButton.setStyleSheet(
- u'background-color: %s' % str(self.theme.font_main_color))
+ u'background-color: %s' % unicode(self.theme.font_main_color))
self.previewTheme(self.theme)
def onFontMainSizeSpinBoxChanged(self, value):
@@ -219,7 +219,7 @@
QtGui.QColor(self.theme.font_footer_color), self).name()
self.FontFooterColorPushButton.setStyleSheet(
- 'background-color: %s' % str(self.theme.font_footer_color))
+ 'background-color: %s' % unicode(self.theme.font_footer_color))
self.previewTheme(self.theme)
def onFontFooterSizeSpinBoxChanged(self, value):
@@ -307,12 +307,12 @@
self.theme.background_color = QtGui.QColorDialog.getColor(
QtGui.QColor(self.theme.background_color), self).name()
self.Color1PushButton.setStyleSheet(
- u'background-color: %s' % str(self.theme.background_color))
+ u'background-color: %s' % unicode(self.theme.background_color))
else:
self.theme.background_startColor = QtGui.QColorDialog.getColor(
QtGui.QColor(self.theme.background_startColor), self).name()
self.Color1PushButton.setStyleSheet(
- u'background-color: %s' % str(self.theme.background_startColor))
+ u'background-color: %s' % unicode(self.theme.background_startColor))
self.previewTheme(self.theme)
@@ -320,7 +320,7 @@
self.theme.background_endColor = QtGui.QColorDialog.getColor(
QtGui.QColor(self.theme.background_endColor), self).name()
self.Color2PushButton.setStyleSheet(
- u'background-color: %s' % str(self.theme.background_endColor))
+ u'background-color: %s' % unicode(self.theme.background_endColor))
self.previewTheme(self.theme)
#
@@ -338,7 +338,7 @@
self.theme.display_outline_color = QtGui.QColorDialog.getColor(
QtGui.QColor(self.theme.display_outline_color), self).name()
self.OutlineColorPushButton.setStyleSheet(
- u'background-color: %s' % str(self.theme.display_outline_color))
+ u'background-color: %s' % unicode(self.theme.display_outline_color))
self.previewTheme(self.theme)
def onShadowCheckBoxChanged(self, value):
@@ -353,7 +353,7 @@
self.theme.display_shadow_color = QtGui.QColorDialog.getColor(
QtGui.QColor(self.theme.display_shadow_color), self).name()
self.ShadowColorPushButton.setStyleSheet(
- u'background-color: %s' % str(self.theme.display_shadow_color))
+ u'background-color: %s' % unicode(self.theme.display_shadow_color))
self.previewTheme(self.theme)
def onHorizontalComboBoxSelected(self, currentIndex):
@@ -372,11 +372,11 @@
log.debug(u'base theme created')
newtheme = ThemeXML()
newtheme.new_document(u'New Theme')
- newtheme.add_background_solid(str(u'#000000'))
- newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(30), u'False')
- newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer')
- newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'),
- str(0), str(0), str(0))
+ newtheme.add_background_solid(unicode(u'#000000'))
+ newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(30), u'False')
+ newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
+ newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', unicode(u'#FFFFFF'),
+ unicode(0), unicode(0), unicode(0))
return newtheme.extract_xml()
@@ -413,9 +413,9 @@
self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width))
self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))
self.FontMainColorPushButton.setStyleSheet(
- u'background-color: %s' % str(theme.font_main_color))
+ u'background-color: %s' % unicode(theme.font_main_color))
self.FontFooterColorPushButton.setStyleSheet(
- u'background-color: %s' % str(theme.font_footer_color))
+ u'background-color: %s' % unicode(theme.font_footer_color))
if self.theme.font_main_override == False:
self.FontMainDefaultCheckBox.setChecked(True)
@@ -428,9 +428,9 @@
self.FontFooterDefaultCheckBox.setChecked(False)
self.OutlineColorPushButton.setStyleSheet(
- u'background-color: %s' % str(theme.display_outline_color))
+ u'background-color: %s' % unicode(theme.display_outline_color))
self.ShadowColorPushButton.setStyleSheet(
- u'background-color: %s' % str(theme.display_shadow_color))
+ u'background-color: %s' % unicode(theme.display_shadow_color))
if self.theme.display_outline:
self.OutlineCheckBox.setChecked(True)
@@ -452,7 +452,7 @@
def stateChanging(self, theme):
if theme.background_type == u'solid':
self.Color1PushButton.setStyleSheet(
- u'background-color: %s' % str(theme.background_color))
+ u'background-color: %s' % unicode(theme.background_color))
self.Color1Label.setText(translate(u'ThemeManager', u'Background Color:'))
self.Color1Label.setVisible(True)
self.Color1PushButton.setVisible(True)
@@ -465,9 +465,9 @@
self.GradientComboBox.setVisible(False)
elif theme.background_type == u'gradient':
self.Color1PushButton.setStyleSheet(
- u'background-color: %s' % str(theme.background_startColor))
+ u'background-color: %s' % unicode(theme.background_startColor))
self.Color2PushButton.setStyleSheet(
- u'background-color: %s' % str(theme.background_endColor))
+ u'background-color: %s' % unicode(theme.background_endColor))
self.Color1Label.setText(translate(u'ThemeManager', u'First Color:'))
self.Color2Label.setText(translate(u'ThemeManager', u'Second Color:'))
self.Color1Label.setVisible(True)
@@ -526,4 +526,4 @@
def previewTheme(self, theme):
if self.allowPreview:
frame = self.thememanager.generateImage(theme)
- self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
+ self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
\ No newline at end of file
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2009-06-11 21:14:12 +0000
+++ openlp/core/ui/generaltab.py 2009-06-16 18:21:24 +0000
@@ -167,7 +167,7 @@
screen_name = translate(u'GeneralTab', u'Screen') + u' ' + \
unicode(screen[u'number'] + 1)
if screen[u'primary']:
- screen_name = screen_name + u' (' + \
+ screen_name = screen_name + u' (u' + \
translate(u'GeneralTab', u'primary') + u')'
self.MonitorComboBox.addItem(screen_name)
# Get the configs
@@ -191,4 +191,4 @@
self.config.set_config(u'Auto Open', self.AutoOpen)
self.config.set_config(u'CCL Number', self.CCLNumber)
self.config.set_config(u'User Name', self.Username)
- self.config.set_config(u'Password', self.Password)
+ self.config.set_config(u'Password', self.Password)
\ No newline at end of file
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2009-06-10 15:37:33 +0000
+++ openlp/core/ui/maindisplay.py 2009-06-16 18:21:24 +0000
@@ -98,7 +98,7 @@
self.alertactive = False
def displayAlert(self):
- alertframe = QtGui.QPixmap(self.frame)
+ alertframe = QtGui.QPixmap.fromImage(self.frame)
painter = QtGui.QPainter(alertframe)
top = alertframe.rect().height() * 0.9
painter.fillRect(QtCore.QRect(0, top , alertframe.rect().width(), alertframe.rect().height() - top), QtGui.QColor(self.alertTab.bg_color))
@@ -114,4 +114,4 @@
painter.end()
self.display.setPixmap(alertframe)
QtTest.QTest.qWait(self.alertTab.timeout*1000)
- self.display.setPixmap(self.frame)
+ self.display.QtGui.QPixmap.fromImage(self.frame)
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2009-06-13 06:46:13 +0000
+++ openlp/core/ui/servicemanager.py 2009-06-16 18:21:24 +0000
@@ -68,7 +68,7 @@
self.ServiceManagerList.setDragDropMode(QtGui.QAbstractItemView.DragDrop)
self.ServiceManagerList.setAlternatingRowColors(True)
self.ServiceManagerList.setHeaderHidden(True)
- self.ServiceManagerList.setObjectName("ServiceManagerList")
+ self.ServiceManagerList.setObjectName(u'ServiceManagerList')
# enable drop
self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
self.ServiceManagerList.__class__.dragMoveEvent = self.dragEnterEvent
@@ -268,10 +268,10 @@
self.ThemeComboBox.addItem(u'')
for theme in theme_list:
self.ThemeComboBox.addItem(theme)
- id = self.ThemeComboBox.findText(str(self.service_theme), QtCore.Qt.MatchExactly)
+ id = self.ThemeComboBox.findText(unicode(self.service_theme), QtCore.Qt.MatchExactly)
# Not Found
if id == -1:
id = 0
self.service_theme = u''
self.ThemeComboBox.setCurrentIndex(id)
- self.parent.RenderManager.set_service_theme(self.service_theme)
+ self.parent.RenderManager.set_service_theme(self.service_theme)
\ No newline at end of file
=== modified file 'openlp/core/ui/settingsdialog.py'
--- openlp/core/ui/settingsdialog.py 2009-02-28 23:19:45 +0000
+++ openlp/core/ui/settingsdialog.py 2009-06-16 18:21:24 +0000
@@ -1,21 +1,29 @@
# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file '/home/raoul/Projects/openlp-2/resources/forms/settings.ui'
-#
-# Created: Sat Feb 28 23:59:58 2009
-# by: PyQt4 UI code generator 4.4.4
-#
-# WARNING! All changes made in this file will be lost!
-
+# 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-2009 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
+"""
from PyQt4 import QtCore, QtGui
+from openlp.core.lib import translate
class Ui_SettingsDialog(object):
def setupUi(self, SettingsDialog):
SettingsDialog.setObjectName(u'SettingsDialog')
SettingsDialog.resize(724, 502)
- #icon = QtGui.QIcon()
- #icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- #SettingsDialog.setWindowIcon(icon)
self.SettingsLayout = QtGui.QVBoxLayout(SettingsDialog)
self.SettingsLayout.setSpacing(8)
self.SettingsLayout.setMargin(8)
@@ -32,14 +40,13 @@
self.ButtonsBox.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.ButtonsBox.setOrientation(QtCore.Qt.Horizontal)
self.ButtonsBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
- self.ButtonsBox.setObjectName("ButtonsBox")
+ self.ButtonsBox.setObjectName(u'ButtonsBox')
self.SettingsLayout.addWidget(self.ButtonsBox)
-
self.retranslateUi(SettingsDialog)
self.SettingsTabWidget.setCurrentIndex(0)
- QtCore.QObject.connect(self.ButtonsBox, QtCore.SIGNAL("accepted()"), SettingsDialog.accept)
- QtCore.QObject.connect(self.ButtonsBox, QtCore.SIGNAL("rejected()"), SettingsDialog.reject)
+ QtCore.QObject.connect(self.ButtonsBox, QtCore.SIGNAL(u'accepted()'), SettingsDialog.accept)
+ QtCore.QObject.connect(self.ButtonsBox, QtCore.SIGNAL(u'rejected()'), SettingsDialog.reject)
QtCore.QMetaObject.connectSlotsByName(SettingsDialog)
def retranslateUi(self, SettingsDialog):
- SettingsDialog.setWindowTitle(QtGui.QApplication.translate("SettingsDialog", "Settings", None, QtGui.QApplication.UnicodeUTF8))
+ SettingsDialog.setWindowTitle(translate(u'SettingsDialog', u'Settings'))
=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py 2009-05-18 19:04:25 +0000
+++ openlp/core/ui/settingsform.py 2009-06-16 18:21:24 +0000
@@ -27,7 +27,7 @@
from settingsdialog import Ui_SettingsDialog
-log = logging.getLogger('SettingsForm')
+log = logging.getLogger(u'SettingsForm')
class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
@@ -51,4 +51,4 @@
def accept(self):
for tab_index in range(0, self.SettingsTabWidget.count()):
self.SettingsTabWidget.widget(tab_index).save()
- return QtGui.QDialog.accept(self)
+ return QtGui.QDialog.accept(self)
\ No newline at end of file
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2009-06-10 16:20:57 +0000
+++ openlp/core/ui/slidecontroller.py 2009-06-16 18:21:24 +0000
@@ -91,7 +91,7 @@
return self.items[row]
def getItem(self, row):
- log.info(u'Get Item:%d -> %s' %(row, str(self.items)))
+ log.info(u'Get Item:%d -> %s' %(row, unicode(self.items)))
return self.items[row]
def getList(self):
@@ -321,4 +321,4 @@
if row.isValid():
self.PreviewListView.selectionModel().setCurrentIndex(row,
QtGui.QItemSelectionModel.SelectCurrent)
- self.onSlideSelected(row)
+ self.onSlideSelected(row)
\ No newline at end of file
=== modified file 'openlp/core/ui/splashscreen.py'
--- openlp/core/ui/splashscreen.py 2009-05-20 20:17:20 +0000
+++ openlp/core/ui/splashscreen.py 2009-06-16 18:21:24 +0000
@@ -17,20 +17,18 @@
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
-
from PyQt4 import QtCore, QtGui
-
from openlp.core.lib import translate
class SplashScreen(object):
def __init__(self, version):
self.splash_screen = QtGui.QSplashScreen()
self.setupUi()
- starting = translate('SplashScreen',u'Starting')
+ starting = translate(u'SplashScreen',u'Starting')
self.message=starting+u'..... '+version
def setupUi(self):
- self.splash_screen.setObjectName("splash_screen")
+ self.splash_screen.setObjectName(u'splash_screen')
self.splash_screen.setWindowModality(QtCore.Qt.NonModal)
self.splash_screen.setEnabled(True)
self.splash_screen.resize(370, 370)
@@ -41,8 +39,8 @@
self.splash_screen.setSizePolicy(sizePolicy)
self.splash_screen.setContextMenuPolicy(QtCore.Qt.PreventContextMenu)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- splash_image = QtGui.QPixmap(":/graphics/openlp-splash-screen.png")
+ icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ splash_image = QtGui.QPixmap(u':/graphics/openlp-splash-screen.png')
self.splash_screen.setWindowIcon(icon)
self.splash_screen.setPixmap(splash_image)
self.splash_screen.setMask(splash_image.mask())
@@ -51,7 +49,7 @@
QtCore.QMetaObject.connectSlotsByName(self.splash_screen)
def retranslateUi(self):
- self.splash_screen.setWindowTitle(QtGui.QApplication.translate("splash_screen", "Splash Screen", None, QtGui.QApplication.UnicodeUTF8))
+ self.splash_screen.setWindowTitle(translate(u'splash_screen', u'Splash Screen'))
def show(self):
self.splash_screen.show()
=== modified file 'openlp/core/ui/test/test_service_manager.py'
--- openlp/core/ui/test/test_service_manager.py 2009-05-09 07:01:33 +0000
+++ openlp/core/ui/test/test_service_manager.py 2009-06-16 18:21:24 +0000
@@ -28,20 +28,20 @@
from openlp.plugins.images.lib import ImageServiceItem
import logging
-logging.basicConfig(filename="test_service_manager.log",level=logging.INFO, filemode="w")
+logging.basicConfig(filename="test_service_manager.log",level=logging.INFO, filemode="w')
# # from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66062
# def whoami(depth=1):
# return sys._getframe(depth).f_code.co_name
global app
global log
-log=logging.getLogger("TestServiceManager")
+log=logging.getLogger(u'TestServiceManager')
class TestServiceManager_base:
def __init__(self):
pass
def setup_class(self):
- log.info( "class setup"+str(self))
+ log.info( "class setup"+unicode(self))
try:
if app is None:
app = QtGui.QApplication([])
@@ -53,11 +53,11 @@
pass
def setup_method(self, method):
- log.info("Setup method:"+str(method))
+ log.info(u'Setup method:"+unicode(method))
self.expected_answer="Don't know yet"
self.answer=None
self.s=ServiceManager(None)
- log.info("--------------- Setup Done -------------")
+ log.info(u'--------------- Setup Done -------------')
def teardown_method(self, method):
self.s=None
@@ -69,64 +69,64 @@
# make a selection of it
self.sm=QItemSelectionModel(self.s.service_data)
self.sm.select(i, QItemSelectionModel.ClearAndSelect)
- log.info(str(self.sm.selectedIndexes()))
+ log.info(unicode(self.sm.selectedIndexes()))
self.s.TreeView.setSelectionModel(self.sm)
- log.info("Selected indexes = " + str(self.s.TreeView.selectedIndexes()))
+ log.info(u'Selected indexes = " + unicode(self.s.TreeView.selectedIndexes()))
def test_easy(self):
- log.info("test_easy")
+ log.info(u'test_easy')
item=ImageServiceItem(None)
- item.add("test.gif")
+ item.add(u'test.gif')
self.s.addServiceItem(item)
answer = self.s.oos_as_text()
- log.info("Answer = " + str(answer))
- lines=answer.split("\n")
- log.info("lines = " + str(lines))
- assert lines[0].startswith("# <openlp.plugins.images.imageserviceitem.ImageServiceItem object")
+ log.info(u'Answer = " + unicode(answer))
+ lines=answer.split(u'\n')
+ log.info(u'lines = " + unicode(lines))
+ assert lines[0].startswith(u'# <openlp.plugins.images.imageserviceitem.ImageServiceItem object')
assert lines[1] == "test.gif"
- log.info("done")
+ log.info(u'done')
def test_2items_as_separate_items(self):
# If nothing is selected when item is added, a new base service item is added
- log.info("test_2items_as_separate_items")
+ log.info(u'test_2items_as_separate_items')
item=ImageServiceItem(None)
- item.add("test.gif")
+ item.add(u'test.gif')
self.s.addServiceItem(item)
item=ImageServiceItem(None)
- item.add("test2.gif")
- item.add("test3.gif")
+ item.add(u'test2.gif')
+ item.add(u'test3.gif')
self.s.addServiceItem(item)
answer = self.s.oos_as_text()
- log.info("Answer = " + str(answer))
- lines=answer.split("\n")
- log.info("lines = " + str(lines))
- assert lines[0].startswith("# <openlp.plugins.images.imageserviceitem.ImageServiceItem object")
+ log.info(u'Answer = " + unicode(answer))
+ lines=answer.split(u'\n')
+ log.info(u'lines = " + unicode(lines))
+ assert lines[0].startswith(u'# <openlp.plugins.images.imageserviceitem.ImageServiceItem object')
assert lines[1] == "test.gif"
- assert lines[2].startswith("# <openlp.plugins.images.imageserviceitem.ImageServiceItem object")
+ assert lines[2].startswith(u'# <openlp.plugins.images.imageserviceitem.ImageServiceItem object')
assert lines[3] == "test2.gif"
assert lines[4] == "test3.gif"
- log.info("done")
+ log.info(u'done')
def test_2items_merged(self):
# If the first object is selected when item is added it should be extended
- log.info("test_2items_merged")
+ log.info(u'test_2items_merged')
item=ImageServiceItem(None)
- item.add("test.gif")
+ item.add(u'test.gif')
self.s.addServiceItem(item)
self.select_row(0)
- log.info("Selected indexes = " + str(self.s.TreeView.selectedIndexes()))
+ log.info(u'Selected indexes = " + unicode(self.s.TreeView.selectedIndexes()))
item=ImageServiceItem(None)
- item.add("test2.gif")
- item.add("test3.gif")
+ item.add(u'test2.gif')
+ item.add(u'test3.gif')
self.s.addServiceItem(item)
answer = self.s.oos_as_text()
- log.info("Answer = " + str(answer))
- lines=answer.split("\n")
- log.info("lines = " + str(lines))
- assert lines[0].startswith("# <openlp.plugins.images.imageserviceitem.ImageServiceItem object")
+ log.info(u'Answer = " + unicode(answer))
+ lines=answer.split(u'\n')
+ log.info(u'lines = " + unicode(lines))
+ assert lines[0].startswith(u'# <openlp.plugins.images.imageserviceitem.ImageServiceItem object')
assert lines[1] == "test.gif"
assert lines[2] == "test2.gif"
assert lines[3] == "test3.gif"
- log.info("done")
+ log.info(u'done')
# more tests to do:
# add different types of service item
@@ -143,4 +143,4 @@
t.test_easy()
t.teardown_method(None)
print "Pass"
- log.info("Pass")
+ log.info(u'Pass')
\ No newline at end of file
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2009-06-10 15:37:33 +0000
+++ openlp/core/ui/thememanager.py 2009-06-16 18:21:24 +0000
@@ -58,12 +58,12 @@
def insertRow(self, row, filename):
self.beginInsertRows(QtCore.QModelIndex(), row, row)
log.info(u'insert row %d:%s' % (row, filename))
- (prefix, shortfilename) = os.path.split(str(filename))
+ (prefix, shortfilename) = os.path.split(unicode(filename))
log.info(u'shortfilename = %s' % shortfilename)
theme = shortfilename.split(u'.')
# create a preview image
if os.path.exists(filename):
- preview = QtGui.QImage(str(filename))
+ preview = QtGui.QImage(unicode(filename))
width = self.maximagewidth
height = self.rowheight
preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
@@ -117,7 +117,7 @@
return self.items[row]
def getItem(self, row):
- log.info(u'Get Item:%d -> %s' % (row, str(self.items)))
+ log.info(u'Get Item:%d -> %s' % (row, unicode(self.items)))
return self.items[row]
def getList(self):
@@ -202,7 +202,7 @@
files = QtGui.QFileDialog.getOpenFileNames(None,
translate(u'ThemeManager', u'Select Import File'),
self.path, u'Theme (*.theme)')
- log.info(u'New Themes %s', str(files))
+ log.info(u'New Themes %s', unicode(files))
if len(files) > 0:
for file in files:
self.unzipTheme(file, self.path)
@@ -224,17 +224,17 @@
def getThemeData(self, themename):
log.debug(u'getthemedata for theme %s', themename)
- xml_file = os.path.join(self.path, str(themename), str(themename) + u'.xml')
+ xml_file = os.path.join(self.path, unicode(themename), unicode(themename) + u'.xml')
try:
xml = file_to_xml(xml_file)
except:
newtheme = ThemeXML()
newtheme.new_document(u'New Theme')
- newtheme.add_background_solid(str(u'#000000'))
- newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(30), u'False')
- newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer')
- newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'),
- str(0), str(0), str(0))
+ newtheme.add_background_solid(unicode(u'#000000'))
+ newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(30), u'False')
+ newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
+ newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', unicode(u'#FFFFFF'),
+ unicode(0), unicode(0), unicode(0))
xml = newtheme.extract_xml()
theme = ThemeXML()
theme.parse(xml)
@@ -253,7 +253,7 @@
necessary.
"""
log.debug(u'Unzipping theme %s', filename)
- zip = zipfile.ZipFile(str(filename))
+ zip = zipfile.ZipFile(unicode(filename))
filexml = None
themename = None
for file in zip.namelist():
@@ -299,31 +299,31 @@
newtheme = ThemeXML()
newtheme.new_document(theme.Name)
if theme.BackgroundType == 0:
- newtheme.add_background_solid(str(theme.BackgroundParameter1.name()))
+ newtheme.add_background_solid(unicode(theme.BackgroundParameter1.name()))
elif theme.BackgroundType == 1:
direction = u'vertical'
if theme.BackgroundParameter3.name() == 1:
direction = u'horizontal'
newtheme.add_background_gradient(
- str(theme.BackgroundParameter1.name()),
- str(theme.BackgroundParameter2.name()), direction)
+ unicode(theme.BackgroundParameter1.name()),
+ unicode(theme.BackgroundParameter2.name()), direction)
else:
- newtheme.add_background_image(str(theme.BackgroundParameter1))
+ newtheme.add_background_image(unicode(theme.BackgroundParameter1))
- newtheme.add_font(str(theme.FontName), str(theme.FontColor.name()),
- str(theme.FontProportion * 2), u'False')
- newtheme.add_font(str(theme.FontName), str(theme.FontColor.name()),
- str(12), u'False', u'footer')
+ newtheme.add_font(unicode(theme.FontName), unicode(theme.FontColor.name()),
+ unicode(theme.FontProportion * 2), u'False')
+ newtheme.add_font(unicode(theme.FontName), unicode(theme.FontColor.name()),
+ unicode(12), u'False', u'footer')
outline = False
shadow = False
if theme.Shadow == 1:
shadow = True
if theme.Outline == 1:
outline = True
- newtheme.add_display(str(shadow), str(theme.ShadowColor.name()),
- str(outline), str(theme.OutlineColor.name()),
- str(theme.HorizontalAlign), str(theme.VerticalAlign),
- str(theme.WrapStyle))
+ newtheme.add_display(unicode(shadow), unicode(theme.ShadowColor.name()),
+ unicode(outline), unicode(theme.OutlineColor.name()),
+ unicode(theme.HorizontalAlign), unicode(theme.VerticalAlign),
+ unicode(theme.WrapStyle))
return newtheme.extract_xml()
def saveTheme(self, name, theme_xml, image_from, image_to) :
@@ -362,4 +362,4 @@
def getPreviewImage(self, theme):
log.debug(u'getPreviewImage %s ', theme)
image = os.path.join(self.path, theme + u'.png')
- return image
+ return image
\ No newline at end of file
=== modified file 'openlp/core/ui/themestab.py'
--- openlp/core/ui/themestab.py 2009-06-05 18:53:50 +0000
+++ openlp/core/ui/themestab.py 2009-06-16 18:21:24 +0000
@@ -97,7 +97,7 @@
QtCore.SIGNAL(u'pressed()'), self.onGlobalLevelButtonPressed)
QtCore.QObject.connect(self.DefaultComboBox,
- QtCore.SIGNAL("activated(int)"), self.onDefaultComboBoxChanged)
+ QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged)
#self.DefaultListView.setScaledContents(True)
@@ -140,8 +140,8 @@
def onDefaultComboBoxChanged(self, value):
self.global_theme = self.DefaultComboBox.currentText()
self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style)
- image = self.parent.ThemeManagerContents.getPreviewImage(str(self.global_theme))
- preview = QtGui.QPixmap(str(image))
+ image = self.parent.ThemeManagerContents.getPreviewImage(unicode(self.global_theme))
+ preview = QtGui.QPixmap(unicode(image))
display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
self.DefaultListView.setPixmap(display)
@@ -152,14 +152,14 @@
self.DefaultComboBox.clear()
for theme in theme_list:
self.DefaultComboBox.addItem(theme)
- id = self.DefaultComboBox.findText(str(self.global_theme), QtCore.Qt.MatchExactly)
+ id = self.DefaultComboBox.findText(unicode(self.global_theme), QtCore.Qt.MatchExactly)
if id == -1:
id = 0 # Not Found
self.global_theme = u''
self.DefaultComboBox.setCurrentIndex(id)
self.parent.RenderManager.set_global_theme(self.global_theme, self.global_style)
if self.global_theme is not u'':
- image = self.parent.ThemeManagerContents.getPreviewImage(str(self.global_theme))
- preview = QtGui.QPixmap(str(image))
+ image = self.parent.ThemeManagerContents.getPreviewImage(unicode(self.global_theme))
+ preview = QtGui.QPixmap(unicode(image))
display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
- self.DefaultListView.setPixmap(display)
+ self.DefaultListView.setPixmap(display)
\ No newline at end of file
=== modified file 'openlp/core/utils/confighelper.py'
--- openlp/core/utils/confighelper.py 2009-06-04 16:53:49 +0000
+++ openlp/core/utils/confighelper.py 2009-06-16 18:21:24 +0000
@@ -42,7 +42,7 @@
except ImportError:
path = os.path.join(os.getenv(u'HOME'), u'.openlp', u'data')
reg = ConfigHelper.get_registry()
- #path = ConfigHelper.get_config('main', 'data path', path)
+ #path = ConfigHelper.get_config(u'main', 'data path', path)
if not os.path.exists(path):
os.makedirs(path)
return path
@@ -89,4 +89,4 @@
except ImportError:
config_path = os.path.join(os.getenv(u'HOME'), u'.openlp')
ConfigHelper.__registry__ = Registry(config_path)
- return ConfigHelper.__registry__
+ return ConfigHelper.__registry__
\ No newline at end of file
=== modified file 'openlp/core/utils/registry.py'
--- openlp/core/utils/registry.py 2009-06-05 18:53:50 +0000
+++ openlp/core/utils/registry.py 2009-06-16 18:21:24 +0000
@@ -54,7 +54,7 @@
Set a single value in the registry.
"""
try :
- self.config.set(section, key, str(value))
+ self.config.set(section, key, unicode(value))
return self._save()
except:
return False
@@ -115,4 +115,4 @@
file_handle.close()
return self._load()
except:
- return False
+ return False
\ No newline at end of file
=== modified file 'openlp/migration/display.py'
--- openlp/migration/display.py 2009-01-01 11:18:16 +0000
+++ openlp/migration/display.py 2009-06-16 18:21:24 +0000
@@ -20,8 +20,8 @@
class Display():
global log
- log=logging.getLogger("Display Logger")
- log.info("Display Class loaded")
+ log=logging.getLogger(u'Display Logger')
+ log.info(u'Display Class loaded')
@staticmethod
def output(string):
@@ -31,5 +31,5 @@
@staticmethod
def sub_output(string):
if not string == None:
- log.debug(" "+string);
- print (" "+string)
+ log.debug(u' "+string);
+ print (u' "+string)
\ No newline at end of file
=== modified file 'openlp/migration/migratebibles.py'
--- openlp/migration/migratebibles.py 2009-01-01 11:18:16 +0000
+++ openlp/migration/migratebibles.py 2009-06-16 18:21:24 +0000
@@ -23,5 +23,5 @@
self.display = display
def process(self):
- self.display.output("Bible process started");
- self.display.output("Bible process finished");
+ self.display.output(u'Bible process started');
+ self.display.output(u'Bible process finished');
\ No newline at end of file
=== modified file 'openlp/migration/migratefiles.py'
--- openlp/migration/migratefiles.py 2009-01-01 11:18:16 +0000
+++ openlp/migration/migratefiles.py 2009-06-16 18:21:24 +0000
@@ -22,20 +22,20 @@
self.display = display
def process(self):
- self.display.output("Files process started");
+ self.display.output(u'Files process started');
self._initial_setup()
- self.display.output("Files process finished");
+ self.display.output(u'Files process finished');
def _initial_setup(self):
- self.display.output("Initial Setup started");
+ self.display.output(u'Initial Setup started');
ConfigHelper.get_data_path()
- self.display.sub_output("Config created");
- ConfigHelper.get_config("bible", "data path")
- self.display.sub_output("Config created");
- ConfigHelper.get_config("videos", "data path")
- self.display.sub_output("videos created");
- ConfigHelper.get_config("images", "data path")
- self.display.sub_output("images created");
- ConfigHelper.get_config("presentations", "data path")
- self.display.sub_output("presentations created");
- self.display.output("Initial Setup finished");
+ self.display.sub_output(u'Config created');
+ ConfigHelper.get_config(u'bible", u'data path')
+ self.display.sub_output(u'Config created');
+ ConfigHelper.get_config(u'videos", u'data path')
+ self.display.sub_output(u'videos created');
+ ConfigHelper.get_config(u'images", u'data path')
+ self.display.sub_output(u'images created');
+ ConfigHelper.get_config(u'presentations", u'data path')
+ self.display.sub_output(u'presentations created');
+ self.display.output(u'Initial Setup finished');
\ No newline at end of file
=== modified file 'openlp/migration/migratesongs.py'
--- openlp/migration/migratesongs.py 2009-05-02 21:40:10 +0000
+++ openlp/migration/migratesongs.py 2009-06-16 18:21:24 +0000
@@ -42,9 +42,9 @@
class MigrateSongs():
def __init__(self, display):
self.display = display
- self.config = PluginConfig('Songs')
+ self.config = PluginConfig(u'Songs')
self.data_path = self.config.get_data_path()
- self.database_files = self.config.get_files('sqlite')
+ self.database_files = self.config.get_files(u'sqlite')
print self.database_files
def process(self):
@@ -66,49 +66,49 @@
def _v1_9_0_authors(self, database):
self.display.sub_output(u'Authors Started for ' + database)
conn = sqlite3.connect(self.data_path + os.sep + database)
- conn.execute("""alter table authors rename to authors_temp;""")
+ conn.execute(u'""alter table authors rename to authors_temp;""')
conn.commit()
self.display.sub_output(u'old author renamed to author_temp')
- conn.execute("""create table authors (
+ conn.execute(u'""create table authors (
id integer primary key ASC AUTOINCREMENT,
first_name varchar(128),
last_name varchar(128),
display_name varchar(255)
- );""")
+ );""')
conn.commit()
self.display.sub_output(u'authors table created')
- conn.execute("""create index if not exists author1 on authors
- (display_name ASC,id ASC);""")
+ conn.execute(u'""create index if not exists author1 on authors
+ (display_name ASC,id ASC);""')
conn.commit()
self.display.sub_output(u'index author1 created')
- conn.execute("""create index if not exists author2 on authors
- (last_name ASC,id ASC);""")
+ conn.execute(u'""create index if not exists author2 on authors
+ (last_name ASC,id ASC);""')
conn.commit()
self.display.sub_output(u'index author2 created')
- conn.execute("""create index if not exists author3 on authors
- (first_name ASC,id ASC);""")
+ conn.execute(u'""create index if not exists author3 on authors
+ (first_name ASC,id ASC);""')
conn.commit()
self.display.sub_output(u'index author3 created')
self.display.sub_output(u'Author Data Migration started')
- conn.execute("""insert into authors (id, display_name)
- select authorid, authorname from authors_temp;""")
+ conn.execute(u'""insert into authors (id, display_name)
+ select authorid, authorname from authors_temp;""')
conn.commit()
self.display.sub_output(u'authors populated')
c = conn.cursor()
- text = c.execute("""select * from authors""") .fetchall()
+ text = c.execute(u'""select * from authors""') .fetchall()
for author in text:
dispname = author[3]
- dispname = dispname.replace("'", "")
- pos = dispname.rfind(" ")
+ dispname = dispname.replace(u''", u'')
+ pos = dispname.rfind(u' ')
authorfirstname = dispname[:pos]
authorlastname = dispname[pos + 1:len(dispname)]
s = "update authors set first_name = '" \
+ authorfirstname + "', last_name = '" + authorlastname \
- + "' where id = " + str(author[0])
+ + "' where id = " + unicode(author[0])
c.execute(s)
conn.commit()
self.display.sub_output(u'Author Data Migration Completed')
- conn.execute("""drop table authors_temp;""")
+ conn.execute(u'""drop table authors_temp;""')
conn.commit()
conn.close()
self.display.sub_output(u'author_temp dropped')
@@ -117,17 +117,17 @@
def _v1_9_0_songbook(self, database):
self.display.sub_output(u'SongBook Started for ' + database)
conn = sqlite3.connect(self.data_path + os.sep + database)
- conn.execute("""create table if not exists song_books (
+ conn.execute(u'""create table if not exists song_books (
id integer Primary Key ASC AUTOINCREMENT,
name varchar(128),
publisher varchar(128)
- );""")
+ );""')
conn.commit()
self.display.sub_output(u'songbook table created')
- conn.execute("""create index if not exists songbook1 on song_books (name ASC,id ASC);""")
+ conn.execute(u'""create index if not exists songbook1 on song_books (name ASC,id ASC);""')
conn.commit()
self.display.sub_output(u'index songbook1 created')
- conn.execute("""create index if not exists songbook2 on song_books (publisher ASC,id ASC);""")
+ conn.execute(u'""create index if not exists songbook2 on song_books (publisher ASC,id ASC);""')
conn.commit()
conn.close()
self.display.sub_output(u'index songbook2 created')
@@ -136,9 +136,9 @@
def _v1_9_0_songs(self, database):
self.display.sub_output(u'Songs Started for ' + database)
conn = sqlite3.connect(self.data_path + os.sep + database)
- conn.execute("""alter table songs rename to songs_temp;""")
+ conn.execute(u'""alter table songs rename to songs_temp;""')
conn.commit()
- conn.execute("""create table if not exists songs (
+ conn.execute(u'""create table if not exists songs (
id integer Primary Key ASC AUTOINCREMENT,
song_book_id integer,
title varchar(255),
@@ -151,31 +151,31 @@
theme_name varchar(128),
search_title varchar(255),
search_lyrics text
- );""")
+ );""')
conn.commit()
self.display.sub_output(u'songs table created')
- conn.execute("""create index if not exists songs1 on songs
- (search_lyrics ASC,id ASC);""")
+ conn.execute(u'""create index if not exists songs1 on songs
+ (search_lyrics ASC,id ASC);""')
conn.commit()
self.display.sub_output(u'index songs1 created')
- conn.execute("""create index if not exists songs2 on songs
- (search_title ASC,id ASC);""")
+ conn.execute(u'""create index if not exists songs2 on songs
+ (search_title ASC,id ASC);""')
conn.commit()
self.display.sub_output(u'index songs2 created')
- conn.execute("""insert into songs (id, title, lyrics, copyright,
+ conn.execute(u'""insert into songs (id, title, lyrics, copyright,
search_title, search_lyrics, song_book_id)
select songid, songtitle, lyrics, copyrightinfo,
replace(replace(replace(replace(replace(replace(replace(replace(
replace(songtitle, '&', 'and'), ',', ''), ';', ''), ':', ''),
- '(', ''), ')', ''), '{', ''), '}',''),'?',''),
+ '(u', ''), ')', ''), '{', ''), '}',''),'?',''),
replace(replace(replace(replace(replace(replace(replace(replace(
replace(lyrics, '&', 'and'), ',', ''), ';', ''), ':', ''),
- '(', ''), ')', ''), '{', ''), '}',''),'?',''),
+ '(u', ''), ')', ''), '{', ''), '}',''),'?',''),
0
- from songs_temp;""")
+ from songs_temp;""')
conn.commit()
self.display.sub_output(u'songs populated')
- conn.execute("""drop table songs_temp;""")
+ conn.execute(u'""drop table songs_temp;""')
conn.commit()
conn.close()
self.display.sub_output(u'songs_temp dropped')
@@ -185,12 +185,12 @@
self.display.sub_output(u'Topics Started for ' + database)
conn = sqlite3.connect(self.data_path+os.sep+database)
conn.text_factory = str
- conn.execute("""create table if not exists topics
+ conn.execute(u'""create table if not exists topics
(id integer Primary Key ASC AUTOINCREMENT,
- name varchar(128));""")
+ name varchar(128));""')
conn.commit()
self.display.sub_output(u'Topic table created')
- conn.execute("""create index if not exists topic1 on topics (name ASC,id ASC);""")
+ conn.execute(u'""create index if not exists topic1 on topics (name ASC,id ASC);""')
conn.commit()
conn.close()
self.display.sub_output(u'index topic1 created')
@@ -200,16 +200,16 @@
def _v1_9_0_songauthors(self, database):
self.display.sub_output(u'SongAuthors Started for ' + database);
conn = sqlite3.connect(self.data_path + os.sep + database)
- conn.execute("""create table if not exists authors_songs
+ conn.execute(u'""create table if not exists authors_songs
(author_id integer,
- song_id integer);""")
+ song_id integer);""')
conn.commit()
self.display.sub_output(u'authors_songs table created')
- conn.execute("""insert into authors_songs (author_id, song_id)
- select authorid, songid from songauthors;""")
+ conn.execute(u'""insert into authors_songs (author_id, song_id)
+ select authorid, songid from songauthors;""')
conn.commit()
self.display.sub_output(u'authors_songs populated')
- conn.execute("""drop table songauthors;""")
+ conn.execute(u'""drop table songauthors;""')
conn.commit()
self.display.sub_output(u'songauthors dropped')
conn.close()
@@ -218,15 +218,15 @@
def _v1_9_0_songtopics(self, database):
self.display.sub_output(u'Songtopics Started for ' + database);
conn = sqlite3.connect(self.data_path+os.sep+database)
- conn.execute("""create table if not exists song_topics
+ conn.execute(u'""create table if not exists song_topics
(song_id integer,
- topic_id integer);""")
+ topic_id integer);""')
conn.commit()
self.display.sub_output(u'songtopics table created')
- conn.execute("""create index if not exists songtopic1 on song_topics (topic_id ASC,song_id ASC);""")
+ conn.execute(u'""create index if not exists songtopic1 on song_topics (topic_id ASC,song_id ASC);""')
conn.commit()
self.display.sub_output(u'index songtopic1 created')
- conn.execute("""create index if not exists songtopic2 on song_topics (song_id ASC,topic_id ASC);""")
+ conn.execute(u'""create index if not exists songtopic2 on song_topics (song_id ASC,topic_id ASC);""')
conn.commit()
conn.close()
self.display.sub_output(u'index songtopic2 created')
@@ -237,4 +237,4 @@
out = fileout.readlines()
if len(out) > 0:
for o in range (0, len(out)):
- self.display.sub_output(out[o])
+ self.display.sub_output(out[o])
\ No newline at end of file
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2009-05-21 05:15:51 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2009-06-16 18:21:24 +0000
@@ -39,7 +39,7 @@
self.weight = -9
# Create the plugin icon
self.icon = QtGui.QIcon()
- self.icon.addPixmap(QtGui.QPixmap(':/media/media_verse.png'),
+ self.icon.addPixmap(QtGui.QPixmap(u':/media/media_verse.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
#Register the bible Manager
self.biblemanager = BibleManager(self.config)
@@ -55,17 +55,17 @@
def add_import_menu_item(self, import_menu):
self.ImportBibleItem = QtGui.QAction(import_menu)
- self.ImportBibleItem.setObjectName("ImportBibleItem")
+ self.ImportBibleItem.setObjectName(u'ImportBibleItem')
import_menu.addAction(self.ImportBibleItem)
- self.ImportBibleItem.setText(translate("BiblePlugin", "&Bible"))
+ self.ImportBibleItem.setText(translate(u'BiblePlugin', u'&Bible'))
# Signals and slots
- QtCore.QObject.connect(self.ImportBibleItem, QtCore.SIGNAL("triggered()"), self.onBibleNewClick)
+ QtCore.QObject.connect(self.ImportBibleItem, QtCore.SIGNAL(u'triggered()'), self.onBibleNewClick)
def add_export_menu_item(self, export_menu):
self.ExportBibleItem = QtGui.QAction(export_menu)
- self.ExportBibleItem.setObjectName("ExportBibleItem")
+ self.ExportBibleItem.setObjectName(u'ExportBibleItem')
export_menu.addAction(self.ExportBibleItem)
- self.ExportBibleItem.setText(translate("BiblePlugin", u'&Bible'))
+ self.ExportBibleItem.setText(translate(u'BiblePlugin', u'&Bible'))
def initialise(self):
pass
=== modified file 'openlp/plugins/bibles/forms/bibleimportdialog.py'
--- openlp/plugins/bibles/forms/bibleimportdialog.py 2009-06-01 17:50:37 +0000
+++ openlp/plugins/bibles/forms/bibleimportdialog.py 2009-06-16 18:21:24 +0000
@@ -11,178 +11,178 @@
class Ui_BibleImportDialog(object):
def setupUi(self, BibleImportDialog):
- BibleImportDialog.setObjectName("BibleImportDialog")
+ BibleImportDialog.setObjectName(u'BibleImportDialog')
BibleImportDialog.resize(494, 725)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
BibleImportDialog.setWindowIcon(icon)
self.ImportToolBox = QtGui.QToolBox(BibleImportDialog)
self.ImportToolBox.setGeometry(QtCore.QRect(20, 20, 451, 401))
self.ImportToolBox.setFrameShape(QtGui.QFrame.StyledPanel)
- self.ImportToolBox.setObjectName("ImportToolBox")
+ self.ImportToolBox.setObjectName(u'ImportToolBox')
self.FileImportPage = QtGui.QWidget()
self.FileImportPage.setGeometry(QtCore.QRect(0, 0, 447, 337))
- self.FileImportPage.setObjectName("FileImportPage")
+ self.FileImportPage.setObjectName(u'FileImportPage')
self.OSISGroupBox = QtGui.QGroupBox(self.FileImportPage)
self.OSISGroupBox.setGeometry(QtCore.QRect(18, 65, 411, 81))
- self.OSISGroupBox.setObjectName("OSISGroupBox")
+ self.OSISGroupBox.setObjectName(u'OSISGroupBox')
self.gridLayout_2 = QtGui.QGridLayout(self.OSISGroupBox)
self.gridLayout_2.setMargin(8)
self.gridLayout_2.setSpacing(8)
- self.gridLayout_2.setObjectName("gridLayout_2")
+ self.gridLayout_2.setObjectName(u'gridLayout_2')
self.LocatioLabel = QtGui.QLabel(self.OSISGroupBox)
- self.LocatioLabel.setObjectName("LocatioLabel")
+ self.LocatioLabel.setObjectName(u'LocatioLabel')
self.gridLayout_2.addWidget(self.LocatioLabel, 0, 0, 1, 1)
self.OSISLocationEdit = QtGui.QLineEdit(self.OSISGroupBox)
- self.OSISLocationEdit.setObjectName("OSISLocationEdit")
+ self.OSISLocationEdit.setObjectName(u'OSISLocationEdit')
self.gridLayout_2.addWidget(self.OSISLocationEdit, 0, 1, 1, 1)
self.OsisFileButton = QtGui.QPushButton(self.OSISGroupBox)
icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/imports/import_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap(u':/imports/import_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OsisFileButton.setIcon(icon1)
- self.OsisFileButton.setObjectName("OsisFileButton")
+ self.OsisFileButton.setObjectName(u'OsisFileButton')
self.gridLayout_2.addWidget(self.OsisFileButton, 0, 2, 1, 1)
self.CVSGroupBox = QtGui.QGroupBox(self.FileImportPage)
self.CVSGroupBox.setGeometry(QtCore.QRect(20, 170, 411, 191))
- self.CVSGroupBox.setObjectName("CVSGroupBox")
+ self.CVSGroupBox.setObjectName(u'CVSGroupBox')
self.gridLayout = QtGui.QGridLayout(self.CVSGroupBox)
self.gridLayout.setMargin(8)
self.gridLayout.setSpacing(8)
- self.gridLayout.setObjectName("gridLayout")
+ self.gridLayout.setObjectName(u'gridLayout')
self.BooksLocationLabel = QtGui.QLabel(self.CVSGroupBox)
- self.BooksLocationLabel.setObjectName("BooksLocationLabel")
+ self.BooksLocationLabel.setObjectName(u'BooksLocationLabel')
self.gridLayout.addWidget(self.BooksLocationLabel, 0, 0, 1, 1)
self.VerseLocationLabel = QtGui.QLabel(self.CVSGroupBox)
- self.VerseLocationLabel.setObjectName("VerseLocationLabel")
+ self.VerseLocationLabel.setObjectName(u'VerseLocationLabel')
self.gridLayout.addWidget(self.VerseLocationLabel, 4, 0, 1, 1)
self.VerseLocationEdit = QtGui.QLineEdit(self.CVSGroupBox)
- self.VerseLocationEdit.setObjectName("VerseLocationEdit")
+ self.VerseLocationEdit.setObjectName(u'VerseLocationEdit')
self.gridLayout.addWidget(self.VerseLocationEdit, 4, 1, 1, 1)
self.BooksLocationEdit = QtGui.QLineEdit(self.CVSGroupBox)
- self.BooksLocationEdit.setObjectName("BooksLocationEdit")
+ self.BooksLocationEdit.setObjectName(u'BooksLocationEdit')
self.gridLayout.addWidget(self.BooksLocationEdit, 0, 1, 1, 1)
self.BooksFileButton = QtGui.QPushButton(self.CVSGroupBox)
self.BooksFileButton.setIcon(icon1)
- self.BooksFileButton.setObjectName("BooksFileButton")
+ self.BooksFileButton.setObjectName(u'BooksFileButton')
self.gridLayout.addWidget(self.BooksFileButton, 0, 2, 1, 1)
self.VersesFileButton = QtGui.QPushButton(self.CVSGroupBox)
self.VersesFileButton.setIcon(icon1)
- self.VersesFileButton.setObjectName("VersesFileButton")
+ self.VersesFileButton.setObjectName(u'VersesFileButton')
self.gridLayout.addWidget(self.VersesFileButton, 4, 2, 1, 1)
self.BibleNameEdit = QtGui.QLineEdit(self.FileImportPage)
self.BibleNameEdit.setGeometry(QtCore.QRect(100, 20, 280, 28))
- self.BibleNameEdit.setObjectName("BibleNameEdit")
+ self.BibleNameEdit.setObjectName(u'BibleNameEdit')
self.BibleNameLabel = QtGui.QLabel(self.FileImportPage)
self.BibleNameLabel.setGeometry(QtCore.QRect(18, 20, 98, 22))
- self.BibleNameLabel.setObjectName("BibleNameLabel")
- self.ImportToolBox.addItem(self.FileImportPage, "")
+ self.BibleNameLabel.setObjectName(u'BibleNameLabel')
+ self.ImportToolBox.addItem(self.FileImportPage, u'')
self.WebBiblePage = QtGui.QWidget()
self.WebBiblePage.setGeometry(QtCore.QRect(0, 0, 447, 337))
- self.WebBiblePage.setObjectName("WebBiblePage")
+ self.WebBiblePage.setObjectName(u'WebBiblePage')
self.WebBibleLayout = QtGui.QVBoxLayout(self.WebBiblePage)
self.WebBibleLayout.setSpacing(8)
self.WebBibleLayout.setMargin(8)
- self.WebBibleLayout.setObjectName("WebBibleLayout")
+ self.WebBibleLayout.setObjectName(u'WebBibleLayout')
self.OptionsGroupBox = QtGui.QGroupBox(self.WebBiblePage)
- self.OptionsGroupBox.setObjectName("OptionsGroupBox")
+ self.OptionsGroupBox.setObjectName(u'OptionsGroupBox')
self.formLayout_2 = QtGui.QFormLayout(self.OptionsGroupBox)
- self.formLayout_2.setObjectName("formLayout_2")
+ self.formLayout_2.setObjectName(u'formLayout_2')
self.LocationLabel = QtGui.QLabel(self.OptionsGroupBox)
- self.LocationLabel.setObjectName("LocationLabel")
+ self.LocationLabel.setObjectName(u'LocationLabel')
self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.LocationLabel)
self.LocationComboBox = QtGui.QComboBox(self.OptionsGroupBox)
- self.LocationComboBox.setObjectName("LocationComboBox")
+ self.LocationComboBox.setObjectName(u'LocationComboBox')
self.LocationComboBox.addItem(QtCore.QString())
self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.LocationComboBox)
self.BibleLabel = QtGui.QLabel(self.OptionsGroupBox)
- self.BibleLabel.setObjectName("BibleLabel")
+ self.BibleLabel.setObjectName(u'BibleLabel')
self.formLayout_2.setWidget(1, QtGui.QFormLayout.LabelRole, self.BibleLabel)
self.BibleComboBox = QtGui.QComboBox(self.OptionsGroupBox)
- self.BibleComboBox.setObjectName("BibleComboBox")
+ self.BibleComboBox.setObjectName(u'BibleComboBox')
self.BibleComboBox.addItem(QtCore.QString())
- self.BibleComboBox.setItemText(0, "")
+ self.BibleComboBox.setItemText(0, u'')
self.BibleComboBox.addItem(QtCore.QString())
self.BibleComboBox.addItem(QtCore.QString())
self.formLayout_2.setWidget(1, QtGui.QFormLayout.FieldRole, self.BibleComboBox)
self.WebBibleLayout.addWidget(self.OptionsGroupBox)
self.ProxyGroupBox = QtGui.QGroupBox(self.WebBiblePage)
- self.ProxyGroupBox.setObjectName("ProxyGroupBox")
+ self.ProxyGroupBox.setObjectName(u'ProxyGroupBox')
self.ProxySettingsLayout = QtGui.QFormLayout(self.ProxyGroupBox)
self.ProxySettingsLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
self.ProxySettingsLayout.setMargin(8)
self.ProxySettingsLayout.setSpacing(8)
- self.ProxySettingsLayout.setObjectName("ProxySettingsLayout")
+ self.ProxySettingsLayout.setObjectName(u'ProxySettingsLayout')
self.AddressLabel = QtGui.QLabel(self.ProxyGroupBox)
- self.AddressLabel.setObjectName("AddressLabel")
+ self.AddressLabel.setObjectName(u'AddressLabel')
self.ProxySettingsLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.AddressLabel)
self.AddressEdit = QtGui.QLineEdit(self.ProxyGroupBox)
- self.AddressEdit.setObjectName("AddressEdit")
+ self.AddressEdit.setObjectName(u'AddressEdit')
self.ProxySettingsLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.AddressEdit)
self.UsernameLabel = QtGui.QLabel(self.ProxyGroupBox)
- self.UsernameLabel.setObjectName("UsernameLabel")
+ self.UsernameLabel.setObjectName(u'UsernameLabel')
self.ProxySettingsLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.UsernameLabel)
self.UsernameEdit = QtGui.QLineEdit(self.ProxyGroupBox)
- self.UsernameEdit.setObjectName("UsernameEdit")
+ self.UsernameEdit.setObjectName(u'UsernameEdit')
self.ProxySettingsLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.UsernameEdit)
self.PasswordLabel = QtGui.QLabel(self.ProxyGroupBox)
- self.PasswordLabel.setObjectName("PasswordLabel")
+ self.PasswordLabel.setObjectName(u'PasswordLabel')
self.ProxySettingsLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.PasswordLabel)
self.PasswordEdit = QtGui.QLineEdit(self.ProxyGroupBox)
self.PasswordEdit.setEchoMode(QtGui.QLineEdit.Password)
- self.PasswordEdit.setObjectName("PasswordEdit")
+ self.PasswordEdit.setObjectName(u'PasswordEdit')
self.ProxySettingsLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.PasswordEdit)
self.WebBibleLayout.addWidget(self.ProxyGroupBox)
- self.ImportToolBox.addItem(self.WebBiblePage, "")
+ self.ImportToolBox.addItem(self.WebBiblePage, u'')
self.LicenceDetailsGroupBox = QtGui.QGroupBox(BibleImportDialog)
self.LicenceDetailsGroupBox.setGeometry(QtCore.QRect(10, 435, 471, 151))
self.LicenceDetailsGroupBox.setMinimumSize(QtCore.QSize(0, 123))
- self.LicenceDetailsGroupBox.setObjectName("LicenceDetailsGroupBox")
+ self.LicenceDetailsGroupBox.setObjectName(u'LicenceDetailsGroupBox')
self.formLayout = QtGui.QFormLayout(self.LicenceDetailsGroupBox)
self.formLayout.setMargin(8)
self.formLayout.setHorizontalSpacing(8)
- self.formLayout.setObjectName("formLayout")
+ self.formLayout.setObjectName(u'formLayout')
self.VersionNameLabel = QtGui.QLabel(self.LicenceDetailsGroupBox)
- self.VersionNameLabel.setObjectName("VersionNameLabel")
+ self.VersionNameLabel.setObjectName(u'VersionNameLabel')
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.VersionNameLabel)
self.VersionNameEdit = QtGui.QLineEdit(self.LicenceDetailsGroupBox)
- self.VersionNameEdit.setObjectName("VersionNameEdit")
+ self.VersionNameEdit.setObjectName(u'VersionNameEdit')
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.VersionNameEdit)
self.CopyrightLabel = QtGui.QLabel(self.LicenceDetailsGroupBox)
- self.CopyrightLabel.setObjectName("CopyrightLabel")
+ self.CopyrightLabel.setObjectName(u'CopyrightLabel')
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.CopyrightLabel)
self.CopyrightEdit = QtGui.QLineEdit(self.LicenceDetailsGroupBox)
- self.CopyrightEdit.setObjectName("CopyrightEdit")
+ self.CopyrightEdit.setObjectName(u'CopyrightEdit')
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.CopyrightEdit)
self.PermisionLabel = QtGui.QLabel(self.LicenceDetailsGroupBox)
- self.PermisionLabel.setObjectName("PermisionLabel")
+ self.PermisionLabel.setObjectName(u'PermisionLabel')
self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.PermisionLabel)
self.PermisionEdit = QtGui.QLineEdit(self.LicenceDetailsGroupBox)
- self.PermisionEdit.setObjectName("PermisionEdit")
+ self.PermisionEdit.setObjectName(u'PermisionEdit')
self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.PermisionEdit)
self.MessageLabel = QtGui.QLabel(BibleImportDialog)
self.MessageLabel.setGeometry(QtCore.QRect(20, 670, 271, 17))
- self.MessageLabel.setObjectName("MessageLabel")
+ self.MessageLabel.setObjectName(u'MessageLabel')
self.ProgressGroupBox = QtGui.QGroupBox(BibleImportDialog)
self.ProgressGroupBox.setGeometry(QtCore.QRect(10, 600, 471, 70))
- self.ProgressGroupBox.setObjectName("ProgressGroupBox")
+ self.ProgressGroupBox.setObjectName(u'ProgressGroupBox')
self.gridLayout_3 = QtGui.QGridLayout(self.ProgressGroupBox)
- self.gridLayout_3.setObjectName("gridLayout_3")
+ self.gridLayout_3.setObjectName(u'gridLayout_3')
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
- self.ProgressBar.setProperty("value", QtCore.QVariant(0))
+ self.ProgressBar.setProperty(u'value', QtCore.QVariant(0))
self.ProgressBar.setInvertedAppearance(False)
- self.ProgressBar.setObjectName("ProgressBar")
+ self.ProgressBar.setObjectName(u'ProgressBar')
self.gridLayout_3.addWidget(self.ProgressBar, 0, 0, 1, 1)
self.layoutWidget = QtGui.QWidget(BibleImportDialog)
self.layoutWidget.setGeometry(QtCore.QRect(300, 680, 180, 38))
- self.layoutWidget.setObjectName("layoutWidget")
+ self.layoutWidget.setObjectName(u'layoutWidget')
self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget)
self.horizontalLayout.setMargin(6)
- self.horizontalLayout.setObjectName("horizontalLayout")
+ self.horizontalLayout.setObjectName(u'horizontalLayout')
self.ImportButton = QtGui.QPushButton(self.layoutWidget)
- self.ImportButton.setObjectName("ImportButton")
+ self.ImportButton.setObjectName(u'ImportButton')
self.horizontalLayout.addWidget(self.ImportButton)
self.CancelButton = QtGui.QPushButton(self.layoutWidget)
- self.CancelButton.setObjectName("CancelButton")
+ self.CancelButton.setObjectName(u'CancelButton')
self.horizontalLayout.addWidget(self.CancelButton)
self.retranslateUi(BibleImportDialog)
@@ -205,31 +205,30 @@
BibleImportDialog.setTabOrder(self.CopyrightEdit, self.PermisionEdit)
def retranslateUi(self, BibleImportDialog):
- BibleImportDialog.setWindowTitle(QtGui.QApplication.translate("BibleImportDialog", "Bible Registration", None, QtGui.QApplication.UnicodeUTF8))
- self.OSISGroupBox.setTitle(QtGui.QApplication.translate("BibleImportDialog", "OSIS Bible", None, QtGui.QApplication.UnicodeUTF8))
- self.LocatioLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "File Location:", None, QtGui.QApplication.UnicodeUTF8))
- self.CVSGroupBox.setTitle(QtGui.QApplication.translate("BibleImportDialog", "CVS Bible", None, QtGui.QApplication.UnicodeUTF8))
- self.BooksLocationLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Books Location:", None, QtGui.QApplication.UnicodeUTF8))
- self.VerseLocationLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Verse Location:", None, QtGui.QApplication.UnicodeUTF8))
- self.BibleNameLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Bible Name:", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportToolBox.setItemText(self.ImportToolBox.indexOf(self.FileImportPage), QtGui.QApplication.translate("BibleImportDialog", "File Import Page", None, QtGui.QApplication.UnicodeUTF8))
- self.OptionsGroupBox.setTitle(QtGui.QApplication.translate("BibleImportDialog", "Download Options", None, QtGui.QApplication.UnicodeUTF8))
- self.LocationLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Location:", None, QtGui.QApplication.UnicodeUTF8))
- self.LocationComboBox.setItemText(0, QtGui.QApplication.translate("BibleImportDialog", "Crosswalk", None, QtGui.QApplication.UnicodeUTF8))
- self.BibleLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Bible:", None, QtGui.QApplication.UnicodeUTF8))
- self.BibleComboBox.setItemText(1, QtGui.QApplication.translate("BibleImportDialog", "NIV", None, QtGui.QApplication.UnicodeUTF8))
- self.BibleComboBox.setItemText(2, QtGui.QApplication.translate("BibleImportDialog", "KJV", None, QtGui.QApplication.UnicodeUTF8))
- self.ProxyGroupBox.setTitle(QtGui.QApplication.translate("BibleImportDialog", "Proxy Settings (Optional)", None, QtGui.QApplication.UnicodeUTF8))
- self.AddressLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Proxy Address:", None, QtGui.QApplication.UnicodeUTF8))
- self.UsernameLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Username:", None, QtGui.QApplication.UnicodeUTF8))
- self.PasswordLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Password:", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportToolBox.setItemText(self.ImportToolBox.indexOf(self.WebBiblePage), QtGui.QApplication.translate("BibleImportDialog", "Web Bible Import page", None, QtGui.QApplication.UnicodeUTF8))
- self.LicenceDetailsGroupBox.setTitle(QtGui.QApplication.translate("BibleImportDialog", "Licence Details", None, QtGui.QApplication.UnicodeUTF8))
- self.VersionNameLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Version Name:", None, QtGui.QApplication.UnicodeUTF8))
- self.CopyrightLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Copyright:", None, QtGui.QApplication.UnicodeUTF8))
- self.PermisionLabel.setText(QtGui.QApplication.translate("BibleImportDialog", "Permission:", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("BibleImportDialog", "Import Progress", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressBar.setFormat(QtGui.QApplication.translate("BibleImportDialog", "%p", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportButton.setText(QtGui.QApplication.translate("BibleImportDialog", "Import", None, QtGui.QApplication.UnicodeUTF8))
- self.CancelButton.setText(QtGui.QApplication.translate("BibleImportDialog", "Cancel", None, QtGui.QApplication.UnicodeUTF8))
-
+ BibleImportDialog.setWindowTitle(translate(u'BibleImportDialog', u'Bible Registration'))
+ self.OSISGroupBox.setTitle(translate(u'BibleImportDialog', u'OSIS Bible'))
+ self.LocatioLabel.setText(translate(u'BibleImportDialog', u'File Location:'))
+ self.CVSGroupBox.setTitle(translate(u'BibleImportDialog', u'CVS Bible'))
+ self.BooksLocationLabel.setText(translate(u'BibleImportDialog', u'Books Location:'))
+ self.VerseLocationLabel.setText(translate(u'BibleImportDialog', u'Verse Location:'))
+ self.BibleNameLabel.setText(translate(u'BibleImportDialog', u'Bible Name:'))
+ self.ImportToolBox.setItemText(self.ImportToolBox.indexOf(self.FileImportPage), translate(u'BibleImportDialog', u'File Import Page'))
+ self.OptionsGroupBox.setTitle(translate(u'BibleImportDialog', u'Download Options'))
+ self.LocationLabel.setText(translate(u'BibleImportDialog', u'Location:'))
+ self.LocationComboBox.setItemText(0, translate(u'BibleImportDialog', u'Crosswalk'))
+ self.BibleLabel.setText(translate(u'BibleImportDialog', u'Bible:'))
+ self.BibleComboBox.setItemText(1, translate(u'BibleImportDialog', u'NIV'))
+ self.BibleComboBox.setItemText(2, translate(u'BibleImportDialog', u'KJV'))
+ self.ProxyGroupBox.setTitle(translate(u'BibleImportDialog', u'Proxy Settings (Optional)'))
+ self.AddressLabel.setText(translate(u'BibleImportDialog', u'Proxy Address:'))
+ self.UsernameLabel.setText(translate(u'BibleImportDialog', u'Username:'))
+ self.PasswordLabel.setText(translate(u'BibleImportDialog', u'Password:'))
+ self.ImportToolBox.setItemText(self.ImportToolBox.indexOf(self.WebBiblePage), translate(u'BibleImportDialog', u'Web Bible Import page'))
+ self.LicenceDetailsGroupBox.setTitle(translate(u'BibleImportDialog', u'Licence Details'))
+ self.VersionNameLabel.setText(translate(u'BibleImportDialog', u'Version Name:'))
+ self.CopyrightLabel.setText(translate(u'BibleImportDialog', u'Copyright:'))
+ self.PermisionLabel.setText(translate(u'BibleImportDialog', u'Permission:'))
+ self.ProgressGroupBox.setTitle(translate(u'BibleImportDialog', u'Import Progress'))
+ self.ProgressBar.setFormat(translate(u'BibleImportDialog', u'%p'))
+ self.ImportButton.setText(translate(u'BibleImportDialog', u'Import'))
+ self.CancelButton.setText(translate(u'BibleImportDialog', u'Cancel'))
=== modified file 'openlp/plugins/bibles/forms/bibleimportform.py'
--- openlp/plugins/bibles/forms/bibleimportform.py 2009-06-08 05:04:06 +0000
+++ openlp/plugins/bibles/forms/bibleimportform.py 2009-06-16 18:21:24 +0000
@@ -61,7 +61,7 @@
for line in fbibles:
p = line.split(u',')
self.bible_versions[p[0]] = p[1].replace(u'\n', u'')
- self.BibleComboBox.addItem(str(p[0]))
+ self.BibleComboBox.addItem(unicode(p[0]))
#Combo Boxes
QtCore.QObject.connect(self.LocationComboBox,
@@ -133,20 +133,20 @@
self.checkOsis()
def onProxyAddressEditLostFocus(self):
- self.config.set_config(u'proxy_address', str(self.AddressEdit.displayText()))
+ self.config.set_config(u'proxy_address', unicode(self.AddressEdit.displayText()))
def onProxyUsernameEditLostFocus(self):
- self.config.set_config(u'proxy_username', str(self.UsernameEdit.displayText()))
+ self.config.set_config(u'proxy_username', unicode(self.UsernameEdit.displayText()))
def onProxyPasswordEditLostFocus(self):
- self.config.set_config(u'proxy_password', str(self.PasswordEdit.displayText()))
+ self.config.set_config(u'proxy_password', unicode(self.PasswordEdit.displayText()))
def onLocationComboBoxSelected(self):
self.checkHttp()
def onBibleComboBoxSelected(self):
self.checkHttp()
- self.BibleNameEdit.setText(str(self.BibleComboBox.currentText()))
+ self.BibleNameEdit.setText(unicode(self.BibleComboBox.currentText()))
def onCancelButtonClicked(self):
# tell import to stop
@@ -187,26 +187,26 @@
def importBible(self):
log.debug(u'Import Bible ')
if self.bible_type == u'OSIS':
- loaded = self.biblemanager.register_osis_file_bible(str(self.BibleNameEdit.displayText()),
+ loaded = self.biblemanager.register_osis_file_bible(unicode(self.BibleNameEdit.displayText()),
self.OSISLocationEdit.displayText())
elif self.bible_type == u'CSV':
- loaded = self.biblemanager.register_csv_file_bible(str(self.BibleNameEdit.displayText()),
+ loaded = self.biblemanager.register_csv_file_bible(unicode(self.BibleNameEdit.displayText()),
self.BooksLocationEdit.displayText(), self.VerseLocationEdit.displayText())
else:
# set a value as it will not be needed
self.setMax(1)
- bible = self.bible_versions[str(self.BibleComboBox.currentText())]
- loaded = self.biblemanager.register_http_bible(str(self.BibleComboBox.currentText()), \
- str(self.LocationComboBox.currentText()), \
- str(bible), \
- str(self.AddressEdit.displayText()), \
- str(self.UsernameEdit .displayText()), \
- str(self.PasswordEdit.displayText()))
+ bible = self.bible_versions[unicode(self.BibleComboBox.currentText())]
+ loaded = self.biblemanager.register_http_bible(unicode(self.BibleComboBox.currentText()), \
+ unicode(self.LocationComboBox.currentText()), \
+ unicode(bible), \
+ unicode(self.AddressEdit.displayText()), \
+ unicode(self.UsernameEdit .displayText()), \
+ unicode(self.PasswordEdit.displayText()))
if loaded:
- self.biblemanager.save_meta_data(str(self.BibleNameEdit.displayText()),
- str(self.VersionNameEdit.displayText()),
- str(self.CopyrightEdit.displayText()),
- str(self.PermisionEdit.displayText()))
+ self.biblemanager.save_meta_data(unicode(self.BibleNameEdit.displayText()),
+ unicode(self.VersionNameEdit.displayText()),
+ unicode(self.CopyrightEdit.displayText()),
+ unicode(self.PermisionEdit.displayText()))
self.bible_type = None
# free the screen state restrictions
self.resetScreenFieldStates()
@@ -286,4 +286,4 @@
self.OSISLocationEdit.setText(u'')
self.BibleNameEdit.setText(u'')
self.LocationComboBox.setCurrentIndex(0)
- self.BibleComboBox.setCurrentIndex(0)
+ self.BibleComboBox.setCurrentIndex(0)
\ No newline at end of file
=== modified file 'openlp/plugins/bibles/lib/bibleCSVimpl.py'
--- openlp/plugins/bibles/lib/bibleCSVimpl.py 2009-03-16 17:33:51 +0000
+++ openlp/plugins/bibles/lib/bibleCSVimpl.py 2009-06-16 18:21:24 +0000
@@ -34,7 +34,7 @@
"""
self.bibledb = bibledb
self.loadbible = True
- QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL("openlpstopimport"),self.stop_import)
+ QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL(u'openlpstopimport'),self.stop_import)
def stop_import(self):
self.loadbible= False
@@ -56,7 +56,7 @@
self.bibledb.create_book(p2, p3, int(p1))
count += 1
if count % 3 == 0: #Every x verses repaint the screen
- Receiver().send_message("openlpprocessevents")
+ Receiver().send_message(u'openlpprocessevents')
count = 0
count = 0
@@ -75,5 +75,5 @@
self.bibledb.add_verse(book.id, p[1], p[2], p3)
count += 1
if count % 3 == 0: #Every x verses repaint the screen
- Receiver().send_message("openlpprocessevents")
- count = 0
+ Receiver().send_message(u'openlpprocessevents')
+ count = 0
\ No newline at end of file
=== modified file 'openlp/plugins/bibles/lib/bibleDBimpl.py'
--- openlp/plugins/bibles/lib/bibleDBimpl.py 2009-06-05 05:00:26 +0000
+++ openlp/plugins/bibles/lib/bibleDBimpl.py 2009-06-16 18:21:24 +0000
@@ -37,10 +37,10 @@
# Connect to database
self.config = config
self.biblefile = os.path.join(biblepath, biblename+u'.sqlite')
- log.debug( "Load bible %s on path %s", biblename, self.biblefile)
+ log.debug(u'Load bible %s on path %s', biblename, self.biblefile)
db_type = self.config.get_config(u'db type', u'sqlite')
if db_type == u'sqlite':
- self.db = create_engine("sqlite:///" + self.biblefile)
+ self.db = create_engine(u'sqlite:///' + self.biblefile)
else:
self.db_url = u'%s://%s:%s@%s/%s' % \
(db_type, self.config.get_config(u'db username'),
@@ -57,12 +57,12 @@
def create_tables(self):
log.debug( u'createTables')
self.save_meta(u'dbversion', u'2')
- self._load_testament("Old Testament")
- self._load_testament("New Testament")
- self._load_testament("Apocrypha")
+ self._load_testament(u'Old Testament')
+ self._load_testament(u'New Testament')
+ self._load_testament(u'Apocrypha')
def add_verse(self, bookid, chap, vse, text):
- #log.debug( "add_verse %s,%s,%s", bookid, chap, vse)
+ #log.debug(u'add_verse %s,%s,%s", bookid, chap, vse)
metadata.bind.echo = False
session = self.session()
verse = Verse()
@@ -74,8 +74,8 @@
session.commit()
def create_chapter(self, bookid, chap, textlist):
- log.debug( "create_chapter %s,%s", bookid, chap)
- #log.debug("Text %s ", textlist)
+ log.debug(u'create_chapter %s,%s', bookid, chap)
+ #log.debug(u'Text %s ", textlist)
metadata.bind.echo = False
session = self.session()
#text list has book and chapter as first to elements of the array
@@ -89,7 +89,7 @@
session.commit()
def create_book(self, bookname, bookabbrev, testament = 1):
- log.debug( "create_book %s,%s", bookname, bookabbrev)
+ log.debug(u'create_book %s,%s', bookname, bookabbrev)
metadata.bind.echo = False
session = self.session()
book = Book()
@@ -101,7 +101,7 @@
return book
def save_meta(self, key, value):
- log.debug( "save_meta %s/%s", key, value)
+ log.debug(u'save_meta %s/%s', key, value)
metadata.bind.echo = False
session = self.session()
bmeta= BibleMeta()
@@ -111,7 +111,7 @@
session.commit()
def get_meta(self, metakey):
- log.debug( "get meta %s", metakey)
+ log.debug(u'get meta %s', metakey)
return self.session.query(BibleMeta).filter_by(key = metakey).first()
def delete_meta(self, metakey):
@@ -124,7 +124,7 @@
return False
def _load_testament(self, testament):
- log.debug("load_testaments %s", testament)
+ log.debug(u'load_testaments %s', testament)
metadata.bind.echo = False
session = self.session()
test = ONTestament()
@@ -133,52 +133,52 @@
session.commit()
def get_bible_books(self):
- log.debug( "get_bible_books ")
+ log.debug(u'get_bible_books ')
return self.session.query(Book).order_by(Book.id).all()
def get_max_bible_book_verses(self, bookname, chapter):
- log.debug( "get_max_bible_book_verses %s,%s ", bookname , chapter)
+ log.debug(u'get_max_bible_book_verses %s,%s', bookname , chapter)
metadata.bind.echo = False
- s = text (""" select max(verse.verse) from verse,book where chapter = :c and book_id = book.id and book.name = :b """)
+ s = text (u'select max(verse.verse) from verse,book where chapter = :c and book_id = book.id and book.name = :b ')
return self.db.execute(s, c=chapter, b=bookname).fetchone()
def get_max_bible_book_chapter(self, bookname):
- log.debug( "get_max_bible_book_chapter %s ", bookname )
+ log.debug(u'get_max_bible_book_chapter %s', bookname )
metadata.bind.echo = False
- s = text (""" select max(verse.chapter) from verse,book where book_id = book.id and book.name = :b """)
+ s = text (u'select max(verse.chapter) from verse,book where book_id = book.id and book.name = :b')
return self.db.execute(s, b=bookname).fetchone()
def get_bible_book(self, bookname):
- log.debug( "get_bible_book %s", bookname)
- bk = self.session.query(Book).filter(Book.name.like(bookname+u"%")).first()
+ log.debug(u'get_bible_book %s', bookname)
+ bk = self.session.query(Book).filter(Book.name.like(bookname + u'%')).first()
if bk == None:
- bk = self.session.query(Book).filter(Book.abbreviation.like(bookname+u"%")).first()
+ bk = self.session.query(Book).filter(Book.abbreviation.like(bookname+u'%')).first()
return bk
def get_bible_chapter(self, id, chapter):
- log.debug( "get_bible_chapter %s,%s", id, chapter )
+ log.debug(u'get_bible_chapter %s,%s', id, chapter )
metadata.bind.echo = False
return self.session.query(Verse).filter_by(chapter = chapter ).filter_by(book_id = id).first()
def get_bible_text(self, bookname, chapter, sverse, everse):
- log.debug( "get_bible_text %s,%s,%s,%s ", bookname, chapter, sverse, everse)
+ log.debug(u'get_bible_text %s,%s,%s,%s', bookname, chapter, sverse, everse)
metadata.bind.echo = False
bookname = bookname + u"%"
- s = text (""" select name,chapter,verse.verse, verse.text FROM verse , book where verse.book_id == book.id AND verse.chapter == :c AND (verse.verse between :v1 and :v2) and (book.name like :b) """)
+ s = text (u'select name,chapter,verse.verse, verse.text FROM verse , book where verse.book_id == book.id AND verse.chapter == :c AND (verse.verse between :v1 and :v2) and (book.name like :b)')
return self.db.execute(s, c=chapter, v1=sverse , v2=everse, b=bookname).fetchall()
def get_verses_from_text(self,versetext):
- log.debug( "get_verses_from_text %s",versetext)
+ log.debug(u'get_verses_from_text %s',versetext)
metadata.bind.echo = False
versetext = "%"+versetext+"%"
- s = text (""" select book.name, verse.chapter, verse.verse, verse.text FROM verse , book where verse.book_id == book.id and verse.text like :t """)
+ s = text (u'select book.name, verse.chapter, verse.verse, verse.text FROM verse , book where verse.book_id == book.id and verse.text like :t')
return self.db.execute(s, t=versetext).fetchall()
def dump_bible(self):
log.debug( u'.........Dumping Bible Database')
log.debug( '...............................Books ')
- s = text (""" select * FROM book """)
+ s = text (u'select * FROM book ')
log.debug( self.db.execute(s).fetchall())
log.debug( u'...............................Verses ')
- s = text (""" select * FROM verse """)
+ s = text (u'select * FROM verse ')
log.debug( self.db.execute(s).fetchall())
=== modified file 'openlp/plugins/bibles/lib/bibleHTTPimpl.py'
--- openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-03-16 17:33:51 +0000
+++ openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-06-16 18:21:24 +0000
@@ -23,31 +23,29 @@
from common import BibleCommon, SearchResults
import logging
-
+
class BGExtract(BibleCommon):
- global log
+ global log
log=logging.getLogger(u'BibleHTTPMgr(BG_extract)')
- log.info(u'BG_extract loaded')
-
+ log.info(u'BG_extract loaded')
+
def __init__(self, proxyurl= None):
- log.debug("init %s", proxyurl)
+ log.debug(u'init %s', proxyurl)
self.proxyurl = proxyurl
-
+
def get_bible_chapter(self, version, bookid, bookname, chapter) :
"""
Access and decode bibles via the BibleGateway website
Version - the version of the bible like 31 for New International version
bookid - Book id for the book of the bible - eg 1 for Genesis
bookname - not used
- chapter - chapter number
-
+ chapter - chapter number
"""
- version = 49
- log.debug( u"get_bible_chapter %s,%s,%s,%s", version, bookid, bookname, chapter)
- urlstring = u"http://www.biblegateway.com/passage/?book_id="+str(bookid)+"&chapter"+str(chapter)+"&version="+str(version)
+ log.debug( u'get_bible_chapter %s,%s,%s,%s', version, bookid, bookname, chapter)
+ urlstring = u'http://www.biblegateway.com/passage/?book_id='+unicode(bookid)+u'&chapter'+unicode(chapter)+u'&version='+unicode(version)
xml_string = self._get_web_text(urlstring, self.proxyurl)
print xml_string
- VerseSearch = u'class='+'"'+u'sup'+'"'+u'>'
+ VerseSearch = u'class='+u'"'+u'sup'+u'"'+u'>'
verse = 1
i= xml_string.find(u'result-text-style-normal')
xml_string = xml_string[i:len(xml_string)]
@@ -61,14 +59,14 @@
#print i , versePos
if i == -1:
i = xml_string.find(u'</div', versePos+1)
- j = xml_string.find(u'<strong', versePos+1)
+ j = xml_string.find(u'<strong', versePos+1)
#print i , j
if j > 0 and j < i:
i = j
- verseText = xml_string[versePos + 7 : i ]
+ verseText = xml_string[versePos + 7 : i ]
#print xml_string
- #print 'VerseText = ' + str(verse) +' '+ verseText
- bible[verse] = self._clean_text(verseText) # store the verse
+ #print 'VerseText = ' + unicode(verse) +' '+ verseText
+ bible[verse] = self._clean_text(verseText) # store the verse
versePos = -1
else:
i = xml_string[:i].rfind(u'<span')+1
@@ -77,43 +75,43 @@
versePos = xml_string.find(VerseSearch) #look for the next verse
bible[verse] = self._clean_text(verseText) # store the verse
verse += 1
- return bible
-
+ return bible
+
class CWExtract(BibleCommon):
- global log
+ global log
log=logging.getLogger(u'BibleHTTPMgr(CWExtract)')
- log.info(u'CWExtract loaded')
-
+ log.info(u'CWExtract loaded')
+
def __init__(self, proxyurl=None):
- log.debug(u"init %s", proxyurl)
+ log.debug(u'init %s', proxyurl)
self.proxyurl = proxyurl
-
+
def get_bible_chapter(self, version, bookid, bookname, chapter) :
- log.debug( u"getBibleChapter %s,%s,%s,%s", version, bookid, bookname, chapter)
+ log.debug( u'getBibleChapter %s,%s,%s,%s', version, bookid, bookname, chapter)
"""
Access and decode bibles via the Crosswalk website
Version - the version of the bible like niv for New International version
bookid - not used
bookname - text name of in english eg 'gen' for Genesis
- chapter - chapter number
- """
- log.debug( "get_bible_chapter %s,%s,%s,%s", version, bookid, bookname, chapter)
- bookname = bookname.replace(' ', '')
- urlstring = "http://bible.crosswalk.com/OnlineStudyBible/bible.cgi?word="+bookname+"+"+str(chapter)+"&version="+version
+ chapter - chapter number
+ """
+ log.debug(u'get_bible_chapter %s,%s,%s,%s', version, bookid, bookname, chapter)
+ bookname = bookname.replace(u' ', '')
+ urlstring = "http://bible.crosswalk.com/OnlineStudyBible/bible.cgi?word="+bookname+"+"+unicode(chapter)+"&version="+version
xml_string = self._get_web_text(urlstring, self.proxyurl)
- #log.debug('Return data %s', xml_string)
+ #log.debug(u'Return data %s', xml_string)
## Strip Book Title from Heading to return it to system
##
i= xml_string.find(u'<title>')
j= xml_string.find(u'-', i)
book_title = xml_string[i + 7:j]
book_title = book_title.rstrip()
- log.debug(u"Book Title %s", book_title)
- i = book_title.rfind(" ")
+ log.debug(u'Book Title %s', book_title)
+ i = book_title.rfind(u' ')
book_chapter = book_title[i+1:len(book_title)].rstrip()
book_title = book_title[:i].rstrip()
- log.debug(u"Book Title %s", book_title)
- log.debug(u"Book Chapter %s", book_chapter)
+ log.debug(u'Book Title %s', book_title)
+ log.debug(u'Book Chapter %s', book_chapter)
## Strip Verse Data from Page and build an array
##
@@ -125,17 +123,17 @@
xml_string = xml_string[i + 3 :len(xml_string)] #remove the <B> at the front
i= xml_string.find(u'<B>') # Remove the heading for the book
xml_string = xml_string[i + 3 :len(xml_string)] #remove the <B> at the front
- versePos = xml_string.find(u'<BLOCKQUOTE>')
+ versePos = xml_string.find(u'<BLOCKQUOTE>')
#log.debug( versePos)
bible = {}
while versePos > 0:
verseText = '' # clear out string
versePos = xml_string.find(u'<B><I>', versePos) + 6
- i = xml_string.find(u'</I></B>', versePos)
+ i = xml_string.find(u'</I></B>', versePos)
#log.debug( versePos, i)
verse= xml_string[versePos:i] # Got the Chapter
#verse = int(temp)
- #log.debug( 'Chapter = ' + str(temp))
+ #log.debug( 'Chapter = ' + unicode(temp))
versePos = i + 8 # move the starting position to negining of the text
i = xml_string.find(u'<B><I>', versePos) # fine the start of the next verse
if i == -1:
@@ -148,14 +146,14 @@
versePos = i
bible[verse] = self._clean_text(verseText)
#bible[verse] = verseText
-
+
#log.debug( bible)
return SearchResults(book_title, book_chapter, bible)
-
+
class BibleHTTPImpl():
- global log
+ global log
log=logging.getLogger(u'BibleHTTPMgr')
- log.info(u'BibleHTTP manager loaded')
+ log.info(u'BibleHTTP manager loaded')
def __init__(self):
"""
Finds all the bibles defined for the system
@@ -168,43 +166,41 @@
biblesource = ''
proxyurl = None
bibleid = None
-
+
def set_proxy(self,proxyurl):
"""
Set the Proxy Url
"""
- log.debug(u"set_proxy %s", proxyurl)
- self.proxyurl = proxyurl
-
+ log.debug(u'set_proxy %s', proxyurl)
+ self.proxyurl = proxyurl
+
def set_bibleid(self,bibleid):
"""
Set the bible id.
The shore identifier of the the bible.
"""
- log.debug(u"set_bibleid %s", bibleid)
- self.bibleid = bibleid
-
+ log.debug(u'set_bibleid %s', bibleid)
+ self.bibleid = bibleid
+
def set_bible_source(self,biblesource):
"""
Set the source of where the bible text is coming from
"""
- log.debug(u"set_bible_source %s", biblesource)
+ log.debug(u'set_bible_source %s', biblesource)
self.biblesource = biblesource
def get_bible_chapter(self, version, bookid, bookname, chapter):
"""
Receive the request and call the relevant handler methods
"""
- log.debug(u"get_bible_chapter %s,%s,%s,%s", version, bookid, bookname, chapter)
- log.debug(u"biblesource = %s", self.biblesource)
+ log.debug(u'get_bible_chapter %s,%s,%s,%s', version, bookid, bookname, chapter)
+ log.debug(u'biblesource = %s', self.biblesource)
try:
if self.biblesource.lower() == u'crosswalk':
ev = CWExtract(self.proxyurl)
else:
ev = BGExtract(self.proxyurl)
-
+
return ev.get_bible_chapter(self.bibleid, bookid, bookname, chapter)
except:
- log.error(u"Error thrown = %s", sys.exc_info()[1])
-
-
+ log.error(u'Error thrown = %s', sys.exc_info()[1])
=== modified file 'openlp/plugins/bibles/lib/bibleOSISimpl.py'
--- openlp/plugins/bibles/lib/bibleOSISimpl.py 2009-06-04 20:06:32 +0000
+++ openlp/plugins/bibles/lib/bibleOSISimpl.py 2009-06-16 18:21:24 +0000
@@ -24,7 +24,7 @@
class BibleOSISImpl():
global log
- log=logging.getLogger(u'BibleOSISImpl')
+ log = logging.getLogger(u'BibleOSISImpl')
log.info(u'BibleOSISImpl loaded')
def __init__(self, biblepath, bibledb):
@@ -33,20 +33,20 @@
self.abbrevOfBible = {} # books of the bible linked to bibleid {osis ,Abbrev }
filepath = os.path.split(os.path.abspath(__file__))[0]
- filepath = os.path.abspath(os.path.join(filepath, '..', 'resources','osisbooks.csv'))
- fbibles=open(filepath, 'r')
+ filepath = os.path.abspath(os.path.join(filepath, u'..', u'resources',u'osisbooks.csv'))
+ fbibles=open(filepath, u'r')
for line in fbibles:
- p = line.split(",")
- self.booksOfBible[p[0]] = p[1].replace('\n', '')
- self.abbrevOfBible[p[0]] = p[2].replace('\n', '')
+ p = line.split(u',')
+ self.booksOfBible[p[0]] = p[1].replace(u'\n', '')
+ self.abbrevOfBible[p[0]] = p[2].replace(u'\n', '')
self.loadbible = True
- QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL("openlpstopimport"),self.stop_import)
+ QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL(u'openlpstopimport'),self.stop_import)
def stop_import(self):
self.loadbible= False
def load_data(self, osisfile, dialogobject=None):
- osis=open(osisfile, 'r')
+ osis=open(osisfile, u'r')
book_ptr = None
id = 0
@@ -60,19 +60,19 @@
# print file
pos = file.find(verseText)
if pos > -1: # we have a verse
- epos= file.find(">", pos)
+ epos= file.find(u'>', pos)
ref = file[pos+15:epos-1] # Book Reference
#lets find the bible text only
pos = epos + 1 # find start of text
- epos = file.find("</verse>", pos) # end of text
+ epos = file.find(u'</verse>', pos) # end of text
text = unicode(file[pos : epos], u'utf8')
#print pos, e, f[pos:e] # Found Basic Text
#remove tags of extra information
- text = self.remove_block(u'<title',u'</title>', text)
- text = self.remove_block(u'<note',u'</note>', text)
- text = self.remove_block(u'<divineName',u'</divineName>', text)
+ text = self.remove_block(u'<title', u'</title>', text)
+ text = self.remove_block(u'<note', u'</note>', text)
+ text = self.remove_block(u'<divineName', u'</divineName>', text)
text = self.remove_tag(u'<lb', text)
text = self.remove_tag(u'<q', text)
@@ -113,12 +113,12 @@
book_ptr = p[0]
book = self.bibledb.create_book(self.booksOfBible[p[0]] , self.abbrevOfBible[p[0]], testament)
dialogobject.incrementProgressBar(self.booksOfBible[p[0]] )
- Receiver().send_message("openlpprocessevents")
+ Receiver().send_message(u'openlpprocessevents')
count = 0
self.bibledb.add_verse(book.id, p[1], p[2], text)
count += 1
if count % 3 == 0: #Every 3 verses repaint the screen
- Receiver().send_message("openlpprocessevents")
+ Receiver().send_message(u'openlpprocessevents')
count = 0
def remove_block(self, start_tag, end_tag, text):
=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
--- openlp/plugins/bibles/lib/biblestab.py 2009-06-08 05:04:06 +0000
+++ openlp/plugins/bibles/lib/biblestab.py 2009-06-16 18:21:24 +0000
@@ -70,7 +70,7 @@
self.VerseTypeLayout.addWidget(self.ParagraphRadioButton)
self.VerseDisplayLayout.addWidget(self.VerseTypeWidget, 0, 0, 1, 1)
self.NewChaptersCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
- self.NewChaptersCheckBox.setObjectName("NewChaptersCheckBox")
+ self.NewChaptersCheckBox.setObjectName(u'NewChaptersCheckBox')
self.VerseDisplayLayout.addWidget(self.NewChaptersCheckBox, 1, 0, 1, 1)
self.DisplayStyleWidget = QtGui.QWidget(self.VerseDisplayGroupBox)
self.DisplayStyleWidget.setObjectName(u'DisplayStyleWidget')
@@ -201,11 +201,11 @@
self.BibleSearchCheckBox.setChecked(self.bible_search)
def save(self):
- self.config.set_config(u'paragraph style', str(self.paragraph_style))
- self.config.set_config(u'display new chapter', str(self.show_new_chapters))
- self.config.set_config(u'display brackets', str(self.display_style))
- self.config.set_config(u'search as type', str(self.bible_search))
- self.config.set_config(u'bible theme', str(self.bible_theme))
+ self.config.set_config(u'paragraph style', unicode(self.paragraph_style))
+ self.config.set_config(u'display new chapter', unicode(self.show_new_chapters))
+ self.config.set_config(u'display brackets', unicode(self.display_style))
+ self.config.set_config(u'search as type', unicode(self.bible_search))
+ self.config.set_config(u'bible theme', unicode(self.bible_theme))
def updateThemeList(self, theme_list):
"""
@@ -215,9 +215,9 @@
self.BibleThemeComboBox.addItem(u'')
for theme in theme_list:
self.BibleThemeComboBox.addItem(theme)
- id = self.BibleThemeComboBox.findText(str(self.bible_theme), QtCore.Qt.MatchExactly)
+ id = self.BibleThemeComboBox.findText(unicode(self.bible_theme), QtCore.Qt.MatchExactly)
if id == -1:
# Not Found
id = 0
self.bible_theme = u''
- self.BibleThemeComboBox.setCurrentIndex(id)
+ self.BibleThemeComboBox.setCurrentIndex(id)
\ No newline at end of file
=== modified file 'openlp/plugins/bibles/lib/common.py'
--- openlp/plugins/bibles/lib/common.py 2009-02-24 20:24:01 +0000
+++ openlp/plugins/bibles/lib/common.py 2009-06-16 18:21:24 +0000
@@ -15,7 +15,6 @@
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
-
import os
import os.path
import sys
@@ -42,13 +41,13 @@
class BibleCommon:
global log
- log=logging.getLogger("BibleCommon")
- log.info("BibleCommon")
+ log = logging.getLogger(u'BibleCommon')
+ log.info(u'BibleCommon')
def __init__(self):
"""
"""
def _get_web_text(self, urlstring, proxyurl):
- log.debug( "get_web_text %s %s", proxyurl, urlstring)
+ log.debug(u'get_web_text %s %s', proxyurl, urlstring)
if not proxyurl == None:
proxy_support = urllib2.ProxyHandler({'http': self.proxyurl})
http_support = urllib2.HTTPHandler()
@@ -56,13 +55,13 @@
urllib2.install_opener(opener)
xml_string = ""
req = urllib2.Request(urlstring)
- req.add_header('User-Agent', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)')
+ req.add_header(u'User-Agent', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)')
try:
handle = urllib2.urlopen(req)
xml_string = handle.read()
except IOError, e:
- if hasattr(e, 'reason'):
- log.error( 'Reason : ')
+ if hasattr(e, u'reason'):
+ log.error(u'Reason : ')
log.error( e.reason)
return xml_string
@@ -73,42 +72,40 @@
"""
#return text.rstrip()
# Remove Headings from the Text
- i = text.find("<h")
+ i = text.find(u'<h')
while i > -1:
- j=text.find("</h", i)
+ j=text.find(u'</h', i)
text = text[ : (i - 1)]+text[(j+4)]
- i = text.find("<h")
+ i = text.find(u'<h')
# Remove Support References from the Text
- x = text.find("<sup>")
+ x = text.find(u'<sup>')
while x > -1:
- y = text.find("</sup>")
+ y = text.find(u'</sup>')
text= text[:x] + text[y + 6:len(text)]
- x = text.find("<sup>")
+ x = text.find(u'<sup>')
# Static Clean ups
- text= text.replace('\n', '')
- text= text.replace('\r', '')
- text= text.replace(' ', '')
- text= text.replace('<P>', '')
- text= text.replace('<I>', '')
- text= text.replace('</I>', '')
- text= text.replace('<P />', '')
- text= text.replace('<p />', '')
- text= text.replace('</P>', '')
- text= text.replace('<BR>', '')
- text= text.replace('<BR />', '')
- text= text.replace(chr(189), '1/2')
- text= text.replace(""", '"')
- text= text.replace("'", "'")
+ text= text.replace(u'\n', u'')
+ text= text.replace(u'\r', u'')
+ text= text.replace(u' ', u'')
+ text= text.replace(u'<P>', u'')
+ text= text.replace(u'<I>', u'')
+ text= text.replace(u'</I>', u'')
+ text= text.replace(u'<P />', u'')
+ text= text.replace(u'<p />', u'')
+ text= text.replace(u'</P>', u'')
+ text= text.replace(u'<BR>', u'')
+ text= text.replace(u'<BR />', u'')
+ text= text.replace(chr(189), u'1/2')
+ text= text.replace(u'"", u''')
+ text= text.replace(u''", u''')
- i = text.find("<")
+ i = text.find(u'<')
while i > -1 :
- j = text.find(">", i)
+ j = text.find(u'>', i)
text= text[:i] + text[j+1:]
- i = text.find("<")
+ i = text.find(u'<')
- text= text.replace('>', '')
+ text= text.replace(u'>', u'')
return text.rstrip()
-
-
=== modified file 'openlp/plugins/bibles/lib/manager.py'
--- openlp/plugins/bibles/lib/manager.py 2009-06-05 05:00:26 +0000
+++ openlp/plugins/bibles/lib/manager.py 2009-06-16 18:21:24 +0000
@@ -17,7 +17,7 @@
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
@@ -29,13 +29,10 @@
from openlp.plugins.bibles.lib.tables import *
from openlp.plugins.bibles.lib.classes import *
-
-import logging
-
class BibleManager():
global log
- log=logging.getLogger("BibleManager")
- log.info("Bible manager loaded")
+ log=logging.getLogger(u'BibleManager')
+ log.info(u'Bible manager loaded')
def __init__(self, config):
"""
Finds all the bibles defined for the system
@@ -45,21 +42,21 @@
Init confirms the bible exists and stores the database path.
"""
self.config = config
- log.debug( "Bible Initialising")
+ log.debug(u'Bible Initialising')
self.bible_db_cache = None # dict of bible database classes
self.bible_http_cache = None # dict of bible http readers
self.biblePath = self.config.get_data_path()
- self.proxyname = self.config.get_config("proxy name") #get proxy name for screen
- self.bibleSuffix = "sqlite"
+ self.proxyname = self.config.get_config(u'proxy name') #get proxy name for screen
+ self.bibleSuffix = u'sqlite'
self.dialogobject = None
self.reload_bibles()
def reload_bibles(self):
- log.debug("Reload bibles")
+ log.debug(u'Reload bibles')
files = self.config.get_files(self.bibleSuffix)
- log.debug("Bible Files %s", files )
+ log.debug(u'Bible Files %s', files )
self.bible_db_cache = {}
self.bible_http_cache = {}
@@ -70,21 +67,21 @@
for f in files:
- nme = f.split('.')
+ nme = f.split(u'.')
bname = nme[0]
self.bible_db_cache[bname] = BibleDBImpl(self.biblePath, bname, self.config)
- biblesource = self.bible_db_cache[bname].get_meta("WEB") # look to see if lazy load bible exists and get create getter.
+ biblesource = self.bible_db_cache[bname].get_meta(u'WEB') # look to see if lazy load bible exists and get create getter.
if biblesource:
self.web_bibles_present = True
nhttp = BibleHTTPImpl()
nhttp.set_bible_source(biblesource.value) # tell The Server where to get the verses from.
self.bible_http_cache [bname] = nhttp
- meta = self.bible_db_cache[bname].get_meta("proxy") # look to see if lazy load bible exists and get create getter.
+ meta = self.bible_db_cache[bname].get_meta(u'proxy') # look to see if lazy load bible exists and get create getter.
proxy = None
if meta != None:
proxy = meta.value
nhttp.set_proxy(proxy) # tell The Server where to get the verses from.
- bibleid = self.bible_db_cache[bname].get_meta("bibleid").value # look to see if lazy load bible exists and get create getter.
+ bibleid = self.bible_db_cache[bname].get_meta(u'bibleid').value # look to see if lazy load bible exists and get create getter.
nhttp.set_bibleid(bibleid) # tell The Server where to get the verses from.
else:
self.bible_http_cache [bname] = None # makes the Full / partial code easier.
@@ -94,13 +91,13 @@
self.book_abbreviations = {} # books of the bible linked to bibleid {osis ,Abbrev }
filepath = os.path.split(os.path.abspath(__file__))[0]
- filepath = os.path.abspath(os.path.join(filepath, '..', 'resources','httpbooks.csv'))
+ filepath = os.path.abspath(os.path.join(filepath, u'..', u'resources',u'httpbooks.csv'))
fbibles=open(filepath, 'r')
for line in fbibles:
- p = line.split(",")
- self.book_abbreviations[p[0]] = p[1].replace('\n', '')
- self.book_testaments[p[0]] = p[2].replace('\n', '')
- log.debug( "Bible Initialised")
+ p = line.split(u',')
+ self.book_abbreviations[p[0]] = p[1].replace(u'\n', '')
+ self.book_testaments[p[0]] = p[2].replace(u'\n', '')
+ log.debug(u'Bible Initialised')
def process_dialog(self, dialogobject):
self.dialogobject = dialogobject
@@ -110,7 +107,7 @@
Return a list of bibles from a given URL.
The selected Bible can then be registered and LazyLoaded into a database
"""
- log.debug( "register_HTTP_bible %s,%s,%s,%s,%s,%s", biblename, biblesource, bibleid, proxyurl, proxyid, proxypass)
+ log.debug(u'register_HTTP_bible %s,%s,%s,%s,%s,%s', biblename, biblesource, bibleid, proxyurl, proxyid, proxypass)
if self._is_new_bible(biblename):
nbible = BibleDBImpl(self.biblePath, biblename, self.config) # Create new Bible
nbible.create_tables() # Create Database
@@ -119,18 +116,18 @@
nhttp = BibleHTTPImpl()
nhttp.set_bible_source(biblesource)
self.bible_http_cache [biblename] = nhttp
- nbible.save_meta("WEB", biblesource) # register a lazy loading interest
- nbible.save_meta("bibleid", bibleid) # store the we id of the bible
+ nbible.save_meta(u'WEB', biblesource) # register a lazy loading interest
+ nbible.save_meta(u'bibleid', bibleid) # store the we id of the bible
if proxyurl != None and proxyurl != "":
- nbible.save_meta("proxy", proxyurl) # store the proxy URL
+ nbible.save_meta(u'proxy', proxyurl) # store the proxy URL
nhttp.set_proxy(proxyurl)
if proxyid != None and proxyid != "":
- nbible.save_meta("proxyid", proxyid) # store the proxy userid
+ nbible.save_meta(u'proxyid', proxyid) # store the proxy userid
if proxypass != None and proxypass != "":
- nbible.save_meta("proxypass", proxypass) # store the proxy password
+ nbible.save_meta(u'proxypass', proxypass) # store the proxy password
return True
else:
- log.debug( "register_http_file_bible %s not created already exists", biblename)
+ log.debug(u'register_http_file_bible %s not created already exists', biblename)
return False
def register_csv_file_bible(self, biblename, booksfile, versefile):
@@ -139,7 +136,7 @@
If the database exists it is deleted and the database is reloaded
from scratch.
"""
- log.debug( "register_CSV_file_bible %s,%s,%s", biblename, booksfile, versefile)
+ log.debug(u'register_CSV_file_bible %s,%s,%s', biblename, booksfile, versefile)
if self._is_new_bible(biblename):
nbible = BibleDBImpl(self.biblePath, biblename, self.config) # Create new Bible
nbible.create_tables() # Create Database
@@ -148,7 +145,7 @@
bcsv.load_data(booksfile, versefile, self.dialogobject)
return True
else:
- log.debug( "register_csv_file_bible %s not created already exists", biblename)
+ log.debug(u'register_csv_file_bible %s not created already exists', biblename)
return False
def register_osis_file_bible(self, biblename, osisfile):
@@ -157,7 +154,7 @@
If the database exists it is deleted and the database is reloaded
from scratch.
"""
- log.debug( "register_OSIS_file_bible %s , %s", biblename, osisfile)
+ log.debug(u'register_OSIS_file_bible %s , %s', biblename, osisfile)
if self._is_new_bible(biblename):
nbible = BibleDBImpl(self.biblePath, biblename, self.config) # Create new Bible
nbible.create_tables() # Create Database
@@ -166,11 +163,11 @@
bcsv.load_data(osisfile, self.dialogobject)
return True
else:
- log.debug( "register_OSIS_file_bible %s , %s not created already exists", biblename, osisfile)
+ log.debug(u'register_OSIS_file_bible %s , %s not created already exists', biblename, osisfile)
return False
- def get_bibles(self, mode="full"):
- log.debug("get_bibles")
+ def get_bibles(self, mode=u'full'):
+ log.debug(u'get_bibles')
"""
Returns a list of Books of the bible
Mode "Full" - Returns all the bibles for the Queck seearch
@@ -178,7 +175,7 @@
"""
r=[]
for b , o in self.bible_db_cache.iteritems():
- if mode == "full":
+ if mode == u'full':
r.append(b)
else:
if self.bible_http_cache [b] == None: # we do not have an http bible
@@ -189,14 +186,14 @@
"""
Returns a list of the books of the bible from the database
"""
- log.debug("get_bible_books %s", bible)
+ log.debug(u'get_bible_books %s', bible)
return self.bible_db_cache[bible].get_bible_books()
def get_book_chapter_count(self, bible, book):
"""
Returns the number of Chapters for a given book
"""
- log.debug( "get_book_chapter_count %s,%s", bible, book)
+ log.debug(u'get_book_chapter_count %s,%s', bible, book)
return self.bible_db_cache[bible].get_max_bible_book_chapter(book)
def get_book_verse_count(self, bible, book, chapter):
@@ -204,7 +201,7 @@
Returns all the number of verses for a given
book and chapterMaxBibleBookVerses
"""
- log.debug( "get_book_verse_count %s,%s,%s", bible, book, chapter)
+ log.debug(u'get_book_verse_count %s,%s,%s', bible, book, chapter)
return self.bible_db_cache[bible].get_max_bible_book_verses(book, chapter)
def get_verse_from_text(self, bible, versetext):
@@ -212,23 +209,23 @@
Returns all the number of verses for a given
book and chapterMaxBibleBookVerses
"""
- log.debug( "get_verses_from_text %s,%s", bible, versetext)
+ log.debug(u'get_verses_from_text %s,%s', bible, versetext)
return self.bible_db_cache[bible].get_verses_from_text(versetext)
def save_meta_data(self, bible, version, copyright, permissions):
"""
Saves the bibles meta data
"""
- log.debug( "save_meta data %s,%s, %s,%s", bible, version, copyright, permissions)
- self.bible_db_cache[bible].save_meta("Version", version)
- self.bible_db_cache[bible].save_meta("Copyright", copyright)
- self.bible_db_cache[bible].save_meta("Permissions", permissions)
+ log.debug(u'save_meta data %s,%s, %s,%s', bible, version, copyright, permissions)
+ self.bible_db_cache[bible].save_meta(u'Version', version)
+ self.bible_db_cache[bible].save_meta(u'Copyright', copyright)
+ self.bible_db_cache[bible].save_meta(u'Permissions', permissions)
def get_meta_data(self, bible, key):
"""
Returns the meta data for a given key
"""
- log.debug( "get_meta %s,%s", bible, key)
+ log.debug(u'get_meta %s,%s', bible, key)
return self.bible_db_cache[bible].get_meta(key)
def get_verse_text(self, bible, bookname, schapter, echapter, sverse, everse = 0 ):
@@ -240,11 +237,11 @@
Rest can be guessed at !
"""
text = []
- log.debug( "get_verse_text %s,%s,%s,%s,%s,%s", bible, bookname, schapter, echapter, sverse, everse)
+ log.debug(u'get_verse_text %s,%s,%s,%s,%s,%s', bible, bookname, schapter, echapter, sverse, everse)
if not self.bible_http_cache [bible] == None:
book= self.bible_db_cache[bible].get_bible_book(bookname) # check to see if book/chapter exists
if book == None:
- log.debug("get_verse_text : new book")
+ log.debug(u'get_verse_text : new book')
for chapter in range(schapter, echapter+1):
search_results = self.bible_http_cache [bible].get_bible_chapter(bible, 0, bookname, chapter)
if search_results.has_verselist() :
@@ -258,7 +255,7 @@
book = self.bible_db_cache[bible].create_book(bookname, \
self.book_abbreviations[bookname], \
self.book_testaments[bookname])
- log.debug("New http book %s , %s, %s", book, book.id, book.name)
+ log.debug(u'New http book %s , %s, %s', book, book.id, book.name)
self.bible_db_cache[bible].create_chapter(book.id, \
search_results.get_chapter(),\
search_results.get_verselist())
@@ -270,7 +267,7 @@
chapter, \
search_results.get_verselist())
else:
- log.debug("get_verse_text : old book")
+ log.debug(u'get_verse_text : old book')
for chapter in range(schapter, echapter+1):
v = self.bible_db_cache[bible].get_bible_chapter(book.id, chapter)
if v == None:
@@ -280,7 +277,7 @@
search_results.get_chapter(),\
search_results.get_verselist())
except :
- log.error("Errow thrown %s", sys.exc_info()[1])
+ log.error(u'Errow thrown %s', sys.exc_info()[1])
if schapter == echapter:
text = self.bible_db_cache[bible].get_bible_text(bookname, schapter, sverse, everse)
@@ -305,7 +302,7 @@
Check cache to see if new bible
"""
for b , o in self.bible_db_cache.iteritems():
- log.debug( "Bible from cache in is_new_bible %s", b )
+ log.debug(u'Bible from cache in is_new_bible %s', b )
if b == name :
return False
return True
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2009-06-08 05:04:06 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2009-06-16 18:21:24 +0000
@@ -272,11 +272,11 @@
self.initialiseBible(bible)
def onAdvancedVersionComboBox(self):
- self.initialiseBible(str(self.AdvancedVersionComboBox.currentText()))
+ self.initialiseBible(unicode(self.AdvancedVersionComboBox.currentText()))
def onAdvancedBookComboBox(self):
- self.initialiseChapterVerse(str(self.AdvancedVersionComboBox.currentText()),
- str(self.AdvancedBookComboBox.currentText()))
+ self.initialiseChapterVerse(unicode(self.AdvancedVersionComboBox.currentText()),
+ unicode(self.AdvancedBookComboBox.currentText()))
def onBibleNewClick(self):
self.bibleimportform = BibleImportForm(self.parent.config, self.parent.biblemanager, self)
@@ -291,15 +291,15 @@
t1 = self.AdvancedFromChapter.currentText()
t2 = self.AdvancedToChapter.currentText()
if t1 != t2:
- bible = str(self.AdvancedVersionComboBox.currentText())
- book = str(self.AdvancedBookComboBox.currentText())
+ bible = unicode(self.AdvancedVersionComboBox.currentText())
+ book = unicode(self.AdvancedBookComboBox.currentText())
vse = self.parent.biblemanager.get_book_verse_count(bible, book, int(t2))[0] # get the verse count for new chapter
self.adjustComboBox(1, vse, self.AdvancedToVerse)
def onAdvancedSearchButton(self):
log.debug(u'Advanced Search Button pressed')
- bible = str(self.AdvancedVersionComboBox.currentText())
- book = str(self.AdvancedBookComboBox.currentText())
+ bible = unicode(self.AdvancedVersionComboBox.currentText())
+ book = unicode(self.AdvancedBookComboBox.currentText())
chapter_from = int(self.AdvancedFromChapter.currentText())
chapter_to = int(self.AdvancedToChapter.currentText())
verse_from = int(self.AdvancedFromVerse.currentText())
@@ -311,8 +311,8 @@
self.displayResults(bible)
def onAdvancedFromChapter(self):
- bible = str(self.AdvancedVersionComboBox.currentText())
- book = str(self.AdvancedBookComboBox.currentText())
+ bible = unicode(self.AdvancedVersionComboBox.currentText())
+ book = unicode(self.AdvancedBookComboBox.currentText())
cf = self.AdvancedFromChapter.currentText()
self.adjustComboBox(cf, self.chapters_from, self.AdvancedToChapter)
vse = self.parent.biblemanager.get_book_verse_count(bible, book, int(cf))[0] # get the verse count for new chapter
@@ -321,8 +321,8 @@
def onQuickSearchButton(self):
log.debug(u'Quick Search Button pressed')
- bible = str(self.QuickVersionComboBox.currentText())
- text = str(self.QuickSearchEdit.displayText())
+ bible = unicode(self.QuickVersionComboBox.currentText())
+ text = unicode(self.QuickSearchEdit.displayText())
if self.ClearQuickSearchComboBox.currentIndex() == 0:
self.BibleListData.resetStore()
if self.QuickSearchComboBox.currentIndex() == 1:
@@ -363,13 +363,13 @@
bible = text[text.find(u'(') + 1:text.find(u')')]
self.searchByReference(bible, verse)
book = self.search_results[0][0]
- chapter = str(self.search_results[0][1])
- verse = str(self.search_results[0][2])
+ chapter = unicode(self.search_results[0][1])
+ verse = unicode(self.search_results[0][2])
text = self.search_results[0][3]
if self.parent.bibles_tab.paragraph_style: #Paragraph
text = text + u'\n\n'
if self.parent.bibles_tab.display_style == 1:
- loc = self.formatVerse(old_chapter, chapter, verse, u'(', u')')
+ loc = self.formatVerse(old_chapter, chapter, verse, u'(u', u')')
elif self.parent.bibles_tab.display_style == 2:
loc = self.formatVerse(old_chapter, chapter, verse, u'{', u'}')
elif self.parent.bibles_tab.display_style == 3:
@@ -407,7 +407,7 @@
def initialiseBible(self, bible):
log.debug(u'initialiseBible %s', bible)
- books = self.parent.biblemanager.get_bible_books(str(bible))
+ books = self.parent.biblemanager.get_bible_books(unicode(bible))
self.AdvancedBookComboBox.clear()
first = True
for book in books:
@@ -429,11 +429,11 @@
log.debug(u'adjustComboBox %s , %s , %s', combo, frm, to)
combo.clear()
for i in range(int(frm), int(to) + 1):
- combo.addItem(str(i))
+ combo.addItem(unicode(i))
def displayResults(self, bible):
for book, chap, vse , txt in self.search_results:
- text = str(u' %s %d:%d (%s)'%(book , chap,vse, bible))
+ text = unicode(u' %s %d:%d (%s)'%(book , chap,vse, bible))
self.BibleListData.addRow(0,text)
def searchByReference(self, bible, search):
@@ -496,8 +496,8 @@
else:
end_chapter = sp1[0]
end_verse = sp1[1]
- #print 'search = ' + str(original)
- #print 'results = ' + str(book) + ' @ '+ str(start_chapter)+' @ '+ str(end_chapter)+' @ '+ str(start_verse)+ ' @ '+ str(end_verse)
+ #print 'search = ' + unicode(original)
+ #print 'results = ' + unicode(book) + ' @ '+ unicode(start_chapter)+' @ '+ unicode(end_chapter)+' @ '+ unicode(start_verse)+ ' @ '+ unicode(end_verse)
if end_chapter == '':
end_chapter = start_chapter.rstrip()
if start_verse == '':
@@ -509,9 +509,9 @@
end_verse = 99
if start_chapter == '':
message = u'No chapter found for search'
- #print 'message = ' + str(message)
- #print 'search = ' + str(original)
- #print 'results = ' + str(book) + ' @ '+ str(start_chapter)+' @ '+ str(end_chapter)+' @ '+ str(start_verse)+ ' @ '+ str(end_verse)
+ #print 'message = ' + unicode(message)
+ #print 'search = ' + unicode(original)
+ #print 'results = ' + unicode(book) + ' @ '+ unicode(start_chapter)+' @ '+ unicode(end_chapter)+' @ '+ unicode(start_verse)+ ' @ '+ unicode(end_verse)
if message == None:
self.search_results = None
self.search_results = self.parent.biblemanager.get_verse_text(bible, book,
=== modified file 'openlp/plugins/bibles/lib/tables.py'
--- openlp/plugins/bibles/lib/tables.py 2009-02-22 07:44:08 +0000
+++ openlp/plugins/bibles/lib/tables.py 2009-06-16 18:21:24 +0000
@@ -22,31 +22,31 @@
metadata = MetaData()
#Define the tables and indexes
-meta_table = Table('metadata', metadata,
- Column('key', String(255), primary_key=True),
- Column('value', String(255)),
+meta_table = Table(u'metadata', metadata,
+ Column(u'key', String(255), primary_key=True),
+ Column(u'value', String(255)),
)
-testament_table = Table('testament', metadata,
- Column('id', Integer, primary_key=True),
- Column('name', String(30)),
+testament_table = Table(u'testament', metadata,
+ Column(u'id', Integer, primary_key=True),
+ Column(u'name', String(30)),
)
-book_table = Table('book', metadata,
- Column('id', Integer, primary_key=True),
- Column('testament_id', Integer, schema.ForeignKey('testament.id')),
- Column('name', String(30)),
- Column('abbreviation', String(5)),
+book_table = Table(u'book', metadata,
+ Column(u'id', Integer, primary_key=True),
+ Column(u'testament_id', Integer, schema.ForeignKey(u'testament.id')),
+ Column(u'name', String(30)),
+ Column(u'abbreviation', String(5)),
)
-Index('idx_name', book_table.c.name, book_table.c.id)
-Index('idx_abbrev', book_table.c.abbreviation, book_table.c.id)
+Index(u'idx_name', book_table.c.name, book_table.c.id)
+Index(u'idx_abbrev', book_table.c.abbreviation, book_table.c.id)
-verse_table = Table('verse', metadata,
- Column('id', Integer, primary_key=True),
- Column('book_id', Integer , schema.ForeignKey('book.id')),
- Column('chapter', Integer),
- Column('verse', Integer),
- Column('text', Text),
+verse_table = Table(u'verse', metadata,
+ Column(u'id', Integer, primary_key=True),
+ Column(u'book_id', Integer , schema.ForeignKey(u'book.id')),
+ Column(u'chapter', Integer),
+ Column(u'verse', Integer),
+ Column(u'text', Text),
)
-Index('idx_chapter_verse_book', verse_table.c.chapter, verse_table.c.verse, verse_table.c.book_id, verse_table.c.id)
-Index('idx_chapter_verse_text', verse_table.c.text, verse_table.c.verse, verse_table.c.book_id, verse_table.c.id)
+Index(u'idx_chapter_verse_book', verse_table.c.chapter, verse_table.c.verse, verse_table.c.book_id, verse_table.c.id)
+Index(u'idx_chapter_verse_text', verse_table.c.text, verse_table.c.verse, verse_table.c.book_id, verse_table.c.id)
\ No newline at end of file
=== modified file 'openlp/plugins/bibles/test/test_bibleManager.py'
--- openlp/plugins/bibles/test/test_bibleManager.py 2009-01-10 08:33:31 +0000
+++ openlp/plugins/bibles/test/test_bibleManager.py 2009-06-16 18:21:24 +0000
@@ -36,25 +36,25 @@
console=logging.StreamHandler()
# set a format which is simpler for console use
-formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
+formatter = logging.Formatter(u'%(name)-12s: %(levelname)-8s %(message)s')
# tell the handler to use this format
console.setFormatter(formatter)
-logging.getLogger('').addHandler(console)
-log=logging.getLogger('')
+logging.getLogger(u'').addHandler(console)
+log=logging.getLogger(u'')
-logging.info("\nLogging started")
+logging.info(u'\nLogging started')
class TestBibleManager:
- log=logging.getLogger("testBibleMgr")
+ log=logging.getLogger(u'testBibleMgr')
def setup_class(self):
- log.debug("\n.......Register BM")
+ log.debug(u'\n.......Register BM')
self.bm = BibleManager()
def testRegisterCSVBibleFiles(self):
# Register a bible from files
- log.debug("\n.......testRegisterBibleFiles")
- self.bm.registerFileBible("TheMessage",'biblebooks_msg_short.csv','bibleverses_msg_short.csv')
- self.bm.registerFileBible("NIV",'biblebooks_niv_short.csv','bibleverses_niv_short.csv')
+ log.debug(u'\n.......testRegisterBibleFiles')
+ self.bm.registerFileBible(u'TheMessage",'biblebooks_msg_short.csv','bibleverses_msg_short.csv')
+ self.bm.registerFileBible(u'NIV",'biblebooks_niv_short.csv','bibleverses_niv_short.csv')
b = self.bm.get_bibles()
for b1 in b:
log.debug( b1)
@@ -62,10 +62,10 @@
def testRegisterHTTPBible(self):
# Register a bible from files
- log.debug( "\n.......testRegisterBibleHTTP")
- self.bm.registerHTTPBible("asv","Crosswalk", "", "", "")
- self.bm.registerHTTPBible("nasb","Biblegateway", "", "", "")
- self.bm.registerHTTPBible("nkj","Biblegateway", "http://tigger2:3128/", "", "")
+ log.debug( "\n.......testRegisterBibleHTTP')
+ self.bm.registerHTTPBible(u'asv","Crosswalk", u'", u'", u'')
+ self.bm.registerHTTPBible(u'nasb","Biblegateway", u'", u'", u'')
+ self.bm.registerHTTPBible(u'nkj","Biblegateway", u'http://tigger2:3128/", u'", u'')
b = self.bm.get_bibles()
for b1 in b:
log.debug( b1)
@@ -73,7 +73,7 @@
def testGetBibles(self):
- log.debug( "\n.......testGetBibles")
+ log.debug( "\n.......testGetBibles')
# make sure the shuffled sequence does not lose any elements
b = self.bm.get_bibles()
for b1 in b:
@@ -81,38 +81,38 @@
assert(b1 in b)
def testGetBibleBooks(self):
- log.debug( "\n.......testGetBibleBooks")
- c = self.bm.get_bible_books("NIV")
+ log.debug( "\n.......testGetBibleBooks')
+ c = self.bm.get_bible_books(u'NIV')
for c1 in c:
log.debug( c1)
assert(c1 in c)
def testGetBookChapterCount(self):
- log.debug( "\n.......testGetBookChapterCount")
- assert(self.bm.get_book_chapter_count("Matthew") == '28')
+ log.debug( "\n.......testGetBookChapterCount')
+ assert(self.bm.get_book_chapter_count(u'Matthew') == '28')
def testGetBookVerseCount(self):
- log.debug( "\n.......testGetBookVerseCount")
- assert(self.bm.get_book_verse_count("Genesis", 1) == '31')
- assert(self.bm.get_book_verse_count("Genesis", 2) == '25')
- assert(self.bm.get_book_verse_count("Matthew", 1) == '25')
- assert(self.bm.get_book_verse_count("Revelation", 1) == '20')
+ log.debug( "\n.......testGetBookVerseCount')
+ assert(self.bm.get_book_verse_count(u'Genesis", 1) == '31')
+ assert(self.bm.get_book_verse_count(u'Genesis", 2) == '25')
+ assert(self.bm.get_book_verse_count(u'Matthew", 1) == '25')
+ assert(self.bm.get_book_verse_count(u'Revelation", 1) == '20')
def testGetVerseText(self):
- log.debug( "\n.......testGetVerseText")
- #c = self.bm.get_verse_text("TheMessage",'Genesis',1,2,1)
+ log.debug( "\n.......testGetVerseText')
+ #c = self.bm.get_verse_text(u'TheMessage",'Genesis',1,2,1)
#log.debug( c )
- #c = self.bm.get_verse_text('NIV','Genesis',1,1,2)
+ #c = self.bm.get_verse_text(u'NIV','Genesis',1,1,2)
#log.debug( c )
- c = self.bm.get_verse_text('asv','Genesis',10,1,20)
+ c = self.bm.get_verse_text(u'asv','Genesis',10,1,20)
log.debug( c )
- c = self.bm.get_verse_text('nasb','Genesis',10,1,20)
+ c = self.bm.get_verse_text(u'nasb','Genesis',10,1,20)
log.debug( c )
- c = self.bm.get_verse_text('nkj','Revelation',10,1,20)
+ c = self.bm.get_verse_text(u'nkj','Revelation',10,1,20)
log.debug( c )
def testLoadBible(self):
- log.debug( "\n.......testLoadBible")
- #self.bm.loadBible('asv')
- #self.bm.loadBible('nasb')
- #self.bm.loadBible('nkj')
+ log.debug( "\n.......testLoadBible')
+ #self.bm.loadBible(u'asv')
+ #self.bm.loadBible(u'nasb')
+ #self.bm.loadBible(u'nkj')
\ No newline at end of file
=== modified file 'openlp/plugins/bibles/test/test_bibleManagerAPI.py'
--- openlp/plugins/bibles/test/test_bibleManagerAPI.py 2008-12-10 19:17:23 +0000
+++ openlp/plugins/bibles/test/test_bibleManagerAPI.py 2009-06-16 18:21:24 +0000
@@ -36,22 +36,22 @@
console=logging.StreamHandler()
# set a format which is simpler for console use
-formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
+formatter = logging.Formatter(u'%(name)-12s: %(levelname)-8s %(message)s')
# tell the handler to use this format
console.setFormatter(formatter)
-logging.getLogger('').addHandler(console)
-log=logging.getLogger('')
+logging.getLogger(u'').addHandler(console)
+log=logging.getLogger(u'')
-logging.info("\nLogging started")
+logging.info(u'\nLogging started')
class TestBibleManager:
- log=logging.getLogger("testBibleMgr")
+ log=logging.getLogger(u'testBibleMgr')
def setup_class(self):
- log.debug("\n.......Register BM")
+ log.debug(u'\n.......Register BM')
self.bm = BibleManager()
def testGetBibles(self):
- log.debug( "\n.......testGetBibles")
+ log.debug( "\n.......testGetBibles')
# make sure the shuffled sequence does not lose any elements
b = self.bm.getBibles()
for b1 in b:
@@ -59,37 +59,36 @@
assert(b1 in b)
def testGetBibleBooks(self):
- log.debug( "\n.......testGetBibleBooks")
- c = self.bm.getBibleBooks("asv")
+ log.debug( "\n.......testGetBibleBooks')
+ c = self.bm.getBibleBooks(u'asv')
for c1 in c:
log.debug( c1)
assert(c1 in c)
def testGetBookChapterCount(self):
- log.debug( "\n.......testGetBookChapterCount")
- assert(self.bm.getBookChapterCount("asv","Matthew")[0] == 28)
+ log.debug( "\n.......testGetBookChapterCount')
+ assert(self.bm.getBookChapterCount(u'asv","Matthew')[0] == 28)
def testGetBookVerseCount(self):
- log.debug( "\n.......testGetBookVerseCount")
- assert(self.bm.getBookVerseCount("asv","Genesis", 1)[0] == 31)
- assert(self.bm.getBookVerseCount("TheMessage","Genesis", 2)[0] == 25)
- assert(self.bm.getBookVerseCount("asv","Matthew", 1)[0] == 25)
- assert(self.bm.getBookVerseCount("TheMessage","Revelation", 1)[0] == 20)
+ log.debug( "\n.......testGetBookVerseCount')
+ assert(self.bm.getBookVerseCount(u'asv","Genesis", 1)[0] == 31)
+ assert(self.bm.getBookVerseCount(u'TheMessage","Genesis", 2)[0] == 25)
+ assert(self.bm.getBookVerseCount(u'asv","Matthew", 1)[0] == 25)
+ assert(self.bm.getBookVerseCount(u'TheMessage","Revelation", 1)[0] == 20)
def testGetVerseText(self):
- log.debug( "\n.......testGetVerseText")
- #c = self.bm.getVerseText("TheMessage",'Genesis',1,2,1)
+ log.debug( "\n.......testGetVerseText')
+ #c = self.bm.getVerseText(u'TheMessage",'Genesis',1,2,1)
#log.debug( c )
- #c = self.bm.getVerseText('NIV','Genesis',1,1,2)
+ #c = self.bm.getVerseText(u'NIV','Genesis',1,1,2)
#log.debug( c )
- c = self.bm.getVerseText('asv','Genesis',10,1,20)
+ c = self.bm.getVerseText(u'asv','Genesis',10,1,20)
log.debug( c )
- c = self.bm.getVerseText('TheMessage','Genesis',10,1,20)
+ c = self.bm.getVerseText(u'TheMessage','Genesis',10,1,20)
log.debug( c )
- c = self.bm.getVerseText('asv','Revelation',10,1,20)
+ c = self.bm.getVerseText(u'asv','Revelation',10,1,20)
log.debug( c )
- c = self.bm.getVersesFromText("asv", "Jesus wept")
+ c = self.bm.getVersesFromText(u'asv", u'Jesus wept')
log.debug( c )
- c = self.bm.getVersesFromText("TheMessage", "Jesus wept")
- log.debug( c )
-
+ c = self.bm.getVersesFromText(u'TheMessage", u'Jesus wept')
+ log.debug( c )
\ No newline at end of file
=== modified file 'openlp/plugins/bibles/test/test_bibleManagerCSV.py'
--- openlp/plugins/bibles/test/test_bibleManagerCSV.py 2008-12-15 18:10:47 +0000
+++ openlp/plugins/bibles/test/test_bibleManagerCSV.py 2009-06-16 18:21:24 +0000
@@ -36,26 +36,26 @@
console=logging.StreamHandler()
# set a format which is simpler for console use
-formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
+formatter = logging.Formatter(u'%(name)-12s: %(levelname)-8s %(message)s')
# tell the handler to use this format
console.setFormatter(formatter)
-logging.getLogger('').addHandler(console)
-log=logging.getLogger('')
+logging.getLogger(u'').addHandler(console)
+log=logging.getLogger(u'')
-logging.info("\nLogging started")
+logging.info(u'\nLogging started')
class TestBibleManager:
- log=logging.getLogger("testBibleMgr")
+ log=logging.getLogger(u'testBibleMgr')
def setup_class(self):
- log.debug("\n.......Register BM")
+ log.debug(u'\n.......Register BM')
self.bm = BibleManager()
def testRegisterCSVBibleFiles(self):
# Register a bible from files
- log.debug("\n.......testRegisterBibleFiles")
- self.bm.registerCSVFileBible("TheMessage",'biblebooks_msg_short.csv','bibleverses_msg_short.csv')
- self.bm.registerCSVFileBible("NIV",'biblebooks_niv_short.csv','bibleverses_niv_short.csv')
+ log.debug(u'\n.......testRegisterBibleFiles')
+ self.bm.registerCSVFileBible(u'TheMessage",'biblebooks_msg_short.csv','bibleverses_msg_short.csv')
+ self.bm.registerCSVFileBible(u'NIV",'biblebooks_niv_short.csv','bibleverses_niv_short.csv')
b = self.bm.get_bibles()
for b1 in b:
log.debug( b1)
- assert(b1 in b)
+ assert(b1 in b)
\ No newline at end of file
=== modified file 'openlp/plugins/bibles/test/test_bibleManagerOSIS.py'
--- openlp/plugins/bibles/test/test_bibleManagerOSIS.py 2009-01-10 08:33:31 +0000
+++ openlp/plugins/bibles/test/test_bibleManagerOSIS.py 2009-06-16 18:21:24 +0000
@@ -36,25 +36,25 @@
console=logging.StreamHandler()
# set a format which is simpler for console use
-formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
+formatter = logging.Formatter(u'%(name)-12s: %(levelname)-8s %(message)s')
# tell the handler to use this format
console.setFormatter(formatter)
-logging.getLogger('').addHandler(console)
-log=logging.getLogger('')
+logging.getLogger(u'').addHandler(console)
+log=logging.getLogger(u'')
-logging.info("\nLogging started")
+logging.info(u'\nLogging started')
class TestBibleManager:
- log=logging.getLogger("testBibleMgr")
+ log=logging.getLogger(u'testBibleMgr')
def setup_class(self):
- log.debug("\n.......Register BM")
+ log.debug(u'\n.......Register BM')
self.bm = BibleManager()
def testRegisterOSISBibleFiles(self):
# Register a bible from files
- log.debug("\n.......testRegisterOSISBibleFiles")
- self.bm.register_osis_file_bible("asv",'asv.osis')
+ log.debug(u'\n.......testRegisterOSISBibleFiles')
+ self.bm.register_osis_file_bible(u'asv",'asv.osis')
b = self.bm.get_bibles()
for b1 in b:
log.debug( b1)
- assert(b1 in b)
+ assert(b1 in b)
\ No newline at end of file
=== modified file 'openlp/plugins/custom/customplugin.py'
--- openlp/plugins/custom/customplugin.py 2009-05-21 16:07:01 +0000
+++ openlp/plugins/custom/customplugin.py 2009-06-16 18:21:24 +0000
@@ -40,7 +40,7 @@
self.edit_custom_form = EditCustomForm(self.custommanager)
# Create the plugin icon
self.icon = QtGui.QIcon()
- self.icon.addPixmap(QtGui.QPixmap(':/media/media_custom.png'),
+ self.icon.addPixmap(QtGui.QPixmap(u':/media/media_custom.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.preview_service_item = CustomServiceItem(self.preview_controller)
self.live_service_item = CustomServiceItem(self.live_controller)
@@ -66,4 +66,4 @@
self.media_item.onCustomPreviewClick()
if event.event_type == EventType.LiveShow and event.payload == 'Custom':
log.debug(u'Load Live Show Item received')
- self.media_item.onCustomLiveClick()
+ self.media_item.onCustomLiveClick()
\ No newline at end of file
=== modified file 'openlp/plugins/custom/forms/editcustomdialog.py'
--- openlp/plugins/custom/forms/editcustomdialog.py 2009-05-21 16:07:01 +0000
+++ openlp/plugins/custom/forms/editcustomdialog.py 2009-06-16 18:21:24 +0000
@@ -12,100 +12,100 @@
class Ui_customEditDialog(object):
def setupUi(self, customEditDialog):
- customEditDialog.setObjectName("customEditDialog")
+ customEditDialog.setObjectName(u'customEditDialog')
customEditDialog.resize(590, 541)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
customEditDialog.setWindowIcon(icon)
self.gridLayout = QtGui.QGridLayout(customEditDialog)
- self.gridLayout.setObjectName("gridLayout")
+ self.gridLayout.setObjectName(u'gridLayout')
self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
+ self.horizontalLayout.setObjectName(u'horizontalLayout')
self.TitleLabel = QtGui.QLabel(customEditDialog)
- self.TitleLabel.setObjectName("TitleLabel")
+ self.TitleLabel.setObjectName(u'TitleLabel')
self.horizontalLayout.addWidget(self.TitleLabel)
self.TitleEdit = QtGui.QLineEdit(customEditDialog)
- self.TitleEdit.setObjectName("TitleEdit")
+ self.TitleEdit.setObjectName(u'TitleEdit')
self.horizontalLayout.addWidget(self.TitleEdit)
self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
self.horizontalLayout_4 = QtGui.QHBoxLayout()
- self.horizontalLayout_4.setObjectName("horizontalLayout_4")
+ self.horizontalLayout_4.setObjectName(u'horizontalLayout_4')
self.VerseListView = QtGui.QListWidget(customEditDialog)
- self.VerseListView.setObjectName("VerseListView")
+ self.VerseListView.setObjectName(u'VerseListView')
self.horizontalLayout_4.addWidget(self.VerseListView)
self.verticalLayout = QtGui.QVBoxLayout()
- self.verticalLayout.setObjectName("verticalLayout")
+ self.verticalLayout.setObjectName(u'verticalLayout')
self.UpButton = QtGui.QPushButton(customEditDialog)
icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/services/service_up.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap(u':/services/service_up.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.UpButton.setIcon(icon1)
- self.UpButton.setObjectName("UpButton")
+ self.UpButton.setObjectName(u'UpButton')
self.verticalLayout.addWidget(self.UpButton)
spacerItem = QtGui.QSpacerItem(20, 128, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.DownButton = QtGui.QPushButton(customEditDialog)
icon2 = QtGui.QIcon()
- icon2.addPixmap(QtGui.QPixmap(":/services/service_down.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon2.addPixmap(QtGui.QPixmap(u':/services/service_down.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.DownButton.setIcon(icon2)
- self.DownButton.setObjectName("DownButton")
+ self.DownButton.setObjectName(u'DownButton')
self.verticalLayout.addWidget(self.DownButton)
self.horizontalLayout_4.addLayout(self.verticalLayout)
self.gridLayout.addLayout(self.horizontalLayout_4, 1, 0, 1, 1)
self.EditWidget = QtGui.QWidget(customEditDialog)
- self.EditWidget.setObjectName("EditWidget")
+ self.EditWidget.setObjectName(u'EditWidget')
self.EditLayout = QtGui.QHBoxLayout(self.EditWidget)
self.EditLayout.setSpacing(8)
self.EditLayout.setMargin(0)
- self.EditLayout.setObjectName("EditLayout")
+ self.EditLayout.setObjectName(u'EditLayout')
self.VerseTextEdit = QtGui.QTextEdit(self.EditWidget)
- self.VerseTextEdit.setObjectName("VerseTextEdit")
+ self.VerseTextEdit.setObjectName(u'VerseTextEdit')
self.EditLayout.addWidget(self.VerseTextEdit)
self.ButtonWidget = QtGui.QWidget(self.EditWidget)
- self.ButtonWidget.setObjectName("ButtonWidget")
+ self.ButtonWidget.setObjectName(u'ButtonWidget')
self.ButtonLayout = QtGui.QVBoxLayout(self.ButtonWidget)
self.ButtonLayout.setSpacing(8)
self.ButtonLayout.setMargin(0)
- self.ButtonLayout.setObjectName("ButtonLayout")
+ self.ButtonLayout.setObjectName(u'ButtonLayout')
self.AddButton = QtGui.QPushButton(self.ButtonWidget)
- self.AddButton.setObjectName("AddButton")
+ self.AddButton.setObjectName(u'AddButton')
self.ButtonLayout.addWidget(self.AddButton)
self.EditButton = QtGui.QPushButton(self.ButtonWidget)
- self.EditButton.setObjectName("EditButton")
+ self.EditButton.setObjectName(u'EditButton')
self.ButtonLayout.addWidget(self.EditButton)
self.SaveButton = QtGui.QPushButton(self.ButtonWidget)
- self.SaveButton.setObjectName("SaveButton")
+ self.SaveButton.setObjectName(u'SaveButton')
self.ButtonLayout.addWidget(self.SaveButton)
self.DeleteButton = QtGui.QPushButton(self.ButtonWidget)
- self.DeleteButton.setObjectName("DeleteButton")
+ self.DeleteButton.setObjectName(u'DeleteButton')
self.ButtonLayout.addWidget(self.DeleteButton)
self.ClearButton = QtGui.QPushButton(self.ButtonWidget)
- self.ClearButton.setObjectName("ClearButton")
+ self.ClearButton.setObjectName(u'ClearButton')
self.ButtonLayout.addWidget(self.ClearButton)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.ButtonLayout.addItem(spacerItem1)
self.EditLayout.addWidget(self.ButtonWidget)
self.gridLayout.addWidget(self.EditWidget, 2, 0, 1, 1)
self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
+ self.horizontalLayout.setObjectName(u'horizontalLayout')
self.ThemeLabel = QtGui.QLabel(customEditDialog)
- self.ThemeLabel.setObjectName("ThemeLabel")
+ self.ThemeLabel.setObjectName(u'ThemeLabel')
self.horizontalLayout.addWidget(self.ThemeLabel)
self.ThemecomboBox = QtGui.QComboBox(customEditDialog)
- self.ThemecomboBox.setObjectName("ThemecomboBox")
+ self.ThemecomboBox.setObjectName(u'ThemecomboBox')
self.horizontalLayout.addWidget(self.ThemecomboBox)
self.gridLayout.addLayout(self.horizontalLayout, 3, 0, 1, 1)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ self.horizontalLayout_2.setObjectName(u'horizontalLayout_2')
self.CreditLabel = QtGui.QLabel(customEditDialog)
- self.CreditLabel.setObjectName("CreditLabel")
+ self.CreditLabel.setObjectName(u'CreditLabel')
self.horizontalLayout_2.addWidget(self.CreditLabel)
self.CreditEdit = QtGui.QLineEdit(customEditDialog)
- self.CreditEdit.setObjectName("CreditEdit")
+ self.CreditEdit.setObjectName(u'CreditEdit')
self.horizontalLayout_2.addWidget(self.CreditEdit)
self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(customEditDialog)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
- self.buttonBox.setObjectName("buttonBox")
+ self.buttonBox.setObjectName(u'buttonBox')
self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 1)
self.retranslateUi(customEditDialog)
@@ -120,12 +120,12 @@
customEditDialog.setTabOrder(self.DeleteButton, self.buttonBox)
def retranslateUi(self, customEditDialog):
- customEditDialog.setWindowTitle(translate("customEditDialog", "Edit Custom Slides"))
- self.TitleLabel.setText(translate("customEditDialog", "Title:"))
- self.AddButton.setText(translate("customEditDialog", "Add"))
- self.EditButton.setText(translate("customEditDialog", "Edit"))
- self.SaveButton.setText(translate("customEditDialog", "Save"))
- self.DeleteButton.setText(translate("customEditDialog", "Delete"))
- self.ClearButton.setText(translate("customEditDialog", "Clear"))
- self.ThemeLabel.setText(translate("customEditDialog", "Theme:"))
- self.CreditLabel.setText(translate("customEditDialog", "Credits:"))
+ customEditDialog.setWindowTitle(translate(u'customEditDialog', u'Edit Custom Slides'))
+ self.TitleLabel.setText(translate(u'customEditDialog', u'Title:'))
+ self.AddButton.setText(translate(u'customEditDialog', u'Add'))
+ self.EditButton.setText(translate(u'customEditDialog', u'Edit'))
+ self.SaveButton.setText(translate(u'customEditDialog', u'Save'))
+ self.DeleteButton.setText(translate(u'customEditDialog', u'Delete'))
+ self.ClearButton.setText(translate(u'customEditDialog', u'Clear'))
+ self.ThemeLabel.setText(translate(u'customEditDialog', u'Theme:'))
+ self.CreditLabel.setText(translate(u'customEditDialog', u'Credits:'))
=== modified file 'openlp/plugins/custom/forms/editcustomform.py'
--- openlp/plugins/custom/forms/editcustomform.py 2009-05-01 05:02:53 +0000
+++ openlp/plugins/custom/forms/editcustomform.py 2009-06-16 18:21:24 +0000
@@ -35,21 +35,21 @@
#self.parent = parent
self.setupUi(self)
# Connecting signals and slots
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.rejected)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), self.accept)
- QtCore.QObject.connect(self.AddButton, QtCore.SIGNAL("pressed()"), self.onAddButtonPressed)
- QtCore.QObject.connect(self.EditButton, QtCore.SIGNAL("pressed()"), self.onEditButtonPressed)
- QtCore.QObject.connect(self.SaveButton, QtCore.SIGNAL("pressed()"), self.onSaveButtonPressed)
- QtCore.QObject.connect(self.DeleteButton, QtCore.SIGNAL("pressed()"), self.onDeleteButtonPressed)
- QtCore.QObject.connect(self.ClearButton, QtCore.SIGNAL("pressed()"), self.onClearButtonPressed)
- QtCore.QObject.connect(self.UpButton, QtCore.SIGNAL("pressed()"), self.onUpButtonPressed)
- QtCore.QObject.connect(self.DownButton, QtCore.SIGNAL("pressed()"), self.onDownButtonPressed)
- QtCore.QObject.connect(self.TitleEdit, QtCore.SIGNAL("lostFocus()"), self.validate)
+ QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), self.rejected)
+ QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), self.accept)
+ QtCore.QObject.connect(self.AddButton, QtCore.SIGNAL(u'pressed()'), self.onAddButtonPressed)
+ QtCore.QObject.connect(self.EditButton, QtCore.SIGNAL(u'pressed()'), self.onEditButtonPressed)
+ QtCore.QObject.connect(self.SaveButton, QtCore.SIGNAL(u'pressed()'), self.onSaveButtonPressed)
+ QtCore.QObject.connect(self.DeleteButton, QtCore.SIGNAL(u'pressed()'), self.onDeleteButtonPressed)
+ QtCore.QObject.connect(self.ClearButton, QtCore.SIGNAL(u'pressed()'), self.onClearButtonPressed)
+ QtCore.QObject.connect(self.UpButton, QtCore.SIGNAL(u'pressed()'), self.onUpButtonPressed)
+ QtCore.QObject.connect(self.DownButton, QtCore.SIGNAL(u'pressed()'), self.onDownButtonPressed)
+ QtCore.QObject.connect(self.TitleEdit, QtCore.SIGNAL(u'lostFocus()'), self.validate)
QtCore.QObject.connect(self.VerseListView,
- QtCore.SIGNAL("itemDoubleClicked(QListWidgetItem*)"), self.onVerseListViewSelected)
+ QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem*)'), self.onVerseListViewSelected)
QtCore.QObject.connect(self.VerseListView,
- QtCore.SIGNAL("itemClicked(QListWidgetItem*)"), self.onVerseListViewPressed)
+ QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), self.onVerseListViewPressed)
# Create other objects and forms
self.custommanager = custommanager
self.initialise()
@@ -60,8 +60,8 @@
self.DeleteButton.setEnabled(False)
self.EditButton.setEnabled(False)
self.SaveButton.setEnabled(False)
- self.TitleEdit.setText('')
- self.CreditEdit.setText('')
+ self.TitleEdit.setText(u'')
+ self.CreditEdit.setText(u'')
self.VerseTextEdit.clear()
self.VerseListView.clear()
#make sure we have a new item
@@ -86,7 +86,7 @@
verseList = songXML.get_verses()
for verse in verseList:
self.VerseListView.addItem(verse[1])
- theme = str(self.customSlide.theme_name)
+ theme = unicode(self.customSlide.theme_name)
id = self.ThemecomboBox.findText(theme, QtCore.Qt.MatchExactly)
if id == -1:
id = 0 # Not Found
@@ -103,7 +103,7 @@
sxml.add_lyrics_to_song()
count = 1
for i in range (0, self.VerseListView.count()):
- sxml.add_verse_to_lyrics(u'custom', str(count), str(self.VerseListView.item(i).text()))
+ sxml.add_verse_to_lyrics(u'custom', unicode(count), unicode(self.VerseListView.item(i).text()))
count += 1
self.customSlide.title = unicode(self.TitleEdit.displayText())
self.customSlide.text = unicode(sxml.extract_xml())
@@ -167,12 +167,12 @@
self.valid = True
if len(self.TitleEdit.displayText()) == 0:
invalid += 1
- self.TitleLabel.setStyleSheet('color: red')
+ self.TitleLabel.setStyleSheet(u'color: red')
else:
- self.TitleLabel.setStyleSheet('color: black')
+ self.TitleLabel.setStyleSheet(u'color: black')
if self.VerseListView.count() == 0: # must have 1 slide
invalid += 1
if invalid == 1:
- self.valid = False
+ self.valid = False
\ No newline at end of file
=== modified file 'openlp/plugins/custom/lib/customserviceitem.py'
--- openlp/plugins/custom/lib/customserviceitem.py 2009-05-21 16:07:01 +0000
+++ openlp/plugins/custom/lib/customserviceitem.py 2009-06-16 18:21:24 +0000
@@ -51,7 +51,7 @@
"""
Init Method
"""
- log.info("init")
+ log.info(u'init')
self.imgs=TextListData()
# self.slide_controller=controller
# self.slide_controller.ControllerContents=QtGui.QListView()
@@ -67,12 +67,12 @@
"""
# render the "image chooser first"
# for f in self.imgs:
-# fl , nm = os.path.split(str(f))
+# fl , nm = os.path.split(unicode(f))
# c = self.slide_controller.rowCount()
# self.slide_controller.setRowCount(c+1)
-# twi = QtGui.QTableWidgetItem(str(f))
+# twi = QtGui.QTableWidgetItem(unicode(f))
# self.slide_controller.setItem(c , 0, twi)
-# twi = QtGui.QTableWidgetItem(str(nm))
+# twi = QtGui.QTableWidgetItem(unicode(nm))
# self.slide_controller.setItem(c , 1, twi)
# self.slide_controller.setRowHeight(c, 80)
@@ -89,11 +89,11 @@
"""
append an image to the list
"""
- if type(data)==type("string"):
- log.info("add filename:"+data)
+ if type(data)==type(u'string'):
+ log.info(u'add filename:'+data)
self.imgs.addRow(data)
else: # it's another service item to be merged in
- log.info("add Item..."+str(data))
+ log.info(u'add Item...'+unicode(data))
for filename in data.imgs.get_file_list():
self.add(filename)
@@ -102,17 +102,16 @@
"""
Turn the image list into a set of filenames for storage in the oos file
"""
- log.info("Get oos text")
- log.info(str(self.imgs))
- log.info(str(self.imgs.get_file_list()))
+ log.info(u'Get oos text')
+ log.info(unicode(self.imgs))
+ log.info(unicode(self.imgs.get_file_list()))
return '\n'.join(self.imgs.get_file_list())
def set_from_oos(self, text):
"""
get text from the OOS file and setup the internal structure
"""
- log.info("Set from OOS:"+text)
- files=text.split('\n')
+ log.info(u'Set from OOS:'+text)
+ files=text.split(u'\n')
for f in files:
self.imgs.addRow(f)
-
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2009-06-07 19:34:24 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2009-06-16 18:21:24 +0000
@@ -152,7 +152,7 @@
self.onSearchTextButtonClick()
def onSearchTextButtonClick(self):
- search_keywords = str(self.SearchTextEdit.displayText())
+ search_keywords = unicode(self.SearchTextEdit.displayText())
search_results = []
search_type = self.SearchTypeComboBox.currentText()
search_results = self.Custommanager.search_Custom_lyrics(search_keywords)
@@ -221,4 +221,4 @@
service_item.title = title
for slide in raw_slides:
service_item.add_from_text(slide[:30], slide)
- service_item.raw_footer = raw_footer
+ service_item.raw_footer = raw_footer
\ No newline at end of file
=== modified file 'openlp/plugins/custom/lib/tables.py'
--- openlp/plugins/custom/lib/tables.py 2009-03-07 09:20:26 +0000
+++ openlp/plugins/custom/lib/tables.py 2009-06-16 18:21:24 +0000
@@ -22,10 +22,10 @@
from openlp.plugins.custom.lib.meta import metadata
# Definition of the "songs" table
-custom_slide_table = Table('custom_slide', metadata,
- Column('id', types.Integer(), primary_key=True),
- Column('title', types.Unicode(255), nullable=False),
- Column('text', types.UnicodeText, nullable=False),
- Column('credits', types.UnicodeText),
- Column('theme_name', types.Unicode(128))
-)
+custom_slide_table = Table(u'custom_slide', metadata,
+ Column(u'id', types.Integer(), primary_key=True),
+ Column(u'title', types.Unicode(255), nullable=False),
+ Column(u'text', types.UnicodeText, nullable=False),
+ Column(u'credits', types.UnicodeText),
+ Column(u'theme_name', types.Unicode(128))
+)
\ No newline at end of file
=== modified file 'openlp/plugins/custom/lib/textlistdata.py'
--- openlp/plugins/custom/lib/textlistdata.py 2009-06-03 15:38:14 +0000
+++ openlp/plugins/custom/lib/textlistdata.py 2009-06-16 18:21:24 +0000
@@ -42,7 +42,7 @@
def insertRow(self, row, id, title):
self.beginInsertRows(QtCore.QModelIndex(),row,row)
- log.debug("insert row %d:%s for id %d" % (row,title, id))
+ log.debug(u'insert row %d:%s for id %d' % (row,title, id))
self.items.insert(row, (id, title))
self.endInsertRows()
=== modified file 'openlp/plugins/images/lib/imageserviceitem.py'
--- openlp/plugins/images/lib/imageserviceitem.py 2009-05-22 18:30:25 +0000
+++ openlp/plugins/images/lib/imageserviceitem.py 2009-06-16 18:21:24 +0000
@@ -42,13 +42,13 @@
"""
global log
- log=logging.getLogger("ImageServiceItem")
- log.info("ImageServiceItem loaded")
+ log=logging.getLogger(u'ImageServiceItem')
+ log.info(u'ImageServiceItem loaded')
def __init__(self, controller):
"""
Init Method
"""
- log.info("init")
+ log.info(u'init')
self.imgs=ListWithPreviews()
# self.slide_controller=controller
# self.slide_controller.ControllerContents=QtGui.QListView()
@@ -64,12 +64,12 @@
"""
# render the "image chooser first"
# for f in self.imgs:
-# fl , nm = os.path.split(str(f))
+# fl , nm = os.path.split(unicode(f))
# c = self.slide_controller.rowCount()
# self.slide_controller.setRowCount(c+1)
-# twi = QtGui.QTableWidgetItem(str(f))
+# twi = QtGui.QTableWidgetItem(unicode(f))
# self.slide_controller.setItem(c , 0, twi)
-# twi = QtGui.QTableWidgetItem(str(nm))
+# twi = QtGui.QTableWidgetItem(unicode(nm))
# self.slide_controller.setItem(c , 1, twi)
# self.slide_controller.setRowHeight(c, 80)
@@ -85,11 +85,11 @@
"""
append an image to the list
"""
- if type(data)==type("string"):
- log.info("add filename:"+data)
+ if type(data)==type(u'string'):
+ log.info(u'add filename:'+data)
self.imgs.addRow(data)
else: # it's another service item to be merged in
- log.info("add Item..."+str(data))
+ log.info(u'add Item...'+unicode(data))
for filename in data.get_file_list():
self.add(filename)
@@ -98,17 +98,16 @@
"""
Turn the image list into a set of filenames for storage in the oos file
"""
- log.info("Get oos text")
- log.info(str(self.imgs))
-# log.info(str(self.imgs.get_file_list()))
+ log.info(u'Get oos text')
+ log.info(unicode(self.imgs))
+# log.info(unicode(self.imgs.get_file_list()))
return '\n'.join(self.imgs.get_file_list())
def set_from_oos(self, text):
"""
get text from the OOS file and setup the internal structure
"""
- log.info("Set from OOS:"+text)
- files=text.split('\n')
+ log.info(u'Set from OOS:'+text)
+ files=text.split(u'\n')
for f in files:
self.imgs.addRow(f)
-
=== modified file 'openlp/plugins/images/lib/listwithpreviews.py'
--- openlp/plugins/images/lib/listwithpreviews.py 2009-05-22 19:36:16 +0000
+++ openlp/plugins/images/lib/listwithpreviews.py 2009-06-16 18:21:24 +0000
@@ -27,8 +27,8 @@
An abstract list of strings and the preview icon to go with them
"""
global log
- log = logging.getLogger("ListWithPreviews")
- log.info("started")
+ log = logging.getLogger(u'ListWithPreviews')
+ log.info(u'started')
def __init__(self):
QtCore.QAbstractListModel.__init__(self)
@@ -41,13 +41,13 @@
def insertRow(self, row, filename):
self.beginInsertRows(QtCore.QModelIndex(),row,row)
- log.info("insert row %d:%s"% (row,filename))
+ log.info(u'insert row %d:%s'% (row,filename))
# get short filename to display next to image
- (prefix, shortfilename) = os.path.split(str(filename))
- log.info("shortfilename=%s"% (shortfilename))
+ (prefix, shortfilename) = os.path.split(unicode(filename))
+ log.info(u'shortfilename=%s'% (shortfilename))
# create a preview image
if os.path.exists(filename):
- preview = QtGui.QPixmap(str(filename))
+ preview = QtGui.QPixmap(unicode(filename))
w = self.maximagewidth;
h = self.rowheight
preview = preview.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2009-06-07 19:34:24 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2009-06-16 18:21:24 +0000
@@ -123,10 +123,10 @@
translate(u'ImageMediaItem', u'Select Image(s)'),
self.parent.config.get_last_dir(),
u'Images (*.jpg *.gif *.png *.bmp)')
- log.info(u'New image(s)', str(files))
+ log.info(u'New image(s)', unicode(files))
if len(files) > 0:
self.loadImageList(files)
- dir, filename = os.path.split(str(files[0]))
+ dir, filename = os.path.split(unicode(files[0]))
self.parent.config.set_last_dir(dir)
self.parent.config.set_list(u'images', self.ImageListData.getFileList())
@@ -146,7 +146,7 @@
service_item.title = u'Images'
for index in indexes:
filename = self.ImageListData.getFilename(index)
- frame = QtGui.QPixmap(str(filename))
+ frame = QtGui.QPixmap(unicode(filename))
(path, name) =os.path.split(filename)
service_item.add_from_image(name, frame)
@@ -169,4 +169,4 @@
service_item = ServiceItem(self.parent)
service_item.addIcon(u':/media/media_image.png')
self.generateSlideData(service_item)
- self.parent.service_manager.addServiceItem(service_item)
+ self.parent.service_manager.addServiceItem(service_item)
\ No newline at end of file
=== modified file 'openlp/plugins/media/lib/filelistdata.py'
--- openlp/plugins/media/lib/filelistdata.py 2009-04-25 06:11:15 +0000
+++ openlp/plugins/media/lib/filelistdata.py 2009-06-16 18:21:24 +0000
@@ -39,10 +39,10 @@
def insertRow(self, row, filename):
self.beginInsertRows(QModelIndex(),row,row)
- log.info("insert row %d:%s"%(row,filename))
+ log.info(u'insert row %d:%s'%(row,filename))
# get short filename to display next to image
- (prefix, shortfilename) = os.path.split(str(filename))
- log.info("shortfilename=%s"%(shortfilename))
+ (prefix, shortfilename) = os.path.split(unicode(filename))
+ log.info(u'shortfilename=%s'%(shortfilename))
# create a preview image
self.items.insert(row, (filename, shortfilename))
self.endInsertRows()
@@ -67,7 +67,7 @@
retval= self.items[row][0]
else:
retval= QVariant()
-# log.info("Returning"+ str(retval))
+# log.info(u'Returning"+ unicode(retval))
if type(retval) is not type(QVariant):
return QVariant(retval)
else:
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2009-05-22 18:30:25 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2009-06-16 18:21:24 +0000
@@ -44,30 +44,30 @@
# Create buttons for the toolbar
## New Media Button ##
self.addToolbarButton(
- translate('MediaMediaItem',u'New Media'),
- translate('MediaMediaItem',u'Load Media into openlp.org'),
+ translate(u'MediaMediaItem',u'New Media'),
+ translate(u'MediaMediaItem',u'Load Media into openlp.org'),
':/videos/video_load.png', self.onMediaNewClick, 'MediaNewItem')
## Delete Media Button ##
self.addToolbarButton(
- translate('MediaMediaItem',u'Delete Media'),
- translate('MediaMediaItem',u'Delete the selected Media item'),
+ translate(u'MediaMediaItem',u'Delete Media'),
+ translate(u'MediaMediaItem',u'Delete the selected Media item'),
':/videos/video_delete.png', self.onMediaDeleteClick, 'MediaDeleteItem')
## Separator Line ##
self.addToolbarSeparator()
## Preview Media Button ##
self.addToolbarButton(
- translate('MediaMediaItem',u'Preview Media'),
- translate('MediaMediaItem',u'Preview the selected Media item'),
+ translate(u'MediaMediaItem',u'Preview Media'),
+ translate(u'MediaMediaItem',u'Preview the selected Media item'),
':/system/system_preview.png', self.onMediaPreviewClick, 'MediaPreviewItem')
## Live Media Button ##
self.addToolbarButton(
- translate('MediaMediaItem',u'Go Live'),
- translate('MediaMediaItem',u'Send the selected Media item live'),
+ translate(u'MediaMediaItem',u'Go Live'),
+ translate(u'MediaMediaItem',u'Send the selected Media item live'),
':/system/system_live.png', self.onMediaLiveClick, 'MediaLiveItem')
## Add Media Button ##
self.addToolbarButton(
- translate('MediaMediaItem',u'Add Media To Service'),
- translate('MediaMediaItem',u'Add the selected Media items(s) to the service'),
+ translate(u'MediaMediaItem',u'Add Media To Service'),
+ translate(u'MediaMediaItem',u'Add the selected Media items(s) to the service'),
':/system/system_add.png',self.onMediaAddClick, 'MediaAddItem')
## Add the Medialist widget ##
@@ -83,13 +83,13 @@
self.MediaListView.addAction(self.contextMenuAction(
self.MediaListView, ':/system/system_preview.png',
- translate('MediaMediaItem',u'&Preview Media'), self.onMediaPreviewClick))
+ translate(u'MediaMediaItem',u'&Preview Media'), self.onMediaPreviewClick))
self.MediaListView.addAction(self.contextMenuAction(
self.MediaListView, ':/system/system_live.png',
- translate('MediaMediaItem',u'&Show Live'), self.onMediaLiveClick))
+ translate(u'MediaMediaItem',u'&Show Live'), self.onMediaLiveClick))
self.MediaListView.addAction(self.contextMenuAction(
self.MediaListView, ':/system/system_add.png',
- translate('MediaMediaItem',u'&Add to Service'), self.onMediaAddClick))
+ translate(u'MediaMediaItem',u'&Add to Service'), self.onMediaAddClick))
def initialise(self):
list = self.parent.config.load_list(u'Media')
@@ -97,12 +97,12 @@
def onMediaNewClick(self):
files = QtGui.QFileDialog.getOpenFileNames(None,
- translate('MediaMediaItem', u'Select Media(s) items'),
+ translate(u'MediaMediaItem', u'Select Media(s) items'),
self.parent.config.get_last_dir(),
u'Videos (*.avi *.mpeg);;Audio (*.mp3 *.ogg *.wma);;All files (*)')
if len(files) > 0:
self.loadMediaList(files)
- dir, filename = os.path.split(str(files[0]))
+ dir, filename = os.path.split(unicode(files[0]))
self.parent.config.set_last_dir(dir)
self.parent.config.set_list(u'media', self.MediaListData.getFileList())
@@ -132,4 +132,4 @@
pass
def onMediaAddClick(self):
- pass
+ pass
\ No newline at end of file
=== modified file 'openlp/plugins/media/lib/mediatab.py'
--- openlp/plugins/media/lib/mediatab.py 2009-06-05 18:53:50 +0000
+++ openlp/plugins/media/lib/mediatab.py 2009-06-16 18:21:24 +0000
@@ -73,4 +73,4 @@
self.UseVMRCheckBox.setChecked(True)
def save(self):
- self.config.set_config(u'use mode layout', str(self.use_vmr_mode))
+ self.config.set_config(u'use mode layout', unicode(self.use_vmr_mode))
\ No newline at end of file
=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py 2009-05-21 05:15:51 +0000
+++ openlp/plugins/media/mediaplugin.py 2009-06-16 18:21:24 +0000
@@ -31,7 +31,7 @@
self.weight = -6
# Create the plugin icon
self.icon = QtGui.QIcon()
- self.icon.addPixmap(QtGui.QPixmap(':/media/media_video.png'),
+ self.icon.addPixmap(QtGui.QPixmap(u':/media/media_video.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
def get_settings_tab(self):
@@ -42,4 +42,3 @@
# Create the MediaManagerItem object
self.media_item = MediaMediaItem(self, self.icon, u'Media')
return self.media_item
-
=== modified file 'openlp/plugins/presentations/lib/filelistdata.py'
--- openlp/plugins/presentations/lib/filelistdata.py 2009-03-19 17:31:33 +0000
+++ openlp/plugins/presentations/lib/filelistdata.py 2009-06-16 18:21:24 +0000
@@ -39,10 +39,10 @@
def insertRow(self, row, filename):
self.beginInsertRows(QModelIndex(),row,row)
- log.info("insert row %d:%s"%(row,filename))
+ log.info(u'insert row %d:%s'%(row,filename))
# get short filename to display next to image
- (prefix, shortfilename) = os.path.split(str(filename))
- log.info("shortfilename=%s"%(shortfilename))
+ (prefix, shortfilename) = os.path.split(unicode(filename))
+ log.info(u'shortfilename=%s'%(shortfilename))
# create a preview image
self.items.insert(row, (filename, shortfilename))
self.endInsertRows()
@@ -67,7 +67,7 @@
retval= self.items[row][0]
else:
retval= QVariant()
-# log.info("Returning"+ str(retval))
+# log.info(u'Returning"+ unicode(retval))
if type(retval) is not type(QVariant):
return QVariant(retval)
else:
=== modified file 'openlp/plugins/presentations/lib/impresscom.py'
--- openlp/plugins/presentations/lib/impresscom.py 2008-12-10 20:40:18 +0000
+++ openlp/plugins/presentations/lib/impresscom.py 2009-06-16 18:21:24 +0000
@@ -1,118 +1,118 @@
-from win32com.client import Dispatch
-
-# OOo API documentation:
-# http://api.openoffice.org/docs/common/ref/com/sun/star/presentation/XSlideShowController.html
-# http://docs.go-oo.org/sd/html/classsd_1_1SlideShow.html
-# http://www.oooforum.org/forum/viewtopic.phtml?t=5252
-# http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Working_with_Presentations
-# http://mail.python.org/pipermail/python-win32/2008-January/006676.html
-
-class ImpressCOMApp(object):
- def __init__(self):
- self.createApp()
-
- def createApp(self):
- try:
- self._sm = Dispatch("com.sun.star.ServiceManager")
- self._app = self._sm.createInstance( "com.sun.star.frame.Desktop" )
- except:
- self._sm = None
- self._app = None
- return
-
- def getApp(self):
- if self._app == None:
- self.createApp()
- if self._app == None:
- return None
- return self._app
-
- app = property(getApp)
-
- def quit(self):
- self._app.Terminate()
- self._app = None
- self._sm = None
-
-class ImpressCOMPres(object):
- def __init__(self, oooApp, filename):
- self.oooApp = oooApp
- self.filename = filename
- self.open()
-
- def getPres(self):
- if self._pres == None:
- self.open()
- return self._pres
-
- pres = property(getPres)
-
- def open(self):
- self.comp = self.oooApp.app.loadComponentFromURL("file:///" + self.filename, "_blank", 0, [])
- self.presdoc = self.comp.getPresentation()
- self.presdoc.start()
- self._pres = self.presdoc.getController()
-
- def close(self):
- self.pres.deactivate()
- self.presdoc.end()
- self.comp.dispose()
- self._pres = None
- self.presdoc = None
- self.comp = None
-
- def isActive(self):
- return self.pres.isRunning() and self.pres.isActive()
-
- def resume(self):
- return self.pres.resume()
-
- def pause(self):
- return self.pres.pause()
-
- def blankScreen(self):
- self.pres.blankScreen(0)
-
- def stop(self):
- self.pres.deactivate()
- # self.presdoc.end()
-
- def go(self):
- self.pres.activate()
- # self.presdoc.start()
-
- def getSlideNumber(self):
- return self.pres.getCurrentSlideIndex
-
- def setSlideNumber(self, slideno):
- self.pres.gotoSlideIndex(slideno)
-
- slideNumber = property(getSlideNumber, setSlideNumber)
-
- def nextStep(self):
- self.pres.gotoNextEffect()
-
- def prevStep(self):
- self.pres.gotoPreviousSlide()
-
- def moveWindow(self, top, height, left, width):
- # position the window somehow
- pass
-
-class ImpressCOMSlide(object):
- def __init__(self, pres, index):
- self.pres = pres
- self.slide = pres.getSlideByIndex(index)
-
- def preview(self):
- if self.preview == None:
- # get a slide somehow
- pass
- return self.preview
-
-if __name__ == '__main__':
- ooo = ImpressCOMApp()
- show = ImpressCOMPres(ooo, "c:/test1.ppt")
- show.go()
- show.resume()
- show.nextStep()
+from win32com.client import Dispatch
+
+# OOo API documentation:
+# http://api.openoffice.org/docs/common/ref/com/sun/star/presentation/XSlideShowController.html
+# http://docs.go-oo.org/sd/html/classsd_1_1SlideShow.html
+# http://www.oooforum.org/forum/viewtopic.phtml?t=5252
+# http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Working_with_Presentations
+# http://mail.python.org/pipermail/python-win32/2008-January/006676.html
+
+class ImpressCOMApp(object):
+ def __init__(self):
+ self.createApp()
+
+ def createApp(self):
+ try:
+ self._sm = Dispatch(u'com.sun.star.ServiceManager')
+ self._app = self._sm.createInstance( "com.sun.star.frame.Desktop" )
+ except:
+ self._sm = None
+ self._app = None
+ return
+
+ def getApp(self):
+ if self._app == None:
+ self.createApp()
+ if self._app == None:
+ return None
+ return self._app
+
+ app = property(getApp)
+
+ def quit(self):
+ self._app.Terminate()
+ self._app = None
+ self._sm = None
+
+class ImpressCOMPres(object):
+ def __init__(self, oooApp, filename):
+ self.oooApp = oooApp
+ self.filename = filename
+ self.open()
+
+ def getPres(self):
+ if self._pres == None:
+ self.open()
+ return self._pres
+
+ pres = property(getPres)
+
+ def open(self):
+ self.comp = self.oooApp.app.loadComponentFromURL(u'file:///" + self.filename, "_blank", 0, [])
+ self.presdoc = self.comp.getPresentation()
+ self.presdoc.start()
+ self._pres = self.presdoc.getController()
+
+ def close(self):
+ self.pres.deactivate()
+ self.presdoc.end()
+ self.comp.dispose()
+ self._pres = None
+ self.presdoc = None
+ self.comp = None
+
+ def isActive(self):
+ return self.pres.isRunning() and self.pres.isActive()
+
+ def resume(self):
+ return self.pres.resume()
+
+ def pause(self):
+ return self.pres.pause()
+
+ def blankScreen(self):
+ self.pres.blankScreen(0)
+
+ def stop(self):
+ self.pres.deactivate()
+ # self.presdoc.end()
+
+ def go(self):
+ self.pres.activate()
+ # self.presdoc.start()
+
+ def getSlideNumber(self):
+ return self.pres.getCurrentSlideIndex
+
+ def setSlideNumber(self, slideno):
+ self.pres.gotoSlideIndex(slideno)
+
+ slideNumber = property(getSlideNumber, setSlideNumber)
+
+ def nextStep(self):
+ self.pres.gotoNextEffect()
+
+ def prevStep(self):
+ self.pres.gotoPreviousSlide()
+
+ def moveWindow(self, top, height, left, width):
+ # position the window somehow
+ pass
+
+class ImpressCOMSlide(object):
+ def __init__(self, pres, index):
+ self.pres = pres
+ self.slide = pres.getSlideByIndex(index)
+
+ def preview(self):
+ if self.preview == None:
+ # get a slide somehow
+ pass
+ return self.preview
+
+if __name__ == '__main__':
+ ooo = ImpressCOMApp()
+ show = ImpressCOMPres(ooo, "c:/test1.ppt')
+ show.go()
+ show.resume()
+ show.nextStep()
\ No newline at end of file
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2009-06-05 05:13:34 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2009-06-16 18:21:24 +0000
@@ -41,30 +41,30 @@
# Create buttons for the toolbar
## New Presentation Button ##
self.addToolbarButton(
- translate('PresentationsMediaItem',u'New presentations'),
- translate('PresentationsMediaItem',u'Load presentations into openlp.org'),
+ translate(u'PresentationsMediaItem',u'New presentations'),
+ translate(u'PresentationsMediaItem',u'Load presentations into openlp.org'),
':/presentations/presentation_load.png', self.onPresentationNewClick, 'PresentationNewItem')
## Delete Presentation Button ##
self.addToolbarButton(
- translate('PresentationsMediaItem',u'Delete Presentation'),
- translate('PresentationsMediaItem',u'Delete the selected presentation'),
+ translate(u'PresentationsMediaItem',u'Delete Presentation'),
+ translate(u'PresentationsMediaItem',u'Delete the selected presentation'),
':/presentations/presentation_delete.png', self.onPresentationDeleteClick, 'PresentationDeleteItem')
## Separator Line ##
self.addToolbarSeparator()
## Preview Presentation Button ##
self.addToolbarButton(
- translate('PresentationsMediaItem',u'Preview Presentation'),
- translate('PresentationsMediaItem',u'Preview the selected Presentation'),
+ translate(u'PresentationsMediaItem',u'Preview Presentation'),
+ translate(u'PresentationsMediaItem',u'Preview the selected Presentation'),
':/system/system_preview.png', self.onPresentationPreviewClick, 'PresentationPreviewItem')
## Live Presentation Button ##
self.addToolbarButton(
- translate('PresentationsMediaItem',u'Go Live'),
- translate('PresentationsMediaItem',u'Send the selected presentation live'),
+ translate(u'PresentationsMediaItem',u'Go Live'),
+ translate(u'PresentationsMediaItem',u'Send the selected presentation live'),
':/system/system_live.png', self.onPresentationLiveClick, 'PresentationLiveItem')
## Add Presentation Button ##
self.addToolbarButton(
- translate('PresentationsMediaItem',u'Add Presentation To Service'),
- translate('PresentationsMediaItem',u'Add the selected Presentations(s) to the service'),
+ translate(u'PresentationsMediaItem',u'Add Presentation To Service'),
+ translate(u'PresentationsMediaItem',u'Add the selected Presentations(s) to the service'),
':/system/system_add.png',self.onPresentationAddClick, 'PresentationsAddItem')
## Add the Presentationlist widget ##
@@ -74,17 +74,17 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.PresentationWidget.sizePolicy().hasHeightForWidth())
self.PresentationWidget.setSizePolicy(sizePolicy)
- self.PresentationWidget.setObjectName('PresentationWidget')
+ self.PresentationWidget.setObjectName(u'PresentationWidget')
self.DisplayLayout = QtGui.QGridLayout(self.PresentationWidget)
- self.DisplayLayout.setObjectName('DisplayLayout')
+ self.DisplayLayout.setObjectName(u'DisplayLayout')
self.DisplayTypeComboBox = QtGui.QComboBox(self.PresentationWidget)
- self.DisplayTypeComboBox.setObjectName('DisplayTypeComboBox')
+ self.DisplayTypeComboBox.setObjectName(u'DisplayTypeComboBox')
self.DisplayLayout.addWidget(self.DisplayTypeComboBox, 0, 1, 1, 2)
self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget)
- self.DisplayTypeLabel.setObjectName('SearchTypeLabel')
+ self.DisplayTypeLabel.setObjectName(u'SearchTypeLabel')
self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1)
- self.DisplayTypeLabel.setText(translate('PresentationMediaItem', u'Present using:'))
+ self.DisplayTypeLabel.setText(translate(u'PresentationMediaItem', u'Present using:'))
# Add the song widget to the page layout
self.PageLayout.addWidget(self.PresentationWidget)
@@ -101,13 +101,13 @@
self.PresentationsListView.addAction(self.contextMenuAction(
self.PresentationsListView, ':/system/system_preview.png',
- translate('PresentationsMediaItem',u'&Preview presentations'), self.onPresentationPreviewClick))
+ translate(u'PresentationsMediaItem',u'&Preview presentations'), self.onPresentationPreviewClick))
self.PresentationsListView.addAction(self.contextMenuAction(
self.PresentationsListView, ':/system/system_live.png',
- translate('PresentationsMediaItem',u'&Show Live'), self.onPresentationLiveClick))
+ translate(u'PresentationsMediaItem',u'&Show Live'), self.onPresentationLiveClick))
self.PresentationsListView.addAction(self.contextMenuAction(
self.PresentationsListView, ':/system/system_add.png',
- translate('PresentationsMediaItem',u'&Add to Service'), self.onPresentationAddClick))
+ translate(u'PresentationsMediaItem',u'&Add to Service'), self.onPresentationAddClick))
def initialise(self):
list = self.parent.config.load_list(u'presentations')
@@ -118,11 +118,11 @@
def onPresentationNewClick(self):
files = QtGui.QFileDialog.getOpenFileNames(None,
- translate('PresentationsMediaItem', u'Select presentations(s)'),
+ translate(u'PresentationsMediaItem', u'Select presentations(s)'),
self.parent.config.get_last_dir(), u'Presentations (*.ppt *.pps *.odp)')
if len(files) > 0:
self.loadPresentationList(files)
- dir, filename = os.path.split(str(files[0]))
+ dir, filename = os.path.split(unicode(files[0]))
self.parent.config.set_last_dir(dir)
self.parent.config.set_list(u'Presentations', self.PresentationsListData.getFileList())
@@ -148,4 +148,4 @@
pass
def onPresentationAddClick(self):
- pass
+ pass
\ No newline at end of file
=== modified file 'openlp/plugins/presentations/lib/powerpoint.py'
--- openlp/plugins/presentations/lib/powerpoint.py 2008-12-10 20:40:18 +0000
+++ openlp/plugins/presentations/lib/powerpoint.py 2009-06-16 18:21:24 +0000
@@ -1,139 +1,139 @@
-from win32com.client import Dispatch
-
-# PPT API documentation:
-# http://msdn.microsoft.com/en-us/library/aa269321(office.10).aspx
-
-
-class PowerPointApp(object):
- def __init__(self):
- self.createApp()
-
- def createApp(self):
- try:
- self._app = Dispatch("PowerPoint.Application")
- except:
- self._app = None
- return
- self._app.Visible = True
- self._app.WindowState = 2
-
- def getApp(self):
- if self._app == None:
- self.createApp()
- if self._app == None:
- return None
- if self._app.Windows.Count == 0:
- self.createApp()
- return self._app
-
- app = property(getApp)
-
- def quit(self):
- self._app.Quit()
- self._app = None
-
-class PowerPointPres(object):
- def __init__(self, pptApp, filename):
- self.pptApp = pptApp
- self.filename = filename
- self.open()
-
- def getPres(self):
- if self._pres == None:
- for p in self.pptApp.app.Presentations:
- if p.FullName == self.filename:
- self._pres = p
- break
- if self._pres != None:
- try:
- x = self._pres.Name
- except:
- self._pres = None
- if self._pres == None:
- self.openPres()
- return self._pres
-
- pres = property(getPres)
-
- def open(self):
- self.pptApp.app.Presentations.Open(self.filename, False, False, True)
- self._pres = self.pptApp.app.Presentations(ppt.app.Presentations.Count)
-
- def close(self):
- self.pres.Close()
- self._pres = None
-
- def isActive(self):
- if self.pres.SlideShowWindow == None:
- return False
- if self.pres.SlideShowWindow.View == None:
- return False
- return True
-
- def resume(self):
- self.pres.SlideShowSettings.Run()
- self.pres.SlideShowWindow.View.State = 1
- self.pres.SlideShowWindow.Activate()
-
- def pause(self):
- if self.isActive():
- self.pres.SlideShowWindow.View.State = 2
-
- def blankScreen(self):
- if self.isActive():
- self.pres.SlideShowWindow.View.State = 3
-
- def stop(self):
- if self.isActive():
- self.pres.SlideShowWindow.View.Exit()
-
- def go(self):
- self.pres.SlideShowSettings.Run()
-
- def getCurrentSlideIndex(self):
- if self.isActive():
- return self.pres.SlideShowWindow.View.CurrentShowPosition
- else:
- return -1
-
- def setCurrentSlideIndex(self, slideno):
- if not self.isActive():
- self.resume()
- self.pres.SlideShowWindow.View.GotoSlide(slideno)
-
- currentSlideIndex = property(getSlideNumber, setSlideNumber)
-
- def nextStep(self):
- if not self.isActive():
- self.resume()
- self.pres.SlideShowWindow.View.Next()
-
- def prevStep(self):
- if not self.isActive():
- self.resume()
- self.pres.SlideShowWindow.View.Previous()
-
- def moveWindow(self, top, height, left, width):
- if not self.isActive():
- self.resume()
- self.pres.SlideShowWindow.Top = top / 20
- self.pres.SlideShowWindow.Height = height / 20
- self.pres.SlideShowWindow.Left = left / 20
- self.pres.SlideShowWindow.Width = width / 20
-
-class PowerPointSlide(object):
- def __init__(self, pres, index):
- self.pres = pres
- self.slide = pres.Slides[index]
-
- def preview(self):
- if self.preview == None:
- self.slide.Copy
- # import win32clipboard as w
- # import win32con
- # w.OpenClipboard()
- # self.preview = w.GetClipboardData.GetData(win32con.CF_BITMAP)
- # w.CloseClipboard()
- return self.preview
-
-
+from win32com.client import Dispatch
+
+# PPT API documentation:
+# http://msdn.microsoft.com/en-us/library/aa269321(office.10).aspx
+
+
+class PowerPointApp(object):
+ def __init__(self):
+ self.createApp()
+
+ def createApp(self):
+ try:
+ self._app = Dispatch(u'PowerPoint.Application')
+ except:
+ self._app = None
+ return
+ self._app.Visible = True
+ self._app.WindowState = 2
+
+ def getApp(self):
+ if self._app == None:
+ self.createApp()
+ if self._app == None:
+ return None
+ if self._app.Windows.Count == 0:
+ self.createApp()
+ return self._app
+
+ app = property(getApp)
+
+ def quit(self):
+ self._app.Quit()
+ self._app = None
+
+class PowerPointPres(object):
+ def __init__(self, pptApp, filename):
+ self.pptApp = pptApp
+ self.filename = filename
+ self.open()
+
+ def getPres(self):
+ if self._pres == None:
+ for p in self.pptApp.app.Presentations:
+ if p.FullName == self.filename:
+ self._pres = p
+ break
+ if self._pres != None:
+ try:
+ x = self._pres.Name
+ except:
+ self._pres = None
+ if self._pres == None:
+ self.openPres()
+ return self._pres
+
+ pres = property(getPres)
+
+ def open(self):
+ self.pptApp.app.Presentations.Open(self.filename, False, False, True)
+ self._pres = self.pptApp.app.Presentations(ppt.app.Presentations.Count)
+
+ def close(self):
+ self.pres.Close()
+ self._pres = None
+
+ def isActive(self):
+ if self.pres.SlideShowWindow == None:
+ return False
+ if self.pres.SlideShowWindow.View == None:
+ return False
+ return True
+
+ def resume(self):
+ self.pres.SlideShowSettings.Run()
+ self.pres.SlideShowWindow.View.State = 1
+ self.pres.SlideShowWindow.Activate()
+
+ def pause(self):
+ if self.isActive():
+ self.pres.SlideShowWindow.View.State = 2
+
+ def blankScreen(self):
+ if self.isActive():
+ self.pres.SlideShowWindow.View.State = 3
+
+ def stop(self):
+ if self.isActive():
+ self.pres.SlideShowWindow.View.Exit()
+
+ def go(self):
+ self.pres.SlideShowSettings.Run()
+
+ def getCurrentSlideIndex(self):
+ if self.isActive():
+ return self.pres.SlideShowWindow.View.CurrentShowPosition
+ else:
+ return -1
+
+ def setCurrentSlideIndex(self, slideno):
+ if not self.isActive():
+ self.resume()
+ self.pres.SlideShowWindow.View.GotoSlide(slideno)
+
+ currentSlideIndex = property(getSlideNumber, setSlideNumber)
+
+ def nextStep(self):
+ if not self.isActive():
+ self.resume()
+ self.pres.SlideShowWindow.View.Next()
+
+ def prevStep(self):
+ if not self.isActive():
+ self.resume()
+ self.pres.SlideShowWindow.View.Previous()
+
+ def moveWindow(self, top, height, left, width):
+ if not self.isActive():
+ self.resume()
+ self.pres.SlideShowWindow.Top = top / 20
+ self.pres.SlideShowWindow.Height = height / 20
+ self.pres.SlideShowWindow.Left = left / 20
+ self.pres.SlideShowWindow.Width = width / 20
+
+class PowerPointSlide(object):
+ def __init__(self, pres, index):
+ self.pres = pres
+ self.slide = pres.Slides[index]
+
+ def preview(self):
+ if self.preview == None:
+ self.slide.Copy
+ # import win32clipboard as w
+ # import win32con
+ # w.OpenClipboard()
+ # self.preview = w.GetClipboardData.GetData(win32con.CF_BITMAP)
+ # w.CloseClipboard()
+ return self.preview
+
+
\ No newline at end of file
=== modified file 'openlp/plugins/presentations/lib/pptview.py'
--- openlp/plugins/presentations/lib/pptview.py 2008-12-10 20:40:18 +0000
+++ openlp/plugins/presentations/lib/pptview.py 2009-06-16 18:21:24 +0000
@@ -1,126 +1,125 @@
-import sys
-import win32api
-from PyQt4 import QtGui, QtCore
-from ctypes import *
-from ctypes.wintypes import RECT
-
-pptdll = cdll.LoadLibrary(r"C:\Documents and Settings\jonathan\My Documents\Personal\openlp\openlp-2\trunk\openlp\libraries\pptviewlib\pptviewlib.dll")
-
-class BoxLayout(QtGui.QWidget):
- def __init__(self, parent=None):
- QtGui.QWidget.__init__(self, parent)
- self.pptid = -1
- self.setWindowTitle('box layout')
-
- PPTLabel = QtGui.QLabel('Open PowerPoint file')
- slideLabel = QtGui.QLabel('Go to slide #')
- self.PPTEdit = QtGui.QLineEdit()
- self.slideEdit = QtGui.QLineEdit()
- self.total = QtGui.QLabel()
- PPTBtn = QtGui.QPushButton("Open")
- PPTDlgBtn = QtGui.QPushButton("...")
- slideBtn = QtGui.QPushButton("Go")
- prev = QtGui.QPushButton("Prev")
- next = QtGui.QPushButton("Next")
- blank = QtGui.QPushButton("Blank")
- unblank = QtGui.QPushButton("Unblank")
- restart = QtGui.QPushButton("Restart")
- close = QtGui.QPushButton("Close")
- resume = QtGui.QPushButton("Resume")
- stop = QtGui.QPushButton("Stop")
- pptwindow = QtGui.QWidget()
-
- grid = QtGui.QGridLayout()
- grid.addWidget(PPTLabel, 0, 0)
- grid.addWidget(self.PPTEdit, 0, 1)
- grid.addWidget(PPTDlgBtn, 0, 2)
- grid.addWidget(PPTBtn, 0, 3)
- grid.addWidget(slideLabel, 1, 0)
- grid.addWidget(self.slideEdit, 1, 1)
- grid.addWidget(slideBtn, 1, 3)
- grid.addWidget(prev, 2, 0)
- grid.addWidget(next, 2, 1)
- grid.addWidget(blank, 3, 0)
- grid.addWidget(unblank, 3, 1)
- grid.addWidget(restart, 4, 0)
- grid.addWidget(stop, 4, 1)
- grid.addWidget(resume, 4, 2)
- grid.addWidget(pptwindow, 5, 0, 10, 3)
- self.connect(PPTBtn, QtCore.SIGNAL('clicked()'), self.OpenClick)
- self.connect(PPTDlgBtn, QtCore.SIGNAL('clicked()'), self.OpenDialog)
- self.connect(slideBtn, QtCore.SIGNAL('clicked()'), self.GotoClick)
- self.connect(prev, QtCore.SIGNAL('clicked()'), self.PrevClick)
- self.connect(next, QtCore.SIGNAL('clicked()'), self.NextClick)
- self.connect(blank, QtCore.SIGNAL('clicked()'), self.BlankClick)
- self.connect(unblank, QtCore.SIGNAL('clicked()'), self.UnblankClick)
- self.connect(restart, QtCore.SIGNAL('clicked()'), self.RestartClick)
- self.connect(close, QtCore.SIGNAL('clicked()'), self.CloseClick)
- self.connect(stop, QtCore.SIGNAL('clicked()'), self.StopClick)
- self.connect(resume, QtCore.SIGNAL('clicked()'), self.ResumeClick)
-
- self.setLayout(grid)
-
- self.resize(300, 150)
-
- def PrevClick(self):
- if self.pptid<0: return
- pptdll.PrevStep(self.pptid)
- self.slideEdit.setText(pptdll.GetCurrentSlide(self.pptid))
-
- def NextClick(self):
- if(self.pptid<0): return
- pptdll.NextStep(self.pptid)
- self.slideEdit.setText(pptdll.GetCurrentSlide(self.pptid))
-
- def BlankClick(self):
- if(self.pptid<0): return
- pptdll.Blank(self.pptid)
-
- def UnblankClick(self):
- if(self.pptid<0): return
- pptdll.Unblank(self.pptid)
-
- def RestartClick(self):
- if(self.pptid<0): return
- pptdll.RestartShow(self.pptid)
- self.slideEdit.setText(pptdll.GetCurrentSlide(self.pptid))
-
- def StopClick(self):
- if(self.pptid<0): return
- pptdll.Stop(self.pptid)
-
- def ResumeClick(self):
- if(self.pptid<0): return
- pptdll.Resume(self.pptid)
-
- def CloseClick(self):
- if(self.pptid<0): return
- pptdll.Close(self.pptid)
- self.pptid = -1
-
- def OpenClick(self):
- if(self.pptid>=0):
- self.CloseClick()
- rect = RECT()
- rect.left = 100
- rect.top = 100
- rect.width = 900
- rect.hight = 700
- #self.pptid = pptdll.OpenPPT(self.PPTEdit.text, None, rect, "c:\temp\slide")
- self.pptid = pptdll.OpenPPT("C:\\test 1.ppt", None, rect, "c:\temp\slide")
- self.total.setText(pptdll.GetSlideCount(self.pptid))
- self.slideEdit.setText(str(pptdll.GetCurrentSlide(self.pptid)))
-
- def GotoClick(self):
- if(self.pptid<0): return
- pptdll.GotoSlide(self.pptid, self.slideEdit.text)
- self.slideEdit.setText(pptdll.GetCurrentSlide(self.pptid))
-
- def OpenDialog(self):
- self.PPTEdit.setText(QtGui.QFileDialog.getOpenFileName(self, 'Open file'))
-
-app = QtGui.QApplication(sys.argv)
-qb = BoxLayout()
-qb.show()
-sys.exit(app.exec_())
-
+import sys
+import win32api
+from PyQt4 import QtGui, QtCore
+from ctypes import *
+from ctypes.wintypes import RECT
+
+pptdll = cdll.LoadLibrary(r"C:\Documents and Settings\jonathan\My Documents\Personal\openlp\openlp-2\trunk\openlp\libraries\pptviewlib\pptviewlib.dll')
+
+class BoxLayout(QtGui.QWidget):
+ def __init__(self, parent=None):
+ QtGui.QWidget.__init__(self, parent)
+ self.pptid = -1
+ self.setWindowTitle(u'box layout')
+
+ PPTLabel = QtGui.QLabel(u'Open PowerPoint file')
+ slideLabel = QtGui.QLabel(u'Go to slide #')
+ self.PPTEdit = QtGui.QLineEdit()
+ self.slideEdit = QtGui.QLineEdit()
+ self.total = QtGui.QLabel()
+ PPTBtn = QtGui.QPushButton(u'Open')
+ PPTDlgBtn = QtGui.QPushButton(u'...')
+ slideBtn = QtGui.QPushButton(u'Go')
+ prev = QtGui.QPushButton(u'Prev')
+ next = QtGui.QPushButton(u'Next')
+ blank = QtGui.QPushButton(u'Blank')
+ unblank = QtGui.QPushButton(u'Unblank')
+ restart = QtGui.QPushButton(u'Restart')
+ close = QtGui.QPushButton(u'Close')
+ resume = QtGui.QPushButton(u'Resume')
+ stop = QtGui.QPushButton(u'Stop')
+ pptwindow = QtGui.QWidget()
+
+ grid = QtGui.QGridLayout()
+ grid.addWidget(PPTLabel, 0, 0)
+ grid.addWidget(self.PPTEdit, 0, 1)
+ grid.addWidget(PPTDlgBtn, 0, 2)
+ grid.addWidget(PPTBtn, 0, 3)
+ grid.addWidget(slideLabel, 1, 0)
+ grid.addWidget(self.slideEdit, 1, 1)
+ grid.addWidget(slideBtn, 1, 3)
+ grid.addWidget(prev, 2, 0)
+ grid.addWidget(next, 2, 1)
+ grid.addWidget(blank, 3, 0)
+ grid.addWidget(unblank, 3, 1)
+ grid.addWidget(restart, 4, 0)
+ grid.addWidget(stop, 4, 1)
+ grid.addWidget(resume, 4, 2)
+ grid.addWidget(pptwindow, 5, 0, 10, 3)
+ self.connect(PPTBtn, QtCore.SIGNAL(u'clicked()'), self.OpenClick)
+ self.connect(PPTDlgBtn, QtCore.SIGNAL(u'clicked()'), self.OpenDialog)
+ self.connect(slideBtn, QtCore.SIGNAL(u'clicked()'), self.GotoClick)
+ self.connect(prev, QtCore.SIGNAL(u'clicked()'), self.PrevClick)
+ self.connect(next, QtCore.SIGNAL(u'clicked()'), self.NextClick)
+ self.connect(blank, QtCore.SIGNAL(u'clicked()'), self.BlankClick)
+ self.connect(unblank, QtCore.SIGNAL(u'clicked()'), self.UnblankClick)
+ self.connect(restart, QtCore.SIGNAL(u'clicked()'), self.RestartClick)
+ self.connect(close, QtCore.SIGNAL(u'clicked()'), self.CloseClick)
+ self.connect(stop, QtCore.SIGNAL(u'clicked()'), self.StopClick)
+ self.connect(resume, QtCore.SIGNAL(u'clicked()'), self.ResumeClick)
+
+ self.setLayout(grid)
+
+ self.resize(300, 150)
+
+ def PrevClick(self):
+ if self.pptid<0: return
+ pptdll.PrevStep(self.pptid)
+ self.slideEdit.setText(pptdll.GetCurrentSlide(self.pptid))
+
+ def NextClick(self):
+ if(self.pptid<0): return
+ pptdll.NextStep(self.pptid)
+ self.slideEdit.setText(pptdll.GetCurrentSlide(self.pptid))
+
+ def BlankClick(self):
+ if(self.pptid<0): return
+ pptdll.Blank(self.pptid)
+
+ def UnblankClick(self):
+ if(self.pptid<0): return
+ pptdll.Unblank(self.pptid)
+
+ def RestartClick(self):
+ if(self.pptid<0): return
+ pptdll.RestartShow(self.pptid)
+ self.slideEdit.setText(pptdll.GetCurrentSlide(self.pptid))
+
+ def StopClick(self):
+ if(self.pptid<0): return
+ pptdll.Stop(self.pptid)
+
+ def ResumeClick(self):
+ if(self.pptid<0): return
+ pptdll.Resume(self.pptid)
+
+ def CloseClick(self):
+ if(self.pptid<0): return
+ pptdll.Close(self.pptid)
+ self.pptid = -1
+
+ def OpenClick(self):
+ if(self.pptid>=0):
+ self.CloseClick()
+ rect = RECT()
+ rect.left = 100
+ rect.top = 100
+ rect.width = 900
+ rect.hight = 700
+ #self.pptid = pptdll.OpenPPT(self.PPTEdit.text, None, rect, "c:\temp\slide')
+ self.pptid = pptdll.OpenPPT(u'C:\\test 1.ppt", None, rect, "c:\temp\slide')
+ self.total.setText(pptdll.GetSlideCount(self.pptid))
+ self.slideEdit.setText(unicode(pptdll.GetCurrentSlide(self.pptid)))
+
+ def GotoClick(self):
+ if(self.pptid<0): return
+ pptdll.GotoSlide(self.pptid, self.slideEdit.text)
+ self.slideEdit.setText(pptdll.GetCurrentSlide(self.pptid))
+
+ def OpenDialog(self):
+ self.PPTEdit.setText(QtGui.QFileDialog.getOpenFileName(self, 'Open file'))
+
+app = QtGui.QApplication(sys.argv)
+qb = BoxLayout()
+qb.show()
+sys.exit(app.exec_())
\ No newline at end of file
=== modified file 'openlp/plugins/presentations/lib/pptviewlib/ppttest.py'
--- openlp/plugins/presentations/lib/pptviewlib/ppttest.py 2008-12-10 20:40:18 +0000
+++ openlp/plugins/presentations/lib/pptviewlib/ppttest.py 2009-06-16 18:21:24 +0000
@@ -1,147 +1,146 @@
-import sys
-from PyQt4 import QtGui, QtCore
-from ctypes import *
-from ctypes.wintypes import RECT
-
-class PPTViewer(QtGui.QWidget):
- def __init__(self, parent=None):
- QtGui.QWidget.__init__(self, parent)
- self.pptid = -1
- self.setWindowTitle('PowerPoint Viewer Test')
-
- PPTLabel = QtGui.QLabel('Open PowerPoint file')
- slideLabel = QtGui.QLabel('Go to slide #')
- self.PPTEdit = QtGui.QLineEdit()
- self.slideEdit = QtGui.QLineEdit()
- self.total = QtGui.QLabel()
- PPTBtn = QtGui.QPushButton("Open")
- PPTDlgBtn = QtGui.QPushButton("...")
- slideBtn = QtGui.QPushButton("Go")
- prev = QtGui.QPushButton("Prev")
- next = QtGui.QPushButton("Next")
- blank = QtGui.QPushButton("Blank")
- unblank = QtGui.QPushButton("Unblank")
- restart = QtGui.QPushButton("Restart")
- close = QtGui.QPushButton("Close")
- resume = QtGui.QPushButton("Resume")
- stop = QtGui.QPushButton("Stop")
- pptwindow = QtGui.QWidget()
-
- grid = QtGui.QGridLayout()
- grid.addWidget(PPTLabel, 0, 0)
- grid.addWidget(self.PPTEdit, 0, 1)
- grid.addWidget(PPTDlgBtn, 0, 2)
- grid.addWidget(PPTBtn, 0, 3)
- grid.addWidget(slideLabel, 1, 0)
- grid.addWidget(self.slideEdit, 1, 1)
- grid.addWidget(slideBtn, 1, 3)
- grid.addWidget(prev, 2, 0)
- grid.addWidget(next, 2, 1)
- grid.addWidget(blank, 3, 0)
- grid.addWidget(unblank, 3, 1)
- grid.addWidget(restart, 4, 0)
- grid.addWidget(close, 4, 1)
- grid.addWidget(stop, 5, 0)
- grid.addWidget(resume, 5, 1)
- grid.addWidget(pptwindow, 6, 0, 10, 3)
- self.connect(PPTBtn, QtCore.SIGNAL('clicked()'), self.OpenClick)
- self.connect(PPTDlgBtn, QtCore.SIGNAL('clicked()'), self.OpenDialog)
- self.connect(slideBtn, QtCore.SIGNAL('clicked()'), self.GotoClick)
- self.connect(prev, QtCore.SIGNAL('clicked()'), self.PrevClick)
- self.connect(next, QtCore.SIGNAL('clicked()'), self.NextClick)
- self.connect(blank, QtCore.SIGNAL('clicked()'), self.BlankClick)
- self.connect(unblank, QtCore.SIGNAL('clicked()'), self.UnblankClick)
- self.connect(restart, QtCore.SIGNAL('clicked()'), self.RestartClick)
- self.connect(close, QtCore.SIGNAL('clicked()'), self.CloseClick)
- self.connect(stop, QtCore.SIGNAL('clicked()'), self.StopClick)
- self.connect(resume, QtCore.SIGNAL('clicked()'), self.ResumeClick)
-
- self.setLayout(grid)
-
- self.resize(300, 150)
-
- def PrevClick(self):
- if self.pptid<0: return
- pptdll.PrevStep(self.pptid)
- self.UpdateCurrSlide()
- app.processEvents()
-
- def NextClick(self):
- if(self.pptid<0): return
- pptdll.NextStep(self.pptid)
- self.UpdateCurrSlide()
- app.processEvents()
-
- def BlankClick(self):
- if(self.pptid<0): return
- pptdll.Blank(self.pptid)
- app.processEvents()
-
- def UnblankClick(self):
- if(self.pptid<0): return
- pptdll.Unblank(self.pptid)
- app.processEvents()
-
- def RestartClick(self):
- if(self.pptid<0): return
- pptdll.RestartShow(self.pptid)
- self.UpdateCurrSlide()
- app.processEvents()
-
- def StopClick(self):
- if(self.pptid<0): return
- pptdll.Stop(self.pptid)
- app.processEvents()
-
- def ResumeClick(self):
- if(self.pptid<0): return
- pptdll.Resume(self.pptid)
- app.processEvents()
-
- def CloseClick(self):
- if(self.pptid<0): return
- pptdll.ClosePPT(self.pptid)
- self.pptid = -1
- app.processEvents()
-
- def OpenClick(self):
- oldid = self.pptid;
- rect = RECT(100,100,900,700)
- filename = str(self.PPTEdit.text())
- print filename
- self.pptid = pptdll.OpenPPT(filename, None, rect, "c:\\temp\\slide")
- print "id: " + str(self.pptid)
- if oldid>=0:
- pptdll.ClosePPT(oldid);
- slides = pptdll.GetSlideCount(self.pptid)
- print "slidecount: " + str(slides)
- self.total.setNum(pptdll.GetSlideCount(self.pptid))
- self.UpdateCurrSlide()
-
- def UpdateCurrSlide(self):
- if(self.pptid<0): return
- slide = str(pptdll.GetCurrentSlide(self.pptid))
- print "currslide: " + slide
- self.slideEdit.setText(slide)
- app.processEvents()
-
- def GotoClick(self):
- if(self.pptid<0): return
- print self.slideEdit.text()
- pptdll.GotoSlide(self.pptid, int(self.slideEdit.text()))
- self.UpdateCurrSlide()
- app.processEvents()
-
- def OpenDialog(self):
- self.PPTEdit.setText(QtGui.QFileDialog.getOpenFileName(self, 'Open file'))
-
-if __name__ == '__main__':
- #pptdll = cdll.LoadLibrary(r"C:\Documents and Settings\jonathan\Desktop\pptviewlib.dll")
- pptdll = cdll.LoadLibrary(r"pptviewlib.dll")
- pptdll.SetDebug(1)
- print "Begin..."
- app = QtGui.QApplication(sys.argv)
- qb = PPTViewer()
- qb.show()
- sys.exit(app.exec_())
-
+import sys
+from PyQt4 import QtGui, QtCore
+from ctypes import *
+from ctypes.wintypes import RECT
+
+class PPTViewer(QtGui.QWidget):
+ def __init__(self, parent=None):
+ QtGui.QWidget.__init__(self, parent)
+ self.pptid = -1
+ self.setWindowTitle(u'PowerPoint Viewer Test')
+
+ PPTLabel = QtGui.QLabel(u'Open PowerPoint file')
+ slideLabel = QtGui.QLabel(u'Go to slide #')
+ self.PPTEdit = QtGui.QLineEdit()
+ self.slideEdit = QtGui.QLineEdit()
+ self.total = QtGui.QLabel()
+ PPTBtn = QtGui.QPushButton(u'Open')
+ PPTDlgBtn = QtGui.QPushButton(u'...')
+ slideBtn = QtGui.QPushButton(u'Go')
+ prev = QtGui.QPushButton(u'Prev')
+ next = QtGui.QPushButton(u'Next')
+ blank = QtGui.QPushButton(u'Blank')
+ unblank = QtGui.QPushButton(u'Unblank')
+ restart = QtGui.QPushButton(u'Restart')
+ close = QtGui.QPushButton(u'Close')
+ resume = QtGui.QPushButton(u'Resume')
+ stop = QtGui.QPushButton(u'Stop')
+ pptwindow = QtGui.QWidget()
+
+ grid = QtGui.QGridLayout()
+ grid.addWidget(PPTLabel, 0, 0)
+ grid.addWidget(self.PPTEdit, 0, 1)
+ grid.addWidget(PPTDlgBtn, 0, 2)
+ grid.addWidget(PPTBtn, 0, 3)
+ grid.addWidget(slideLabel, 1, 0)
+ grid.addWidget(self.slideEdit, 1, 1)
+ grid.addWidget(slideBtn, 1, 3)
+ grid.addWidget(prev, 2, 0)
+ grid.addWidget(next, 2, 1)
+ grid.addWidget(blank, 3, 0)
+ grid.addWidget(unblank, 3, 1)
+ grid.addWidget(restart, 4, 0)
+ grid.addWidget(close, 4, 1)
+ grid.addWidget(stop, 5, 0)
+ grid.addWidget(resume, 5, 1)
+ grid.addWidget(pptwindow, 6, 0, 10, 3)
+ self.connect(PPTBtn, QtCore.SIGNAL(u'clicked()'), self.OpenClick)
+ self.connect(PPTDlgBtn, QtCore.SIGNAL(u'clicked()'), self.OpenDialog)
+ self.connect(slideBtn, QtCore.SIGNAL(u'clicked()'), self.GotoClick)
+ self.connect(prev, QtCore.SIGNAL(u'clicked()'), self.PrevClick)
+ self.connect(next, QtCore.SIGNAL(u'clicked()'), self.NextClick)
+ self.connect(blank, QtCore.SIGNAL(u'clicked()'), self.BlankClick)
+ self.connect(unblank, QtCore.SIGNAL(u'clicked()'), self.UnblankClick)
+ self.connect(restart, QtCore.SIGNAL(u'clicked()'), self.RestartClick)
+ self.connect(close, QtCore.SIGNAL(u'clicked()'), self.CloseClick)
+ self.connect(stop, QtCore.SIGNAL(u'clicked()'), self.StopClick)
+ self.connect(resume, QtCore.SIGNAL(u'clicked()'), self.ResumeClick)
+
+ self.setLayout(grid)
+
+ self.resize(300, 150)
+
+ def PrevClick(self):
+ if self.pptid<0: return
+ pptdll.PrevStep(self.pptid)
+ self.UpdateCurrSlide()
+ app.processEvents()
+
+ def NextClick(self):
+ if(self.pptid<0): return
+ pptdll.NextStep(self.pptid)
+ self.UpdateCurrSlide()
+ app.processEvents()
+
+ def BlankClick(self):
+ if(self.pptid<0): return
+ pptdll.Blank(self.pptid)
+ app.processEvents()
+
+ def UnblankClick(self):
+ if(self.pptid<0): return
+ pptdll.Unblank(self.pptid)
+ app.processEvents()
+
+ def RestartClick(self):
+ if(self.pptid<0): return
+ pptdll.RestartShow(self.pptid)
+ self.UpdateCurrSlide()
+ app.processEvents()
+
+ def StopClick(self):
+ if(self.pptid<0): return
+ pptdll.Stop(self.pptid)
+ app.processEvents()
+
+ def ResumeClick(self):
+ if(self.pptid<0): return
+ pptdll.Resume(self.pptid)
+ app.processEvents()
+
+ def CloseClick(self):
+ if(self.pptid<0): return
+ pptdll.ClosePPT(self.pptid)
+ self.pptid = -1
+ app.processEvents()
+
+ def OpenClick(self):
+ oldid = self.pptid;
+ rect = RECT(100,100,900,700)
+ filename = unicode(self.PPTEdit.text())
+ print filename
+ self.pptid = pptdll.OpenPPT(filename, None, rect, "c:\\temp\\slide')
+ print "id: " + unicode(self.pptid)
+ if oldid>=0:
+ pptdll.ClosePPT(oldid);
+ slides = pptdll.GetSlideCount(self.pptid)
+ print "slidecount: " + unicode(slides)
+ self.total.setNum(pptdll.GetSlideCount(self.pptid))
+ self.UpdateCurrSlide()
+
+ def UpdateCurrSlide(self):
+ if(self.pptid<0): return
+ slide = unicode(pptdll.GetCurrentSlide(self.pptid))
+ print "currslide: " + slide
+ self.slideEdit.setText(slide)
+ app.processEvents()
+
+ def GotoClick(self):
+ if(self.pptid<0): return
+ print self.slideEdit.text()
+ pptdll.GotoSlide(self.pptid, int(self.slideEdit.text()))
+ self.UpdateCurrSlide()
+ app.processEvents()
+
+ def OpenDialog(self):
+ self.PPTEdit.setText(QtGui.QFileDialog.getOpenFileName(self, 'Open file'))
+
+if __name__ == '__main__':
+ #pptdll = cdll.LoadLibrary(r"C:\Documents and Settings\jonathan\Desktop\pptviewlib.dll')
+ pptdll = cdll.LoadLibrary(r"pptviewlib.dll')
+ pptdll.SetDebug(1)
+ print "Begin..."
+ app = QtGui.QApplication(sys.argv)
+ qb = PPTViewer()
+ qb.show()
+ sys.exit(app.exec_())
\ No newline at end of file
=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
--- openlp/plugins/presentations/lib/presentationtab.py 2009-06-05 18:53:50 +0000
+++ openlp/plugins/presentations/lib/presentationtab.py 2009-06-16 18:21:24 +0000
@@ -55,19 +55,19 @@
self.VerseTypeLayout.setObjectName(u'VerseTypeLayout')
self.PowerpointCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
- self.PowerpointCheckBox.setObjectName("PowerpointCheckBox")
+ self.PowerpointCheckBox.setObjectName(u'PowerpointCheckBox')
self.VerseDisplayLayout.addWidget(self.PowerpointCheckBox, 0, 0, 1, 1)
self.PowerpointPath = QtGui.QLineEdit(self.VerseDisplayGroupBox)
- self.PowerpointPath.setObjectName("PowerpointPath")
+ self.PowerpointPath.setObjectName(u'PowerpointPath')
self.VerseDisplayLayout.addWidget(self.PowerpointPath, 1, 0, 1, 1)
self.ImpressCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
- self.ImpressCheckBox.setObjectName("ImpressCheckBox")
+ self.ImpressCheckBox.setObjectName(u'ImpressCheckBox')
self.VerseDisplayLayout.addWidget(self.ImpressCheckBox, 2, 0, 1, 1)
self.ImpressPath = QtGui.QLineEdit(self.VerseDisplayGroupBox)
- self.ImpressPath.setObjectName("ImpressPath")
+ self.ImpressPath.setObjectName(u'ImpressPath')
self.VerseDisplayLayout.addWidget(self.ImpressPath, 3, 0, 1, 1)
self.PresentationThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox)
@@ -96,11 +96,11 @@
# Signals and slots
#QtCore.QObject.connect(self.NewChaptersCheckBox,
- # QtCore.SIGNAL("stateChanged(int)"), self.onNewChaptersCheckBoxChanged)
+ # QtCore.SIGNAL(u'stateChanged(int)'), self.onNewChaptersCheckBoxChanged)
def retranslateUi(self):
- self.PowerpointCheckBox.setText(translate('PresentationTab', 'Powerpoint available:'))
- self.ImpressCheckBox.setText(translate('PresentationTab', 'Impress available:'))
+ self.PowerpointCheckBox.setText(translate(u'PresentationTab', 'Powerpoint available:'))
+ self.ImpressCheckBox.setText(translate(u'PresentationTab', 'Impress available:'))
self.PowerpointPath.setText(u'powerpoint.exe ')
self.ImpressPath.setText(u'openoffice.org -nologo -show ')
@@ -114,7 +114,7 @@
def load(self):
pass
# self.paragraph_style = (self.config.get_config(u'paragraph style', u'True'))
-# self.show_new_chapters = (self.config.get_config(u'display new chapter', u"False"))
+# self.show_new_chapters = (self.config.get_config(u'display new chapter', u"False'))
# self.display_style = int(self.config.get_config(u'display brackets', u'0'))
# self.Presentation_theme = int(self.config.get_config(u'Presentation theme', u'0'))
# self.Presentation_search = (self.config.get_config(u'search as type', u'True'))
@@ -128,8 +128,8 @@
def save(self):
pass
-# self.config.set_config(u'paragraph style', str(self.paragraph_style))
-# self.config.set_config(u'display new chapter', str(self.show_new_chapters))
-# self.config.set_config(u'display brackets', str(self.display_style))
-# self.config.set_config(u'search as type', str(self.Presentation_search))
-# self.config.set_config(u'Presentation theme', str(self.Presentation_theme))
+# self.config.set_config(u'paragraph style', unicode(self.paragraph_style))
+# self.config.set_config(u'display new chapter', unicode(self.show_new_chapters))
+# self.config.set_config(u'display brackets', unicode(self.display_style))
+# self.config.set_config(u'search as type', unicode(self.Presentation_search))
+# self.config.set_config(u'Presentation theme', unicode(self.Presentation_theme))
\ No newline at end of file
=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py 2009-05-18 16:04:34 +0000
+++ openlp/plugins/presentations/presentationplugin.py 2009-06-16 18:21:24 +0000
@@ -33,7 +33,7 @@
self.weight = -8
# Create the plugin icon
self.icon = QtGui.QIcon()
- self.icon.addPixmap(QtGui.QPixmap(':/media/media_presentation.png'),
+ self.icon.addPixmap(QtGui.QPixmap(u':/media/media_presentation.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
def get_settings_tab(self):
@@ -43,4 +43,4 @@
def get_media_manager_item(self):
# Create the MediaManagerItem object
self.media_item = PresentationMediaItem(self, self.icon, u'Presentations')
- return self.media_item
+ return self.media_item
\ No newline at end of file
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2009-06-14 13:50:56 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2009-06-16 18:21:24 +0000
@@ -47,7 +47,7 @@
QtCore.QObject.connect(self.AuthorRemoveItem,
QtCore.SIGNAL(u'clicked()'), self.onAuthorRemovefromSongItemClicked)
QtCore.QObject.connect(self.AuthorsListView,
- QtCore.SIGNAL("itemClicked(QListWidgetItem*)"), self.onAuthorsListViewPressed)
+ QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), self.onAuthorsListViewPressed)
QtCore.QObject.connect(self.AddTopicButton,
QtCore.SIGNAL(u'clicked()'), self.onAddTopicButtonClicked)
QtCore.QObject.connect(self.AddTopicsToSongButton,
@@ -55,7 +55,7 @@
QtCore.QObject.connect(self.TopicRemoveItem,
QtCore.SIGNAL(u'clicked()'), self.onTopicRemovefromSongItemClicked)
QtCore.QObject.connect(self.TopicsListView,
- QtCore.SIGNAL("itemClicked(QListWidgetItem*)"), self.onTopicListViewPressed)
+ QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), self.onTopicListViewPressed)
QtCore.QObject.connect(self.AddSongBookButton,
QtCore.SIGNAL(u'clicked()'), self.onAddSongBookButtonClicked)
QtCore.QObject.connect(self.CopyrightInsertItem,
@@ -67,7 +67,7 @@
QtCore.QObject.connect(self.DeleteButton,
QtCore.SIGNAL(u'clicked()'), self.onDeleteVerseButtonClicked)
QtCore.QObject.connect(self.VerseListWidget,
- QtCore.SIGNAL("itemClicked(QListWidgetItem*)"), self.onVerseListViewPressed)
+ QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), self.onVerseListViewPressed)
QtCore.QObject.connect(self.SongbookCombo,
QtCore.SIGNAL(u'activated(int)'), self.onSongBookComboChanged)
QtCore.QObject.connect(self.ThemeSelectionComboItem,
@@ -132,6 +132,9 @@
self.TitleEditItem.setText(u'')
self.AlternativeEdit.setText(u'')
self.CopyrightEditItem.setText(u'')
+ self.VerseOrderEdit.setText(u'')
+ self.CommentsEdit.setText(u'')
+ self.CCLNumberEdit.setText(u'')
self.VerseListWidget.clear()
self.AuthorsListView.clear()
self.TopicsListView.clear()
@@ -160,6 +163,18 @@
self.AlternativeEdit.setText(title[1])
self.CopyrightEditItem.setText(self.song.copyright)
self.VerseListWidget.clear()
+ if self.song.verse_order is not None:
+ self.VerseOrderEdit.setText(self.song.verse_order)
+ else:
+ self.VerseOrderEdit.setText(u'')
+ if self.song.comments is not None:
+ self.CommentsEdit.setText(self.song.comments)
+ else:
+ self.CommentsEdit.setText(u'')
+ if self.song.ccli_number is not None:
+ self.CCLNumberEdit.setText(self.song.ccli_number)
+ else:
+ self.CCLNumberEdit.setText(u'')
#lazy xml migration for now
if self.song.lyrics.startswith(u'<?xml version='):
songXML=SongXMLParser(self.song.lyrics)
@@ -227,7 +242,6 @@
self.song.topics.remove(topic)
row = self.TopicsListView.row(item)
self.TopicsListView.takeItem(row)
-
def onAddAuthorsButtonClicked(self):
"""
Slot documentation goes here.
@@ -324,6 +338,15 @@
self.song.title = self.TitleEditItem.text()
self.title_change = True
+ def on_VerseOrderEdit_lostFocus(self):
+ self.song.verse_order = self.VerseOrderEdit.text()
+
+ def on_CommentsEdit_lostFocus(self):
+ self.song.comments = self.CommentsEdit.text()
+
+ def on_CCLNumberEdit_lostFocus(self):
+ self.song.ccli_number = self.CCLNumberEdit.text()
+
def onCopyrightInsertItemTriggered(self):
text = self.CopyrightEditItem.displayText()
pos = self.CopyrightEditItem.cursorPosition()
@@ -355,15 +378,19 @@
sxml.add_lyrics_to_song()
count = 1
text = u' '
+ verse_order = u''
for i in range (0, self.VerseListWidget.count()):
sxml.add_verse_to_lyrics(u'Verse', unicode(count), unicode(self.VerseListWidget.item(i).text()))
text = text + unicode(self.VerseListWidget.item(i).text()) + u' '
+ verse_order = verse_order +unicode(count) + u' '
count += 1
+ if self.song.verse_order is None:
+ self.song.verse_order = verse_order
text = text.replace("'", u'')
text = text.replace(u',', u'')
text = text.replace(u';', u'')
text = text.replace(u':', u'')
- text = text.replace(u'(', u'')
+ text = text.replace(u'(u', u'')
text = text.replace(u')', u'')
text = text.replace(u'{', u'')
text = text.replace(u'}', u'')
@@ -377,7 +404,7 @@
self.song.search_title = self.song.search_title.replace(u',', u'')
self.song.search_title = self.song.search_title.replace(u';', u'')
self.song.search_title = self.song.search_title.replace(u':', u'')
- self.song.search_title = self.song.search_title.replace(u'(', u'')
+ self.song.search_title = self.song.search_title.replace(u'(u', u'')
self.song.search_title = self.song.search_title.replace(u')', u'')
self.song.search_title = self.song.search_title.replace(u'{', u'')
self.song.search_title = self.song.search_title.replace(u'}', u'')
=== modified file 'openlp/plugins/songs/forms/openlpexportform.py'
--- openlp/plugins/songs/forms/openlpexportform.py 2009-05-01 22:26:43 +0000
+++ openlp/plugins/songs/forms/openlpexportform.py 2009-06-16 18:21:24 +0000
@@ -3,7 +3,7 @@
"""
OpenLP - Open Source Lyrics Projection
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
the terms of the GNU General Public License as published by the Free Software
@@ -17,10 +17,8 @@
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
-
from PyQt4 import QtCore, QtGui
-
-from openlp.core.resources import *
+from openlp.core.lib import translate
class OpenLPExportForm(object):
@@ -29,36 +27,36 @@
self.setupUi()
def setupUi(self):
- self.OpenLPExportForm.setObjectName("OpenLPExportForm")
+ self.OpenLPExportForm.setObjectName(u'OpenLPExportForm')
self.OpenLPExportForm.resize(473, 459)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenLPExportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPExportForm)
self.verticalLayout_5.setMargin(8)
- self.verticalLayout_5.setObjectName("verticalLayout_5")
+ self.verticalLayout_5.setObjectName(u'verticalLayout_5')
self.ExportFileWidget = QtGui.QWidget(self.OpenLPExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileWidget.sizePolicy().hasHeightForWidth())
self.ExportFileWidget.setSizePolicy(sizePolicy)
- self.ExportFileWidget.setObjectName("ExportFileWidget")
+ self.ExportFileWidget.setObjectName(u'ExportFileWidget')
self.horizontalLayout = QtGui.QHBoxLayout(self.ExportFileWidget)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setMargin(0)
- self.horizontalLayout.setObjectName("horizontalLayout")
+ self.horizontalLayout.setObjectName(u'horizontalLayout')
self.ExportFileLabel = QtGui.QLabel(self.ExportFileWidget)
- self.ExportFileLabel.setObjectName("ExportFileLabel")
+ self.ExportFileLabel.setObjectName(u'ExportFileLabel')
self.horizontalLayout.addWidget(self.ExportFileLabel)
self.ExportFileLineEdit = QtGui.QLineEdit(self.ExportFileWidget)
- self.ExportFileLineEdit.setObjectName("ExportFileLineEdit")
+ self.ExportFileLineEdit.setObjectName(u'ExportFileLineEdit')
self.horizontalLayout.addWidget(self.ExportFileLineEdit)
self.ExportFileSelectPushButton = QtGui.QPushButton(self.ExportFileWidget)
icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/exports/export_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap(u':/exports/export_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportFileSelectPushButton.setIcon(icon1)
- self.ExportFileSelectPushButton.setObjectName("ExportFileSelectPushButton")
+ self.ExportFileSelectPushButton.setObjectName(u'ExportFileSelectPushButton')
self.horizontalLayout.addWidget(self.ExportFileSelectPushButton)
self.verticalLayout_5.addWidget(self.ExportFileWidget)
self.SongListFrame = QtGui.QFrame(self.OpenLPExportForm)
@@ -69,31 +67,31 @@
self.SongListFrame.setSizePolicy(sizePolicy)
self.SongListFrame.setFrameShape(QtGui.QFrame.Box)
self.SongListFrame.setFrameShadow(QtGui.QFrame.Raised)
- self.SongListFrame.setObjectName("SongListFrame")
+ self.SongListFrame.setObjectName(u'SongListFrame')
self.horizontalLayout_6 = QtGui.QHBoxLayout(self.SongListFrame)
self.horizontalLayout_6.setSpacing(8)
self.horizontalLayout_6.setMargin(8)
- self.horizontalLayout_6.setObjectName("horizontalLayout_6")
+ self.horizontalLayout_6.setObjectName(u'horizontalLayout_6')
self.ExportFileSongListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileSongListWidget.sizePolicy().hasHeightForWidth())
self.ExportFileSongListWidget.setSizePolicy(sizePolicy)
- self.ExportFileSongListWidget.setObjectName("ExportFileSongListWidget")
+ self.ExportFileSongListWidget.setObjectName(u'ExportFileSongListWidget')
self.verticalLayout = QtGui.QVBoxLayout(self.ExportFileSongListWidget)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(0)
- self.verticalLayout.setObjectName("verticalLayout")
+ self.verticalLayout.setObjectName(u'verticalLayout')
self.ExportListLabel = QtGui.QLabel(self.ExportFileSongListWidget)
- self.ExportListLabel.setObjectName("ExportListLabel")
+ self.ExportListLabel.setObjectName(u'ExportListLabel')
self.verticalLayout.addWidget(self.ExportListLabel)
self.ExportListTable = QtGui.QTableWidget(self.ExportFileSongListWidget)
self.ExportListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.ExportListTable.setShowGrid(False)
self.ExportListTable.setWordWrap(False)
self.ExportListTable.setCornerButtonEnabled(False)
- self.ExportListTable.setObjectName("ExportListTable")
+ self.ExportListTable.setObjectName(u'ExportListTable')
self.ExportListTable.setColumnCount(2)
self.ExportListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
@@ -102,11 +100,11 @@
self.ExportListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout.addWidget(self.ExportListTable)
self.ExportSelectAllWidget = QtGui.QWidget(self.ExportFileSongListWidget)
- self.ExportSelectAllWidget.setObjectName("ExportSelectAllWidget")
+ self.ExportSelectAllWidget.setObjectName(u'ExportSelectAllWidget')
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ExportSelectAllWidget)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setMargin(0)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ self.horizontalLayout_2.setObjectName(u'horizontalLayout_2')
self.ExportSelectAllPushButton = QtGui.QPushButton(self.ExportSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -115,9 +113,9 @@
self.ExportSelectAllPushButton.setSizePolicy(sizePolicy)
self.ExportSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
icon2 = QtGui.QIcon()
- icon2.addPixmap(QtGui.QPixmap(":/exports/export_selectall.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon2.addPixmap(QtGui.QPixmap(u':/exports/export_selectall.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportSelectAllPushButton.setIcon(icon2)
- self.ExportSelectAllPushButton.setObjectName("ExportSelectAllPushButton")
+ self.ExportSelectAllPushButton.setObjectName(u'ExportSelectAllPushButton')
self.horizontalLayout_2.addWidget(self.ExportSelectAllPushButton)
spacerItem = QtGui.QSpacerItem(89, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
@@ -129,19 +127,19 @@
sizePolicy.setHeightForWidth(self.exportFilterWidget.sizePolicy().hasHeightForWidth())
self.exportFilterWidget.setSizePolicy(sizePolicy)
self.exportFilterWidget.setMinimumSize(QtCore.QSize(0, 0))
- self.exportFilterWidget.setObjectName("exportFilterWidget")
+ self.exportFilterWidget.setObjectName(u'exportFilterWidget')
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.exportFilterWidget)
self.horizontalLayout_3.setMargin(0)
- self.horizontalLayout_3.setObjectName("horizontalLayout_3")
+ self.horizontalLayout_3.setObjectName(u'horizontalLayout_3')
self.ExportFilterComboBox = QtGui.QComboBox(self.exportFilterWidget)
self.ExportFilterComboBox.setMinimumSize(QtCore.QSize(70, 0))
- self.ExportFilterComboBox.setObjectName("ExportFilterComboBox")
+ self.ExportFilterComboBox.setObjectName(u'ExportFilterComboBox')
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.horizontalLayout_3.addWidget(self.ExportFilterComboBox)
self.ExportFilterLineEdit = QtGui.QLineEdit(self.exportFilterWidget)
- self.ExportFilterLineEdit.setObjectName("ExportFilterLineEdit")
+ self.ExportFilterLineEdit.setObjectName(u'ExportFilterLineEdit')
self.horizontalLayout_3.addWidget(self.ExportFilterLineEdit)
self.verticalLayout.addWidget(self.exportFilterWidget)
self.horizontalLayout_6.addWidget(self.ExportFileSongListWidget)
@@ -151,10 +149,10 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedWidget.sizePolicy().hasHeightForWidth())
self.AddSelectedWidget.setSizePolicy(sizePolicy)
- self.AddSelectedWidget.setObjectName("AddSelectedWidget")
+ self.AddSelectedWidget.setObjectName(u'AddSelectedWidget')
self.verticalLayout_3 = QtGui.QVBoxLayout(self.AddSelectedWidget)
self.verticalLayout_3.setMargin(0)
- self.verticalLayout_3.setObjectName("verticalLayout_3")
+ self.verticalLayout_3.setObjectName(u'verticalLayout_3')
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem1)
self.AddSelectedPushButton = QtGui.QPushButton(self.AddSelectedWidget)
@@ -165,9 +163,9 @@
self.AddSelectedPushButton.setSizePolicy(sizePolicy)
self.AddSelectedPushButton.setMinimumSize(QtCore.QSize(25, 25))
icon3 = QtGui.QIcon()
- icon3.addPixmap(QtGui.QPixmap(":/exports/export_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon3.addPixmap(QtGui.QPixmap(u':/exports/export_move_to_list.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddSelectedPushButton.setIcon(icon3)
- self.AddSelectedPushButton.setObjectName("AddSelectedPushButton")
+ self.AddSelectedPushButton.setObjectName(u'AddSelectedPushButton')
self.verticalLayout_3.addWidget(self.AddSelectedPushButton)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
@@ -178,19 +176,19 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedFileListWidget.sizePolicy().hasHeightForWidth())
self.SelectedFileListWidget.setSizePolicy(sizePolicy)
- self.SelectedFileListWidget.setObjectName("SelectedFileListWidget")
+ self.SelectedFileListWidget.setObjectName(u'SelectedFileListWidget')
self.verticalLayout_2 = QtGui.QVBoxLayout(self.SelectedFileListWidget)
self.verticalLayout_2.setMargin(0)
- self.verticalLayout_2.setObjectName("verticalLayout_2")
+ self.verticalLayout_2.setObjectName(u'verticalLayout_2')
self.SelectedListLabel = QtGui.QLabel(self.SelectedFileListWidget)
- self.SelectedListLabel.setObjectName("SelectedListLabel")
+ self.SelectedListLabel.setObjectName(u'SelectedListLabel')
self.verticalLayout_2.addWidget(self.SelectedListLabel)
self.SelectedListTable = QtGui.QTableWidget(self.SelectedFileListWidget)
self.SelectedListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.SelectedListTable.setShowGrid(False)
self.SelectedListTable.setWordWrap(False)
self.SelectedListTable.setCornerButtonEnabled(False)
- self.SelectedListTable.setObjectName("SelectedListTable")
+ self.SelectedListTable.setObjectName(u'SelectedListTable')
self.SelectedListTable.setColumnCount(2)
self.SelectedListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
@@ -199,11 +197,11 @@
self.SelectedListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout_2.addWidget(self.SelectedListTable)
self.SelectedSelectAllWidget = QtGui.QWidget(self.SelectedFileListWidget)
- self.SelectedSelectAllWidget.setObjectName("SelectedSelectAllWidget")
+ self.SelectedSelectAllWidget.setObjectName(u'SelectedSelectAllWidget')
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.SelectedSelectAllWidget)
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setMargin(0)
- self.horizontalLayout_4.setObjectName("horizontalLayout_4")
+ self.horizontalLayout_4.setObjectName(u'horizontalLayout_4')
self.SelectedSelectAllPushButton = QtGui.QPushButton(self.SelectedSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -212,7 +210,7 @@
self.SelectedSelectAllPushButton.setSizePolicy(sizePolicy)
self.SelectedSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
self.SelectedSelectAllPushButton.setIcon(icon2)
- self.SelectedSelectAllPushButton.setObjectName("SelectedSelectAllPushButton")
+ self.SelectedSelectAllPushButton.setObjectName(u'SelectedSelectAllPushButton')
self.horizontalLayout_4.addWidget(self.SelectedSelectAllPushButton)
spacerItem3 = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
@@ -223,10 +221,10 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedWidget.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedWidget.setSizePolicy(sizePolicy)
- self.SelectedRemoveSelectedWidget.setObjectName("SelectedRemoveSelectedWidget")
+ self.SelectedRemoveSelectedWidget.setObjectName(u'SelectedRemoveSelectedWidget')
self.horizontalLayout_5 = QtGui.QHBoxLayout(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_5.setMargin(0)
- self.horizontalLayout_5.setObjectName("horizontalLayout_5")
+ self.horizontalLayout_5.setObjectName(u'horizontalLayout_5')
self.SelectedRemoveSelectedButton = QtGui.QPushButton(self.SelectedRemoveSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -235,9 +233,9 @@
self.SelectedRemoveSelectedButton.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedButton.setMinimumSize(QtCore.QSize(140, 0))
icon4 = QtGui.QIcon()
- icon4.addPixmap(QtGui.QPixmap(":/exports/export_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon4.addPixmap(QtGui.QPixmap(u':/exports/export_remove.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SelectedRemoveSelectedButton.setIcon(icon4)
- self.SelectedRemoveSelectedButton.setObjectName("SelectedRemoveSelectedButton")
+ self.SelectedRemoveSelectedButton.setObjectName(u'SelectedRemoveSelectedButton')
self.horizontalLayout_5.addWidget(self.SelectedRemoveSelectedButton)
spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem4)
@@ -250,61 +248,61 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
- self.ProgressGroupBox.setObjectName("ProgressGroupBox")
+ self.ProgressGroupBox.setObjectName(u'ProgressGroupBox')
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setContentsMargins(8, 0, 8, 8)
- self.verticalLayout_4.setObjectName("verticalLayout_4")
+ self.verticalLayout_4.setObjectName(u'verticalLayout_4')
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
- self.ProgressLabel.setObjectName("ProgressLabel")
+ self.ProgressLabel.setObjectName(u'ProgressLabel')
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
- self.ProgressBar.setProperty("value", QtCore.QVariant(24))
- self.ProgressBar.setObjectName("ProgressBar")
+ self.ProgressBar.setProperty(u'value', QtCore.QVariant(24))
+ self.ProgressBar.setObjectName(u'ProgressBar')
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout_5.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenLPExportForm)
- self.ButtonBarWidget.setObjectName("ButtonBarWidget")
+ self.ButtonBarWidget.setObjectName(u'ButtonBarWidget')
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
- self.horizontalLayout_7.setObjectName("horizontalLayout_7")
+ self.horizontalLayout_7.setObjectName(u'horizontalLayout_7')
spacerItem5 = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem5)
self.ExportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
- self.ExportPushButton.setObjectName("ExportPushButton")
+ self.ExportPushButton.setObjectName(u'ExportPushButton')
self.horizontalLayout_7.addWidget(self.ExportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
- self.ClosePushButton.setObjectName("ClosePushButton")
+ self.ClosePushButton.setObjectName(u'ClosePushButton')
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout_5.addWidget(self.ButtonBarWidget)
self.retranslateUi()
- QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenLPExportForm.close)
- QtCore.QObject.connect(self.ExportSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.ExportListTable.selectAll)
- QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.selectAll)
- QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.clear)
+ QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL(u'clicked()'), self.OpenLPExportForm.close)
+ QtCore.QObject.connect(self.ExportSelectAllPushButton, QtCore.SIGNAL(u'clicked()'), self.ExportListTable.selectAll)
+ QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL(u'clicked()'), self.SelectedListTable.selectAll)
+ QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL(u'clicked()'), self.SelectedListTable.clear)
QtCore.QMetaObject.connectSlotsByName(self.OpenLPExportForm)
def retranslateUi(self):
- self.OpenLPExportForm.setWindowTitle(QtGui.QApplication.translate("OpenLPExportForm", "openlp.org Song Exporter", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportFileLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Select openlp.org export filename:", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportListLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Full Song List", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportFilterComboBox.setItemText(0, QtGui.QApplication.translate("OpenLPExportForm", "Lyrics", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportFilterComboBox.setItemText(1, QtGui.QApplication.translate("OpenLPExportForm", "Title", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportFilterComboBox.setItemText(2, QtGui.QApplication.translate("OpenLPExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedListLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Song Export List", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedRemoveSelectedButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Remove Selected", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenLPExportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Ready to export", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportPushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Export", None, QtGui.QApplication.UnicodeUTF8))
- self.ClosePushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
+ self.OpenLPExportForm.setWindowTitle(translate(u'OpenLPExportForm', u'openlp.org Song Exporter'))
+ self.ExportFileLabel.setText(translate(u'OpenLPExportForm', u'Select openlp.org export filename:'))
+ self.ExportListLabel.setText(translate(u'OpenLPExportForm', u'Full Song List'))
+ self.ExportListTable.horizontalHeaderItem(0).setText(translate(u'OpenLPExportForm', u'Song Title'))
+ self.ExportListTable.horizontalHeaderItem(1).setText(translate(u'OpenLPExportForm', u'Author'))
+ self.ExportSelectAllPushButton.setText(translate(u'OpenLPExportForm', u'Select All'))
+ self.ExportFilterComboBox.setItemText(0, translate(u'OpenLPExportForm', u'Lyrics'))
+ self.ExportFilterComboBox.setItemText(1, translate(u'OpenLPExportForm', u'Title'))
+ self.ExportFilterComboBox.setItemText(2, translate(u'OpenLPExportForm', u'Author'))
+ self.SelectedListLabel.setText(translate(u'OpenLPExportForm', u'Song Export List'))
+ self.SelectedListTable.horizontalHeaderItem(0).setText(translate(u'OpenLPExportForm', u'Song Title'))
+ self.SelectedListTable.horizontalHeaderItem(1).setText(translate(u'OpenLPExportForm', u'Author'))
+ self.SelectedSelectAllPushButton.setText(translate(u'OpenLPExportForm', u'Select All'))
+ self.SelectedRemoveSelectedButton.setText(translate(u'OpenLPExportForm', u'Remove Selected'))
+ self.ProgressGroupBox.setTitle(translate(u'OpenLPExportForm', u'Progress:'))
+ self.ProgressLabel.setText(translate(u'OpenLPExportForm', u'Ready to export'))
+ self.ExportPushButton.setText(translate(u'OpenLPExportForm', u'Export'))
+ self.ClosePushButton.setText(translate(u'OpenLPExportForm', u'Close'))
def show(self):
self.OpenLPExportForm.show()
=== modified file 'openlp/plugins/songs/forms/openlpimportform.py'
--- openlp/plugins/songs/forms/openlpimportform.py 2009-05-01 22:26:43 +0000
+++ openlp/plugins/songs/forms/openlpimportform.py 2009-06-16 18:21:24 +0000
@@ -3,7 +3,7 @@
"""
OpenLP - Open Source Lyrics Projection
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
the terms of the GNU General Public License as published by the Free Software
@@ -17,10 +17,8 @@
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
-
from PyQt4 import QtCore, QtGui
-
-from openlp.core.resources import *
+from openlp.core.lib import translate
class OpenLPImportForm(object):
@@ -29,36 +27,36 @@
self.setupUi()
def setupUi(self):
- self.OpenLPImportForm.setObjectName("OpenLPImportForm")
+ self.OpenLPImportForm.setObjectName(u'OpenLPImportForm')
self.OpenLPImportForm.resize(473, 459)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenLPImportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPImportForm)
self.verticalLayout_5.setMargin(8)
- self.verticalLayout_5.setObjectName("verticalLayout_5")
+ self.verticalLayout_5.setObjectName(u'verticalLayout_5')
self.ImportFileWidget = QtGui.QWidget(self.OpenLPImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportFileWidget.sizePolicy().hasHeightForWidth())
self.ImportFileWidget.setSizePolicy(sizePolicy)
- self.ImportFileWidget.setObjectName("ImportFileWidget")
+ self.ImportFileWidget.setObjectName(u'ImportFileWidget')
self.horizontalLayout = QtGui.QHBoxLayout(self.ImportFileWidget)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setMargin(0)
- self.horizontalLayout.setObjectName("horizontalLayout")
+ self.horizontalLayout.setObjectName(u'horizontalLayout')
self.ImportFileLabel = QtGui.QLabel(self.ImportFileWidget)
- self.ImportFileLabel.setObjectName("ImportFileLabel")
+ self.ImportFileLabel.setObjectName(u'ImportFileLabel')
self.horizontalLayout.addWidget(self.ImportFileLabel)
self.ImportFileLineEdit = QtGui.QLineEdit(self.ImportFileWidget)
- self.ImportFileLineEdit.setObjectName("ImportFileLineEdit")
+ self.ImportFileLineEdit.setObjectName(u'ImportFileLineEdit')
self.horizontalLayout.addWidget(self.ImportFileLineEdit)
self.ImportFileSelectPushButton = QtGui.QPushButton(self.ImportFileWidget)
icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/imports/import_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap(u':/imports/import_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImportFileSelectPushButton.setIcon(icon1)
- self.ImportFileSelectPushButton.setObjectName("ImportFileSelectPushButton")
+ self.ImportFileSelectPushButton.setObjectName(u'ImportFileSelectPushButton')
self.horizontalLayout.addWidget(self.ImportFileSelectPushButton)
self.verticalLayout_5.addWidget(self.ImportFileWidget)
self.SongListFrame = QtGui.QFrame(self.OpenLPImportForm)
@@ -69,31 +67,31 @@
self.SongListFrame.setSizePolicy(sizePolicy)
self.SongListFrame.setFrameShape(QtGui.QFrame.Box)
self.SongListFrame.setFrameShadow(QtGui.QFrame.Raised)
- self.SongListFrame.setObjectName("SongListFrame")
+ self.SongListFrame.setObjectName(u'SongListFrame')
self.horizontalLayout_6 = QtGui.QHBoxLayout(self.SongListFrame)
self.horizontalLayout_6.setSpacing(8)
self.horizontalLayout_6.setMargin(8)
- self.horizontalLayout_6.setObjectName("horizontalLayout_6")
+ self.horizontalLayout_6.setObjectName(u'horizontalLayout_6')
self.ImportFileSongListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportFileSongListWidget.sizePolicy().hasHeightForWidth())
self.ImportFileSongListWidget.setSizePolicy(sizePolicy)
- self.ImportFileSongListWidget.setObjectName("ImportFileSongListWidget")
+ self.ImportFileSongListWidget.setObjectName(u'ImportFileSongListWidget')
self.verticalLayout = QtGui.QVBoxLayout(self.ImportFileSongListWidget)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(0)
- self.verticalLayout.setObjectName("verticalLayout")
+ self.verticalLayout.setObjectName(u'verticalLayout')
self.ImportListLabel = QtGui.QLabel(self.ImportFileSongListWidget)
- self.ImportListLabel.setObjectName("ImportListLabel")
+ self.ImportListLabel.setObjectName(u'ImportListLabel')
self.verticalLayout.addWidget(self.ImportListLabel)
self.ImportListTable = QtGui.QTableWidget(self.ImportFileSongListWidget)
self.ImportListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.ImportListTable.setShowGrid(False)
self.ImportListTable.setWordWrap(False)
self.ImportListTable.setCornerButtonEnabled(False)
- self.ImportListTable.setObjectName("ImportListTable")
+ self.ImportListTable.setObjectName(u'ImportListTable')
self.ImportListTable.setColumnCount(2)
self.ImportListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
@@ -102,11 +100,11 @@
self.ImportListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout.addWidget(self.ImportListTable)
self.ImportSelectAllWidget = QtGui.QWidget(self.ImportFileSongListWidget)
- self.ImportSelectAllWidget.setObjectName("ImportSelectAllWidget")
+ self.ImportSelectAllWidget.setObjectName(u'ImportSelectAllWidget')
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImportSelectAllWidget)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setMargin(0)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ self.horizontalLayout_2.setObjectName(u'horizontalLayout_2')
self.ImportSelectAllPushButton = QtGui.QPushButton(self.ImportSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -115,9 +113,9 @@
self.ImportSelectAllPushButton.setSizePolicy(sizePolicy)
self.ImportSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
icon2 = QtGui.QIcon()
- icon2.addPixmap(QtGui.QPixmap(":/imports/import_selectall.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon2.addPixmap(QtGui.QPixmap(u':/imports/import_selectall.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImportSelectAllPushButton.setIcon(icon2)
- self.ImportSelectAllPushButton.setObjectName("ImportSelectAllPushButton")
+ self.ImportSelectAllPushButton.setObjectName(u'ImportSelectAllPushButton')
self.horizontalLayout_2.addWidget(self.ImportSelectAllPushButton)
spacerItem = QtGui.QSpacerItem(89, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
@@ -129,19 +127,19 @@
sizePolicy.setHeightForWidth(self.importFilterWidget.sizePolicy().hasHeightForWidth())
self.importFilterWidget.setSizePolicy(sizePolicy)
self.importFilterWidget.setMinimumSize(QtCore.QSize(0, 0))
- self.importFilterWidget.setObjectName("importFilterWidget")
+ self.importFilterWidget.setObjectName(u'importFilterWidget')
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.importFilterWidget)
self.horizontalLayout_3.setMargin(0)
- self.horizontalLayout_3.setObjectName("horizontalLayout_3")
+ self.horizontalLayout_3.setObjectName(u'horizontalLayout_3')
self.ImportFilterComboBox = QtGui.QComboBox(self.importFilterWidget)
self.ImportFilterComboBox.setMinimumSize(QtCore.QSize(70, 0))
- self.ImportFilterComboBox.setObjectName("ImportFilterComboBox")
+ self.ImportFilterComboBox.setObjectName(u'ImportFilterComboBox')
self.ImportFilterComboBox.addItem(QtCore.QString())
self.ImportFilterComboBox.addItem(QtCore.QString())
self.ImportFilterComboBox.addItem(QtCore.QString())
self.horizontalLayout_3.addWidget(self.ImportFilterComboBox)
self.importFilterLineEdit = QtGui.QLineEdit(self.importFilterWidget)
- self.importFilterLineEdit.setObjectName("importFilterLineEdit")
+ self.importFilterLineEdit.setObjectName(u'importFilterLineEdit')
self.horizontalLayout_3.addWidget(self.importFilterLineEdit)
self.verticalLayout.addWidget(self.importFilterWidget)
self.horizontalLayout_6.addWidget(self.ImportFileSongListWidget)
@@ -151,10 +149,10 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedWidget.sizePolicy().hasHeightForWidth())
self.AddSelectedWidget.setSizePolicy(sizePolicy)
- self.AddSelectedWidget.setObjectName("AddSelectedWidget")
+ self.AddSelectedWidget.setObjectName(u'AddSelectedWidget')
self.verticalLayout_3 = QtGui.QVBoxLayout(self.AddSelectedWidget)
self.verticalLayout_3.setMargin(0)
- self.verticalLayout_3.setObjectName("verticalLayout_3")
+ self.verticalLayout_3.setObjectName(u'verticalLayout_3')
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem1)
self.AddSelectedPushButton = QtGui.QPushButton(self.AddSelectedWidget)
@@ -165,9 +163,9 @@
self.AddSelectedPushButton.setSizePolicy(sizePolicy)
self.AddSelectedPushButton.setMinimumSize(QtCore.QSize(25, 25))
icon3 = QtGui.QIcon()
- icon3.addPixmap(QtGui.QPixmap(":/imports/import_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon3.addPixmap(QtGui.QPixmap(u':/imports/import_move_to_list.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddSelectedPushButton.setIcon(icon3)
- self.AddSelectedPushButton.setObjectName("AddSelectedPushButton")
+ self.AddSelectedPushButton.setObjectName(u'AddSelectedPushButton')
self.verticalLayout_3.addWidget(self.AddSelectedPushButton)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
@@ -178,19 +176,19 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedFileListWidget.sizePolicy().hasHeightForWidth())
self.SelectedFileListWidget.setSizePolicy(sizePolicy)
- self.SelectedFileListWidget.setObjectName("SelectedFileListWidget")
+ self.SelectedFileListWidget.setObjectName(u'SelectedFileListWidget')
self.verticalLayout_2 = QtGui.QVBoxLayout(self.SelectedFileListWidget)
self.verticalLayout_2.setMargin(0)
- self.verticalLayout_2.setObjectName("verticalLayout_2")
+ self.verticalLayout_2.setObjectName(u'verticalLayout_2')
self.SelectedListLabel = QtGui.QLabel(self.SelectedFileListWidget)
- self.SelectedListLabel.setObjectName("SelectedListLabel")
+ self.SelectedListLabel.setObjectName(u'SelectedListLabel')
self.verticalLayout_2.addWidget(self.SelectedListLabel)
self.SelectedListTable = QtGui.QTableWidget(self.SelectedFileListWidget)
self.SelectedListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.SelectedListTable.setShowGrid(False)
self.SelectedListTable.setWordWrap(False)
self.SelectedListTable.setCornerButtonEnabled(False)
- self.SelectedListTable.setObjectName("SelectedListTable")
+ self.SelectedListTable.setObjectName(u'SelectedListTable')
self.SelectedListTable.setColumnCount(2)
self.SelectedListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
@@ -199,11 +197,11 @@
self.SelectedListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout_2.addWidget(self.SelectedListTable)
self.SelectedSelectAllWidget = QtGui.QWidget(self.SelectedFileListWidget)
- self.SelectedSelectAllWidget.setObjectName("SelectedSelectAllWidget")
+ self.SelectedSelectAllWidget.setObjectName(u'SelectedSelectAllWidget')
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.SelectedSelectAllWidget)
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setMargin(0)
- self.horizontalLayout_4.setObjectName("horizontalLayout_4")
+ self.horizontalLayout_4.setObjectName(u'horizontalLayout_4')
self.SelectedSelectAllPushButton = QtGui.QPushButton(self.SelectedSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -212,7 +210,7 @@
self.SelectedSelectAllPushButton.setSizePolicy(sizePolicy)
self.SelectedSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
self.SelectedSelectAllPushButton.setIcon(icon2)
- self.SelectedSelectAllPushButton.setObjectName("SelectedSelectAllPushButton")
+ self.SelectedSelectAllPushButton.setObjectName(u'SelectedSelectAllPushButton')
self.horizontalLayout_4.addWidget(self.SelectedSelectAllPushButton)
spacerItem3 = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
@@ -223,10 +221,10 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedWidget.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedWidget.setSizePolicy(sizePolicy)
- self.SelectedRemoveSelectedWidget.setObjectName("SelectedRemoveSelectedWidget")
+ self.SelectedRemoveSelectedWidget.setObjectName(u'SelectedRemoveSelectedWidget')
self.horizontalLayout_5 = QtGui.QHBoxLayout(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_5.setMargin(0)
- self.horizontalLayout_5.setObjectName("horizontalLayout_5")
+ self.horizontalLayout_5.setObjectName(u'horizontalLayout_5')
self.SelectedRemoveSelectedButton = QtGui.QPushButton(self.SelectedRemoveSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -235,9 +233,9 @@
self.SelectedRemoveSelectedButton.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedButton.setMinimumSize(QtCore.QSize(140, 0))
icon4 = QtGui.QIcon()
- icon4.addPixmap(QtGui.QPixmap(":/imports/import_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon4.addPixmap(QtGui.QPixmap(u':/imports/import_remove.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SelectedRemoveSelectedButton.setIcon(icon4)
- self.SelectedRemoveSelectedButton.setObjectName("SelectedRemoveSelectedButton")
+ self.SelectedRemoveSelectedButton.setObjectName(u'SelectedRemoveSelectedButton')
self.horizontalLayout_5.addWidget(self.SelectedRemoveSelectedButton)
spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem4)
@@ -250,61 +248,61 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
- self.ProgressGroupBox.setObjectName("ProgressGroupBox")
+ self.ProgressGroupBox.setObjectName(u'ProgressGroupBox')
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setContentsMargins(8, 0, 8, 8)
- self.verticalLayout_4.setObjectName("verticalLayout_4")
+ self.verticalLayout_4.setObjectName(u'verticalLayout_4')
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
- self.ProgressLabel.setObjectName("ProgressLabel")
+ self.ProgressLabel.setObjectName(u'ProgressLabel')
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
- self.ProgressBar.setProperty("value", QtCore.QVariant(0))
- self.ProgressBar.setObjectName("ProgressBar")
+ self.ProgressBar.setProperty(u'value', QtCore.QVariant(0))
+ self.ProgressBar.setObjectName(u'ProgressBar')
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout_5.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenLPImportForm)
- self.ButtonBarWidget.setObjectName("ButtonBarWidget")
+ self.ButtonBarWidget.setObjectName(u'ButtonBarWidget')
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
- self.horizontalLayout_7.setObjectName("horizontalLayout_7")
+ self.horizontalLayout_7.setObjectName(u'horizontalLayout_7')
spacerItem5 = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem5)
self.ImportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
- self.ImportPushButton.setObjectName("ImportPushButton")
+ self.ImportPushButton.setObjectName(u'ImportPushButton')
self.horizontalLayout_7.addWidget(self.ImportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
- self.ClosePushButton.setObjectName("ClosePushButton")
+ self.ClosePushButton.setObjectName(u'ClosePushButton')
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout_5.addWidget(self.ButtonBarWidget)
self.retranslateUi()
- QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenLPImportForm.close)
- QtCore.QObject.connect(self.ImportSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.ImportListTable.selectAll)
- QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.selectAll)
- QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.clear)
+ QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL(u'clicked()'), self.OpenLPImportForm.close)
+ QtCore.QObject.connect(self.ImportSelectAllPushButton, QtCore.SIGNAL(u'clicked()'), self.ImportListTable.selectAll)
+ QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL(u'clicked()'), self.SelectedListTable.selectAll)
+ QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL(u'clicked()'), self.SelectedListTable.clear)
QtCore.QMetaObject.connectSlotsByName(self.OpenLPImportForm)
def retranslateUi(self):
- self.OpenLPImportForm.setWindowTitle(QtGui.QApplication.translate("OpenLPImportForm", "openlp.org Song Importer", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportFileLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Select openlp.org songfile to import:", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportListLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Import File Song List", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPImportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPImportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportFilterComboBox.setItemText(0, QtGui.QApplication.translate("OpenLPImportForm", "Lyrics", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportFilterComboBox.setItemText(1, QtGui.QApplication.translate("OpenLPImportForm", "Title", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportFilterComboBox.setItemText(2, QtGui.QApplication.translate("OpenLPImportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedListLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Song Import List", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPImportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPImportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedRemoveSelectedButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Remove Selected", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenLPImportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Ready to import", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportPushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Import", None, QtGui.QApplication.UnicodeUTF8))
- self.ClosePushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
+ self.OpenLPImportForm.setWindowTitle(translate(u'OpenLPImportForm', u'openlp.org Song Importer'))
+ self.ImportFileLabel.setText(translate(u'OpenLPImportForm', u'Select openlp.org songfile to import:'))
+ self.ImportListLabel.setText(translate(u'OpenLPImportForm', u'Import File Song List'))
+ self.ImportListTable.horizontalHeaderItem(0).setText(translate(u'OpenLPImportForm', u'Song Title'))
+ self.ImportListTable.horizontalHeaderItem(1).setText(translate(u'OpenLPImportForm', u'Author'))
+ self.ImportSelectAllPushButton.setText(translate(u'OpenLPImportForm', u'Select All'))
+ self.ImportFilterComboBox.setItemText(0, translate(u'OpenLPImportForm', u'Lyrics'))
+ self.ImportFilterComboBox.setItemText(1, translate(u'OpenLPImportForm', u'Title'))
+ self.ImportFilterComboBox.setItemText(2, translate(u'OpenLPImportForm', u'Author'))
+ self.SelectedListLabel.setText(translate(u'OpenLPImportForm', u'Song Import List'))
+ self.SelectedListTable.horizontalHeaderItem(0).setText(translate(u'OpenLPImportForm', u'Song Title'))
+ self.SelectedListTable.horizontalHeaderItem(1).setText(translate(u'OpenLPImportForm', u'Author'))
+ self.SelectedSelectAllPushButton.setText(translate(u'OpenLPImportForm', u'Select All'))
+ self.SelectedRemoveSelectedButton.setText(translate(u'OpenLPImportForm', u'Remove Selected'))
+ self.ProgressGroupBox.setTitle(translate(u'OpenLPImportForm', u'Progress:'))
+ self.ProgressLabel.setText(translate(u'OpenLPImportForm', u'Ready to import'))
+ self.ImportPushButton.setText(translate(u'OpenLPImportForm', u'Import'))
+ self.ClosePushButton.setText(translate(u'OpenLPImportForm', u'Close'))
def show(self):
self.OpenLPImportForm.show()
=== modified file 'openlp/plugins/songs/forms/opensongexportform.py'
--- openlp/plugins/songs/forms/opensongexportform.py 2009-05-01 22:26:43 +0000
+++ openlp/plugins/songs/forms/opensongexportform.py 2009-06-16 18:21:24 +0000
@@ -3,7 +3,7 @@
"""
OpenLP - Open Source Lyrics Projection
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
the terms of the GNU General Public License as published by the Free Software
@@ -17,10 +17,8 @@
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
-
from PyQt4 import QtCore, QtGui
-
-from openlp.core.resources import *
+from openlp.core.lib import translate
class OpenSongExportForm(object):
@@ -29,36 +27,36 @@
self.setupUi()
def setupUi(self):
- self.OpenSongExportForm.setObjectName("OpenSongExportForm")
+ self.OpenSongExportForm.setObjectName(u'OpenSongExportForm')
self.OpenSongExportForm.resize(473, 459)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenSongExportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenSongExportForm)
self.verticalLayout_5.setMargin(8)
- self.verticalLayout_5.setObjectName("verticalLayout_5")
+ self.verticalLayout_5.setObjectName(u'verticalLayout_5')
self.ExportFileWidget = QtGui.QWidget(self.OpenSongExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileWidget.sizePolicy().hasHeightForWidth())
self.ExportFileWidget.setSizePolicy(sizePolicy)
- self.ExportFileWidget.setObjectName("ExportFileWidget")
+ self.ExportFileWidget.setObjectName(u'ExportFileWidget')
self.horizontalLayout = QtGui.QHBoxLayout(self.ExportFileWidget)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setMargin(0)
- self.horizontalLayout.setObjectName("horizontalLayout")
+ self.horizontalLayout.setObjectName(u'horizontalLayout')
self.ExportFileLabel = QtGui.QLabel(self.ExportFileWidget)
- self.ExportFileLabel.setObjectName("ExportFileLabel")
+ self.ExportFileLabel.setObjectName(u'ExportFileLabel')
self.horizontalLayout.addWidget(self.ExportFileLabel)
self.ExportFileLineEdit = QtGui.QLineEdit(self.ExportFileWidget)
- self.ExportFileLineEdit.setObjectName("ExportFileLineEdit")
+ self.ExportFileLineEdit.setObjectName(u'ExportFileLineEdit')
self.horizontalLayout.addWidget(self.ExportFileLineEdit)
self.ExportFileSelectPushButton = QtGui.QPushButton(self.ExportFileWidget)
icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/exports/export_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap(u':/exports/export_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportFileSelectPushButton.setIcon(icon1)
- self.ExportFileSelectPushButton.setObjectName("ExportFileSelectPushButton")
+ self.ExportFileSelectPushButton.setObjectName(u'ExportFileSelectPushButton')
self.horizontalLayout.addWidget(self.ExportFileSelectPushButton)
self.verticalLayout_5.addWidget(self.ExportFileWidget)
self.SongListFrame = QtGui.QFrame(self.OpenSongExportForm)
@@ -69,31 +67,31 @@
self.SongListFrame.setSizePolicy(sizePolicy)
self.SongListFrame.setFrameShape(QtGui.QFrame.Box)
self.SongListFrame.setFrameShadow(QtGui.QFrame.Raised)
- self.SongListFrame.setObjectName("SongListFrame")
+ self.SongListFrame.setObjectName(u'SongListFrame')
self.horizontalLayout_6 = QtGui.QHBoxLayout(self.SongListFrame)
self.horizontalLayout_6.setSpacing(8)
self.horizontalLayout_6.setMargin(8)
- self.horizontalLayout_6.setObjectName("horizontalLayout_6")
+ self.horizontalLayout_6.setObjectName(u'horizontalLayout_6')
self.ExportFileSongListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileSongListWidget.sizePolicy().hasHeightForWidth())
self.ExportFileSongListWidget.setSizePolicy(sizePolicy)
- self.ExportFileSongListWidget.setObjectName("ExportFileSongListWidget")
+ self.ExportFileSongListWidget.setObjectName(u'ExportFileSongListWidget')
self.verticalLayout = QtGui.QVBoxLayout(self.ExportFileSongListWidget)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(0)
- self.verticalLayout.setObjectName("verticalLayout")
+ self.verticalLayout.setObjectName(u'verticalLayout')
self.ExportListLabel = QtGui.QLabel(self.ExportFileSongListWidget)
- self.ExportListLabel.setObjectName("ExportListLabel")
+ self.ExportListLabel.setObjectName(u'ExportListLabel')
self.verticalLayout.addWidget(self.ExportListLabel)
self.ExportListTable = QtGui.QTableWidget(self.ExportFileSongListWidget)
self.ExportListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.ExportListTable.setShowGrid(False)
self.ExportListTable.setWordWrap(False)
self.ExportListTable.setCornerButtonEnabled(False)
- self.ExportListTable.setObjectName("ExportListTable")
+ self.ExportListTable.setObjectName(u'ExportListTable')
self.ExportListTable.setColumnCount(2)
self.ExportListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
@@ -102,11 +100,11 @@
self.ExportListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout.addWidget(self.ExportListTable)
self.ExportSelectAllWidget = QtGui.QWidget(self.ExportFileSongListWidget)
- self.ExportSelectAllWidget.setObjectName("ExportSelectAllWidget")
+ self.ExportSelectAllWidget.setObjectName(u'ExportSelectAllWidget')
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ExportSelectAllWidget)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setMargin(0)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ self.horizontalLayout_2.setObjectName(u'horizontalLayout_2')
self.ExportSelectAllPushButton = QtGui.QPushButton(self.ExportSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -115,9 +113,9 @@
self.ExportSelectAllPushButton.setSizePolicy(sizePolicy)
self.ExportSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
icon2 = QtGui.QIcon()
- icon2.addPixmap(QtGui.QPixmap(":/exports/export_selectall.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon2.addPixmap(QtGui.QPixmap(u':/exports/export_selectall.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportSelectAllPushButton.setIcon(icon2)
- self.ExportSelectAllPushButton.setObjectName("ExportSelectAllPushButton")
+ self.ExportSelectAllPushButton.setObjectName(u'ExportSelectAllPushButton')
self.horizontalLayout_2.addWidget(self.ExportSelectAllPushButton)
spacerItem = QtGui.QSpacerItem(89, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
@@ -129,19 +127,19 @@
sizePolicy.setHeightForWidth(self.exportFilterWidget.sizePolicy().hasHeightForWidth())
self.exportFilterWidget.setSizePolicy(sizePolicy)
self.exportFilterWidget.setMinimumSize(QtCore.QSize(0, 0))
- self.exportFilterWidget.setObjectName("exportFilterWidget")
+ self.exportFilterWidget.setObjectName(u'exportFilterWidget')
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.exportFilterWidget)
self.horizontalLayout_3.setMargin(0)
- self.horizontalLayout_3.setObjectName("horizontalLayout_3")
+ self.horizontalLayout_3.setObjectName(u'horizontalLayout_3')
self.ExportFilterComboBox = QtGui.QComboBox(self.exportFilterWidget)
self.ExportFilterComboBox.setMinimumSize(QtCore.QSize(70, 0))
- self.ExportFilterComboBox.setObjectName("ExportFilterComboBox")
+ self.ExportFilterComboBox.setObjectName(u'ExportFilterComboBox')
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.horizontalLayout_3.addWidget(self.ExportFilterComboBox)
self.ExportFilterLineEdit = QtGui.QLineEdit(self.exportFilterWidget)
- self.ExportFilterLineEdit.setObjectName("ExportFilterLineEdit")
+ self.ExportFilterLineEdit.setObjectName(u'ExportFilterLineEdit')
self.horizontalLayout_3.addWidget(self.ExportFilterLineEdit)
self.verticalLayout.addWidget(self.exportFilterWidget)
self.horizontalLayout_6.addWidget(self.ExportFileSongListWidget)
@@ -151,10 +149,10 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedWidget.sizePolicy().hasHeightForWidth())
self.AddSelectedWidget.setSizePolicy(sizePolicy)
- self.AddSelectedWidget.setObjectName("AddSelectedWidget")
+ self.AddSelectedWidget.setObjectName(u'AddSelectedWidget')
self.verticalLayout_3 = QtGui.QVBoxLayout(self.AddSelectedWidget)
self.verticalLayout_3.setMargin(0)
- self.verticalLayout_3.setObjectName("verticalLayout_3")
+ self.verticalLayout_3.setObjectName(u'verticalLayout_3')
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem1)
self.AddSelectedPushButton = QtGui.QPushButton(self.AddSelectedWidget)
@@ -165,9 +163,9 @@
self.AddSelectedPushButton.setSizePolicy(sizePolicy)
self.AddSelectedPushButton.setMinimumSize(QtCore.QSize(25, 25))
icon3 = QtGui.QIcon()
- icon3.addPixmap(QtGui.QPixmap(":/exports/export_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon3.addPixmap(QtGui.QPixmap(u':/exports/export_move_to_list.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddSelectedPushButton.setIcon(icon3)
- self.AddSelectedPushButton.setObjectName("AddSelectedPushButton")
+ self.AddSelectedPushButton.setObjectName(u'AddSelectedPushButton')
self.verticalLayout_3.addWidget(self.AddSelectedPushButton)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
@@ -178,19 +176,19 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedFileListWidget.sizePolicy().hasHeightForWidth())
self.SelectedFileListWidget.setSizePolicy(sizePolicy)
- self.SelectedFileListWidget.setObjectName("SelectedFileListWidget")
+ self.SelectedFileListWidget.setObjectName(u'SelectedFileListWidget')
self.verticalLayout_2 = QtGui.QVBoxLayout(self.SelectedFileListWidget)
self.verticalLayout_2.setMargin(0)
- self.verticalLayout_2.setObjectName("verticalLayout_2")
+ self.verticalLayout_2.setObjectName(u'verticalLayout_2')
self.SelectedListLabel = QtGui.QLabel(self.SelectedFileListWidget)
- self.SelectedListLabel.setObjectName("SelectedListLabel")
+ self.SelectedListLabel.setObjectName(u'SelectedListLabel')
self.verticalLayout_2.addWidget(self.SelectedListLabel)
self.SelectedListTable = QtGui.QTableWidget(self.SelectedFileListWidget)
self.SelectedListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.SelectedListTable.setShowGrid(False)
self.SelectedListTable.setWordWrap(False)
self.SelectedListTable.setCornerButtonEnabled(False)
- self.SelectedListTable.setObjectName("SelectedListTable")
+ self.SelectedListTable.setObjectName(u'SelectedListTable')
self.SelectedListTable.setColumnCount(2)
self.SelectedListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
@@ -199,11 +197,11 @@
self.SelectedListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout_2.addWidget(self.SelectedListTable)
self.SelectedSelectAllWidget = QtGui.QWidget(self.SelectedFileListWidget)
- self.SelectedSelectAllWidget.setObjectName("SelectedSelectAllWidget")
+ self.SelectedSelectAllWidget.setObjectName(u'SelectedSelectAllWidget')
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.SelectedSelectAllWidget)
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setMargin(0)
- self.horizontalLayout_4.setObjectName("horizontalLayout_4")
+ self.horizontalLayout_4.setObjectName(u'horizontalLayout_4')
self.SelectedSelectAllPushButton = QtGui.QPushButton(self.SelectedSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -212,7 +210,7 @@
self.SelectedSelectAllPushButton.setSizePolicy(sizePolicy)
self.SelectedSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
self.SelectedSelectAllPushButton.setIcon(icon2)
- self.SelectedSelectAllPushButton.setObjectName("SelectedSelectAllPushButton")
+ self.SelectedSelectAllPushButton.setObjectName(u'SelectedSelectAllPushButton')
self.horizontalLayout_4.addWidget(self.SelectedSelectAllPushButton)
spacerItem3 = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
@@ -223,10 +221,10 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedWidget.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedWidget.setSizePolicy(sizePolicy)
- self.SelectedRemoveSelectedWidget.setObjectName("SelectedRemoveSelectedWidget")
+ self.SelectedRemoveSelectedWidget.setObjectName(u'SelectedRemoveSelectedWidget')
self.horizontalLayout_5 = QtGui.QHBoxLayout(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_5.setMargin(0)
- self.horizontalLayout_5.setObjectName("horizontalLayout_5")
+ self.horizontalLayout_5.setObjectName(u'horizontalLayout_5')
self.SelectedRemoveSelectedButton = QtGui.QPushButton(self.SelectedRemoveSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -235,9 +233,9 @@
self.SelectedRemoveSelectedButton.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedButton.setMinimumSize(QtCore.QSize(140, 0))
icon4 = QtGui.QIcon()
- icon4.addPixmap(QtGui.QPixmap(":/exports/export_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon4.addPixmap(QtGui.QPixmap(u':/exports/export_remove.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SelectedRemoveSelectedButton.setIcon(icon4)
- self.SelectedRemoveSelectedButton.setObjectName("SelectedRemoveSelectedButton")
+ self.SelectedRemoveSelectedButton.setObjectName(u'SelectedRemoveSelectedButton')
self.horizontalLayout_5.addWidget(self.SelectedRemoveSelectedButton)
spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem4)
@@ -250,61 +248,61 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
- self.ProgressGroupBox.setObjectName("ProgressGroupBox")
+ self.ProgressGroupBox.setObjectName(u'ProgressGroupBox')
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setContentsMargins(8, 0, 8, 8)
- self.verticalLayout_4.setObjectName("verticalLayout_4")
+ self.verticalLayout_4.setObjectName(u'verticalLayout_4')
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
- self.ProgressLabel.setObjectName("ProgressLabel")
+ self.ProgressLabel.setObjectName(u'ProgressLabel')
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
- self.ProgressBar.setProperty("value", QtCore.QVariant(24))
- self.ProgressBar.setObjectName("ProgressBar")
+ self.ProgressBar.setProperty(u'value', QtCore.QVariant(24))
+ self.ProgressBar.setObjectName(u'ProgressBar')
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout_5.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenSongExportForm)
- self.ButtonBarWidget.setObjectName("ButtonBarWidget")
+ self.ButtonBarWidget.setObjectName(u'ButtonBarWidget')
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
- self.horizontalLayout_7.setObjectName("horizontalLayout_7")
+ self.horizontalLayout_7.setObjectName(u'horizontalLayout_7')
spacerItem5 = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem5)
self.ExportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
- self.ExportPushButton.setObjectName("ExportPushButton")
+ self.ExportPushButton.setObjectName(u'ExportPushButton')
self.horizontalLayout_7.addWidget(self.ExportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
- self.ClosePushButton.setObjectName("ClosePushButton")
+ self.ClosePushButton.setObjectName(u'ClosePushButton')
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout_5.addWidget(self.ButtonBarWidget)
self.retranslateUi()
- QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenSongExportForm.close)
- QtCore.QObject.connect(self.ExportSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.ExportListTable.selectAll)
- QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.selectAll)
- QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.clear)
+ QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL(u'clicked()'), self.OpenSongExportForm.close)
+ QtCore.QObject.connect(self.ExportSelectAllPushButton, QtCore.SIGNAL(u'clicked()'), self.ExportListTable.selectAll)
+ QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL(u'clicked()'), self.SelectedListTable.selectAll)
+ QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL(u'clicked()'), self.SelectedListTable.clear)
QtCore.QMetaObject.connectSlotsByName(self.OpenSongExportForm)
def retranslateUi(self):
- self.OpenSongExportForm.setWindowTitle(QtGui.QApplication.translate("OpenSongExportForm", "OpenSong Song Exporter", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportFileLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Select OpenSong song folder:", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportListLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Full Song List", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenSongExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenSongExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportSelectAllPushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportFilterComboBox.setItemText(0, QtGui.QApplication.translate("OpenSongExportForm", "Lyrics", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportFilterComboBox.setItemText(1, QtGui.QApplication.translate("OpenSongExportForm", "Title", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportFilterComboBox.setItemText(2, QtGui.QApplication.translate("OpenSongExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedListLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Song Export List", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenSongExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenSongExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedSelectAllPushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
- self.SelectedRemoveSelectedButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Remove Selected", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenSongExportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Ready to export", None, QtGui.QApplication.UnicodeUTF8))
- self.ExportPushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Export", None, QtGui.QApplication.UnicodeUTF8))
- self.ClosePushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
+ self.OpenSongExportForm.setWindowTitle(translate(u'OpenSongExportForm', u'OpenSong Song Exporter'))
+ self.ExportFileLabel.setText(translate(u'OpenSongExportForm', u'Select OpenSong song folder:'))
+ self.ExportListLabel.setText(translate(u'OpenSongExportForm', u'Full Song List'))
+ self.ExportListTable.horizontalHeaderItem(0).setText(translate(u'OpenSongExportForm', u'Song Title'))
+ self.ExportListTable.horizontalHeaderItem(1).setText(translate(u'OpenSongExportForm', u'Author'))
+ self.ExportSelectAllPushButton.setText(translate(u'OpenSongExportForm', u'Select All'))
+ self.ExportFilterComboBox.setItemText(0, translate(u'OpenSongExportForm', u'Lyrics'))
+ self.ExportFilterComboBox.setItemText(1, translate(u'OpenSongExportForm', u'Title'))
+ self.ExportFilterComboBox.setItemText(2, translate(u'OpenSongExportForm', u'Author'))
+ self.SelectedListLabel.setText(translate(u'OpenSongExportForm', u'Song Export List'))
+ self.SelectedListTable.horizontalHeaderItem(0).setText(translate(u'OpenSongExportForm', u'Song Title'))
+ self.SelectedListTable.horizontalHeaderItem(1).setText(translate(u'OpenSongExportForm', u'Author'))
+ self.SelectedSelectAllPushButton.setText(translate(u'OpenSongExportForm', u'Select All'))
+ self.SelectedRemoveSelectedButton.setText(translate(u'OpenSongExportForm', u'Remove Selected'))
+ self.ProgressGroupBox.setTitle(translate(u'OpenSongExportForm', u'Progress:'))
+ self.ProgressLabel.setText(translate(u'OpenSongExportForm', u'Ready to export'))
+ self.ExportPushButton.setText(translate(u'OpenSongExportForm', u'Export'))
+ self.ClosePushButton.setText(translate(u'OpenSongExportForm', u'Close'))
def show(self):
self.OpenSongExportForm.show()
=== modified file 'openlp/plugins/songs/forms/opensongimportform.py'
--- openlp/plugins/songs/forms/opensongimportform.py 2009-05-01 22:26:43 +0000
+++ openlp/plugins/songs/forms/opensongimportform.py 2009-06-16 18:21:24 +0000
@@ -3,7 +3,7 @@
"""
OpenLP - Open Source Lyrics Projection
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
the terms of the GNU General Public License as published by the Free Software
@@ -17,10 +17,8 @@
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
-
from PyQt4 import QtCore, QtGui
-
-from openlp.core.resources import *
+from openlp.core.lib import translate
class OpenSongImportForm(object):
@@ -29,37 +27,37 @@
self.setupUi()
def setupUi(self):
- self.OpenSongImportForm.setObjectName("OpenSongImportForm")
+ self.OpenSongImportForm.setObjectName(u'OpenSongImportForm')
self.OpenSongImportForm.resize(481, 153)
icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenSongImportForm.setWindowIcon(icon)
self.verticalLayout = QtGui.QVBoxLayout(self.OpenSongImportForm)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(8)
- self.verticalLayout.setObjectName("verticalLayout")
+ self.verticalLayout.setObjectName(u'verticalLayout')
self.ImportFileWidget = QtGui.QWidget(self.OpenSongImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportFileWidget.sizePolicy().hasHeightForWidth())
self.ImportFileWidget.setSizePolicy(sizePolicy)
- self.ImportFileWidget.setObjectName("ImportFileWidget")
+ self.ImportFileWidget.setObjectName(u'ImportFileWidget')
self.horizontalLayout = QtGui.QHBoxLayout(self.ImportFileWidget)
self.horizontalLayout.setSpacing(6)
self.horizontalLayout.setMargin(0)
- self.horizontalLayout.setObjectName("horizontalLayout")
+ self.horizontalLayout.setObjectName(u'horizontalLayout')
self.ImportFileLabel = QtGui.QLabel(self.ImportFileWidget)
- self.ImportFileLabel.setObjectName("ImportFileLabel")
+ self.ImportFileLabel.setObjectName(u'ImportFileLabel')
self.horizontalLayout.addWidget(self.ImportFileLabel)
self.ImportFileLineEdit = QtGui.QLineEdit(self.ImportFileWidget)
- self.ImportFileLineEdit.setObjectName("ImportFileLineEdit")
+ self.ImportFileLineEdit.setObjectName(u'ImportFileLineEdit')
self.horizontalLayout.addWidget(self.ImportFileLineEdit)
self.ImportFileSelectPushButton = QtGui.QPushButton(self.ImportFileWidget)
icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/imports/import_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap(u':/imports/import_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImportFileSelectPushButton.setIcon(icon1)
- self.ImportFileSelectPushButton.setObjectName("ImportFileSelectPushButton")
+ self.ImportFileSelectPushButton.setObjectName(u'ImportFileSelectPushButton')
self.horizontalLayout.addWidget(self.ImportFileSelectPushButton)
self.verticalLayout.addWidget(self.ImportFileWidget)
self.ProgressGroupBox = QtGui.QGroupBox(self.OpenSongImportForm)
@@ -68,46 +66,46 @@
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
- self.ProgressGroupBox.setObjectName("ProgressGroupBox")
+ self.ProgressGroupBox.setObjectName(u'ProgressGroupBox')
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(6)
self.verticalLayout_4.setContentsMargins(6, 0, 8, 8)
- self.verticalLayout_4.setObjectName("verticalLayout_4")
+ self.verticalLayout_4.setObjectName(u'verticalLayout_4')
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
- self.ProgressLabel.setObjectName("ProgressLabel")
+ self.ProgressLabel.setObjectName(u'ProgressLabel')
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
- self.ProgressBar.setProperty("value", QtCore.QVariant(24))
- self.ProgressBar.setObjectName("ProgressBar")
+ self.ProgressBar.setProperty(u'value', QtCore.QVariant(24))
+ self.ProgressBar.setObjectName(u'ProgressBar')
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenSongImportForm)
- self.ButtonBarWidget.setObjectName("ButtonBarWidget")
+ self.ButtonBarWidget.setObjectName(u'ButtonBarWidget')
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
- self.horizontalLayout_7.setObjectName("horizontalLayout_7")
+ self.horizontalLayout_7.setObjectName(u'horizontalLayout_7')
spacerItem = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem)
self.ImportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
- self.ImportPushButton.setObjectName("ImportPushButton")
+ self.ImportPushButton.setObjectName(u'ImportPushButton')
self.horizontalLayout_7.addWidget(self.ImportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
- self.ClosePushButton.setObjectName("ClosePushButton")
+ self.ClosePushButton.setObjectName(u'ClosePushButton')
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout.addWidget(self.ButtonBarWidget)
self.retranslateUi()
- QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenSongImportForm.close)
+ QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL(u'clicked()'), self.OpenSongImportForm.close)
QtCore.QMetaObject.connectSlotsByName(self.OpenSongImportForm)
def retranslateUi(self):
- self.OpenSongImportForm.setWindowTitle(QtGui.QApplication.translate("OpenSongImportForm", "OpenSong Song Importer", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportFileLabel.setText(QtGui.QApplication.translate("OpenSongImportForm", "OpenSong Folder:", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenSongImportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
- self.ProgressLabel.setText(QtGui.QApplication.translate("OpenSongImportForm", "Ready to import", None, QtGui.QApplication.UnicodeUTF8))
- self.ImportPushButton.setText(QtGui.QApplication.translate("OpenSongImportForm", "Import", None, QtGui.QApplication.UnicodeUTF8))
- self.ClosePushButton.setText(QtGui.QApplication.translate("OpenSongImportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
+ self.OpenSongImportForm.setWindowTitle(translate(u'OpenSongImportForm', u'OpenSong Song Importer'))
+ self.ImportFileLabel.setText(translate(u'OpenSongImportForm', u'OpenSong Folder:'))
+ self.ProgressGroupBox.setTitle(translate(u'OpenSongImportForm', u'Progress:'))
+ self.ProgressLabel.setText(translate(u'OpenSongImportForm', u'Ready to import'))
+ self.ImportPushButton.setText(translate(u'OpenSongImportForm', u'Import'))
+ self.ClosePushButton.setText(translate(u'OpenSongImportForm', u'Close'))
def show(self):
self.OpenSongImportForm.show()
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2009-06-14 13:50:56 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2009-06-16 18:21:24 +0000
@@ -216,8 +216,9 @@
def onSongDeleteClick(self):
item = self.SongListWidget.currentItem()
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
- self.parent.songmanager.delete_song(id)
- self.SongListWidget.removeItem(item)
+ self.parent.songmanager.delete_song(item_id)
+ row = self.SongListWidget.row(item)
+ self.SongListWidget.takeItem(row)
def onSongPreviewClick(self):
service_item = ServiceItem(self.parent)
@@ -238,7 +239,8 @@
songXML=SongXMLParser(song.lyrics)
verseList = songXML.get_verses()
for verse in verseList:
- service_item.add_from_text(verse[1][:30], verse[1])
+ if verse[1] is not None:
+ service_item.add_from_text(verse[1][:30], verse[1])
else:
verses = song.lyrics.split(u'\n\n')
for slide in verses:
=== modified file 'openlp/plugins/songs/lib/songxml.py'
--- openlp/plugins/songs/lib/songxml.py 2009-01-06 20:10:03 +0000
+++ openlp/plugins/songs/lib/songxml.py 2009-06-16 18:21:24 +0000
@@ -1,663 +1,663 @@
-# -*- coding:iso-8859-1 -*-
-# 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, Carsten Tinggaard
-
-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 sys
-import os
-from types import StringType, ListType, NoneType
-
-sys.path.append(os.path.abspath("./../../../.."))
-
-from openlp.core.lib import XmlRootClass
-
-class SongException(Exception):
- pass
-
-class SongTitleError(SongException):
- pass
-
-class SongTypeError(SongException):
- pass
-
-class SongSlideError(SongException):
- pass
-
-class SongFeatureError(SongException):
- pass
-
-# TODO: Song: Logging - not all, but enough
-# TODO: Song: Handle OpenLP2 format
-# TODO: Song: Import OpenLP1
-# TODO: Song: Export OpenLP1
-# TODO: Song: Export Song to CCLI
-# TODO: Song: Export Song to OpenSong
-# TODO: Song: Import ChangingSong
-# TODO: Song: Export ChangingSong
-
-_blankOpenSongXml = \
-'''<?xml version="1.0" encoding="UTF-8"?>
-<song>
- <title></title>
- <author></author>
- <copyright></copyright>
- <presentation></presentation>
- <ccli></ccli>
- <lyrics></lyrics>
- <theme></theme>
- <alttheme></alttheme>
-</song>
-'''
-
-class _OpenSong(XmlRootClass):
- """Class for import of OpenSogn"""
-
- def __init__(self, xmlContent = None):
- """Initialize from given xml content"""
- super(_OpenSong, self).__init__()
- self.from_buffer(xmlContent)
-
- def _reset(self):
- """Reset all song attributes"""
- global _blankOpenSongXml
- self._setFromXml(_blankOpenSongXml, "song")
-
- def from_buffer(self, xmlContent):
- """Initialize from buffer(string) with xml content"""
- self._reset()
- if xmlContent != None :
- self._setFromXml(xmlContent, "song")
-
- def get_author_list(self):
- """Convert author field to an authorlist
-
- in OpenSong an author list may be separated by '/'
- return as a string
- """
- res = []
- if self.author != None :
- lst = self.author.split(' and ')
- for l in lst :
- res.append(l.strip())
- s = ", ".join(res)
- return s
-
- def get_category_array(self):
- """Convert theme and alttheme into category_array
-
- return as a string
- """
- res = []
- if self.theme != None :
- res.append(self.theme)
- if self.alttheme != None :
- res.append(self.alttheme)
- s = ", ".join(res)
- return s
-
- def _reorder_verse(self, tag, tmpVerse):
- """Reorder the verse in case of first char is a number
-
- tag -- the tag of this verse / verse group
- tmpVerse -- list of strings
- """
- res = []
- for c in '1234567890 ':
- tagPending = True
- for l in tmpVerse :
- if l.startswith(c) :
- if tagPending :
- tagPending = False
- t = tag.strip("[]").lower()
- if 'v' == t :
- newtag = "Verse"
- elif 'c' == t :
- newtag = "Chorus"
- elif 'b' == t :
- newtag = "Bridge"
- elif 'p' == t :
- newtag = "Pre-chorus"
- else :
- newtag = t
- s = ("# %s %s"%(newtag, c)).rstrip()
- res.append(s)
- res.append(l[1:])
- if (len(l) == 0) and (not tagPending) :
- res.append(l)
- return res
-
- def get_lyrics(self):
- """Convert the lyrics to openlp lyrics format
-
- return as list of strings
- """
- lyrics = self.lyrics.split("\n")
- tmpVerse = []
- finalLyrics = []
- tag = ""
- for l in lyrics:
- line = l.rstrip()
- if not line.startswith('.') :
- # drop all chords
- tmpVerse.append(line)
- if len(line) > 0 :
- if line.startswith('['):
- tag = line
- else :
- r = self._reorder_verse(tag, tmpVerse)
- finalLyrics.extend(r)
- tag = ""
- tmpVerse = []
- # catch up final verse
- r = self._reorder_verse(tag, tmpVerse)
- finalLyrics.extend(r)
- return finalLyrics
-
-
-class Song(object) :
- """Handling song properties and methods
-
- handles all conversions between various input and output formats
-
- CCLI :
- from_ccli_text_file
- to_ccli_text_file
- from_ccli_text_buffer
- to_ccli_text_buffer
-
- OpenSong:
- from_opensong_file
- to_opensong_file
- from_opensong_buffer
- to_opensong_buffer
-
- presentation (screen):
- get_number_of_slides
- get_preview_slide
- get_render_slide
-
- openlp1 :
- from_openlp1_lyrics_buffer
- to_openlp1_lyrics_buffer
- set_author_list
- get_author_list
-
- editing and openlp2 :
- set_*
- get_*
- """
-
- def __init__(self, songid = 0):
- """Initialize song object
-
- songid -- database id for this song
- title -- title of the song
- search_title -- title without punctuation chars
- author_list -- list of authors
- song_cclino -- CCLI number for this song
- copyright -- copyright string
- show_title -- 0: no show, 1: show
- show_author_list -- 0: no show, 1: show
- show_copyright -- 0: no show, 1: show
- show_song_cclino -- 0: no show, 1: show
- theme -- name of theme or blank
- category_array -- list of user defined properties (hymn, gospel)
- song_book -- name of originating book
- song_number -- number of the song, related to a songbook
- comments -- free comment
- verse_order -- presentation order of the slides
- lyrics -- text format
- search_lyrics -- lowercase lyrics without punctuation
- """
- self.songid = songid
- self._reset()
-
- def _reset(self):
- """Reset all song attributes"""
- self.slideList = []
- self.set_title("BlankSong")
- self.author_list = None
- self.song_cclino = ""
- self.copyright = ""
- self.show_author_list = 1
- self.show_copyright = 1
- self.show_song_cclino = 1
- self.show_title = 1
- self.theme = ""
- self.category_array = None
- self.song_book = ""
- self.song_number = ""
- self.comments = ""
- self.verse_order = ""
- self.set_lyrics("")
- return
-
- def set_songid(self, songid):
- """Set the songid for the database"""
- self.songid = songid
-
- def get_songid(self):
- """Return the songid for the database"""
- return self.songid
-
- def from_opensong_buffer(self, xmlcontent):
- """Initialize from buffer(string) of xml lines in opensong format"""
- self._reset()
- opensong = _OpenSong(xmlcontent)
- if opensong.title != None:
- self.set_title(opensong.title)
- if opensong.copyright != None :
- self.set_copyright(opensong.copyright)
- if opensong.presentation != None:
- self.set_verse_order(opensong.presentation)
- if opensong.ccli != None:
- self.set_song_cclino(opensong.ccli)
- self.set_author_list(opensong.get_author_list())
- self.set_category_array(opensong.get_category_array())
- self.set_lyrics(opensong.get_lyrics())
-
- def from_opensong_file(self, xmlfilename):
- """Initialize from file containing xml
-
- xmlfilename -- path to xml file
- """
- lst = []
- f = open(xmlfilename, 'r')
- for line in f :
- lst.append(line)
- f.close()
- xml = "".join(lst)
- self.from_opensong_buffer(xml)
-
- def _remove_punctuation(self, title):
- """Remove the puntuation chars from title
-
- chars are: .,:;!?&%#/\@`$'|"^~*-
- """
- punctuation = ".,:;!?&%#'\"/\\@`$|^~*-"
- s = title
- for c in punctuation :
- s = s.replace(c, '')
- return s
-
- def set_title(self, title):
- """Set the song title
-
- title (string)
- raises SongTitleError if the title is empty
- raises SongTitleError if the seach_title is empty
- """
- self.title = title.strip()
- self.search_title = self._remove_punctuation(title).strip()
- if len(self.title) < 1 :
- raise SongTitleError("The title is empty")
- if len(self.search_title) < 1 :
- raise SongTitleError("The searchable title is empty")
-
- def get_title(self):
- """Return title value"""
- return self.title
-
- def get_search_title(self):
- """Return search_title"""
- return self.search_title
-
- def from_ccli_text_buffer(self, textList):
- """Create song from a list of texts (strings) - CCLI text format expected
-
- textList (list of strings) -- the song
- """
- self._reset()
- # extract the following fields
- # - name
- # - author
- # - CCLI no
- sName = ""
- sAuthor = ""
- sCopyright = ""
- sCcli = ""
- lastpart = 0
- n = 0
- metMisc = False
- lyrics = []
- for l in textList :
- n += 1
- if lastpart > 0 :
- lastpart += 1
- if lastpart == 2 :
- sCopyright = l[1:].strip()
- if lastpart == 3 :
- sAuthor = l
- elif l.startswith('CCLI Song') :
- sCcli = l[13:].strip()
- lastpart = 1
- else :
- if metMisc :
- metMisc = False
- if l.upper().startswith("(BRIDGE)") :
- lyrics.append("# Bridge")
- # otherwise unknown misc keyword
- elif l.startswith("Misc") :
- metMisc = True
- elif l.startswith("Verse") or l.startswith("Chorus"):
- lyrics.append("# %s"%l)
- else :
- # should we remove multiple blank lines?
- if n == 1 :
- sName = l
- else :
- lyrics.append(l)
- # split on known separators
- lst = sAuthor.split('/')
- if len(lst) < 2:
- lst = sAuthor.split('|')
- author_list = ", ".join(lst)
- self.set_title(sName)
- self.set_author_list(author_list)
- self.set_copyright(sCopyright)
- self.set_song_cclino(sCcli)
- self.set_lyrics(lyrics)
-
- def from_ccli_text_file(self, textFileName):
- """Create song from a list of texts read from given file
-
- textFileName -- path to text file
- """
- lines = []
- f = open(textFileName, 'r')
- for orgline in f:
- lines.append(orgline.rstrip())
- f.close()
- self.from_ccli_text_buffer(lines)
-
- def _assure_string(self, s):
- """Force a string is returned"""
- if s == None :
- r = ""
- else :
- r = str(s)
- return r
-
- def _split_to_list(self, aString):
- """Split a string into a list - comma separated"""
- res = []
- if aString != None :
- lst = aString.split(',')
- for l in lst :
- # remove whitespace
- res.append(l.strip())
- return res
-
- def _list_to_string(self, strOrList):
- """Force a possibly list into a string"""
- if type(strOrList) == StringType :
- lst = self._split_to_list(strOrList)
- elif type(strOrList) == ListType :
- lst = strOrList
- elif type(strOrList) == NoneType :
- lst = []
- else :
- raise SongTypeError("Variable not String or List")
- s = ", ".join(lst)
- return s
-
- def get_copyright(self):
- """Return copyright info string"""
- return self._assure_string(self.copyright)
-
- def set_copyright(self, copyright):
- """Set the copyright string"""
- self.copyright = copyright
-
- def get_song_cclino(self):
- """Return the songCclino"""
- return self._assure_string(self.song_cclino)
-
- def set_song_cclino(self, song_cclino):
- """Set the song_cclino"""
- self.song_cclino = song_cclino
-
- def get_theme(self):
- """Return the theme name for the song"""
- return self._assure_string(self.theme)
-
- def set_theme(self, theme):
- """Set the theme name (string)"""
- self.theme = theme
-
- def get_song_book(self):
- """Return the song_book (string)"""
- return self._assure_string(self.song_book)
-
- def set_song_book(self, song_book):
- """Set the song_book (string)"""
- self.song_book = song_book
-
- def get_song_number(self):
- """Return the song_number (string)"""
- return self._assure_string(self.song_number)
-
- def set_song_number(self, song_number):
- """Set the song_number (string)"""
- self.song_number = song_number
-
- def get_comments(self):
- """Return the comments (string)"""
- return self._assure_string(self.comments)
-
- def set_comments(self, comments):
- """Set the comments (string)"""
- self.comments = comments
-
- def get_verse_order(self):
- """Get the verseOrder (string) - preferably space delimited"""
- return self._assure_string(self.verse_order)
-
- def set_verse_order(self, verse_order):
- """Set the verse order (string) - space delimited"""
- self.verse_order = verse_order
-
- def get_author_list(self, asOneString = True):
- """Return the list of authors as a string
-
- asOneString
- True -- string:
- "John Newton, A Parker"
- False -- list of strings
- ["John Newton", "A Parker"]
- """
- if asOneString :
- res = self._assure_string(self.author_list)
- else :
- res = self._split_to_list(self.author_list)
- return res
-
- def set_author_list(self, author_list):
- """Set the author_list
-
- author_list -- a string or list of strings
- """
- if author_list == None :
- self.author_list = None
- else :
- self.author_list = self._list_to_string(author_list)
-
- def get_category_array(self, asOneString = True):
- """Return the list of categories as a string
-
- asOneString
- True -- string:
- "Hymn, Gospel"
- False -- list of strings
- ["Hymn", "Gospel"]
- """
- if asOneString :
- res = self._assure_string(self.category_array)
- else :
- res = self._split_to_list(self.category_array)
- return res
-
- def set_category_array(self, category_array):
- """Set the category_array
-
- category_array -- a string or list of strings
- """
- if category_array == None :
- self.category_array = None
- else :
- self.category_array = self._list_to_string(category_array)
-
- def get_show_title(self):
- """Return the show_title flag (bool)"""
- return self.show_title
-
- def set_show_title(self, show_title):
- """Set the show_title flag (bool)"""
- self.show_title = show_title
-
- def get_show_author_list(self):
- """Return the show_author_list flag"""
- return self.show_author_list
-
- def set_show_author_list(self, show_author_list):
- """Set the show_author_list flag (bool)"""
- self.show_author_list = show_author_list
-
- def get_show_copyright(self):
- """Return the show_copyright flag"""
- return self.show_copyright
-
- def set_show_copyright(self, show_copyright):
- """Set the show_copyright flag (bool)"""
- self.show_copyright = show_copyright
-
- def get_show_song_cclino(self):
- """Return the showSongCclino (string)"""
- return self.show_song_cclino
-
- def set_show_song_cclino(self, show_song_cclino):
- """Set the show_song_cclino flag (bool)"""
- self.show_song_cclino = show_song_cclino
-
- def get_lyrics(self):
- """Return the lyrics as a list of strings
-
- this will return all the strings in the song
- """
- return self.lyrics
-
- def set_lyrics(self, lyrics):
- """Set the lyrics as a list of strings"""
- self.lyrics = lyrics
- self._parse_lyrics()
-
- def _parse_lyrics(self):
- """Parse lyrics into the slidelist"""
- # TODO: check font formatting
- self.slideList = []
- tmpSlide = []
- metContent = False
- for l in self.lyrics :
- if len(l) > 0 :
- metContent = True
- tmpSlide.append(l)
- else :
- if metContent :
- metContent = False
- self.slideList.append(tmpSlide)
- tmpSlide = []
- #
- if len(tmpSlide) > 0:
- self.slideList.append(tmpSlide)
-
- def get_number_of_slides(self):
- """Return the number of slides in the song (int)"""
- numOfSlides = len(self.slideList)
- return numOfSlides
-
- def get_preview_slide(self, slideNumber):
- """Return the preview text for specified slide number
-
- slideNumber -- 0: all slides, 1..n : specific slide
- a list of strings are returned
- """
- num = len(self.slideList)
- if num < 1 :
- raise SongSlideError("No slides in this song")
- elif slideNumber > num :
- raise SongSlideError("Slide number too high")
- if slideNumber > 0 :
- # return this slide
- res = self.slideList[slideNumber-1]
- # find theme in this slide
- else :
- res = []
- for i in range(num):
- if i > 0 :
- res.append("")
- res.extend()
- # remove formattingincluding themes
- return res
-
- def get_render_slide(self, slideNumber):
- """Return the slide to be rendered including the additional
- properties
-
- slideNumber -- 1 .. numberOfSlides
- Returns a list as:
- [theme (string),
- title (string),
- authorlist (string),
- copyright (string),
- cclino (string),
- lyric-part as a list of strings]
- """
- num = len(self.slideList)
- if num < 1 :
- raise SongSlideError("No slides in this song")
- elif slideNumber > num :
- raise SongSlideError("Slide number too high")
- res = []
- if self.show_title :
- title = self.get_title()
- else :
- title = ""
- if self.show_author_list :
- author = self.get_author_list(True)
- else :
- author = ""
- if self.show_copyright :
- cpright = self.get_copyright()
- else :
- cpright = ""
- if self.show_song_cclino :
- ccli = self.get_song_cclino()
- else :
- ccli = ""
- theme = self.get_theme()
- # examine the slide for a theme
- res.append(theme)
- res.append(title)
- res.append(author)
- res.append(cpright)
- res.append(ccli)
- # append the correct slide
- return res
-
-__all__ = ['SongException', 'SongTitleError', 'SongSlideError', 'SongTypeError',
- 'SongFeatureError', 'Song']
+# -*- coding:iso-8859-1 -*-
+# 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, Carsten Tinggaard
+
+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 sys
+import os
+from types import StringType, ListType, NoneType
+
+sys.path.append(os.path.abspath(u'./../../../..'))
+
+from openlp.core.lib import XmlRootClass
+
+class SongException(Exception):
+ pass
+
+class SongTitleError(SongException):
+ pass
+
+class SongTypeError(SongException):
+ pass
+
+class SongSlideError(SongException):
+ pass
+
+class SongFeatureError(SongException):
+ pass
+
+# TODO: Song: Logging - not all, but enough
+# TODO: Song: Handle OpenLP2 format
+# TODO: Song: Import OpenLP1
+# TODO: Song: Export OpenLP1
+# TODO: Song: Export Song to CCLI
+# TODO: Song: Export Song to OpenSong
+# TODO: Song: Import ChangingSong
+# TODO: Song: Export ChangingSong
+
+_blankOpenSongXml = \
+'''<?xml version="1.0" encoding="UTF-8"?>
+<song>
+ <title></title>
+ <author></author>
+ <copyright></copyright>
+ <presentation></presentation>
+ <ccli></ccli>
+ <lyrics></lyrics>
+ <theme></theme>
+ <alttheme></alttheme>
+</song>
+'''
+
+class _OpenSong(XmlRootClass):
+ """Class for import of OpenSogn"""
+
+ def __init__(self, xmlContent = None):
+ """Initialize from given xml content"""
+ super(_OpenSong, self).__init__()
+ self.from_buffer(xmlContent)
+
+ def _reset(self):
+ """Reset all song attributes"""
+ global _blankOpenSongXml
+ self._setFromXml(_blankOpenSongXml, "song')
+
+ def from_buffer(self, xmlContent):
+ """Initialize from buffer(string) with xml content"""
+ self._reset()
+ if xmlContent != None :
+ self._setFromXml(xmlContent, "song')
+
+ def get_author_list(self):
+ """Convert author field to an authorlist
+
+ in OpenSong an author list may be separated by '/'
+ return as a string
+ """
+ res = []
+ if self.author != None :
+ lst = self.author.split(u' and ')
+ for l in lst :
+ res.append(l.strip())
+ s = ", u'.join(res)
+ return s
+
+ def get_category_array(self):
+ """Convert theme and alttheme into category_array
+
+ return as a string
+ """
+ res = []
+ if self.theme != None :
+ res.append(self.theme)
+ if self.alttheme != None :
+ res.append(self.alttheme)
+ s = ", u'.join(res)
+ return s
+
+ def _reorder_verse(self, tag, tmpVerse):
+ """Reorder the verse in case of first char is a number
+
+ tag -- the tag of this verse / verse group
+ tmpVerse -- list of strings
+ """
+ res = []
+ for c in '1234567890 ':
+ tagPending = True
+ for l in tmpVerse :
+ if l.startswith(c) :
+ if tagPending :
+ tagPending = False
+ t = tag.strip(u'[]').lower()
+ if 'v' == t :
+ newtag = "Verse"
+ elif 'c' == t :
+ newtag = "Chorus"
+ elif 'b' == t :
+ newtag = "Bridge"
+ elif 'p' == t :
+ newtag = "Pre-chorus"
+ else :
+ newtag = t
+ s = (u'# %s %s"%(newtag, c)).rstrip()
+ res.append(s)
+ res.append(l[1:])
+ if (len(l) == 0) and (not tagPending) :
+ res.append(l)
+ return res
+
+ def get_lyrics(self):
+ """Convert the lyrics to openlp lyrics format
+
+ return as list of strings
+ """
+ lyrics = self.lyrics.split(u'\n')
+ tmpVerse = []
+ finalLyrics = []
+ tag = ""
+ for l in lyrics:
+ line = l.rstrip()
+ if not line.startswith(u'.') :
+ # drop all chords
+ tmpVerse.append(line)
+ if len(line) > 0 :
+ if line.startswith(u'['):
+ tag = line
+ else :
+ r = self._reorder_verse(tag, tmpVerse)
+ finalLyrics.extend(r)
+ tag = ""
+ tmpVerse = []
+ # catch up final verse
+ r = self._reorder_verse(tag, tmpVerse)
+ finalLyrics.extend(r)
+ return finalLyrics
+
+
+class Song(object) :
+ """Handling song properties and methods
+
+ handles all conversions between various input and output formats
+
+ CCLI :
+ from_ccli_text_file
+ to_ccli_text_file
+ from_ccli_text_buffer
+ to_ccli_text_buffer
+
+ OpenSong:
+ from_opensong_file
+ to_opensong_file
+ from_opensong_buffer
+ to_opensong_buffer
+
+ presentation (screen):
+ get_number_of_slides
+ get_preview_slide
+ get_render_slide
+
+ openlp1 :
+ from_openlp1_lyrics_buffer
+ to_openlp1_lyrics_buffer
+ set_author_list
+ get_author_list
+
+ editing and openlp2 :
+ set_*
+ get_*
+ """
+
+ def __init__(self, songid = 0):
+ """Initialize song object
+
+ songid -- database id for this song
+ title -- title of the song
+ search_title -- title without punctuation chars
+ author_list -- list of authors
+ song_cclino -- CCLI number for this song
+ copyright -- copyright string
+ show_title -- 0: no show, 1: show
+ show_author_list -- 0: no show, 1: show
+ show_copyright -- 0: no show, 1: show
+ show_song_cclino -- 0: no show, 1: show
+ theme -- name of theme or blank
+ category_array -- list of user defined properties (hymn, gospel)
+ song_book -- name of originating book
+ song_number -- number of the song, related to a songbook
+ comments -- free comment
+ verse_order -- presentation order of the slides
+ lyrics -- text format
+ search_lyrics -- lowercase lyrics without punctuation
+ """
+ self.songid = songid
+ self._reset()
+
+ def _reset(self):
+ """Reset all song attributes"""
+ self.slideList = []
+ self.set_title(u'BlankSong')
+ self.author_list = None
+ self.song_cclino = ""
+ self.copyright = ""
+ self.show_author_list = 1
+ self.show_copyright = 1
+ self.show_song_cclino = 1
+ self.show_title = 1
+ self.theme = ""
+ self.category_array = None
+ self.song_book = ""
+ self.song_number = ""
+ self.comments = ""
+ self.verse_order = ""
+ self.set_lyrics(u'')
+ return
+
+ def set_songid(self, songid):
+ """Set the songid for the database"""
+ self.songid = songid
+
+ def get_songid(self):
+ """Return the songid for the database"""
+ return self.songid
+
+ def from_opensong_buffer(self, xmlcontent):
+ """Initialize from buffer(string) of xml lines in opensong format"""
+ self._reset()
+ opensong = _OpenSong(xmlcontent)
+ if opensong.title != None:
+ self.set_title(opensong.title)
+ if opensong.copyright != None :
+ self.set_copyright(opensong.copyright)
+ if opensong.presentation != None:
+ self.set_verse_order(opensong.presentation)
+ if opensong.ccli != None:
+ self.set_song_cclino(opensong.ccli)
+ self.set_author_list(opensong.get_author_list())
+ self.set_category_array(opensong.get_category_array())
+ self.set_lyrics(opensong.get_lyrics())
+
+ def from_opensong_file(self, xmlfilename):
+ """Initialize from file containing xml
+
+ xmlfilename -- path to xml file
+ """
+ lst = []
+ f = open(xmlfilename, 'r')
+ for line in f :
+ lst.append(line)
+ f.close()
+ xml = "".join(lst)
+ self.from_opensong_buffer(xml)
+
+ def _remove_punctuation(self, title):
+ """Remove the puntuation chars from title
+
+ chars are: .,:;!?&%#/\@`$'|"^~*-
+ """
+ punctuation = ".,:;!?&%#'\"/\\@`$|^~*-"
+ s = title
+ for c in punctuation :
+ s = s.replace(c, '')
+ return s
+
+ def set_title(self, title):
+ """Set the song title
+
+ title (string)
+ raises SongTitleError if the title is empty
+ raises SongTitleError if the seach_title is empty
+ """
+ self.title = title.strip()
+ self.search_title = self._remove_punctuation(title).strip()
+ if len(self.title) < 1 :
+ raise SongTitleError(u'The title is empty')
+ if len(self.search_title) < 1 :
+ raise SongTitleError(u'The searchable title is empty')
+
+ def get_title(self):
+ """Return title value"""
+ return self.title
+
+ def get_search_title(self):
+ """Return search_title"""
+ return self.search_title
+
+ def from_ccli_text_buffer(self, textList):
+ """Create song from a list of texts (strings) - CCLI text format expected
+
+ textList (list of strings) -- the song
+ """
+ self._reset()
+ # extract the following fields
+ # - name
+ # - author
+ # - CCLI no
+ sName = ""
+ sAuthor = ""
+ sCopyright = ""
+ sCcli = ""
+ lastpart = 0
+ n = 0
+ metMisc = False
+ lyrics = []
+ for l in textList :
+ n += 1
+ if lastpart > 0 :
+ lastpart += 1
+ if lastpart == 2 :
+ sCopyright = l[1:].strip()
+ if lastpart == 3 :
+ sAuthor = l
+ elif l.startswith(u'CCLI Song') :
+ sCcli = l[13:].strip()
+ lastpart = 1
+ else :
+ if metMisc :
+ metMisc = False
+ if l.upper().startswith(u'(BRIDGE)') :
+ lyrics.append(u'# Bridge')
+ # otherwise unknown misc keyword
+ elif l.startswith(u'Misc') :
+ metMisc = True
+ elif l.startswith(u'Verse') or l.startswith(u'Chorus'):
+ lyrics.append(u'# %s"%l)
+ else :
+ # should we remove multiple blank lines?
+ if n == 1 :
+ sName = l
+ else :
+ lyrics.append(l)
+ # split on known separators
+ lst = sAuthor.split(u'/')
+ if len(lst) < 2:
+ lst = sAuthor.split(u'|')
+ author_list = ", u'.join(lst)
+ self.set_title(sName)
+ self.set_author_list(author_list)
+ self.set_copyright(sCopyright)
+ self.set_song_cclino(sCcli)
+ self.set_lyrics(lyrics)
+
+ def from_ccli_text_file(self, textFileName):
+ """Create song from a list of texts read from given file
+
+ textFileName -- path to text file
+ """
+ lines = []
+ f = open(textFileName, 'r')
+ for orgline in f:
+ lines.append(orgline.rstrip())
+ f.close()
+ self.from_ccli_text_buffer(lines)
+
+ def _assure_string(self, s):
+ """Force a string is returned"""
+ if s == None :
+ r = ""
+ else :
+ r = unicode(s)
+ return r
+
+ def _split_to_list(self, aString):
+ """Split a string into a list - comma separated"""
+ res = []
+ if aString != None :
+ lst = aString.split(u',')
+ for l in lst :
+ # remove whitespace
+ res.append(l.strip())
+ return res
+
+ def _list_to_string(self, strOrList):
+ """Force a possibly list into a string"""
+ if type(strOrList) == StringType :
+ lst = self._split_to_list(strOrList)
+ elif type(strOrList) == ListType :
+ lst = strOrList
+ elif type(strOrList) == NoneType :
+ lst = []
+ else :
+ raise SongTypeError(u'Variable not String or List')
+ s = ", u'.join(lst)
+ return s
+
+ def get_copyright(self):
+ """Return copyright info string"""
+ return self._assure_string(self.copyright)
+
+ def set_copyright(self, copyright):
+ """Set the copyright string"""
+ self.copyright = copyright
+
+ def get_song_cclino(self):
+ """Return the songCclino"""
+ return self._assure_string(self.song_cclino)
+
+ def set_song_cclino(self, song_cclino):
+ """Set the song_cclino"""
+ self.song_cclino = song_cclino
+
+ def get_theme(self):
+ """Return the theme name for the song"""
+ return self._assure_string(self.theme)
+
+ def set_theme(self, theme):
+ """Set the theme name (string)"""
+ self.theme = theme
+
+ def get_song_book(self):
+ """Return the song_book (string)"""
+ return self._assure_string(self.song_book)
+
+ def set_song_book(self, song_book):
+ """Set the song_book (string)"""
+ self.song_book = song_book
+
+ def get_song_number(self):
+ """Return the song_number (string)"""
+ return self._assure_string(self.song_number)
+
+ def set_song_number(self, song_number):
+ """Set the song_number (string)"""
+ self.song_number = song_number
+
+ def get_comments(self):
+ """Return the comments (string)"""
+ return self._assure_string(self.comments)
+
+ def set_comments(self, comments):
+ """Set the comments (string)"""
+ self.comments = comments
+
+ def get_verse_order(self):
+ """Get the verseOrder (string) - preferably space delimited"""
+ return self._assure_string(self.verse_order)
+
+ def set_verse_order(self, verse_order):
+ """Set the verse order (string) - space delimited"""
+ self.verse_order = verse_order
+
+ def get_author_list(self, asOneString = True):
+ """Return the list of authors as a string
+
+ asOneString
+ True -- string:
+ "John Newton, A Parker"
+ False -- list of strings
+ ["John Newton", u'A Parker"]
+ """
+ if asOneString :
+ res = self._assure_string(self.author_list)
+ else :
+ res = self._split_to_list(self.author_list)
+ return res
+
+ def set_author_list(self, author_list):
+ """Set the author_list
+
+ author_list -- a string or list of strings
+ """
+ if author_list == None :
+ self.author_list = None
+ else :
+ self.author_list = self._list_to_string(author_list)
+
+ def get_category_array(self, asOneString = True):
+ """Return the list of categories as a string
+
+ asOneString
+ True -- string:
+ "Hymn, Gospel"
+ False -- list of strings
+ ["Hymn", u'Gospel"]
+ """
+ if asOneString :
+ res = self._assure_string(self.category_array)
+ else :
+ res = self._split_to_list(self.category_array)
+ return res
+
+ def set_category_array(self, category_array):
+ """Set the category_array
+
+ category_array -- a string or list of strings
+ """
+ if category_array == None :
+ self.category_array = None
+ else :
+ self.category_array = self._list_to_string(category_array)
+
+ def get_show_title(self):
+ """Return the show_title flag (bool)"""
+ return self.show_title
+
+ def set_show_title(self, show_title):
+ """Set the show_title flag (bool)"""
+ self.show_title = show_title
+
+ def get_show_author_list(self):
+ """Return the show_author_list flag"""
+ return self.show_author_list
+
+ def set_show_author_list(self, show_author_list):
+ """Set the show_author_list flag (bool)"""
+ self.show_author_list = show_author_list
+
+ def get_show_copyright(self):
+ """Return the show_copyright flag"""
+ return self.show_copyright
+
+ def set_show_copyright(self, show_copyright):
+ """Set the show_copyright flag (bool)"""
+ self.show_copyright = show_copyright
+
+ def get_show_song_cclino(self):
+ """Return the showSongCclino (string)"""
+ return self.show_song_cclino
+
+ def set_show_song_cclino(self, show_song_cclino):
+ """Set the show_song_cclino flag (bool)"""
+ self.show_song_cclino = show_song_cclino
+
+ def get_lyrics(self):
+ """Return the lyrics as a list of strings
+
+ this will return all the strings in the song
+ """
+ return self.lyrics
+
+ def set_lyrics(self, lyrics):
+ """Set the lyrics as a list of strings"""
+ self.lyrics = lyrics
+ self._parse_lyrics()
+
+ def _parse_lyrics(self):
+ """Parse lyrics into the slidelist"""
+ # TODO: check font formatting
+ self.slideList = []
+ tmpSlide = []
+ metContent = False
+ for l in self.lyrics :
+ if len(l) > 0 :
+ metContent = True
+ tmpSlide.append(l)
+ else :
+ if metContent :
+ metContent = False
+ self.slideList.append(tmpSlide)
+ tmpSlide = []
+ #
+ if len(tmpSlide) > 0:
+ self.slideList.append(tmpSlide)
+
+ def get_number_of_slides(self):
+ """Return the number of slides in the song (int)"""
+ numOfSlides = len(self.slideList)
+ return numOfSlides
+
+ def get_preview_slide(self, slideNumber):
+ """Return the preview text for specified slide number
+
+ slideNumber -- 0: all slides, 1..n : specific slide
+ a list of strings are returned
+ """
+ num = len(self.slideList)
+ if num < 1 :
+ raise SongSlideError(u'No slides in this song')
+ elif slideNumber > num :
+ raise SongSlideError(u'Slide number too high')
+ if slideNumber > 0 :
+ # return this slide
+ res = self.slideList[slideNumber-1]
+ # find theme in this slide
+ else :
+ res = []
+ for i in range(num):
+ if i > 0 :
+ res.append(u'')
+ res.extend()
+ # remove formattingincluding themes
+ return res
+
+ def get_render_slide(self, slideNumber):
+ """Return the slide to be rendered including the additional
+ properties
+
+ slideNumber -- 1 .. numberOfSlides
+ Returns a list as:
+ [theme (string),
+ title (string),
+ authorlist (string),
+ copyright (string),
+ cclino (string),
+ lyric-part as a list of strings]
+ """
+ num = len(self.slideList)
+ if num < 1 :
+ raise SongSlideError(u'No slides in this song')
+ elif slideNumber > num :
+ raise SongSlideError(u'Slide number too high')
+ res = []
+ if self.show_title :
+ title = self.get_title()
+ else :
+ title = ""
+ if self.show_author_list :
+ author = self.get_author_list(True)
+ else :
+ author = ""
+ if self.show_copyright :
+ cpright = self.get_copyright()
+ else :
+ cpright = ""
+ if self.show_song_cclino :
+ ccli = self.get_song_cclino()
+ else :
+ ccli = ""
+ theme = self.get_theme()
+ # examine the slide for a theme
+ res.append(theme)
+ res.append(title)
+ res.append(author)
+ res.append(cpright)
+ res.append(ccli)
+ # append the correct slide
+ return res
+
+__all__ = ['SongException', 'SongTitleError', 'SongSlideError', 'SongTypeError',
+ 'SongFeatureError', 'Song']
\ No newline at end of file
=== modified file 'openlp/plugins/songs/lib/tables.py'
--- openlp/plugins/songs/lib/tables.py 2009-06-13 16:15:55 +0000
+++ openlp/plugins/songs/lib/tables.py 2009-06-16 18:21:24 +0000
@@ -22,50 +22,50 @@
from openlp.plugins.songs.lib.meta import metadata
# Definition of the "authors" table
-authors_table = Table('authors', metadata,
- Column('id', types.Integer, primary_key=True),
- Column('first_name', types.Unicode(128)),
- Column('last_name', types.Unicode(128)),
- Column('display_name', types.Unicode(255), nullable=False)
+authors_table = Table(u'authors', metadata,
+ Column(u'id', types.Integer, primary_key=True),
+ Column(u'first_name', types.Unicode(128)),
+ Column(u'last_name', types.Unicode(128)),
+ Column(u'display_name', types.Unicode(255), nullable=False)
)
# Definition of the "song_books" table
-song_books_table = Table('song_books', metadata,
- Column('id', types.Integer, primary_key=True),
- Column('name', types.Unicode(128), nullable=False),
- Column('publisher', types.Unicode(128))
+song_books_table = Table(u'song_books', metadata,
+ Column(u'id', types.Integer, primary_key=True),
+ Column(u'name', types.Unicode(128), nullable=False),
+ Column(u'publisher', types.Unicode(128))
)
# Definition of the "songs" table
-songs_table = Table('songs', metadata,
- Column('id', types.Integer, primary_key=True),
- Column('song_book_id', types.Integer, ForeignKey('song_books.id'), default=0),
- Column('title', types.Unicode(255), nullable=False),
- Column('lyrics', types.UnicodeText, nullable=False),
- Column('verse_order', types.Unicode(128)),
- Column('copyright', types.Unicode(255)),
- Column('comments', types.UnicodeText),
- Column('ccli_number', types.Unicode(64)),
- Column('song_number', types.Unicode(64)),
- Column('theme_name', types.Unicode(128)),
- Column('search_title', types.Unicode(255), index=True, nullable=False),
- Column('search_lyrics', types.UnicodeText, index=True, nullable=False)
+songs_table = Table(u'songs', metadata,
+ Column(u'id', types.Integer, primary_key=True),
+ Column(u'song_book_id', types.Integer, ForeignKey(u'song_books.id'), default=0),
+ Column(u'title', types.Unicode(255), nullable=False),
+ Column(u'lyrics', types.UnicodeText, nullable=False),
+ Column(u'verse_order', types.Unicode(128)),
+ Column(u'copyright', types.Unicode(255)),
+ Column(u'comments', types.UnicodeText),
+ Column(u'ccli_number', types.Unicode(64)),
+ Column(u'song_number', types.Unicode(64)),
+ Column(u'theme_name', types.Unicode(128)),
+ Column(u'search_title', types.Unicode(255), index=True, nullable=False),
+ Column(u'search_lyrics', types.UnicodeText, index=True, nullable=False)
)
# Definition of the "topics" table
-topics_table = Table('topics', metadata,
- Column('id', types.Integer, primary_key=True),
- Column('name', types.Unicode(128), nullable=False)
+topics_table = Table(u'topics', metadata,
+ Column(u'id', types.Integer, primary_key=True),
+ Column(u'name', types.Unicode(128), nullable=False)
)
# Definition of the "authors_songs" table
-authors_songs_table = Table('authors_songs', metadata,
- Column('author_id', types.Integer, ForeignKey('authors.id'), primary_key=True),
- Column('song_id', types.Integer, ForeignKey('songs.id'), primary_key=True)
+authors_songs_table = Table(u'authors_songs', metadata,
+ Column(u'author_id', types.Integer, ForeignKey(u'authors.id'), primary_key=True),
+ Column(u'song_id', types.Integer, ForeignKey(u'songs.id'), primary_key=True)
)
# Definition of the "songs_topics" table
-songs_topics_table = Table('songs_topics', metadata,
- Column('song_id', types.Integer, ForeignKey('songs.id'), primary_key=True),
- Column('topic_id', types.Integer, ForeignKey('topics.id'), primary_key=True)
-)
+songs_topics_table = Table(u'songs_topics', metadata,
+ Column(u'song_id', types.Integer, ForeignKey(u'songs.id'), primary_key=True),
+ Column(u'topic_id', types.Integer, ForeignKey(u'topics.id'), primary_key=True)
+)
\ No newline at end of file
=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py 2009-06-14 07:25:39 +0000
+++ openlp/plugins/songs/songsplugin.py 2009-06-16 18:21:24 +0000
@@ -43,7 +43,7 @@
self.opensong_export_form = OpenSongExportForm()
# Create the plugin icon
self.icon = QtGui.QIcon()
- self.icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
+ self.icon.addPixmap(QtGui.QPixmap(u':/media/media_song.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
def get_media_manager_item(self):
@@ -136,4 +136,4 @@
self.media_item.onSongLiveClick()
if event.event_type == EventType.LoadSongList :
log.debug(u'Load Load Song List Item received')
- self.media_item.displayResults(self.songmanager.get_songs())
+ self.media_item.displayResults(self.songmanager.get_songs())
\ No newline at end of file
=== modified file 'openlp/plugins/songs/test/test_song_basic.py'
--- openlp/plugins/songs/test/test_song_basic.py 2009-01-06 20:10:03 +0000
+++ openlp/plugins/songs/test/test_song_basic.py 2009-06-16 18:21:24 +0000
@@ -1,174 +1,174 @@
-# -*- 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, Carsten Tinggaard
-
-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 py.test
-import os
-import sys
-
-__ThisDir__ = os.path.dirname(__file__)
-if "" == __ThisDir__ :
- __ThisDir__ = os.path.abspath(".")
-
-sys.path.append(os.path.abspath("%s/../../../.."%__ThisDir__))
-
-from openlp.plugins.songs.lib.songxml import *
-
-class Test_Basic(object):
- """Class for first initialization check
- set-get functions
- """
-
- def test_Creation(self):
- """Init: Create as empty"""
- s = Song()
- assert(True)
-
- def test_Title1(self):
- """Set an empty title - raises an exception"""
- s = Song()
- py.test.raises(SongTitleError, s.set_title, "")
-
- def test_Title2(self):
- """Set a normal title"""
- s = Song()
- t = "A normal title"
- s.set_title(t)
- assert(s.get_title() == t)
- assert(s.get_search_title() == t)
-
- def test_Title3(self):
- """Set a titel with punctuation 1"""
- s = Song()
- t1 = "Hey! Come on, ya programmers*"
- t2 = "Hey Come on ya programmers"
- s.set_title(t1)
- assert(s.get_title() == t1)
- assert(s.get_search_title() == t2)
-
- def test_Title4(self):
- """Set a titel with punctuation 2"""
- s = Song()
- t1 = "??#Hey! Come on, ya programmers*"
- t2 = "Hey Come on ya programmers"
- s.set_title(t1)
- assert(s.get_title() == t1)
- assert(s.get_search_title() == t2)
-
- def test_Title5(self):
- """Set a title, where searchable title becomes empty - raises an exception"""
- s = Song()
- py.test.raises(SongTitleError, s.set_title, ",*")
-
- def test_Copyright(self):
- """Set a copyright string"""
- s = Song()
- assert(s.get_copyright() == "")
- s.set_copyright("A B Car")
- assert(s.get_copyright() == "A B Car")
-
- def test_SongCclino(self):
- """Set a SongCcliNo"""
- s = Song()
- assert(s.get_song_cclino() == "")
- s.set_song_cclino(12345)
- assert(s.get_song_cclino() == "12345")
-
- def test_SongBook(self):
- """Set a songbook value"""
- s = Song()
- assert(s.get_song_book() == "")
- s.set_song_book("Hymns")
- assert(s.get_song_book() == "Hymns")
-
- def test_SongNumber(self):
- """Set a song number"""
- s = Song()
- assert(s.get_song_number() == "")
- s.set_song_number(278)
- assert(s.get_song_number() == "278")
-
- def test_Theme(self):
- """Set a theme name"""
- s = Song()
- assert(s.get_theme() == "")
- s.set_theme("Red")
- assert(s.get_theme() == "Red")
-
- def test_VerseOrder(self):
- """Set a verse order"""
- s = Song()
- assert(s.get_verse_order() == "")
- s.set_verse_order("V1 C V2")
- assert(s.get_verse_order() == "V1 C V2")
-
- def test_Comments(self):
- """Set a comment"""
- s = Song()
- assert(s.get_comments() == "")
- s.set_comments("a comment")
- assert(s.get_comments() == "a comment")
-
- def test_AuthorList(self):
- """Set author lists"""
- s = Song()
- assert(s.get_author_list(True) == "")
- assert(s.get_author_list(False) == [])
- t1 = "John Newton"
- s.set_author_list(t1)
- assert(s.get_author_list(True) == t1)
- assert(s.get_author_list(False) == [t1])
- s.set_author_list(" Peter Done , John Newton")
- assert(s.get_author_list(True)== "Peter Done, John Newton")
- assert(s.get_author_list(False) == ["Peter Done", "John Newton"])
- s.set_author_list(None)
- assert(s.get_author_list(True) == "")
- assert(s.get_author_list(False) == [])
- s.set_author_list("")
- assert(s.get_author_list(True) == "")
- assert(s.get_author_list(False) == [""])
- s.set_author_list([])
- assert(s.get_author_list(True) == "")
- assert(s.get_author_list(False) == [""])
-
- def test_CategoryArray(self):
- """Set categories"""
- s = Song()
- assert(s.get_category_array(True) == "")
- assert(s.get_category_array(False) == [])
- t1 = "Gospel"
- s.set_category_array(t1)
- assert(s.get_category_array(True) == t1)
- assert(s.get_category_array(False) == [t1])
- s.set_category_array(" Gospel, Hymns ")
- assert(s.get_category_array(True) == "Gospel, Hymns")
- assert(s.get_category_array(False) == ["Gospel", "Hymns"])
- s.set_category_array(None)
- assert(s.get_category_array(True) == "")
- assert(s.get_category_array(False) == [])
- s.set_category_array("")
- assert(s.get_category_array(True) == "")
- assert(s.get_category_array(False) == [""])
- s.set_category_array([])
- assert(s.get_category_array(True) == "")
- assert(s.get_category_array(False) == [""])
-
-if '__main__' == __name__:
- r = Test_Basic()
- r.test_asString()
+# -*- 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, Carsten Tinggaard
+
+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 py.test
+import os
+import sys
+
+__ThisDir__ = os.path.dirname(__file__)
+if "" == __ThisDir__ :
+ __ThisDir__ = os.path.abspath(u'.')
+
+sys.path.append(os.path.abspath(u'%s/../../../.."%__ThisDir__))
+
+from openlp.plugins.songs.lib.songxml import *
+
+class Test_Basic(object):
+ """Class for first initialization check
+ set-get functions
+ """
+
+ def test_Creation(self):
+ """Init: Create as empty"""
+ s = Song()
+ assert(True)
+
+ def test_Title1(self):
+ """Set an empty title - raises an exception"""
+ s = Song()
+ py.test.raises(SongTitleError, s.set_title, "')
+
+ def test_Title2(self):
+ """Set a normal title"""
+ s = Song()
+ t = "A normal title"
+ s.set_title(t)
+ assert(s.get_title() == t)
+ assert(s.get_search_title() == t)
+
+ def test_Title3(self):
+ """Set a titel with punctuation 1"""
+ s = Song()
+ t1 = "Hey! Come on, ya programmers*"
+ t2 = "Hey Come on ya programmers"
+ s.set_title(t1)
+ assert(s.get_title() == t1)
+ assert(s.get_search_title() == t2)
+
+ def test_Title4(self):
+ """Set a titel with punctuation 2"""
+ s = Song()
+ t1 = "??#Hey! Come on, ya programmers*"
+ t2 = "Hey Come on ya programmers"
+ s.set_title(t1)
+ assert(s.get_title() == t1)
+ assert(s.get_search_title() == t2)
+
+ def test_Title5(self):
+ """Set a title, where searchable title becomes empty - raises an exception"""
+ s = Song()
+ py.test.raises(SongTitleError, s.set_title, ",*')
+
+ def test_Copyright(self):
+ """Set a copyright string"""
+ s = Song()
+ assert(s.get_copyright() == "')
+ s.set_copyright(u'A B Car')
+ assert(s.get_copyright() == "A B Car')
+
+ def test_SongCclino(self):
+ """Set a SongCcliNo"""
+ s = Song()
+ assert(s.get_song_cclino() == "')
+ s.set_song_cclino(12345)
+ assert(s.get_song_cclino() == "12345')
+
+ def test_SongBook(self):
+ """Set a songbook value"""
+ s = Song()
+ assert(s.get_song_book() == "')
+ s.set_song_book(u'Hymns')
+ assert(s.get_song_book() == "Hymns')
+
+ def test_SongNumber(self):
+ """Set a song number"""
+ s = Song()
+ assert(s.get_song_number() == "')
+ s.set_song_number(278)
+ assert(s.get_song_number() == "278')
+
+ def test_Theme(self):
+ """Set a theme name"""
+ s = Song()
+ assert(s.get_theme() == "')
+ s.set_theme(u'Red')
+ assert(s.get_theme() == "Red')
+
+ def test_VerseOrder(self):
+ """Set a verse order"""
+ s = Song()
+ assert(s.get_verse_order() == "')
+ s.set_verse_order(u'V1 C V2')
+ assert(s.get_verse_order() == "V1 C V2')
+
+ def test_Comments(self):
+ """Set a comment"""
+ s = Song()
+ assert(s.get_comments() == "')
+ s.set_comments(u'a comment')
+ assert(s.get_comments() == "a comment')
+
+ def test_AuthorList(self):
+ """Set author lists"""
+ s = Song()
+ assert(s.get_author_list(True) == "')
+ assert(s.get_author_list(False) == [])
+ t1 = "John Newton"
+ s.set_author_list(t1)
+ assert(s.get_author_list(True) == t1)
+ assert(s.get_author_list(False) == [t1])
+ s.set_author_list(u' Peter Done , John Newton')
+ assert(s.get_author_list(True)== "Peter Done, John Newton')
+ assert(s.get_author_list(False) == ["Peter Done", u'John Newton"])
+ s.set_author_list(None)
+ assert(s.get_author_list(True) == "')
+ assert(s.get_author_list(False) == [])
+ s.set_author_list(u'')
+ assert(s.get_author_list(True) == "')
+ assert(s.get_author_list(False) == [""])
+ s.set_author_list([])
+ assert(s.get_author_list(True) == "')
+ assert(s.get_author_list(False) == [""])
+
+ def test_CategoryArray(self):
+ """Set categories"""
+ s = Song()
+ assert(s.get_category_array(True) == "')
+ assert(s.get_category_array(False) == [])
+ t1 = "Gospel"
+ s.set_category_array(t1)
+ assert(s.get_category_array(True) == t1)
+ assert(s.get_category_array(False) == [t1])
+ s.set_category_array(u' Gospel, Hymns ')
+ assert(s.get_category_array(True) == "Gospel, Hymns')
+ assert(s.get_category_array(False) == ["Gospel", u'Hymns"])
+ s.set_category_array(None)
+ assert(s.get_category_array(True) == "')
+ assert(s.get_category_array(False) == [])
+ s.set_category_array(u'')
+ assert(s.get_category_array(True) == "')
+ assert(s.get_category_array(False) == [""])
+ s.set_category_array([])
+ assert(s.get_category_array(True) == "')
+ assert(s.get_category_array(False) == [""])
+
+if '__main__' == __name__:
+ r = Test_Basic()
+ r.test_asString()
\ No newline at end of file
=== modified file 'openlp/plugins/songs/test/test_song_opensong.py'
--- openlp/plugins/songs/test/test_song_opensong.py 2009-01-06 20:10:03 +0000
+++ openlp/plugins/songs/test/test_song_opensong.py 2009-06-16 18:21:24 +0000
@@ -1,187 +1,186 @@
-# -*- coding:iso-8859-1 -*-
-# 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, Carsten Tinggaard
-
-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 os
-import sys
-
-__ThisDir__ = os.path.dirname(__file__)
-if "" == __ThisDir__ :
- __ThisDir__ = os.path.abspath(".")
-
-sys.path.append(os.path.abspath("%s/../../../.."%__ThisDir__))
-
-from openlp.plugins.songs.lib.songxml import *
-
-
-_sample1 = \
-'''<?xml version="1.0" encoding="UTF-8"?>
-<song>
- <title></title>
- <author></author>
- <copyright></copyright>
- <presentation></presentation>
- <ccli></ccli>
- <theme></theme>
- <lyrics>[V1]
-. chord line 1
- verse 1 line 1
-. chord line 2
- verse 1 line 2
-
-[V2]
- verse 2 line 1
- verse 2 line 2
-
-[V3]
- verse 3 line 1
- verse 3 line 2
-
-[C]
-. chorus chord line 1
- chorus line 1
-. chorus chord line 2
- chorus line 2</lyrics>
-</song>
-'''
-
-_sample2 = \
-'''<?xml version="1.0" encoding="UTF-8"?>
-<song>
- <title></title>
- <author></author>
- <copyright></copyright>
- <presentation></presentation>
- <ccli></ccli>
- <theme></theme>
- <lyrics>[V]
-1verse 1 line 1
-2verse 2 line 1
-3verse 3 line 1
-1verse 1 line 2
-2verse 2 line 2
-3verse 3 line 2
-
-[C]
- chorus line 1
- chorus line 2</lyrics>
-</song>
-'''
-
-_sample3 = \
-'''<?xml version="1.0" encoding="UTF-8"?>
-<song>
- <title></title>
- <author></author>
- <copyright></copyright>
- <presentation></presentation>
- <ccli></ccli>
- <theme></theme>
- <lyrics>[V]
-1verse 1 line 1
-2verse 2 line 1
-3verse 3 line 1
-1verse 1 line 2
-2verse 2 line 2
-3verse 3 line 2
-
-[C]
- chorus line 1
- chorus line 2
-
-[P]
- pre-chorus line 1
- pre-chorus line 2
- pre-chorus line 3
-
-[B]
- bridge line 1
- bridge line 2
-</lyrics>
-</song>
-'''
-
-class Test_OpenSong(object):
- """Test cases for converting from OpenSong xml format to Song"""
-
- def test_sample1(self):
- """OpenSong: handwritten sample1"""
- s = Song()
- s.from_opensong_buffer(_sample1)
- l = s.get_lyrics()
- assert(len(l) == (4*3+3))
- assert(s.get_number_of_slides() == 4)
-
- def test_sample2(self):
- """OpenSong: handwritten sample2 - with verses and chorus"""
- s = Song()
- s.from_opensong_buffer(_sample2)
- l = s.get_lyrics()
- assert(len(l) == (4*3+3))
- assert(s.get_number_of_slides() == 4)
-
- def test_sample3(self):
- """OpenSong: handwritten sample3 - with verses, chorus, bridge and pre-chorus"""
- s = Song()
- s.from_opensong_buffer(_sample3)
- l = s.get_lyrics()
- assert(len(l) == (4*3+4+5+4))
- assert(s.get_number_of_slides() == 6)
-
- def test_file1(self):
- """OpenSong: parse Amazing Grace"""
- global __ThisDir__
- s = Song()
- s.from_opensong_file("%s/data_opensong/Amazing Grace"%(__ThisDir__))
- assert(s.get_title() == "Amazing Grace")
- assert(s.get_copyright() == "1982 Jubilate Hymns Limited")
- assert(s.get_song_cclino() == "1037882")
- assert(s.get_category_array(True) == "God: Attributes")
- assert(s.get_author_list(True) == "John Newton")
- assert(s.get_verse_order() == "")
- assert(s.get_number_of_slides() == 4)
-
- def test_file2(self):
- """OpenSong: parse The Solid Rock"""
- s = Song()
- s.from_opensong_file("%s/data_opensong/The Solid Rock"%(__ThisDir__))
- assert(s.get_title() == "The Solid Rock")
- assert(s.get_copyright() == "Public Domain")
- assert(s.get_song_cclino() == "101740")
- assert(s.get_category_array(True) == "Christ: Victory, Fruit: Peace/Comfort")
- assert(s.get_author_list(True) == "Edward Mote, John B. Dykes")
- assert(s.get_verse_order() == "V1 C V2 C V3 C V4 C")
- assert(s.get_number_of_slides() == 5)
-
- def test_file3(self):
- """OpenSong: parse 'På en fjern ensom høj' (danish)"""
- #FIXME: problem with XML convert and danish characters
- s = Song()
- s.from_opensong_file("%s/data_opensong/På en fjern ensom høj"%(__ThisDir__))
- assert(s.get_title() == u"På en fjern ensom høj")
- assert(s.get_copyright() == "")
- assert(s.get_song_cclino() == "")
- assert(s.get_category_array(True) == "")
- assert(s.get_author_list(True) == "")
- assert(s.get_verse_order() == "V1 C1 V2 C2 V3 C3 V4 C4")
- assert(s.get_number_of_slides() == 8)
-
-if '__main__' == __name__:
- r = Test_OpenSong()
- r.test_file3()
-
+# -*- coding:iso-8859-1 -*-
+# 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, Carsten Tinggaard
+
+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 os
+import sys
+
+__ThisDir__ = os.path.dirname(__file__)
+if "" == __ThisDir__ :
+ __ThisDir__ = os.path.abspath(u'.')
+
+sys.path.append(os.path.abspath(u'%s/../../../.."%__ThisDir__))
+
+from openlp.plugins.songs.lib.songxml import *
+
+
+_sample1 = \
+'''<?xml version="1.0" encoding="UTF-8"?>
+<song>
+ <title></title>
+ <author></author>
+ <copyright></copyright>
+ <presentation></presentation>
+ <ccli></ccli>
+ <theme></theme>
+ <lyrics>[V1]
+. chord line 1
+ verse 1 line 1
+. chord line 2
+ verse 1 line 2
+
+[V2]
+ verse 2 line 1
+ verse 2 line 2
+
+[V3]
+ verse 3 line 1
+ verse 3 line 2
+
+[C]
+. chorus chord line 1
+ chorus line 1
+. chorus chord line 2
+ chorus line 2</lyrics>
+</song>
+'''
+
+_sample2 = \
+'''<?xml version="1.0" encoding="UTF-8"?>
+<song>
+ <title></title>
+ <author></author>
+ <copyright></copyright>
+ <presentation></presentation>
+ <ccli></ccli>
+ <theme></theme>
+ <lyrics>[V]
+1verse 1 line 1
+2verse 2 line 1
+3verse 3 line 1
+1verse 1 line 2
+2verse 2 line 2
+3verse 3 line 2
+
+[C]
+ chorus line 1
+ chorus line 2</lyrics>
+</song>
+'''
+
+_sample3 = \
+'''<?xml version="1.0" encoding="UTF-8"?>
+<song>
+ <title></title>
+ <author></author>
+ <copyright></copyright>
+ <presentation></presentation>
+ <ccli></ccli>
+ <theme></theme>
+ <lyrics>[V]
+1verse 1 line 1
+2verse 2 line 1
+3verse 3 line 1
+1verse 1 line 2
+2verse 2 line 2
+3verse 3 line 2
+
+[C]
+ chorus line 1
+ chorus line 2
+
+[P]
+ pre-chorus line 1
+ pre-chorus line 2
+ pre-chorus line 3
+
+[B]
+ bridge line 1
+ bridge line 2
+</lyrics>
+</song>
+'''
+
+class Test_OpenSong(object):
+ """Test cases for converting from OpenSong xml format to Song"""
+
+ def test_sample1(self):
+ """OpenSong: handwritten sample1"""
+ s = Song()
+ s.from_opensong_buffer(_sample1)
+ l = s.get_lyrics()
+ assert(len(l) == (4*3+3))
+ assert(s.get_number_of_slides() == 4)
+
+ def test_sample2(self):
+ """OpenSong: handwritten sample2 - with verses and chorus"""
+ s = Song()
+ s.from_opensong_buffer(_sample2)
+ l = s.get_lyrics()
+ assert(len(l) == (4*3+3))
+ assert(s.get_number_of_slides() == 4)
+
+ def test_sample3(self):
+ """OpenSong: handwritten sample3 - with verses, chorus, bridge and pre-chorus"""
+ s = Song()
+ s.from_opensong_buffer(_sample3)
+ l = s.get_lyrics()
+ assert(len(l) == (4*3+4+5+4))
+ assert(s.get_number_of_slides() == 6)
+
+ def test_file1(self):
+ """OpenSong: parse Amazing Grace"""
+ global __ThisDir__
+ s = Song()
+ s.from_opensong_file(u'%s/data_opensong/Amazing Grace"%(__ThisDir__))
+ assert(s.get_title() == "Amazing Grace')
+ assert(s.get_copyright() == "1982 Jubilate Hymns Limited')
+ assert(s.get_song_cclino() == "1037882')
+ assert(s.get_category_array(True) == "God: Attributes')
+ assert(s.get_author_list(True) == "John Newton')
+ assert(s.get_verse_order() == "')
+ assert(s.get_number_of_slides() == 4)
+
+ def test_file2(self):
+ """OpenSong: parse The Solid Rock"""
+ s = Song()
+ s.from_opensong_file(u'%s/data_opensong/The Solid Rock"%(__ThisDir__))
+ assert(s.get_title() == "The Solid Rock')
+ assert(s.get_copyright() == "Public Domain')
+ assert(s.get_song_cclino() == "101740')
+ assert(s.get_category_array(True) == "Christ: Victory, Fruit: Peace/Comfort')
+ assert(s.get_author_list(True) == "Edward Mote, John B. Dykes')
+ assert(s.get_verse_order() == "V1 C V2 C V3 C V4 C')
+ assert(s.get_number_of_slides() == 5)
+
+ def test_file3(self):
+ """OpenSong: parse 'På en fjern ensom høj' (danish)"""
+ #FIXME: problem with XML convert and danish characters
+ s = Song()
+ s.from_opensong_file(u'%s/data_opensong/På en fjern ensom høj"%(__ThisDir__))
+ assert(s.get_title() == u"På en fjern ensom høj')
+ assert(s.get_copyright() == "')
+ assert(s.get_song_cclino() == "')
+ assert(s.get_category_array(True) == "')
+ assert(s.get_author_list(True) == "')
+ assert(s.get_verse_order() == "V1 C1 V2 C2 V3 C3 V4 C4')
+ assert(s.get_number_of_slides() == 8)
+
+if '__main__' == __name__:
+ r = Test_OpenSong()
+ r.test_file3()
\ No newline at end of file
=== modified file 'openlp/plugins/songs/test/test_song_text.py'
--- openlp/plugins/songs/test/test_song_text.py 2009-01-06 20:10:03 +0000
+++ openlp/plugins/songs/test/test_song_text.py 2009-06-16 18:21:24 +0000
@@ -1,61 +1,60 @@
-# -*- coding:iso-8859-1 -*-
-# 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, Carsten Tinggaard
-
-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 os
-import sys
-
-__ThisDir__ = os.path.dirname(__file__)
-if "" == __ThisDir__ :
- __ThisDir__ = os.path.abspath(".")
-
-sys.path.append(os.path.abspath("%s/../../../.."%__ThisDir__))
-
-from openlp.plugins.songs.lib.songxml import *
-
-class Test_Text(object):
- """Test cases for converting from text format to Song"""
-
- def test_file1(self):
- """OpenSong: parse CCLI example"""
- global __ThisDir__
- s = Song()
- s.from_ccli_text_file("%s/data_text/CCLI example.txt"%(__ThisDir__))
- assert(s.get_title() == "Song Title Here")
- assert(s.get_author_list(True) == "Author, artist name")
- assert(s.get_copyright() == "1996 Publisher Info")
- assert(s.get_song_cclino() == "1234567")
- assert(s.get_number_of_slides() == 4)
-
- def test_file2(self):
- """OpenSong: parse PåEnFjern (danish)"""
- global __ThisDir__
- s = Song()
- s.from_ccli_text_file("%s/data_text/PåEnFjern.txt"%(__ThisDir__))
- assert(s.get_title() == "På en fjern ensom høj")
- assert(s.get_author_list(True) == "Georg Bennard")
- assert(s.get_copyright() == "")
- assert(s.get_song_cclino() == "")
- assert(s.get_number_of_slides() == 8)
-
-if '__main__' == __name__:
- # for local debugging
- r = Test_Text()
- r.test_file1()
- r.test_file2()
-
+# -*- coding:iso-8859-1 -*-
+# 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, Carsten Tinggaard
+
+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 os
+import sys
+
+__ThisDir__ = os.path.dirname(__file__)
+if "" == __ThisDir__ :
+ __ThisDir__ = os.path.abspath(u'.')
+
+sys.path.append(os.path.abspath(u'%s/../../../.."%__ThisDir__))
+
+from openlp.plugins.songs.lib.songxml import *
+
+class Test_Text(object):
+ """Test cases for converting from text format to Song"""
+
+ def test_file1(self):
+ """OpenSong: parse CCLI example"""
+ global __ThisDir__
+ s = Song()
+ s.from_ccli_text_file(u'%s/data_text/CCLI example.txt"%(__ThisDir__))
+ assert(s.get_title() == "Song Title Here')
+ assert(s.get_author_list(True) == "Author, artist name')
+ assert(s.get_copyright() == "1996 Publisher Info')
+ assert(s.get_song_cclino() == "1234567')
+ assert(s.get_number_of_slides() == 4)
+
+ def test_file2(self):
+ """OpenSong: parse PåEnFjern (danish)"""
+ global __ThisDir__
+ s = Song()
+ s.from_ccli_text_file(u'%s/data_text/PåEnFjern.txt"%(__ThisDir__))
+ assert(s.get_title() == "På en fjern ensom høj')
+ assert(s.get_author_list(True) == "Georg Bennard')
+ assert(s.get_copyright() == "')
+ assert(s.get_song_cclino() == "')
+ assert(s.get_number_of_slides() == 8)
+
+if '__main__' == __name__:
+ # for local debugging
+ r = Test_Text()
+ r.test_file1()
+ r.test_file2()
\ No newline at end of file
=== modified file 'openlp/plugins/songs/test/test_song_verse.py'
--- openlp/plugins/songs/test/test_song_verse.py 2009-01-06 20:10:03 +0000
+++ openlp/plugins/songs/test/test_song_verse.py 2009-06-16 18:21:24 +0000
@@ -1,152 +1,152 @@
-# -*- coding:iso-8859-1 -*-
-# 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, Carsten Tinggaard
-
-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 py.test
-import os
-import sys
-
-__ThisDir__ = os.path.dirname(__file__)
-if "" == __ThisDir__ :
- __ThisDir__ = os.path.abspath(".")
-
-sys.path.append(os.path.abspath("%s/../../../.."%__ThisDir__))
-
-from openlp.plugins.songs.lib.songxml import *
-
-class Test_Verse(object):
- """Class for testing verses for preview and review"""
-
- def stdSong(self):
- """Definition of a standard song"""
- s = Song()
- self.title = "A song"
- self.author = "John Newton"
- self.copyright = "Peter Hamil"
- self.ccli = "123456"
- s.set_lyrics(["# verse","a single line"])
- s.set_title(self.title)
- s.set_copyright(self.copyright)
- s.set_author_list(self.author)
- s.set_song_cclino(self.ccli)
- return s
-
- def check_allfields(self, r, isblank = 0):
- #[theme, title, author, cpright, ccli, lyrics]
- if isblank == 1 :
- assert(r[1] == "")
- else :
- assert(r[1] == self.title)
- if isblank == 2 :
- assert(r[2] == "")
- else :
- assert(r[2] == self.author)
- if isblank == 3 :
- assert(r[3] == "")
- else :
- assert(r[3] == self.copyright)
- if isblank == 4 :
- assert(r[4] == "")
- else :
- assert(r[4] == self.ccli)
-
-
- def test_title_show_noshow(self):
- """Test the show title flag"""
- s = self.stdSong()
- r = s.get_render_slide(1)
- self.check_allfields(r)
- s.set_show_title(False)
- r = s.get_render_slide(1)
- self.check_allfields(r, 1)
- s.set_show_title(True)
- r = s.get_render_slide(1)
- self.check_allfields(r)
-
- def test_author_show_noshow(self):
- """Test the show author flag"""
- s = self.stdSong()
- r = s.get_render_slide(1)
- self.check_allfields(r)
- s.set_show_author_list(False)
- r = s.get_render_slide(1)
- self.check_allfields(r, 2)
- s.set_show_author_list(True)
- r = s.get_render_slide(1)
- self.check_allfields(r)
-
- def test_copyright_show_noshow(self):
- """Test the show copyright flag"""
- s = self.stdSong()
- r = s.get_render_slide(1)
- self.check_allfields(r)
- s.set_show_copyright(False)
- r = s.get_render_slide(1)
- self.check_allfields(r, 3)
- s.set_show_copyright(True)
- r = s.get_render_slide(1)
- self.check_allfields(r)
-
- def test_ccli_show_noshow(self):
- """Test the show copyright flag"""
- s = self.stdSong()
- r = s.get_render_slide(1)
- self.check_allfields(r)
- s.set_show_song_cclino(False)
- r = s.get_render_slide(1)
- self.check_allfields(r, 4)
- s.set_show_song_cclino(True)
- r = s.get_render_slide(1)
- self.check_allfields(r)
-
- def test_verse1(self):
- """Test an empty verse list"""
- s = Song()
- s.set_lyrics([])
- assert(s.get_number_of_slides() == 0)
-
- def test_verse2(self):
- """Test a list with an empty string"""
- s = Song()
- s.set_lyrics([""])
- assert(s.get_number_of_slides() == 0)
-
- def test_verse3a(self):
- """Test a one liner song"""
- s = Song()
- s.set_lyrics(["Single verse"])
- assert(s.get_number_of_slides() == 1)
-
- def test_verse3b(self):
- """Test a one liner song"""
- s = Song()
- s.set_lyrics(["", "Single verse"])
- assert(s.get_number_of_slides() == 1)
-
- def test_verse3c(self):
- """Test a one liner song"""
- s = Song()
- s.set_lyrics(["", "Single verse", "", ""])
- assert(s.get_number_of_slides() == 1)
-
- def test_verse3d(self):
- """Test a one liner song"""
- s = Song()
- s.set_lyrics(["", "# Verse", "", ""])
- assert(s.get_number_of_slides() == 1)
+# -*- coding:iso-8859-1 -*-
+# 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, Carsten Tinggaard
+
+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 py.test
+import os
+import sys
+
+__ThisDir__ = os.path.dirname(__file__)
+if "" == __ThisDir__ :
+ __ThisDir__ = os.path.abspath(u'.')
+
+sys.path.append(os.path.abspath(u'%s/../../../.."%__ThisDir__))
+
+from openlp.plugins.songs.lib.songxml import *
+
+class Test_Verse(object):
+ """Class for testing verses for preview and review"""
+
+ def stdSong(self):
+ """Definition of a standard song"""
+ s = Song()
+ self.title = "A song"
+ self.author = "John Newton"
+ self.copyright = "Peter Hamil"
+ self.ccli = "123456"
+ s.set_lyrics(["# verse","a single line"])
+ s.set_title(self.title)
+ s.set_copyright(self.copyright)
+ s.set_author_list(self.author)
+ s.set_song_cclino(self.ccli)
+ return s
+
+ def check_allfields(self, r, isblank = 0):
+ #[theme, title, author, cpright, ccli, lyrics]
+ if isblank == 1 :
+ assert(r[1] == "')
+ else :
+ assert(r[1] == self.title)
+ if isblank == 2 :
+ assert(r[2] == "')
+ else :
+ assert(r[2] == self.author)
+ if isblank == 3 :
+ assert(r[3] == "')
+ else :
+ assert(r[3] == self.copyright)
+ if isblank == 4 :
+ assert(r[4] == "')
+ else :
+ assert(r[4] == self.ccli)
+
+
+ def test_title_show_noshow(self):
+ """Test the show title flag"""
+ s = self.stdSong()
+ r = s.get_render_slide(1)
+ self.check_allfields(r)
+ s.set_show_title(False)
+ r = s.get_render_slide(1)
+ self.check_allfields(r, 1)
+ s.set_show_title(True)
+ r = s.get_render_slide(1)
+ self.check_allfields(r)
+
+ def test_author_show_noshow(self):
+ """Test the show author flag"""
+ s = self.stdSong()
+ r = s.get_render_slide(1)
+ self.check_allfields(r)
+ s.set_show_author_list(False)
+ r = s.get_render_slide(1)
+ self.check_allfields(r, 2)
+ s.set_show_author_list(True)
+ r = s.get_render_slide(1)
+ self.check_allfields(r)
+
+ def test_copyright_show_noshow(self):
+ """Test the show copyright flag"""
+ s = self.stdSong()
+ r = s.get_render_slide(1)
+ self.check_allfields(r)
+ s.set_show_copyright(False)
+ r = s.get_render_slide(1)
+ self.check_allfields(r, 3)
+ s.set_show_copyright(True)
+ r = s.get_render_slide(1)
+ self.check_allfields(r)
+
+ def test_ccli_show_noshow(self):
+ """Test the show copyright flag"""
+ s = self.stdSong()
+ r = s.get_render_slide(1)
+ self.check_allfields(r)
+ s.set_show_song_cclino(False)
+ r = s.get_render_slide(1)
+ self.check_allfields(r, 4)
+ s.set_show_song_cclino(True)
+ r = s.get_render_slide(1)
+ self.check_allfields(r)
+
+ def test_verse1(self):
+ """Test an empty verse list"""
+ s = Song()
+ s.set_lyrics([])
+ assert(s.get_number_of_slides() == 0)
+
+ def test_verse2(self):
+ """Test a list with an empty string"""
+ s = Song()
+ s.set_lyrics([""])
+ assert(s.get_number_of_slides() == 0)
+
+ def test_verse3a(self):
+ """Test a one liner song"""
+ s = Song()
+ s.set_lyrics(["Single verse"])
+ assert(s.get_number_of_slides() == 1)
+
+ def test_verse3b(self):
+ """Test a one liner song"""
+ s = Song()
+ s.set_lyrics(["", u'Single verse"])
+ assert(s.get_number_of_slides() == 1)
+
+ def test_verse3c(self):
+ """Test a one liner song"""
+ s = Song()
+ s.set_lyrics(["", u'Single verse", u'", u'"])
+ assert(s.get_number_of_slides() == 1)
+
+ def test_verse3d(self):
+ """Test a one liner song"""
+ s = Song()
+ s.set_lyrics(["", u'# Verse", u'", u'"])
+ assert(s.get_number_of_slides() == 1)
\ No newline at end of file
=== modified file 'openlpcnv.pyw'
--- openlpcnv.pyw 2009-05-02 19:32:15 +0000
+++ openlpcnv.pyw 2009-06-16 18:21:24 +0000
@@ -22,8 +22,8 @@
"""
"""
self.display = Display()
- self.stime = time.strftime("%Y-%m-%d-%H%M%S", time.localtime())
- self.display.output("OpenLp v1.9.0 Migration Utility Started" )
+ self.stime = time.strftime(u'%Y-%m-%d-%H%M%S", time.localtime())
+ self.display.output(u'OpenLp v1.9.0 Migration Utility Started" )
def process(self):
MigrateFiles(self.display).process()
@@ -33,13 +33,13 @@
def move_log_file(self):
fname = 'openlp-migration.log'
c = os.path.splitext(fname)
- b = (c[0]+'-'+ str(self.stime) + c[1])
- self.display.output("Logfile " +b + " generated")
- self.display.output("Migration Utility Finished ")
+ b = (c[0]+'-'+ unicode(self.stime) + c[1])
+ self.display.output(u'Logfile " +b + " generated')
+ self.display.output(u'Migration Utility Finished ')
os.rename(fname, b)
if __name__ == '__main__':
mig = Migration()
mig.process()
- #mig.move_log_file()
+ #mig.move_log_file()
\ No newline at end of file
Follow ups