forked from openlp/openlp
Merge from an old remote branch.
This commit is contained in:
commit
94cd34d333
@ -8,3 +8,4 @@
|
||||
|
||||
lib
|
||||
theme
|
||||
|
||||
|
@ -2,7 +2,9 @@
|
||||
# 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
|
||||
@ -21,17 +23,51 @@ import types
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
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)
|
||||
|
||||
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()
|
||||
|
||||
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:
|
||||
return stringvalue
|
||||
return stringvalue.strip().lower() in (u'true', u'yes', u'y')
|
||||
|
||||
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
|
||||
if type(icon) is QtGui.QIcon:
|
||||
ButtonIcon = icon
|
||||
@ -71,8 +107,7 @@ from serviceitem import ServiceItem
|
||||
from serviceitem import ServiceType
|
||||
from serviceitem import ServiceItem
|
||||
from toolbar import OpenLPToolbar
|
||||
from songxmlhandler import SongXMLBuilder
|
||||
from songxmlhandler import SongXMLParser
|
||||
from songxmlhandler import SongXMLBuilder, SongXMLParser
|
||||
from themexmlhandler import ThemeXML
|
||||
from renderer import Renderer
|
||||
from rendermanager import RenderManager
|
||||
|
@ -2,7 +2,9 @@
|
||||
# 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
|
||||
@ -19,6 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from openlp.core.utils import ConfigHelper
|
||||
|
||||
class PluginConfig(object):
|
||||
|
@ -2,7 +2,9 @@
|
||||
# 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
|
||||
|
@ -2,7 +2,9 @@
|
||||
# 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
|
||||
|
@ -2,7 +2,9 @@
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
|
||||
Portions copyright (c) 2008 - 2009Martin Thompson, Tim Bentley
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
|
@ -2,7 +2,9 @@
|
||||
# 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
|
||||
|
@ -2,7 +2,9 @@
|
||||
# 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
|
||||
@ -20,8 +22,9 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
class SettingsManager(object):
|
||||
"""
|
||||
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
|
||||
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.
|
||||
"""
|
||||
def __init__(self, screen):
|
||||
self.screen = screen[0]
|
||||
|
@ -2,7 +2,9 @@
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
|
||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
@ -19,6 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import PluginConfig
|
||||
|
||||
class SettingsTab(QtGui.QWidget):
|
||||
|
@ -2,7 +2,9 @@
|
||||
# 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, Carsten Tinggaard
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
@ -16,9 +18,17 @@ PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
import logging
|
||||
from xml.dom.minidom import Document
|
||||
from xml.etree.ElementTree import ElementTree, XML, dump
|
||||
|
||||
class SongXMLBuilder(object):
|
||||
"""
|
||||
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">
|
||||
@ -27,15 +37,6 @@ from xml.etree.ElementTree import ElementTree, XML, dump
|
||||
</verse>
|
||||
</lyrics>
|
||||
</song>
|
||||
|
||||
"""
|
||||
import logging
|
||||
from xml.dom.minidom import Document
|
||||
from xml.etree.ElementTree import ElementTree, XML, dump
|
||||
|
||||
class SongXMLBuilder():
|
||||
"""
|
||||
This class builds the XML used to describe songs.
|
||||
"""
|
||||
def __init__(self):
|
||||
"""
|
||||
@ -97,9 +98,21 @@ class SongXMLBuilder():
|
||||
"""
|
||||
return self.song_xml.toxml(u'utf-8')
|
||||
|
||||
class SongXMLParser():
|
||||
|
||||
class SongXMLParser(object):
|
||||
"""
|
||||
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
|
||||
log = logging.getLogger(u'SongXMLParser')
|
||||
|
@ -2,7 +2,9 @@
|
||||
# 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, Carsten Tinggaard
|
||||
|
||||
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
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
|
||||
Copyright (c) 2009 Raoul Snyman
|
||||
|
||||
Portions copyright (c) 2009 Martin Thompson, Tim Bentley
|
||||
|
||||
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
|
||||
"""
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user