forked from openlp/openlp
Merge from an old remote branch.
This commit is contained in:
commit
94cd34d333
@ -8,3 +8,4 @@
|
|||||||
|
|
||||||
lib
|
lib
|
||||||
theme
|
theme
|
||||||
|
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
|
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
@ -21,17 +23,51 @@ import types
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
def translate(context, text):
|
def translate(context, text):
|
||||||
|
"""
|
||||||
|
A special shortcut method to wrap around the Qt4 translation functions.
|
||||||
|
This abstracts the translation procedure so that we can change it if at a
|
||||||
|
later date if necessary, without having to redo the whole of OpenLP.
|
||||||
|
|
||||||
|
``context``
|
||||||
|
The translation context, used to give each string a context or a
|
||||||
|
namespace.
|
||||||
|
|
||||||
|
``text``
|
||||||
|
The text to put into the translation tables for translation.
|
||||||
|
"""
|
||||||
return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8)
|
return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8)
|
||||||
|
|
||||||
def file_to_xml(xmlfile):
|
def file_to_xml(xmlfile):
|
||||||
|
"""
|
||||||
|
Open a file and return the contents of the file.
|
||||||
|
|
||||||
|
``xmlfile``
|
||||||
|
The name of the file.
|
||||||
|
"""
|
||||||
return open(xmlfile).read()
|
return open(xmlfile).read()
|
||||||
|
|
||||||
def str_to_bool(stringvalue):
|
def str_to_bool(stringvalue):
|
||||||
|
"""
|
||||||
|
Convert a string version of a boolean into a real boolean.
|
||||||
|
|
||||||
|
``stringvalue``
|
||||||
|
The string value to examine and convert to a boolean type.
|
||||||
|
"""
|
||||||
if stringvalue is True or stringvalue is False:
|
if stringvalue is True or stringvalue is False:
|
||||||
return stringvalue
|
return stringvalue
|
||||||
return stringvalue.strip().lower() in (u'true', u'yes', u'y')
|
return stringvalue.strip().lower() in (u'true', u'yes', u'y')
|
||||||
|
|
||||||
def buildIcon(icon):
|
def buildIcon(icon):
|
||||||
|
"""
|
||||||
|
Build a QIcon instance from an existing QIcon, a resource location, or a
|
||||||
|
physical file location. If the icon is a QIcon instance, that icon is
|
||||||
|
simply returned. If not, it builds a QIcon instance from the resource or
|
||||||
|
file name.
|
||||||
|
|
||||||
|
``icon``
|
||||||
|
The icon to build. This can be a QIcon, a resource string in the form
|
||||||
|
``:/resource/file.png``, or a file location like ``/path/to/file.png``.
|
||||||
|
"""
|
||||||
ButtonIcon = None
|
ButtonIcon = None
|
||||||
if type(icon) is QtGui.QIcon:
|
if type(icon) is QtGui.QIcon:
|
||||||
ButtonIcon = icon
|
ButtonIcon = icon
|
||||||
@ -71,8 +107,7 @@ from serviceitem import ServiceItem
|
|||||||
from serviceitem import ServiceType
|
from serviceitem import ServiceType
|
||||||
from serviceitem import ServiceItem
|
from serviceitem import ServiceItem
|
||||||
from toolbar import OpenLPToolbar
|
from toolbar import OpenLPToolbar
|
||||||
from songxmlhandler import SongXMLBuilder
|
from songxmlhandler import SongXMLBuilder, SongXMLParser
|
||||||
from songxmlhandler import SongXMLParser
|
|
||||||
from themexmlhandler import ThemeXML
|
from themexmlhandler import ThemeXML
|
||||||
from renderer import Renderer
|
from renderer import Renderer
|
||||||
from rendermanager import RenderManager
|
from rendermanager import RenderManager
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008 -2009 Martin Thompson, Tim Bentley
|
Portions copyright (c) 2008 -2009 Martin Thompson, Tim Bentley
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
@ -19,6 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from openlp.core.utils import ConfigHelper
|
from openlp.core.utils import ConfigHelper
|
||||||
|
|
||||||
class PluginConfig(object):
|
class PluginConfig(object):
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley,
|
Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley,
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
|
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008 - 2009Martin Thompson, Tim Bentley
|
Portions copyright (c) 2008 - 2009Martin Thompson, Tim Bentley
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
@ -42,7 +44,7 @@ class RenderManager(object):
|
|||||||
Defaults to *0*. The index of the output/display screen.
|
Defaults to *0*. The index of the output/display screen.
|
||||||
"""
|
"""
|
||||||
global log
|
global log
|
||||||
log=logging.getLogger(u'RenderManager')
|
log = logging.getLogger(u'RenderManager')
|
||||||
log.info(u'RenderManager Loaded')
|
log.info(u'RenderManager Loaded')
|
||||||
|
|
||||||
def __init__(self, theme_manager, screen_list, screen_number=0):
|
def __init__(self, theme_manager, screen_list, screen_number=0):
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
|
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
@ -37,7 +39,7 @@ class ServiceItem(object):
|
|||||||
compositor.
|
compositor.
|
||||||
"""
|
"""
|
||||||
global log
|
global log
|
||||||
log=logging.getLogger(u'ServiceItem')
|
log = logging.getLogger(u'ServiceItem')
|
||||||
log.info(u'Service Item created')
|
log.info(u'Service Item created')
|
||||||
|
|
||||||
def __init__(self, hostplugin=None):
|
def __init__(self, hostplugin=None):
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
|
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
@ -20,8 +22,9 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
|
|
||||||
class SettingsManager(object):
|
class SettingsManager(object):
|
||||||
"""
|
"""
|
||||||
Class to control the size of the UI components so they size correctly
|
Class to control the size of the UI components so they size correctly.
|
||||||
This class is created by the main window and then calculates the size of individual components
|
This class is created by the main window and then calculates the size of
|
||||||
|
individual components.
|
||||||
"""
|
"""
|
||||||
def __init__(self, screen):
|
def __init__(self, screen):
|
||||||
self.screen = screen[0]
|
self.screen = screen[0]
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley
|
Portions copyright (c) 2008 Martin Thompson, Tim Bentley
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
@ -19,6 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import PluginConfig
|
from openlp.core.lib import PluginConfig
|
||||||
|
|
||||||
class SettingsTab(QtGui.QWidget):
|
class SettingsTab(QtGui.QWidget):
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard
|
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
@ -16,26 +18,25 @@ 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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
from xml.dom.minidom import Document
|
|
||||||
from xml.etree.ElementTree import ElementTree, XML, dump
|
|
||||||
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<song version="1.0">
|
|
||||||
<lyrics language="en">
|
|
||||||
<verse type="chorus" label="1">
|
|
||||||
<![CDATA[ ... ]]>
|
|
||||||
</verse>
|
|
||||||
</lyrics>
|
|
||||||
</song>
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from xml.dom.minidom import Document
|
from xml.dom.minidom import Document
|
||||||
from xml.etree.ElementTree import ElementTree, XML, dump
|
from xml.etree.ElementTree import ElementTree, XML, dump
|
||||||
|
|
||||||
class SongXMLBuilder():
|
class SongXMLBuilder(object):
|
||||||
"""
|
"""
|
||||||
This class builds the XML used to describe songs.
|
This class builds the XML used to describe songs.
|
||||||
|
|
||||||
|
The basic XML looks like this::
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<song version="1.0">
|
||||||
|
<lyrics language="en">
|
||||||
|
<verse type="chorus" label="1">
|
||||||
|
<![CDATA[ ... ]]>
|
||||||
|
</verse>
|
||||||
|
</lyrics>
|
||||||
|
</song>
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""
|
"""
|
||||||
@ -97,9 +98,21 @@ class SongXMLBuilder():
|
|||||||
"""
|
"""
|
||||||
return self.song_xml.toxml(u'utf-8')
|
return self.song_xml.toxml(u'utf-8')
|
||||||
|
|
||||||
class SongXMLParser():
|
|
||||||
|
class SongXMLParser(object):
|
||||||
"""
|
"""
|
||||||
A class to read in and parse a song's XML.
|
A class to read in and parse a song's XML.
|
||||||
|
|
||||||
|
The basic XML looks like this::
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<song version="1.0">
|
||||||
|
<lyrics language="en">
|
||||||
|
<verse type="chorus" label="1">
|
||||||
|
<![CDATA[ ... ]]>
|
||||||
|
</verse>
|
||||||
|
</lyrics>
|
||||||
|
</song>
|
||||||
"""
|
"""
|
||||||
global log
|
global log
|
||||||
log = logging.getLogger(u'SongXMLParser')
|
log = logging.getLogger(u'SongXMLParser')
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard
|
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2009 Raoul Snyman
|
Copyright (c) 2009 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2009 Martin Thompson, Tim Bentley
|
Portions copyright (c) 2009 Martin Thompson, Tim Bentley
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
"""
|
"""
|
||||||
OpenLP - Open Source Lyrics Projection
|
OpenLP - Open Source Lyrics Projection
|
||||||
|
|
||||||
Copyright (c) 2008 Raoul Snyman
|
Copyright (c) 2008 Raoul Snyman
|
||||||
|
|
||||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Carsten Tinggaard
|
Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Carsten Tinggaard
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
|
Loading…
Reference in New Issue
Block a user