diff --git a/openlp.pyw b/openlp.pyw index fb8eff2ed..5ec730e22 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -100,7 +100,7 @@ class OpenLP(QtGui.QApplication): ) else: log.info(u'Openlp version %s' % app_version[u'version']) - except: + except IOError: log.exception('Error in version file.') app_version = { u'full': u'1.9.0-bzr000', diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 3794afde0..d5b46e6cb 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -173,7 +173,6 @@ from settingsmanager import SettingsManager from plugin import PluginStatus, Plugin from pluginmanager import PluginManager from settingstab import SettingsTab -from mediamanageritem import MediaManagerItem from xmlrootclass import XmlRootClass from serviceitem import ServiceItem from serviceitem import ServiceItemType @@ -184,4 +183,6 @@ from songxmlhandler import SongXMLBuilder, SongXMLParser from themexmlhandler import ThemeXML from renderer import Renderer from rendermanager import RenderManager +from mediamanageritem import MediaManagerItem +from basemodel import BaseModel from baselistwithdnd import BaseListWithDnD diff --git a/openlp/core/lib/basemodel.py b/openlp/core/lib/basemodel.py new file mode 100644 index 000000000..f56336c7b --- /dev/null +++ b/openlp/core/lib/basemodel.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2010 Raoul Snyman # +# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin # +# Thompson, Jon Tibble, 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 # +############################################################################### + +class BaseModel(object): + """ + BaseModel provides a base object with a set of generic functions + """ + + @classmethod + def populate(cls, **kwargs): + """ + Creates an instance of a class and populates it, returning the instance + """ + me = cls() + for key in kwargs: + me.__setattr__(key, kwargs[key]) + return me + diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index b1429770a..8bfefceb0 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -23,15 +23,14 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +import logging import types import os from PyQt4 import QtCore, QtGui -from openlp.core.lib.toolbar import * from openlp.core.lib import contextMenuAction, contextMenuSeparator, \ - SettingsManager -from serviceitem import ServiceItem + SettingsManager, OpenLPToolbar, ServiceItem, build_icon log = logging.getLogger(__name__) @@ -336,8 +335,8 @@ class MediaManagerItem(QtGui.QWidget): log.info(u'New files(s) %s', unicode(files)) if files: self.loadList(files) - dir = os.path.split(unicode(files[0]))[0] - SettingsManager.set_last_dir(self.settingsSection, dir) + lastDir = os.path.split(unicode(files[0]))[0] + SettingsManager.set_last_dir(self.settingsSection, lastDir) SettingsManager.set_list(self.settingsSection, self.settingsSection, self.getFileList()) diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index fe48ccf0a..95bf3971c 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -38,30 +38,32 @@ class PluginManager(object): """ log.info(u'Plugin manager loaded') - def __init__(self, dir): + def __init__(self, plugin_dir): """ The constructor for the plugin manager. Passes the controllers on to the plugins for them to interact with via their ServiceItems. - ``dir`` + ``plugin_dir`` The directory to search for plugins. """ log.info(u'Plugin manager initing') - if not dir in sys.path: - log.debug(u'Inserting %s into sys.path', dir) - sys.path.insert(0, dir) - self.basepath = os.path.abspath(dir) + if not plugin_dir in sys.path: + log.debug(u'Inserting %s into sys.path', plugin_dir) + sys.path.insert(0, plugin_dir) + self.basepath = os.path.abspath(plugin_dir) log.debug(u'Base path %s ', self.basepath) + self.plugin_helpers = [] self.plugins = [] - # this has to happen after the UI is sorted self.find_plugins(dir) + # this has to happen after the UI is sorted + # self.find_plugins(plugin_dir) log.info(u'Plugin manager Initialised') - def find_plugins(self, dir, plugin_helpers): + def find_plugins(self, plugin_dir, plugin_helpers): """ - Scan the directory ``dir`` for objects inheriting from the ``Plugin`` - class. + Scan the directory ``plugin_dir`` for objects inheriting from the + ``Plugin`` class. - ``dir`` + ``plugin_dir`` The directory to scan. ``plugin_helpers`` @@ -69,10 +71,11 @@ class PluginManager(object): """ self.plugin_helpers = plugin_helpers - startdepth = len(os.path.abspath(dir).split(os.sep)) - log.debug(u'find plugins %s at depth %d', unicode(dir), startdepth) + startdepth = len(os.path.abspath(plugin_dir).split(os.sep)) + log.debug(u'finding plugins in %s at depth %d', + unicode(plugin_dir), startdepth) - for root, dirs, files in os.walk(dir): + for root, dirs, files in os.walk(plugin_dir): for name in files: if name.endswith(u'.py') and not name.startswith(u'__'): path = os.path.abspath(os.path.join(root, name)) @@ -80,7 +83,7 @@ class PluginManager(object): if thisdepth - startdepth > 2: # skip anything lower down continue - modulename, pyext = os.path.splitext(path) + modulename = os.path.splitext(path)[0] prefix = os.path.commonprefix([self.basepath, path]) # hack off the plugin base path modulename = modulename[len(prefix) + 1:] @@ -91,8 +94,8 @@ class PluginManager(object): try: __import__(modulename, globals(), locals(), []) except ImportError, e: - log.exception(u'Failed to import module %s on path %s for reason %s', - modulename, path, e.args[0]) + log.exception(u'Failed to import module %s on path %s ' + 'for reason %s', modulename, path, e.args[0]) plugin_classes = Plugin.__subclasses__() plugin_objects = [] for p in plugin_classes: @@ -214,3 +217,4 @@ class PluginManager(object): if plugin.is_active(): plugin.finalise() log.info(u'Finalisation Complete for %s ' % plugin.name) + diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 55c66a809..55700ebac 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -189,7 +189,8 @@ class Renderer(object): pos = split_text.rfind(u' ') #no more spaces and we are still too long if pos == -1: - while metrics.width(split_text, -1) > line_width: + while \ + metrics.width(split_text, -1) > line_width: split_text = split_text[:-1] pos = len(split_text) else: @@ -199,12 +200,14 @@ class Renderer(object): #if we have more text add up to 10 spaces on the front. if line and self._theme.font_main_indentation > 0: line = u'%s%s' % \ - (u' '[:int(self._theme.font_main_indentation)], line) + (u' '[:int(self._theme.font_main_indentation)], + line) #Text fits in a line now for count, line in enumerate(split_lines): page.append(line) #last but one line and only 2 lines to go or end of page - if (len(page) == page_length - 1 and len(split_lines) - 3 == count) or \ + if (len(page) == page_length - 1 and + len(split_lines) - 3 == count) or \ len(page) == page_length: split_pages.append(page) page = [] @@ -559,7 +562,8 @@ class Renderer(object): self.painter.drawText(x, rowpos, line) if self._theme.display_slideTransition: # Print 2nd image with 70% weight - if self._theme.display_outline and outline_size != 0 and not footer: + if self._theme.display_outline and outline_size != 0 and \ + not footer: path = QtGui.QPainterPath() path.addText(QtCore.QPointF(x, rowpos), font, line) self.painter2.setBrush(self.painter2.pen().brush()) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index e811529db..431f74564 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -181,7 +181,8 @@ class RenderManager(object): footer.append(u'CCLI 123456') formatted = self.renderer.format_slide(verse, False) #Only Render the first slide page returned - return self.renderer.generate_frame_from_lines(formatted[0], footer)[u'main'] + return self.renderer.generate_frame_from_lines(formatted[0], + footer)[u'main'] def format_slide(self, words): """ diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index d6b987db4..b3d16595e 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -172,11 +172,12 @@ class SettingsManager(object): path = os.path.join(path, section) try: files = os.listdir(path) - except: + except OSError: return [] if extension: - return [file for file in files - if extension == os.path.splitext(file)[1]] + return [filename for filename in files + if extension == os.path.splitext(filename)[1]] else: # no filtering required return files + diff --git a/openlp/core/lib/songxmlhandler.py b/openlp/core/lib/songxmlhandler.py index 4b0a26d7b..acb75609b 100644 --- a/openlp/core/lib/songxmlhandler.py +++ b/openlp/core/lib/songxmlhandler.py @@ -24,8 +24,10 @@ ############################################################################### import logging + from xml.dom.minidom import Document from xml.etree.ElementTree import ElementTree, XML, dump +from xml.parsers.expat import ExpatError log = logging.getLogger(__name__) @@ -136,7 +138,7 @@ class SongXMLParser(object): try: self.song_xml = ElementTree( element=XML(unicode(xml).encode('unicode-escape'))) - except: + except ExpatError: log.exception(u'Invalid xml %s', xml) def get_verses(self): @@ -144,9 +146,9 @@ class SongXMLParser(object): Iterates through the verses in the XML and returns a list of verses and their attributes. """ - iter = self.song_xml.getiterator() + xml_iter = self.song_xml.getiterator() verse_list = [] - for element in iter: + for element in xml_iter: if element.tag == u'verse': if element.text is None: element.text = u'' diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index b3cfb0307..a6d1ec186 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -30,7 +30,7 @@ from xml.etree.ElementTree import ElementTree, XML from openlp.core.lib import str_to_bool -blankthemexml = \ +BLANK_THEME_XML = \ ''' BlankStyle @@ -97,7 +97,8 @@ class ThemeXML(object): """ if self.background_filename and path: self.theme_name = self.theme_name.rstrip().lstrip() - self.background_filename = self.background_filename.rstrip().lstrip() + self.background_filename = \ + self.background_filename.rstrip().lstrip() self.background_filename = os.path.join(path, self.theme_name, self.background_filename) @@ -244,7 +245,8 @@ class ThemeXML(object): background.appendChild(element) def add_display(self, shadow, shadow_color, outline, outline_color, - horizontal, vertical, wrap, transition, shadow_pixel=5, outline_pixel=2): + horizontal, vertical, wrap, transition, shadow_pixel=5, + outline_pixel=2): """ Add a Display options. @@ -349,13 +351,12 @@ class ThemeXML(object): """ self.base_parse_xml() self.parse_xml(xml) - self.theme_filename_extended = False def base_parse_xml(self): """ Pull in the blank theme XML as a starting point. """ - self.parse_xml(blankthemexml) + self.parse_xml(BLANK_THEME_XML) def parse_xml(self, xml): """ @@ -365,9 +366,9 @@ class ThemeXML(object): The XML string to parse. """ theme_xml = ElementTree(element=XML(xml)) - iter = theme_xml.getiterator() + xml_iter = theme_xml.getiterator() master = u'' - for element in iter: + for element in xml_iter: element.text = unicode(element.text).decode('unicode-escape') if element.getchildren(): master = element.tag + u'_' @@ -409,3 +410,4 @@ class ThemeXML(object): if key[0:1] != u'_': theme_strings.append(u'%30s: %s' % (key, getattr(self, key))) return u'\n'.join(theme_strings) + diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index a1af42736..12916097e 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -120,7 +120,7 @@ class OpenLPToolbar(QtGui.QToolBar): try: if self.icons[title]: return self.icons[title] - except: + except NameError: log.exception(u'getIconFromTitle - no icon for %s' % title) return QtGui.QIcon() diff --git a/openlp/core/lib/xmlrootclass.py b/openlp/core/lib/xmlrootclass.py index 017d365c2..9b58a6f03 100644 --- a/openlp/core/lib/xmlrootclass.py +++ b/openlp/core/lib/xmlrootclass.py @@ -52,8 +52,8 @@ class XmlRootClass(object): The root tag of the xml. """ root = ElementTree(element=XML(xml)) - iter = root.getiterator() - for element in iter: + xml_iter = root.getiterator() + for element in xml_iter: if element.tag != root_tag: text = element.text if type(text) is NoneType: @@ -76,7 +76,8 @@ class XmlRootClass(object): # Ok, it seems to be a string. val = text if hasattr(self, u'post_tag_hook'): - (element.tag, val) = self.post_tag_hook(element.tag, val) + (element.tag, val) = \ + self.post_tag_hook(element.tag, val) setattr(self, element.tag, val) def __str__(self): @@ -90,7 +91,8 @@ class XmlRootClass(object): attributes = [] for attrib in dir(self): if not attrib.startswith(u'_'): - attributes.append(u'%30s : %s' % (attrib, getattr(self, attrib))) + attributes.append( + u'%30s : %s' % (attrib, getattr(self, attrib))) return u'\n'.join(attributes) def _get_as_string(self): diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index 501a7c33e..f63ee4c26 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -28,13 +28,13 @@ import types from xml.etree.ElementTree import ElementTree, XML from PyQt4 import QtGui -DelphiColors = {"clRed":0xFF0000, - "clBlue":0x0000FF, - "clYellow":0xFFFF00, - "clBlack":0x000000, - "clWhite":0xFFFFFF} +DELPHI_COLORS = {"clRed":0xFF0000, + "clBlue":0x0000FF, + "clYellow":0xFFFF00, + "clBlack":0x000000, + "clWhite":0xFFFFFF} -blankstylexml = \ +BLANK_STYLE_XML = \ ''' BlankStyle @@ -97,7 +97,7 @@ class Theme(object): 1 - lyrics """ # init to defaults - self._set_from_XML(blankstylexml) + self._set_from_XML(BLANK_STYLE_XML) self._set_from_XML(xml) def _get_as_string(self): @@ -115,26 +115,27 @@ class Theme(object): for element in iter: delphiColorChange = False if element.tag != u'Theme': - t = element.text + element_text = element.text val = 0 # easy! - if type(t) == type(None): - val = t + if element_text is None: + val = element_text # strings need special handling to sort the colours out - if type(t) is types.StringType or type(t) is types.UnicodeType: - if t[0] == u'$': # might be a hex number + if type(element_text) is types.StringType or \ + type(element_text) is types.UnicodeType: + if element_text[0] == u'$': # might be a hex number try: - val = int(t[1:], 16) + val = int(element_text[1:], 16) except ValueError: # nope pass - elif DelphiColors.has_key(t): - val = DelphiColors[t] + elif DELPHI_COLORS.has_key(element_text): + val = DELPHI_COLORS[element_text] delphiColorChange = True else: try: - val = int(t) + val = int(element_text) except ValueError: - val = t + val = element_text if (element.tag.find(u'Color') > 0 or (element.tag.find(u'BackgroundParameter') == 0 and type(val) == type(0))): diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index a4bc72cca..90a67667e 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -132,7 +132,8 @@ class Ui_AboutDialog(object): u'consider contributing by using the button below.' )) self.AboutNotebook.setTabText( - self.AboutNotebook.indexOf(self.AboutTab), + + self.AboutNotebook.indexOf(self.AboutTab), translate(u'AboutForm', u'About')) self.CreditsTextEdit.setPlainText(translate(u'AboutForm', u'Project Lead\n' diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index c5994a9ec..933a12b56 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -58,5 +58,6 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog): Launch a web browser and go to the contribute page on the site. """ import webbrowser - url = u'http://www.openlp.org/en/documentation/introduction/contributing.html' + url = u'http://www.openlp.org/en/documentation/introduction/' \ + + u'contributing.html' webbrowser.open_new(url) diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index 636975726..283d6f3b4 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -24,8 +24,8 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon -from openlp.core.lib import translate + +from openlp.core.lib import build_icon, translate class Ui_AmendThemeDialog(object): def setupUi(self, AmendThemeDialog): @@ -68,45 +68,56 @@ class Ui_AmendThemeDialog(object): self.BackgroundLayout.setObjectName(u'BackgroundLayout') self.BackgroundLabel = QtGui.QLabel(self.BackgroundTab) self.BackgroundLabel.setObjectName(u'BackgroundLabel') - self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.BackgroundLabel) + self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.BackgroundLabel) self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab) 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.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.BackgroundComboBox) self.BackgroundTypeLabel = QtGui.QLabel(self.BackgroundTab) self.BackgroundTypeLabel.setObjectName(u'BackgroundTypeLabel') - self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.BackgroundTypeLabel) + self.BackgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.BackgroundTypeLabel) self.BackgroundTypeComboBox = QtGui.QComboBox(self.BackgroundTab) 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.BackgroundLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.BackgroundTypeComboBox) self.Color1Label = QtGui.QLabel(self.BackgroundTab) self.Color1Label.setObjectName(u'Color1Label') - self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.Color1Label) + self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, + self.Color1Label) self.Color1PushButton = QtGui.QPushButton(self.BackgroundTab) self.Color1PushButton.setObjectName(u'Color1PushButton') - self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.Color1PushButton) + self.BackgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + self.Color1PushButton) self.Color2Label = QtGui.QLabel(self.BackgroundTab) self.Color2Label.setObjectName(u'Color2Label') - self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.Color2Label) + self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, + self.Color2Label) self.Color2PushButton = QtGui.QPushButton(self.BackgroundTab) self.Color2PushButton.setObjectName(u'Color2PushButton') - self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.Color2PushButton) + self.BackgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, + self.Color2PushButton) self.ImageLabel = QtGui.QLabel(self.BackgroundTab) self.ImageLabel.setObjectName(u'ImageLabel') - self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.ImageLabel) + self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, + self.ImageLabel) self.GradientLabel = QtGui.QLabel(self.BackgroundTab) self.GradientLabel.setObjectName(u'GradientLabel') - self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.GradientLabel) + self.BackgroundLayout.setWidget(6, QtGui.QFormLayout.LabelRole, + self.GradientLabel) self.GradientComboBox = QtGui.QComboBox(self.BackgroundTab) 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.BackgroundLayout.setWidget(6, QtGui.QFormLayout.FieldRole, + self.GradientComboBox) self.ImageFilenameWidget = QtGui.QWidget(self.BackgroundTab) self.ImageFilenameWidget.setObjectName(u'ImageFilenameWidget') self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImageFilenameWidget) @@ -121,7 +132,8 @@ class Ui_AmendThemeDialog(object): self.ImageToolButton.setIcon(icon1) self.ImageToolButton.setObjectName(u'ImageToolButton') self.horizontalLayout_2.addWidget(self.ImageToolButton) - self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget) + self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, + self.ImageFilenameWidget) self.ThemeTabWidget.addTab(self.BackgroundTab, u'') self.FontMainTab = QtGui.QWidget() self.FontMainTab.setObjectName(u'FontMainTab') @@ -138,65 +150,88 @@ class Ui_AmendThemeDialog(object): self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget) 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.setFormAlignment(QtCore.Qt.AlignLeading | + QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.MainFontLayout.setMargin(8) self.MainFontLayout.setSpacing(8) self.MainFontLayout.setObjectName(u'MainFontLayout') self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox) self.FontMainlabel.setObjectName(u'FontMainlabel') - self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontMainlabel) + self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.FontMainlabel) self.FontMainComboBox = QtGui.QFontComboBox(self.FontMainGroupBox) self.FontMainComboBox.setObjectName(u'FontMainComboBox') - self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainComboBox) + self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.FontMainComboBox) self.FontMainColorLabel = QtGui.QLabel(self.FontMainGroupBox) self.FontMainColorLabel.setObjectName(u'FontMainColorLabel') - self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainColorLabel) + self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.FontMainColorLabel) self.FontMainColorPushButton = QtGui.QPushButton(self.FontMainGroupBox) self.FontMainColorPushButton.setObjectName(u'FontMainColorPushButton') - self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainColorPushButton) + self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.FontMainColorPushButton) self.FontMainSize = QtGui.QLabel(self.FontMainGroupBox) self.FontMainSize.setObjectName(u'FontMainSize') - self.MainFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.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) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainSizeSpinBox.setSizePolicy(sizePolicy) self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) self.FontMainSizeSpinBox.setProperty(u'value', QtCore.QVariant(16)) self.FontMainSizeSpinBox.setMaximum(999) self.FontMainSizeSpinBox.setObjectName(u'FontMainSizeSpinBox') - self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox) + self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + self.FontMainSizeSpinBox) self.FontMainWeightComboBox = QtGui.QComboBox(self.FontMainGroupBox) - self.FontMainWeightComboBox.setObjectName("FontMainWeightComboBox") + self.FontMainWeightComboBox.setObjectName(u'FontMainWeightComboBox') self.FontMainWeightComboBox.addItem(QtCore.QString()) self.FontMainWeightComboBox.addItem(QtCore.QString()) self.FontMainWeightComboBox.addItem(QtCore.QString()) self.FontMainWeightComboBox.addItem(QtCore.QString()) - self.MainFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWeightComboBox) + self.MainFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, + self.FontMainWeightComboBox) self.FontMainWeightLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainWeightLabel.setObjectName("FontMainWeightLabel") - self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWeightLabel) + self.FontMainWeightLabel.setObjectName(u'FontMainWeightLabel') + self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, + self.FontMainWeightLabel) self.MainLeftLayout.addWidget(self.FontMainGroupBox) - self.FontMainWrapLineAdjustmentLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainWrapLineAdjustmentLabel.setObjectName("FontMainWrapLineAdjustmentLabel") - self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainWrapLineAdjustmentLabel) - self.FontMainLineAdjustmentSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) - self.FontMainLineAdjustmentSpinBox.setObjectName("FontMainLineAdjustmentSpinBox") + self.FontMainWrapLineAdjustmentLabel = QtGui.QLabel( + self.FontMainGroupBox) + self.FontMainWrapLineAdjustmentLabel.setObjectName( + u'FontMainWrapLineAdjustmentLabel') + self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, + self.FontMainWrapLineAdjustmentLabel) + self.FontMainLineAdjustmentSpinBox = QtGui.QSpinBox( + self.FontMainGroupBox) + self.FontMainLineAdjustmentSpinBox.setObjectName( + u'FontMainLineAdjustmentSpinBox') self.FontMainLineAdjustmentSpinBox.setMinimum(-99) - self.MainFontLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainLineAdjustmentSpinBox) + self.MainFontLayout.setWidget(4, QtGui.QFormLayout.FieldRole, + self.FontMainLineAdjustmentSpinBox) self.FontMainWrapIndentationLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainWrapIndentationLabel.setObjectName("FontMainWrapIndentationLabel") - self.MainFontLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.FontMainWrapIndentationLabel) + self.FontMainWrapIndentationLabel.setObjectName( + u'FontMainWrapIndentationLabel') + self.MainFontLayout.setWidget(5, QtGui.QFormLayout.LabelRole, + self.FontMainWrapIndentationLabel) self.FontMainLineSpacingSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) - self.FontMainLineSpacingSpinBox.setObjectName("FontMainLineSpacingSpinBox") + self.FontMainLineSpacingSpinBox.setObjectName( + u'FontMainLineSpacingSpinBox') self.FontMainLineSpacingSpinBox.setMaximum(10) - self.MainFontLayout.setWidget(5, QtGui.QFormLayout.FieldRole, self.FontMainLineSpacingSpinBox) + self.MainFontLayout.setWidget(5, QtGui.QFormLayout.FieldRole, + self.FontMainLineSpacingSpinBox) self.FontMainLinesPageLabel = QtGui.QLabel(self.FontMainGroupBox) - self.FontMainLinesPageLabel.setObjectName("FontMainLinesPageLabel") - self.MainFontLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.FontMainLinesPageLabel) - spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.FontMainLinesPageLabel.setObjectName(u'FontMainLinesPageLabel') + self.MainFontLayout.setWidget(6, QtGui.QFormLayout.LabelRole, + self.FontMainLinesPageLabel) + 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) @@ -213,66 +248,86 @@ class Ui_AmendThemeDialog(object): self.MainLocationLayout.setObjectName(u'MainLocationLayout') self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox) self.DefaultLocationLabel.setObjectName(u'DefaultLocationLabel') - self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.DefaultLocationLabel) - self.FontMainDefaultCheckBox = QtGui.QCheckBox(self.MainLocationGroupBox) + self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.DefaultLocationLabel) + self.FontMainDefaultCheckBox = QtGui.QCheckBox( + self.MainLocationGroupBox) self.FontMainDefaultCheckBox.setTristate(False) self.FontMainDefaultCheckBox.setObjectName(u'FontMainDefaultCheckBox') - self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainDefaultCheckBox) + self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.FontMainDefaultCheckBox) self.FontMainXLabel = QtGui.QLabel(self.MainLocationGroupBox) self.FontMainXLabel.setObjectName(u'FontMainXLabel') - self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainXLabel) + self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.FontMainXLabel) self.FontMainYLabel = QtGui.QLabel(self.MainLocationGroupBox) self.FontMainYLabel.setObjectName(u'FontMainYLabel') - self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainYLabel) + self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.LabelRole, + self.FontMainYLabel) self.FontMainWidthLabel = QtGui.QLabel(self.MainLocationGroupBox) self.FontMainWidthLabel.setObjectName(u'FontMainWidthLabel') - self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWidthLabel) + self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.LabelRole, + self.FontMainWidthLabel) self.FontMainHeightLabel = QtGui.QLabel(self.MainLocationGroupBox) self.FontMainHeightLabel.setObjectName(u'FontMainHeightLabel') - self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.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) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainXSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainXSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainXSpinBox.setSizePolicy(sizePolicy) self.FontMainXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontMainXSpinBox.setProperty(u'value', QtCore.QVariant(0)) self.FontMainXSpinBox.setMaximum(9999) self.FontMainXSpinBox.setObjectName(u'FontMainXSpinBox') - self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainXSpinBox) + self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.FontMainXSpinBox) self.FontMainYSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainYSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainYSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainYSpinBox.setSizePolicy(sizePolicy) self.FontMainYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontMainYSpinBox.setMaximum(9999) self.FontMainYSpinBox.setObjectName(u'FontMainYSpinBox') - self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainYSpinBox) + self.MainLocationLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + self.FontMainYSpinBox) self.FontMainWidthSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainWidthSpinBox.setSizePolicy(sizePolicy) self.FontMainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontMainWidthSpinBox.setMaximum(9999) self.FontMainWidthSpinBox.setObjectName(u'FontMainWidthSpinBox') - self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWidthSpinBox) + self.MainLocationLayout.setWidget(3, QtGui.QFormLayout.FieldRole, + self.FontMainWidthSpinBox) self.FontMainHeightSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainHeightSpinBox.setSizePolicy(sizePolicy) self.FontMainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontMainHeightSpinBox.setMaximum(9999) self.FontMainHeightSpinBox.setObjectName(u'FontMainHeightSpinBox') - self.MainLocationLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.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) + 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, u'') @@ -291,49 +346,64 @@ class Ui_AmendThemeDialog(object): self.FooterFontGroupBox = QtGui.QGroupBox(self.FooterLeftWidget) 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.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(u'FooterFontLayout') self.FontFooterLabel = QtGui.QLabel(self.FooterFontGroupBox) self.FontFooterLabel.setObjectName(u'FontFooterLabel') - self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterLabel) + self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.FontFooterLabel) self.FontFooterComboBox = QtGui.QFontComboBox(self.FooterFontGroupBox) self.FontFooterComboBox.setObjectName(u'FontFooterComboBox') - self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterComboBox) + self.FooterFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.FontFooterComboBox) self.FontFooterColorLabel = QtGui.QLabel(self.FooterFontGroupBox) self.FontFooterColorLabel.setObjectName(u'FontFooterColorLabel') - self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterColorLabel) - self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox) - self.FontFooterColorPushButton.setObjectName(u'FontFooterColorPushButton') - self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterColorPushButton) + self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.FontFooterColorLabel) + self.FontFooterColorPushButton = QtGui.QPushButton( + self.FooterFontGroupBox) + self.FontFooterColorPushButton.setObjectName( + u'FontFooterColorPushButton') + self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.FontFooterColorPushButton) self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox) self.FontFooterSizeLabel.setObjectName(u'FontFooterSizeLabel') - self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.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) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth()) self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy) self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) self.FontFooterSizeSpinBox.setProperty(u'value', QtCore.QVariant(10)) self.FontFooterSizeSpinBox.setMaximum(999) self.FontFooterSizeSpinBox.setObjectName(u'FontFooterSizeSpinBox') - self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox) + self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + self.FontFooterSizeSpinBox) self.FontFooterWeightComboBox = QtGui.QComboBox(self.FooterFontGroupBox) - self.FontFooterWeightComboBox.setObjectName("FontFooterWeightComboBox") + self.FontFooterWeightComboBox.setObjectName(u'FontFooterWeightComboBox') self.FontFooterWeightComboBox.addItem(QtCore.QString()) self.FontFooterWeightComboBox.addItem(QtCore.QString()) self.FontFooterWeightComboBox.addItem(QtCore.QString()) self.FontFooterWeightComboBox.addItem(QtCore.QString()) - self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWeightComboBox) + self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, + self.FontFooterWeightComboBox) self.FontFooterWeightLabel = QtGui.QLabel(self.FooterFontGroupBox) - self.FontFooterWeightLabel.setObjectName("FontFooterWeightLabel") - self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWeightLabel) + self.FontFooterWeightLabel.setObjectName(u'FontFooterWeightLabel') + self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, + self.FontFooterWeightLabel) self.FooterLeftLayout.addWidget(self.FooterFontGroupBox) - spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + 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) @@ -344,65 +414,87 @@ class Ui_AmendThemeDialog(object): self.FooterRightLayout.setObjectName(u'FooterRightLayout') self.LocationFooterGroupBox = QtGui.QGroupBox(self.FooterRightWidget) 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 = 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(u'LocationFooterLayout') self.FontFooterDefaultLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterDefaultLabel.setObjectName(u'FontFooterDefaultLabel') - self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterDefaultLabel) - self.FontFooterDefaultCheckBox = QtGui.QCheckBox(self.LocationFooterGroupBox) + self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.FontFooterDefaultLabel) + self.FontFooterDefaultCheckBox = QtGui.QCheckBox( + self.LocationFooterGroupBox) self.FontFooterDefaultCheckBox.setTristate(False) - self.FontFooterDefaultCheckBox.setObjectName(u'FontFooterDefaultCheckBox') - self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterDefaultCheckBox) + self.FontFooterDefaultCheckBox.setObjectName( + u'FontFooterDefaultCheckBox') + self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.FontFooterDefaultCheckBox) self.FontFooterXLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterXLabel.setObjectName(u'FontFooterXLabel') - self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterXLabel) + self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.FontFooterXLabel) self.FontFooterYLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterYLabel.setObjectName(u'FontFooterYLabel') - self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontFooterYLabel) + self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.LabelRole, + self.FontFooterYLabel) self.FontFooterWidthLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterWidthLabel.setObjectName(u'FontFooterWidthLabel') - self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWidthLabel) + self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.LabelRole, + self.FontFooterWidthLabel) self.FontFooterHeightLabel = QtGui.QLabel(self.LocationFooterGroupBox) self.FontFooterHeightLabel.setObjectName(u'FontFooterHeightLabel') - self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontFooterHeightLabel) + self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.LabelRole, + self.FontFooterHeightLabel) self.FontFooterXSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth()) self.FontFooterXSpinBox.setSizePolicy(sizePolicy) self.FontFooterXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontFooterXSpinBox.setProperty(u'value', QtCore.QVariant(0)) self.FontFooterXSpinBox.setMaximum(9999) self.FontFooterXSpinBox.setObjectName(u'FontFooterXSpinBox') - self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterXSpinBox) + self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.FontFooterXSpinBox) self.FontFooterYSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth()) self.FontFooterYSpinBox.setSizePolicy(sizePolicy) self.FontFooterYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontFooterYSpinBox.setProperty(u'value', QtCore.QVariant(0)) self.FontFooterYSpinBox.setMaximum(9999) self.FontFooterYSpinBox.setObjectName(u'FontFooterYSpinBox') - self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterYSpinBox) - self.FontFooterWidthSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) + 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(u'FontFooterWidthSpinBox') - self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthSpinBox) - self.FontFooterHeightSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) + 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(u'FontFooterHeightSpinBox') - self.LocationFooterLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.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) + 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, u'') @@ -432,23 +524,29 @@ class Ui_AmendThemeDialog(object): self.OutlineLayout.setObjectName(u'OutlineLayout') self.OutlineCheckBox = QtGui.QCheckBox(self.OutlineWidget) self.OutlineCheckBox.setObjectName(u'OutlineCheckBox') - self.OutlineLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.OutlineCheckBox) + self.OutlineLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.OutlineCheckBox) self.OutlineSpinBox = QtGui.QSpinBox(self.OutlineWidget) - self.OutlineSpinBox.setObjectName("OutlineSpinBox") + self.OutlineSpinBox.setObjectName(u'OutlineSpinBox') self.OutlineSpinBox.setMaximum(10) - self.OutlineLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.OutlineSpinBox) + self.OutlineLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.OutlineSpinBox) self.OutlineSpinBoxLabel = QtGui.QLabel(self.OutlineWidget) self.OutlineSpinBoxLabel.setObjectName(u'OutlineSpinBoxLabel') - self.OutlineLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.OutlineSpinBoxLabel) + self.OutlineLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.OutlineSpinBoxLabel) self.OutlineColorLabel = QtGui.QLabel(self.OutlineWidget) self.OutlineColorLabel.setObjectName(u'OutlineColorLabel') - self.OutlineLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.OutlineColorLabel) + self.OutlineLayout.setWidget(2, QtGui.QFormLayout.LabelRole, + self.OutlineColorLabel) self.OutlineColorPushButton = QtGui.QPushButton(self.OutlineWidget) self.OutlineColorPushButton.setObjectName(u'OutlineColorPushButton') - self.OutlineLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.OutlineColorPushButton) + self.OutlineLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + self.OutlineColorPushButton) self.OutlineEnabledLabel = QtGui.QLabel(self.OutlineWidget) self.OutlineEnabledLabel.setObjectName(u'OutlineEnabledLabel') - self.OutlineLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.OutlineEnabledLabel) + self.OutlineLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.OutlineEnabledLabel) self.verticalLayout.addWidget(self.OutlineWidget) self.OptionsLeftLayout.addWidget(self.OutlineGroupBox) self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsLeftWidget) @@ -465,26 +563,33 @@ class Ui_AmendThemeDialog(object): self.ShadowLayout.setObjectName(u'ShadowLayout') self.ShadowCheckBox = QtGui.QCheckBox(self.ShadowWidget) self.ShadowCheckBox.setObjectName(u'ShadowCheckBox') - self.ShadowLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.ShadowCheckBox) + self.ShadowLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.ShadowCheckBox) self.ShadowSpinBox = QtGui.QSpinBox(self.OutlineWidget) - self.ShadowSpinBox.setObjectName("ShadowSpinBox") + self.ShadowSpinBox.setObjectName(u'ShadowSpinBox') self.ShadowSpinBox.setMaximum(10) - self.ShadowLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ShadowSpinBox) + self.ShadowLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.ShadowSpinBox) self.ShadowSpinBoxLabel = QtGui.QLabel(self.OutlineWidget) self.ShadowSpinBoxLabel.setObjectName(u'ShadowSpinBoxLabel') - self.ShadowLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.ShadowSpinBoxLabel) + self.ShadowLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.ShadowSpinBoxLabel) self.ShadowColorLabel = QtGui.QLabel(self.ShadowWidget) self.ShadowColorLabel.setObjectName(u'ShadowColorLabel') - self.ShadowLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.ShadowColorLabel) + self.ShadowLayout.setWidget(2, QtGui.QFormLayout.LabelRole, + self.ShadowColorLabel) self.ShadowColorPushButton = QtGui.QPushButton(self.ShadowWidget) self.ShadowColorPushButton.setObjectName(u'ShadowColorPushButton') - self.ShadowLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.ShadowColorPushButton) + self.ShadowLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + self.ShadowColorPushButton) self.ShadowEnabledLabel = QtGui.QLabel(self.ShadowWidget) self.ShadowEnabledLabel.setObjectName(u'ShadowEnabledLabel') - self.ShadowLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.ShadowEnabledLabel) + self.ShadowLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.ShadowEnabledLabel) self.verticalLayout.addWidget(self.ShadowWidget) self.OptionsLeftLayout.addWidget(self.ShadowGroupBox) - spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Expanding) self.OptionsLeftLayout.addItem(spacerItem5) self.OtherOptionsLayout.addWidget(self.OptionsLeftWidget) self.OptionsRightWidget = QtGui.QWidget(self.OtherOptionsTab) @@ -520,14 +625,18 @@ class Ui_AmendThemeDialog(object): self.TransitionGroupBox.setObjectName(u'TransitionGroupBox') self.gridLayout_5 = QtGui.QGridLayout(self.TransitionGroupBox) self.gridLayout_5.setObjectName(u'gridLayout_5') - self.SlideTransitionCheckedBoxLabel = QtGui.QLabel(self.TransitionGroupBox) - self.SlideTransitionCheckedBoxLabel.setObjectName(u'SlideTransitionCheckedBoxLabel') - self.gridLayout_5.addWidget(self.SlideTransitionCheckedBoxLabel, 0, 0, 1, 1) + self.SlideTransitionCheckedBoxLabel = QtGui.QLabel( + self.TransitionGroupBox) + self.SlideTransitionCheckedBoxLabel.setObjectName( + u'SlideTransitionCheckedBoxLabel') + self.gridLayout_5.addWidget( + self.SlideTransitionCheckedBoxLabel, 0, 0, 1, 1) self.SlideTransitionCheckedBox = QtGui.QCheckBox(self.AlignmentGroupBox) self.SlideTransitionCheckedBox.setTristate(False) self.gridLayout_5.addWidget(self.SlideTransitionCheckedBox, 0, 1, 1, 1) self.OptionsRightLayout.addWidget(self.TransitionGroupBox) - spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + 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, u'') @@ -539,13 +648,16 @@ class Ui_AmendThemeDialog(object): self.ThemePreviewLayout.setSpacing(8) self.ThemePreviewLayout.setMargin(8) self.ThemePreviewLayout.setObjectName(u'ThemePreviewLayout') - spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) + spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, + QtGui.QSizePolicy.Expanding) self.ThemePreviewLayout.addItem(spacerItem7) self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.ThemePreview.sizePolicy().hasHeightForWidth()) self.ThemePreview.setSizePolicy(sizePolicy) self.ThemePreview.setMaximumSize(QtCore.QSize(300, 225)) self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel) @@ -554,53 +666,87 @@ class Ui_AmendThemeDialog(object): self.ThemePreview.setScaledContents(True) self.ThemePreview.setObjectName(u'ThemePreview') self.ThemePreviewLayout.addWidget(self.ThemePreview) - spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) + 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.setStandardButtons( + QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.ThemeButtonBox.setObjectName(u'ThemeButtonBox') self.AmendThemeLayout.addWidget(self.ThemeButtonBox) self.retranslateUi(AmendThemeDialog) self.ThemeTabWidget.setCurrentIndex(0) - QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL(u'accepted()'), AmendThemeDialog.accept) - QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL(u'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) - AmendThemeDialog.setTabOrder(self.ThemeTabWidget, self.BackgroundComboBox) - AmendThemeDialog.setTabOrder(self.BackgroundComboBox, self.BackgroundTypeComboBox) - AmendThemeDialog.setTabOrder(self.BackgroundTypeComboBox, self.Color1PushButton) - AmendThemeDialog.setTabOrder(self.Color1PushButton, self.Color2PushButton) + AmendThemeDialog.setTabOrder(self.ThemeTabWidget, + self.BackgroundComboBox) + AmendThemeDialog.setTabOrder(self.BackgroundComboBox, + self.BackgroundTypeComboBox) + AmendThemeDialog.setTabOrder(self.BackgroundTypeComboBox, + self.Color1PushButton) + AmendThemeDialog.setTabOrder(self.Color1PushButton, + self.Color2PushButton) AmendThemeDialog.setTabOrder(self.Color2PushButton, self.ImageLineEdit) AmendThemeDialog.setTabOrder(self.ImageLineEdit, self.ImageToolButton) - AmendThemeDialog.setTabOrder(self.ImageToolButton, self.GradientComboBox) - AmendThemeDialog.setTabOrder(self.GradientComboBox, self.FontMainComboBox) - AmendThemeDialog.setTabOrder(self.FontMainComboBox, self.FontMainColorPushButton) - AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, self.FontMainSizeSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainWeightComboBox) - AmendThemeDialog.setTabOrder(self.FontMainWeightComboBox, self.FontMainLineSpacingSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainLineSpacingSpinBox, self.FontMainDefaultCheckBox) - AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, self.FontMainXSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, self.FontMainYSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, self.FontMainWidthSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox, self.FontMainHeightSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox, self.FontFooterComboBox) - AmendThemeDialog.setTabOrder(self.FontFooterComboBox, self.FontFooterColorPushButton) - AmendThemeDialog.setTabOrder(self.FontFooterColorPushButton, self.FontFooterSizeSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterWeightComboBox) - AmendThemeDialog.setTabOrder(self.FontFooterWeightComboBox, self.FontFooterDefaultCheckBox) - AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, self.FontFooterYSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterWidthSpinBox, self.FontFooterHeightSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterHeightSpinBox, self.OutlineCheckBox) - AmendThemeDialog.setTabOrder(self.OutlineCheckBox, self.OutlineColorPushButton) - AmendThemeDialog.setTabOrder(self.OutlineColorPushButton, self.ShadowCheckBox) - AmendThemeDialog.setTabOrder(self.ShadowCheckBox, self.ShadowColorPushButton) - AmendThemeDialog.setTabOrder(self.ShadowColorPushButton, self.HorizontalComboBox) - AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox) + AmendThemeDialog.setTabOrder(self.ImageToolButton, + self.GradientComboBox) + AmendThemeDialog.setTabOrder(self.GradientComboBox, + self.FontMainComboBox) + AmendThemeDialog.setTabOrder(self.FontMainComboBox, + self.FontMainColorPushButton) + AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, + self.FontMainSizeSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, + self.FontMainWeightComboBox) + AmendThemeDialog.setTabOrder(self.FontMainWeightComboBox, + self.FontMainLineSpacingSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainLineSpacingSpinBox, + self.FontMainDefaultCheckBox) + AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, + self.FontMainXSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, + self.FontMainYSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, + self.FontMainWidthSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox, + self.FontMainHeightSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox, + self.FontFooterComboBox) + AmendThemeDialog.setTabOrder(self.FontFooterComboBox, + self.FontFooterColorPushButton) + AmendThemeDialog.setTabOrder(self.FontFooterColorPushButton, + self.FontFooterSizeSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, + self.FontFooterWeightComboBox) + AmendThemeDialog.setTabOrder(self.FontFooterWeightComboBox, + self.FontFooterDefaultCheckBox) + AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, + self.FontFooterXSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, + self.FontFooterYSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, + self.FontFooterWidthSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterWidthSpinBox, + self.FontFooterHeightSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterHeightSpinBox, + self.OutlineCheckBox) + AmendThemeDialog.setTabOrder(self.OutlineCheckBox, + self.OutlineColorPushButton) + AmendThemeDialog.setTabOrder(self.OutlineColorPushButton, + self.ShadowCheckBox) + AmendThemeDialog.setTabOrder(self.ShadowCheckBox, + self.ShadowColorPushButton) + AmendThemeDialog.setTabOrder(self.ShadowColorPushButton, + self.HorizontalComboBox) + AmendThemeDialog.setTabOrder(self.HorizontalComboBox, + self.VerticalComboBox) def retranslateUi(self, AmendThemeDialog): AmendThemeDialog.setWindowTitle( @@ -611,26 +757,25 @@ class Ui_AmendThemeDialog(object): translate(u'AmendThemeForm', u'Background:')) self.BackgroundComboBox.setItemText(0, translate(u'AmendThemeForm', u'Opaque')) - self.BackgroundComboBox.setItemText(1, + self.BackgroundComboBox.setItemText(1, translate(u'AmendThemeForm', u'Transparent')) self.BackgroundTypeLabel.setText( translate(u'AmendThemeForm', u'Background Type:')) self.BackgroundTypeComboBox.setItemText(0, translate(u'AmendThemeForm', u'Solid Color')) - self.BackgroundTypeComboBox.setItemText(1, + self.BackgroundTypeComboBox.setItemText(1, translate(u'AmendThemeForm', u'Gradient')) - self.BackgroundTypeComboBox.setItemText(2, + self.BackgroundTypeComboBox.setItemText(2, translate(u'AmendThemeForm', u'Image')) - self.Color1Label.setText( - translate(u'AmendThemeForm', u'')) + self.Color1Label.setText(translate(u'AmendThemeForm', u'')) self.Color2Label.setText(translate(u'AmendThemeForm', u'')) self.ImageLabel.setText(translate(u'AmendThemeForm', u'Image:')) self.GradientLabel.setText(translate(u'AmendThemeForm', u'Gradient :')) - self.GradientComboBox.setItemText(0, + self.GradientComboBox.setItemText(0, translate(u'AmendThemeForm', u'Horizontal')) - self.GradientComboBox.setItemText(1, + self.GradientComboBox.setItemText(1, translate(u'AmendThemeForm', u'Vertical')) - self.GradientComboBox.setItemText(2, + self.GradientComboBox.setItemText(2, translate(u'AmendThemeForm', u'Circular')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.BackgroundTab), @@ -646,13 +791,13 @@ class Ui_AmendThemeDialog(object): translate(u'AmendThemeForm', u'Wrap Indentation')) self.FontMainWrapLineAdjustmentLabel.setText( translate(u'AmendThemeForm', u'Adjust Line Spacing')) - self.FontMainWeightComboBox.setItemText(0, + self.FontMainWeightComboBox.setItemText(0, translate(u'AmendThemeForm', u'Normal')) - self.FontMainWeightComboBox.setItemText(1, + self.FontMainWeightComboBox.setItemText(1, translate(u'AmendThemeForm', u'Bold')) - self.FontMainWeightComboBox.setItemText(2, + self.FontMainWeightComboBox.setItemText(2, translate(u'AmendThemeForm', u'Italics')) - self.FontMainWeightComboBox.setItemText(3, + self.FontMainWeightComboBox.setItemText(3, translate(u'AmendThemeForm', u'Bold/Italics')) self.FontMainWeightLabel.setText( translate(u'AmendThemeForm', u'Font Weight:')) @@ -668,9 +813,12 @@ class Ui_AmendThemeDialog(object): translate(u'AmendThemeForm', u'Width:')) self.FontMainHeightLabel.setText( translate(u'AmendThemeForm', u'Height:')) - self.FontMainXSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) - self.FontMainYSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) - self.FontMainWidthSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) + self.FontMainXSpinBox.setSuffix( + translate(u'AmendThemeForm', u'px')) + self.FontMainYSpinBox.setSuffix( + translate(u'AmendThemeForm', u'px')) + self.FontMainWidthSpinBox.setSuffix( + translate(u'AmendThemeForm', u'px')) self.FontMainHeightSpinBox.setSuffix( translate(u'AmendThemeForm', u'px')) self.ThemeTabWidget.setTabText( @@ -683,13 +831,13 @@ class Ui_AmendThemeDialog(object): translate(u'AmendThemeForm', u'Font Color:')) self.FontFooterSizeLabel.setText(translate(u'AmendThemeForm', u'Size:')) self.FontFooterSizeSpinBox.setSuffix(translate(u'AmendThemeForm', u'pt')) - self.FontFooterWeightComboBox.setItemText(0, + self.FontFooterWeightComboBox.setItemText(0, translate(u'AmendThemeForm', u'Normal')) self.FontFooterWeightComboBox.setItemText(1, translate(u'AmendThemeForm', u'Bold')) - self.FontFooterWeightComboBox.setItemText(2, + self.FontFooterWeightComboBox.setItemText(2, translate(u'AmendThemeForm', u'Italics')) - self.FontFooterWeightComboBox.setItemText(3, + self.FontFooterWeightComboBox.setItemText(3, translate(u'AmendThemeForm', u'Bold/Italics')) self.FontFooterWeightLabel.setText( translate(u'AmendThemeForm', u'Font Weight:')) @@ -715,17 +863,16 @@ class Ui_AmendThemeDialog(object): translate(u'AmendThemeForm', u'px')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.FontFooterTab), - translate(u'AmendThemeForm', u'Font Footer')) - self.OutlineGroupBox.setTitle(translate(u'AmendThemeForm', u'Outline')) + translate('AmendThemeForm', 'Font Footer')) + self.OutlineGroupBox.setTitle(translate('AmendThemeForm', 'Outline')) self.OutlineSpinBoxLabel.setText( - translate(u'AmendThemeForm', u'Outline Size:')) - self.OutlineSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) + translate('AmendThemeForm', 'Outline Size:')) + self.OutlineSpinBox.setSuffix(translate('AmendThemeForm', 'px')) self.OutlineColorLabel.setText( translate(u'AmendThemeForm', u'Outline Color:')) self.OutlineEnabledLabel.setText( - translate(u'AmendThemeForm', u'Show Outline:')) - self.ShadowGroupBox.setTitle( - translate(u'AmendThemeForm', u'Shadow')) + translate('AmendThemeForm', 'Show Outline:')) + self.ShadowGroupBox.setTitle(translate('AmendThemeForm', 'Shadow')) self.ShadowSpinBoxLabel.setText( translate(u'AmendThemeForm', u'Shadow Size:')) self.ShadowSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 060bb9437..4510d77ea 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -154,8 +154,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): unicode(self.theme.background_endColor), self.theme.background_direction) else: - (path, filename) = \ - os.path.split(unicode(self.theme.background_filename)) + filename = \ + os.path.split(unicode(self.theme.background_filename))[0] new_theme.add_background_image(filename) save_to = os.path.join(self.path, theme_name, filename) save_from = self.theme.background_filename diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 115af6f58..c65fa2ec0 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -62,7 +62,8 @@ class VersionThread(QtCore.QThread): QtCore.QThread.__init__(self, parent) self.parent = parent self.app_version = app_version - self.version_splitter = re.compile(r'([0-9]+).([0-9]+).([0-9]+)(?:-bzr([0-9]+))') + self.version_splitter = re.compile( + r'([0-9]+).([0-9]+).([0-9]+)(?:-bzr([0-9]+))') def run(self): """ @@ -847,7 +848,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): recentFileCount = QtCore.QSettings().value( self.generalSettingsSection + u'/max recent files', QtCore.QVariant(4)).toInt()[0] - if filename and not self.recentFiles.contains(filename): - self.recentFiles.prepend(QtCore.QString(filename)) + if filename and filename not in self.recentFiles: + self.recentFiles.insert(0, QtCore.QString(filename)) while self.recentFiles.count() > recentFileCount: - self.recentFiles.takeLast() + self.recentFiles.pop() + diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index 855cae4fa..5ecc3ea61 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -73,3 +73,4 @@ class Ui_ServiceItemEditDialog(object): self.deleteButton.setText(translate(u'ServiceItemEditForm', u'Delete')) self.downButton.setText(translate(u'ServiceItemEditForm', u'Down')) + diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index d6e8aaa9c..80f081ea1 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -153,9 +153,11 @@ class ServiceManager(QtGui.QWidget): self.ServiceManagerList.setAlternatingRowColors(True) self.ServiceManagerList.setHeaderHidden(True) self.ServiceManagerList.setExpandsOnDoubleClick(False) - self.ServiceManagerList.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) + self.ServiceManagerList.setContextMenuPolicy( + QtCore.Qt.CustomContextMenu) QtCore.QObject.connect(self.ServiceManagerList, - QtCore.SIGNAL('customContextMenuRequested(QPoint)'), self.contextMenu) + QtCore.SIGNAL('customContextMenuRequested(QPoint)'), + self.contextMenu) self.ServiceManagerList.setObjectName(u'ServiceManagerList') # enable drop self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent @@ -291,7 +293,7 @@ class ServiceManager(QtGui.QWidget): self.makeLive() def onServiceItemNoteForm(self): - item, count = self.findServiceItem() + item = self.findServiceItem()[0] self.serviceNoteForm.textEdit.setPlainText( self.serviceItems[item][u'service_item'].notes) if self.serviceNoteForm.exec_(): @@ -300,7 +302,7 @@ class ServiceManager(QtGui.QWidget): self.repaintServiceList(item, 0) def onServiceItemEditForm(self): - item, count = self.findServiceItem() + item = self.findServiceItem()[0] self.serviceItemEditForm.setServiceItem( self.serviceItems[item][u'service_item']) if self.serviceItemEditForm.exec_(): @@ -500,7 +502,7 @@ class ServiceManager(QtGui.QWidget): """ Remove the current ServiceItem from the list """ - item, count = self.findServiceItem() + item = self.findServiceItem()[0] if item is not -1: self.serviceItems.remove(self.serviceItems[item]) self.repaintServiceList(0, 0) @@ -526,10 +528,10 @@ class ServiceManager(QtGui.QWidget): if serviceitem.notes: icon = QtGui.QImage(serviceitem.icon) icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, - QtCore.Qt.SmoothTransformation) + QtCore.Qt.SmoothTransformation) overlay = QtGui.QImage(':/services/service_item_notes.png') overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio, - QtCore.Qt.SmoothTransformation) + QtCore.Qt.SmoothTransformation) painter = QtGui.QPainter(icon) painter.drawImage(0, 0, overlay) painter.end() @@ -537,7 +539,8 @@ class ServiceManager(QtGui.QWidget): else: treewidgetitem.setIcon(0, serviceitem.iconic_representation) else: - treewidgetitem.setIcon(0, build_icon(u':/general/general_delete.png')) + treewidgetitem.setIcon(0, + build_icon(u':/general/general_delete.png')) treewidgetitem.setText(0, serviceitem.title) treewidgetitem.setToolTip(0, serviceitem.notes) treewidgetitem.setData(0, QtCore.Qt.UserRole, @@ -599,7 +602,7 @@ class ServiceManager(QtGui.QWidget): cPickle.dump(service, file) file.close() zip.write(servicefile) - except: + except IOError: log.exception(u'Failed to save service to disk') finally: if file: @@ -608,7 +611,7 @@ class ServiceManager(QtGui.QWidget): zip.close() try: os.remove(servicefile) - except: + except (IOError, OSError): pass #if not present do not worry name = filename.split(os.path.sep) self.serviceName = name[-1] @@ -660,23 +663,23 @@ class ServiceManager(QtGui.QWidget): self.parent.serviceSettingsSection, os.path.split(filename)[0]) zip = None - f = None + file_to = None try: zip = zipfile.ZipFile(unicode(filename)) for file in zip.namelist(): osfile = unicode(QtCore.QDir.toNativeSeparators(file)) names = osfile.split(os.path.sep) - file_to = os.path.join(self.servicePath, + file_path = os.path.join(self.servicePath, names[len(names) - 1]) - f = open(file_to, u'wb') - f.write(zip.read(file)) - f.flush() - f.close() - if file_to.endswith(u'osd'): - p_file = file_to - f = open(p_file, u'r') - items = cPickle.load(f) - f.close() + file_to = open(file_path, u'wb') + file_to.write(zip.read(file)) + file_to.flush() + file_to.close() + if file_path.endswith(u'osd'): + p_file = file_path + file_to = open(p_file, u'r') + items = cPickle.load(file_to) + file_to.close() self.onNewService() for item in items: serviceitem = ServiceItem() @@ -687,13 +690,13 @@ class ServiceManager(QtGui.QWidget): try: if os.path.isfile(p_file): os.remove(p_file) - except: + except (IOError, OSError): log.exception(u'Failed to remove osd file') - except: + except IOError: log.exception(u'Problem loading a service file') finally: - if f: - f.close() + if file_to: + file_to.close() if zip: zip.close() self.isNew = False @@ -720,7 +723,7 @@ class ServiceManager(QtGui.QWidget): try: if os.path.isfile(file_path): os.remove(file_path) - except: + except OSError: log.exception(u'Failed to clean up servicePath') def onThemeComboBoxSelected(self, currentIndex): @@ -761,7 +764,7 @@ class ServiceManager(QtGui.QWidget): Service Item to be added """ - sitem, count = self.findServiceItem() + sitem = self.findServiceItem()[0] item.render() if replace: item.merge(self.serviceItems[sitem][u'service_item']) @@ -813,7 +816,7 @@ class ServiceManager(QtGui.QWidget): """ Send the current item to the Preview slide controller """ - item, count = self.findServiceItem() + item = self.findServiceItem()[0] if item == -1: return False else: @@ -849,7 +852,7 @@ class ServiceManager(QtGui.QWidget): """ Posts a remote edit message to a plugin to allow item to be edited. """ - item, count = self.findServiceItem() + item = self.findServiceItem()[0] if self.serviceItems[item][u'service_item']\ .is_capable(ItemCapabilities.AllowsEdit): Receiver.send_message(u'%s_edit' % @@ -966,7 +969,7 @@ class ServiceManager(QtGui.QWidget): def onThemeChangeAction(self): theme = unicode(self.sender().text()) - item, count = self.findServiceItem() + item = self.findServiceItem()[0] self.serviceItems[item][u'service_item'].theme = theme self.regenerateServiceItems() @@ -979,7 +982,7 @@ class ServiceManager(QtGui.QWidget): def listRequest(self, message=None): data = [] - curindex, count = self.findServiceItem() + curindex = self.findServiceItem()[0] if curindex >= 0 and curindex < len(self.serviceItems): curitem = self.serviceItems[curindex] else: @@ -993,3 +996,4 @@ class ServiceManager(QtGui.QWidget): data_item[u'selected'] = (item == curitem) data.append(data_item) Receiver.send_message(u'servicemanager_list_response', data) + diff --git a/openlp/core/ui/servicenotedialog.py b/openlp/core/ui/servicenotedialog.py index 4bf2ee531..c3dfd377f 100644 --- a/openlp/core/ui/servicenotedialog.py +++ b/openlp/core/ui/servicenotedialog.py @@ -39,8 +39,8 @@ class Ui_ServiceNoteEdit(object): self.textEdit.setObjectName(u'textEdit') self.verticalLayout.addWidget(self.textEdit) self.buttonBox = QtGui.QDialogButtonBox(self.widget) - self.buttonBox.setStandardButtons( - QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | + QtGui.QDialogButtonBox.Save) self.buttonBox.setObjectName(u'buttonBox') self.verticalLayout.addWidget(self.buttonBox) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index d85f8e7bd..7d45ca30c 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -394,9 +394,9 @@ class SlideController(QtGui.QWidget): width = self.parent.ControlSplitter.sizes()[self.split] height = width * self.parent.RenderManager.screen_ratio self.PreviewListWidget.setColumnWidth(0, width) - #Sort out image hights (Songs , bibles excluded) + #Sort out image heights (Songs, bibles excluded) if self.serviceItem and not self.serviceItem.is_text(): - for framenumber, frame in enumerate(self.serviceItem.get_frames()): + for framenumber in range(len(self.serviceItem.get_frames())): self.PreviewListWidget.setRowHeight(framenumber, height) def trackSplitter(self, tab, pos): @@ -554,17 +554,9 @@ class SlideController(QtGui.QWidget): if self.serviceItem.is_text(): if frame[u'verseTag']: bits = frame[u'verseTag'].split(u':') - tag = None - #If verse handle verse number else tag only - if bits[0] == translate(u'SlideController', u'Verse') or \ - bits[0] == translate(u'SlideController', u'Chorus'): - tag = u'%s\n%s' % (bits[0][0], bits[1][0:] ) - tag1 = u'%s%s' % (bits[0][0], bits[1][0:] ) - row = tag - else: - tag = bits[0] - tag1 = tag - row = bits[0][0:1] + tag = u'%s\n%s' % (bits[0][0], bits[1][0:] ) + tag1 = u'%s%s' % (bits[0][0], bits[1][0:] ) + row = tag else: row += 1 if self.isLive and frame[u'verseTag'] is not None: @@ -795,7 +787,8 @@ class SlideController(QtGui.QWidget): def updatePreview(self): rm = self.parent.RenderManager if not rm.screens.current[u'primary']: - # Grab now, but try again in a couple of seconds if slide change is slow + # Grab now, but try again in a couple of seconds if slide change + # is slow QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) QtCore.QTimer.singleShot(2.5, self.grabMainDisplay) else: diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 46f175b67..81ebb7f18 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -191,12 +191,11 @@ class ThemeManager(QtGui.QWidget): else: for plugin in self.parent.plugin_manager.plugins: if not plugin.can_delete_theme(theme): - QtGui.QMessageBox.critical( - self, translate(u'ThemeManager', u'Error'), - translate(u'ThemeManager', - u'Theme %s is use in %s plugin' - % (theme, plugin.name)), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) + QtGui.QMessageBox.critical(self, + translate(u'ThemeManager', u'Error'), + translate(u'ThemeManager', + u'Theme %s is use in %s plugin' % (theme, + plugin.name))) return if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme: QtGui.QMessageBox.critical( @@ -213,7 +212,7 @@ class ThemeManager(QtGui.QWidget): os.remove(os.path.join(self.path, th)) os.remove(os.path.join(self.thumbPath, th)) shutil.rmtree(os.path.join(self.path, theme)) - except: + except OSError: #if not present do not worry pass # As we do not reload the themes push out the change @@ -244,12 +243,12 @@ class ThemeManager(QtGui.QWidget): try: zip = zipfile.ZipFile(themePath, u'w') source = os.path.join(self.path, theme) - for root, dirs, files in os.walk(source): + for files in os.walk(source)[2]: for name in files: zip.write( os.path.join(source, name), os.path.join(theme, name)) - except: + except (IOError, OSError): log.exception(u'Export Theme Failed') finally: if zip: @@ -283,7 +282,6 @@ class ThemeManager(QtGui.QWidget): #check to see file is in theme root directory theme = os.path.join(self.path, name) if os.path.exists(theme): - (path, filename) = os.path.split(unicode(file)) textName = os.path.splitext(name)[0] if textName == self.global_theme: name = u'%s (%s)' % (textName, @@ -371,11 +369,10 @@ class ThemeManager(QtGui.QWidget): outfile = open(fullpath, u'wb') outfile.write(zip.read(file)) self.generateAndSaveImage(dir, themename, filexml) - except: + except IOError: QtGui.QMessageBox.critical( self, translate(u'ThemeManager', u'Error'), translate(u'ThemeManager', u'File is not a valid theme.'), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) log.exception(u'Importing theme from zip file failed %s' % filename) finally: if zip: @@ -468,7 +465,7 @@ class ThemeManager(QtGui.QWidget): try: outfile = open(theme_file, u'w') outfile.write(theme_pretty_xml) - except: + except IOError: log.exception(u'Saving theme to file failed') finally: if outfile: @@ -476,7 +473,7 @@ class ThemeManager(QtGui.QWidget): if image_from and image_from != image_to: try: shutil.copyfile(image_from, image_to) - except: + except IOError: log.exception(u'Failed to save theme image') self.generateAndSaveImage(self.path, name, theme_xml) self.loadThemes() @@ -579,3 +576,4 @@ class ThemeManager(QtGui.QWidget): #theme.theme_mode theme.theme_name = theme.theme_name.strip() #theme.theme_version + diff --git a/openlp/migration/migratebibles.py b/openlp/migration/migratebibles.py index 17ded3a80..89bb5ffdf 100644 --- a/openlp/migration/migratebibles.py +++ b/openlp/migration/migratebibles.py @@ -27,10 +27,10 @@ import os import sys import sqlite3 -from sqlalchemy import create_engine -from sqlalchemy.orm import scoped_session, sessionmaker, mapper +from sqlalchemy.exceptions import InvalidRequestError +from sqlalchemy.orm import mapper -from openlp.core.lib import SettingsManager +from openlp.core.lib import BaseModel, SettingsManager from openlp.core.utils import AppLocation from openlp.plugins.bibles.lib.models import * @@ -85,13 +85,6 @@ mapper(TTestament, temp_testament_table) mapper(TBook, temp_book_table) mapper(TVerse, temp_verse_table) -def init_models(url): - engine = create_engine(url) - metadata.bind = engine - session = scoped_session(sessionmaker(autoflush=False, - autocommit=False, bind=engine)) - return session - class MigrateBibles(object): def __init__(self, display): self.display = display @@ -105,8 +98,8 @@ class MigrateBibles(object): def process(self): self.progress(u'Bibles processing started') - for f in self.database_files: - self.v_1_9_0(f) + for db_file in self.database_files: + self.v_1_9_0(db_file) self.progress(u'Bibles processing finished') def v_1_9_0(self, database): @@ -143,7 +136,7 @@ class MigrateBibles(object): try: self.session.add(testament) self.session.commit() - except: + except InvalidRequestError: self.session.rollback() print u'Error thrown = ', sys.exc_info()[1] self.progress(u'Create book table') @@ -157,7 +150,7 @@ class MigrateBibles(object): try: self.session.add(book) self.session.commit() - except: + except InvalidRequestError: self.session.rollback() print u'Error thrown = ', sys.exc_info()[1] self.progress(u'Create verse table') @@ -171,14 +164,10 @@ class MigrateBibles(object): verse.text = verse_temp.text try: self.session.add(verse) - except: + self.session.commit() + except InvalidRequestError: self.session.rollback() print u'Error thrown = ', sys.exc_info()[1] - try: - self.session.commit() - except: - self.session.rollback() - print u'Error thrown = ', sys.exc_info()[1] self.progress(u'Create metadata table') results = self.session.query(TBibleMeta).order_by(TBibleMeta.key).all() for biblemeta_temp in results: @@ -188,7 +177,7 @@ class MigrateBibles(object): try: self.session.add(biblemeta) self.session.commit() - except: + except InvalidRequestError: self.session.rollback() print u'Error thrown = ', sys.exc_info()[1] @@ -206,3 +195,4 @@ class MigrateBibles(object): conn.commit() conn.execute(u'vacuum;') conn.commit() + diff --git a/openlp/migration/migratesongs.py b/openlp/migration/migratesongs.py index f7624e98c..87d5de40b 100644 --- a/openlp/migration/migratesongs.py +++ b/openlp/migration/migratesongs.py @@ -27,11 +27,11 @@ import os import sys import sqlite3 -from sqlalchemy import * from sqlalchemy import create_engine +from sqlalchemy.exceptions import InvalidRequestError from sqlalchemy.orm import scoped_session, sessionmaker, mapper, relation -from openlp.core.lib import SettingsManager +from openlp.core.lib import BaseModel, SettingsManager from openlp.core.utils import AppLocation from openlp.plugins.songs.lib.models import metadata, songs_table, Song, \ Author, Topic, Book @@ -159,7 +159,7 @@ class MigrateSongs(object): try: self.session.add(song) self.session.commit() - except: + except InvalidRequestError: self.session.rollback() print u'Error thrown = ', sys.exc_info()[1] diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 8fff3007c..6ac87e8e6 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -24,6 +24,7 @@ ############################################################################### from PyQt4 import QtCore, QtGui + from openlp.core.lib import translate class Ui_AlertDialog(object): @@ -31,7 +32,8 @@ class Ui_AlertDialog(object): AlertDialog.setObjectName(u'AlertDialog') AlertDialog.resize(567, 440) icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(u':/icon/openlp.org-icon-32.bmp'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon.addPixmap(QtGui.QPixmap(u':/icon/openlp.org-icon-32.bmp'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) AlertDialog.setWindowIcon(icon) self.AlertDialogLayout = QtGui.QVBoxLayout(AlertDialog) self.AlertDialogLayout.setSpacing(8) @@ -42,22 +44,28 @@ class Ui_AlertDialog(object): self.AlertTextLayout.setSpacing(8) self.AlertTextLayout.setObjectName(u'AlertTextLayout') self.AlertEntryLabel = QtGui.QLabel(AlertDialog) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, + QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.AlertEntryLabel.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.AlertEntryLabel.sizePolicy().hasHeightForWidth()) self.AlertEntryLabel.setSizePolicy(sizePolicy) self.AlertEntryLabel.setObjectName(u'AlertEntryLabel') - self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.AlertEntryLabel) + self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.AlertEntryLabel) self.AlertParameter = QtGui.QLabel(AlertDialog) self.AlertParameter.setObjectName(u'AlertParameter') - self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.AlertParameter) + self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.AlertParameter) self.ParameterEdit = QtGui.QLineEdit(AlertDialog) self.ParameterEdit.setObjectName(u'ParameterEdit') - self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.ParameterEdit) + self.AlertTextLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.ParameterEdit) self.AlertTextEdit = QtGui.QLineEdit(AlertDialog) self.AlertTextEdit.setObjectName(u'AlertTextEdit') - self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.AlertTextEdit) + self.AlertTextLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.AlertTextEdit) self.AlertDialogLayout.addLayout(self.AlertTextLayout) self.ManagementLayout = QtGui.QHBoxLayout() self.ManagementLayout.setSpacing(8) @@ -72,24 +80,28 @@ class Ui_AlertDialog(object): self.ManageButtonLayout.setObjectName(u'ManageButtonLayout') self.NewButton = QtGui.QPushButton(AlertDialog) icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap(u':/general/general_new.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon1.addPixmap(QtGui.QPixmap(u':/general/general_new.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.NewButton.setIcon(icon1) self.NewButton.setObjectName(u'NewButton') self.ManageButtonLayout.addWidget(self.NewButton) self.SaveButton = QtGui.QPushButton(AlertDialog) self.SaveButton.setEnabled(False) icon2 = QtGui.QIcon() - icon2.addPixmap(QtGui.QPixmap(u':/general/general_save.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon2.addPixmap(QtGui.QPixmap(u':/general/general_save.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.SaveButton.setIcon(icon2) self.SaveButton.setObjectName(u'SaveButton') self.ManageButtonLayout.addWidget(self.SaveButton) self.DeleteButton = QtGui.QPushButton(AlertDialog) icon3 = QtGui.QIcon() - icon3.addPixmap(QtGui.QPixmap(u':/general/general_delete.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon3.addPixmap(QtGui.QPixmap(u':/general/general_delete.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.DeleteButton.setIcon(icon3) self.DeleteButton.setObjectName(u'DeleteButton') self.ManageButtonLayout.addWidget(self.DeleteButton) - spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Expanding) self.ManageButtonLayout.addItem(spacerItem) self.ManagementLayout.addLayout(self.ManageButtonLayout) self.AlertDialogLayout.addLayout(self.ManagementLayout) @@ -122,7 +134,8 @@ class Ui_AlertDialog(object): self.AlertParameter.setBuddy(self.ParameterEdit) self.retranslateUi(AlertDialog) - QtCore.QObject.connect(self.CloseButton, QtCore.SIGNAL(u'clicked()'), AlertDialog.close) + QtCore.QObject.connect(self.CloseButton, QtCore.SIGNAL(u'clicked()'), + AlertDialog.close) QtCore.QMetaObject.connectSlotsByName(AlertDialog) AlertDialog.setTabOrder(self.AlertTextEdit, self.ParameterEdit) AlertDialog.setTabOrder(self.ParameterEdit, self.AlertListWidget) diff --git a/openlp/plugins/alerts/lib/classes.py b/openlp/plugins/alerts/lib/classes.py index fd1883b71..e58f80829 100644 --- a/openlp/plugins/alerts/lib/classes.py +++ b/openlp/plugins/alerts/lib/classes.py @@ -23,21 +23,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -class BaseModel(object): - """ - BaseModel provides a base object with a set of generic functions - """ - - @classmethod - def populate(cls, **kwargs): - """ - Creates an instance of a class and populates it, returning the instance - """ - me = cls() - keys = kwargs.keys() - for key in keys: - me.__setattr__(key, kwargs[key]) - return me +from openlp.core.lib import BaseModel class AlertItem(BaseModel): """ diff --git a/openlp/plugins/alerts/lib/manager.py b/openlp/plugins/alerts/lib/manager.py index 9d9c87fbb..088f0cbae 100644 --- a/openlp/plugins/alerts/lib/manager.py +++ b/openlp/plugins/alerts/lib/manager.py @@ -26,6 +26,7 @@ import logging from PyQt4 import QtCore +from sqlalchemy.exceptions import InvalidRequestError from openlp.core.utils import AppLocation from openlp.plugins.alerts.lib.models import init_models, metadata, AlertItem @@ -80,7 +81,7 @@ class DBManager(object): self.session.commit() log.debug(u'Alert saved') return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Alert save failed') return False @@ -104,7 +105,7 @@ class DBManager(object): self.session.delete(alert_item) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Alert deleton failed') return False diff --git a/openlp/plugins/alerts/lib/models.py b/openlp/plugins/alerts/lib/models.py index d95ebce5d..f222345f1 100644 --- a/openlp/plugins/alerts/lib/models.py +++ b/openlp/plugins/alerts/lib/models.py @@ -34,6 +34,6 @@ def init_models(url): engine = create_engine(url) metadata.bind = engine session = scoped_session(sessionmaker(autoflush=True, autocommit=False, - bind=engine)) + bind=engine)) mapper(AlertItem, alerts_table) return session diff --git a/openlp/plugins/bibles/forms/bibleimportwizard.py b/openlp/plugins/bibles/forms/bibleimportwizard.py index 48fef9bf0..61e7c5fe0 100644 --- a/openlp/plugins/bibles/forms/bibleimportwizard.py +++ b/openlp/plugins/bibles/forms/bibleimportwizard.py @@ -383,4 +383,3 @@ class Ui_BibleImportWizard(object): translate(u'BiblesPlugin.ImportWizardForm', u'Ready.')) self.ImportProgressBar.setFormat(u'%p%') - diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index 00ecce6d5..4aa584d4d 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -146,7 +146,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.CsvVerseLocationEdit.setFocus() return False - elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenSong: + elif self.field(u'source_format').toInt()[0] == \ + BibleFormat.OpenSong: if self.field(u'opensong_file').toString() == u'': QtGui.QMessageBox.critical(self, translate(u'BiblesPlugin.ImportWizardForm', u'Invalid OpenSong Bible'), @@ -159,7 +160,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): elif self.currentId() == 2: # License details license_version = variant_to_unicode(self.field(u'license_version')) - license_copyright = variant_to_unicode(self.field(u'license_copyright')) + license_copyright = variant_to_unicode( + self.field(u'license_copyright')) if license_version == u'': QtGui.QMessageBox.critical(self, translate(u'BiblesPlugin.ImportWizardForm', u'Empty Version Name'), @@ -323,7 +325,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): if not isinstance(name, unicode): name = unicode(name, u'utf8') self.web_bible_list[WebDownload.Crosswalk][ver] = name.strip() - except: + except IOError: log.exception(u'Crosswalk resources missing') finally: if books_file: @@ -342,8 +344,9 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): ver = unicode(ver, u'utf8') if not isinstance(name, unicode): name = unicode(name, u'utf8') - self.web_bible_list[WebDownload.BibleGateway][ver] = name.strip() - except: + self.web_bible_list[WebDownload.BibleGateway][ver] = \ + name.strip() + except IOError: log.exception(u'Biblegateway resources missing') finally: if books_file: @@ -406,16 +409,19 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): if not isinstance(bible_version, unicode): bible_version = unicode(bible_version, u'utf8') if download_location == WebDownload.Crosswalk: - bible = self.web_bible_list[WebDownload.Crosswalk][bible_version] + bible = \ + self.web_bible_list[WebDownload.Crosswalk][bible_version] elif download_location == WebDownload.BibleGateway: - bible = self.web_bible_list[WebDownload.BibleGateway][bible_version] + bible = \ + self.web_bible_list[WebDownload.BibleGateway][bible_version] importer = self.manager.import_bible( BibleFormat.WebDownload, name=license_version, download_source=WebDownload.get_name(download_location), download_name=bible, proxy_server=variant_to_unicode(self.field(u'proxy_server')), - proxy_username=variant_to_unicode(self.field(u'proxy_username')), + proxy_username=variant_to_unicode( + self.field(u'proxy_username')), proxy_password=variant_to_unicode(self.field(u'proxy_password')) ) success = importer.do_import() @@ -438,4 +444,3 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): self.cancelButton.setVisible(False) Receiver.send_message(u'openlp_process_events') - diff --git a/openlp/plugins/bibles/lib/common.py b/openlp/plugins/bibles/lib/common.py index 94d83ce3d..8313354c2 100644 --- a/openlp/plugins/bibles/lib/common.py +++ b/openlp/plugins/bibles/lib/common.py @@ -30,7 +30,8 @@ import chardet import htmlentitydefs only_verses = re.compile(r'([\w .]+)[ ]+([0-9]+)[ ]*[:|v|V][ ]*([0-9]+)' - r'(?:[ ]*-[ ]*([0-9]+|end))?(?:[ ]*,[ ]*([0-9]+)(?:[ ]*-[ ]*([0-9]+|end))?)?', + r'(?:[ ]*-[ ]*([0-9]+|end))?(?:[ ]*,[ ]*([0-9]+)' + r'(?:[ ]*-[ ]*([0-9]+|end))?)?', re.UNICODE) chapter_range = re.compile(r'([\w .]+)[ ]+([0-9]+)[ ]*[:|v|V][ ]*' r'([0-9]+|end)[ ]*-[ ]*([0-9]+)[ ]*[:|v|V][ ]*([0-9]+|end)', diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index 54775bd35..faaccf303 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -80,7 +80,7 @@ class CSVBible(BibleDB): self.create_book(unicode(line[1], details['encoding']), line[2], int(line[0])) Receiver.send_message(u'openlp_process_events') - except: + except IOError: log.exception(u'Loading books from file failed') success = False finally: @@ -109,7 +109,7 @@ class CSVBible(BibleDB): unicode(line[3], details['encoding'])) Receiver.send_message(u'openlp_process_events') self.commit() - except: + except IOError: log.exception(u'Loading verses from file failed') success = False finally: diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 79a650541..02b0a82aa 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -87,8 +87,8 @@ class BibleDB(QtCore.QObject): unicode(settings.value(u'db hostname').toString()), unicode(settings.value(u'db database').toString())) settings.endGroup() - self.metadata, self.session = init_models(db_url) - self.metadata.create_all(checkfirst=True) + self.session = init_models(db_url) + metadata.create_all(checkfirst=True) if u'file' in kwargs: self.get_name() @@ -123,7 +123,7 @@ class BibleDB(QtCore.QObject): try: os.remove(self.db_file) return True - except: + except OSError: return False def register(self, wizard): @@ -320,12 +320,14 @@ class BibleDB(QtCore.QObject): verses = self.session.query(Verse) if text.find(u',') > -1: or_clause = [] - keywords = [u'%%%s%%' % keyword.strip() for keyword in text.split(u',')] + keywords = [u'%%%s%%' % keyword.strip() + for keyword in text.split(u',')] for keyword in keywords: or_clause.append(Verse.text.like(keyword)) verses = verses.filter(or_(*or_clause)) else: - keywords = [u'%%%s%%' % keyword.strip() for keyword in text.split(u' ')] + keywords = [u'%%%s%%' % keyword.strip() + for keyword in text.split(u' ')] for keyword in keywords: verses = verses.filter(Verse.text.like(keyword)) verses = verses.all() diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 6cb7fe75b..eb86ec4ae 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -33,8 +33,9 @@ from BeautifulSoup import BeautifulSoup, Tag, NavigableString from openlp.core.lib import Receiver from openlp.core.utils import AppLocation -from common import BibleCommon, SearchResults, unescape -from db import BibleDB +from openlp.plugins.bibles.lib.common import BibleCommon, SearchResults, \ + unescape +from openlp.plugins.bibles.lib.db import BibleDB from openlp.plugins.bibles.lib.models import Book log = logging.getLogger(__name__) @@ -462,7 +463,8 @@ class HTTPBible(BibleDB): """ Return the list of books. """ - return [Book.populate(name=book['name']) for book in HTTPBooks.get_books()] + return [Book.populate(name=book['name']) + for book in HTTPBooks.get_books()] def lookup_book(self, book): """ diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 8a87288f3..7ef18a604 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -181,7 +181,7 @@ class BibleManager(object): Returns a list of the names of available Bibles. """ log.debug(u'get_bibles') - return [name for name, bible in self.db_cache.iteritems()] + return self.db_cache.keys() def get_books(self, bible): """ diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 47518ac85..7d75764be 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -460,10 +460,14 @@ class BibleMediaItem(MediaManagerItem): if bible2: bible2_verses = [] for scripture in self.lastReference: - bible2_verses.extend(self.parent.manager.get_verses(bible2, scripture)) - bible2_version = self.parent.manager.get_meta_data(bible2, u'Version') - bible2_copyright = self.parent.manager.get_meta_data(bible2, u'Copyright') - bible2_permission = self.parent.manager.get_meta_data(bible2, u'Permissions') + bible2_verses.extend(self.parent.manager.get_verses(bible2, + scripture)) + bible2_version = self.parent.manager.get_meta_data(bible2, + u'Version') + bible2_copyright = self.parent.manager.get_meta_data(bible2, + u'Copyright') + bible2_permission = self.parent.manager.get_meta_data(bible2, + u'Permissions') if bible2_version: bible2_version = bible2_version.value else: @@ -491,25 +495,30 @@ class BibleMediaItem(MediaManagerItem): copyright = self._decodeQtObject(reference, 'copyright') permission = self._decodeQtObject(reference, 'permission') if self.parent.settings_tab.display_style == 1: - verse_text = self.formatVerse(old_chapter, chapter, verse, u'(u', u')') + verse_text = self.formatVerse(old_chapter, chapter, verse, + u'(u', u')') elif self.parent.settings_tab.display_style == 2: - verse_text = self.formatVerse(old_chapter, chapter, verse, u'{', u'}') + verse_text = self.formatVerse(old_chapter, chapter, verse, + u'{', u'}') elif self.parent.settings_tab.display_style == 3: - verse_text = self.formatVerse(old_chapter, chapter, verse, u'[', u']') + verse_text = self.formatVerse(old_chapter, chapter, verse, + u'[', u']') else: - verse_text = self.formatVerse(old_chapter, chapter, verse, u'', u'') + verse_text = self.formatVerse(old_chapter, chapter, verse, + u'', u'') old_chapter = chapter footer = u'%s (%s %s)' % (book, version, copyright) #If not found add to footer if footer not in raw_footer: raw_footer.append(footer) if bible2: - footer = u'%s (%s %s)' % (book, bible2_version, bible2_copyright) + footer = u'%s (%s %s)' % (book, bible2_version, + bible2_copyright) #If not found add second version and copyright to footer if footer not in raw_footer: raw_footer.append(footer) - bible_text = u'%s %s \n\n %s %s' % \ - (verse_text, text, verse_text, bible2_verses[item.row()].text) + bible_text = u'%s %s \n\n %s %s' % (verse_text, text, + verse_text, bible2_verses[item.row()].text) raw_slides.append(bible_text) bible_text = u'' else: diff --git a/openlp/plugins/bibles/lib/models.py b/openlp/plugins/bibles/lib/models.py index 4631b1e32..d970bce08 100644 --- a/openlp/plugins/bibles/lib/models.py +++ b/openlp/plugins/bibles/lib/models.py @@ -27,20 +27,7 @@ from sqlalchemy import Column, Table, MetaData, ForeignKey, types, \ create_engine from sqlalchemy.orm import mapper, relation, sessionmaker, scoped_session -class BaseModel(object): - """ - BaseModel provides a base object with a set of generic functions - """ - @classmethod - def populate(cls, **kwargs): - """ - Creates an instance of a class and populates it, returning the instance - """ - me = cls() - keys = kwargs.keys() - for key in keys: - me.__setattr__(key, kwargs[key]) - return me +from openlp.core.lib import BaseModel class BibleMeta(BaseModel): @@ -73,10 +60,9 @@ class Verse(BaseModel): def init_models(db_url): engine = create_engine(db_url) metadata.bind = engine - session = scoped_session(sessionmaker(autoflush=True, - autocommit=False, - bind=engine)) - return metadata, session + session = scoped_session(sessionmaker(autoflush=True, autocommit=False, + bind=engine)) + return session metadata = MetaData() meta_table = Table(u'metadata', metadata, diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 3160d4b87..585b5bae0 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -98,7 +98,7 @@ class OpenSongBible(BibleDB): translate(u'BiblesPlugin.Opensong', u'Importing'),\ db_book.name, chapter.attrib[u'n']))) self.commit() - except: + except IOError: log.exception(u'Loading bible from OpenSong file failed') success = False finally: diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 9763ff24b..c6779c132 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -78,7 +78,7 @@ class OSISBible(BibleDB): book = line.split(u',') self.books[book[0]] = (book[1].lstrip().rstrip(), book[2].lstrip().rstrip()) - except: + except IOError: log.exception(u'OSIS bible import failed') finally: if fbibles: @@ -104,7 +104,7 @@ class OSISBible(BibleDB): try: detect_file = open(self.filename, u'r') details = chardet.detect(detect_file.read()) - except: + except IOError: log.exception(u'Failed to detect OSIS file encoding') return finally: @@ -173,7 +173,7 @@ class OSISBible(BibleDB): self.wizard.incrementProgressBar(u'Finishing import...') if match_count == 0: success = False - except: + except (ValueError, IOError): log.exception(u'Loading bible from OSIS file failed') success = False finally: @@ -185,4 +185,3 @@ class OSISBible(BibleDB): else: return success - diff --git a/openlp/plugins/custom/lib/classes.py b/openlp/plugins/custom/lib/classes.py index 305852df2..dc6c5c1b8 100644 --- a/openlp/plugins/custom/lib/classes.py +++ b/openlp/plugins/custom/lib/classes.py @@ -23,21 +23,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -class BaseModel(object): - """ - BaseModel provides a base object with a set of generic functions - """ - - @classmethod - def populate(cls, **kwargs): - """ - Creates an instance of a class and populates it, returning the instance - """ - me = cls() - keys = kwargs.keys() - for key in keys: - me.__setattr__(key, kwargs[key]) - return me +from openlp.core.lib import BaseModel class CustomSlide(BaseModel): """ diff --git a/openlp/plugins/custom/lib/manager.py b/openlp/plugins/custom/lib/manager.py index b5e0e8411..793cd8699 100644 --- a/openlp/plugins/custom/lib/manager.py +++ b/openlp/plugins/custom/lib/manager.py @@ -26,6 +26,7 @@ import logging from PyQt4 import QtCore +from sqlalchemy.exceptions import InvalidRequestError from openlp.core.utils import AppLocation from openlp.plugins.custom.lib.models import init_models, metadata, CustomSlide @@ -80,7 +81,7 @@ class CustomManager(object): self.session.commit() log.debug(u'Custom Slide saved') return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Custom Slide save failed') return False @@ -104,7 +105,7 @@ class CustomManager(object): self.session.delete(customslide) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Custom Slide deleton failed') return False diff --git a/openlp/plugins/custom/lib/models.py b/openlp/plugins/custom/lib/models.py index d75968882..3bd2886bd 100644 --- a/openlp/plugins/custom/lib/models.py +++ b/openlp/plugins/custom/lib/models.py @@ -34,6 +34,6 @@ def init_models(url): engine = create_engine(url) metadata.bind = engine session = scoped_session(sessionmaker(autoflush=True, autocommit=False, - bind=engine)) + bind=engine)) mapper(CustomSlide, custom_slide_table) return session diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index a6f9880a9..53210eb8b 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -119,7 +119,7 @@ class ImageMediaItem(MediaManagerItem): try: os.remove( os.path.join(self.servicePath, unicode(text.text()))) - except: + except OSError: #if not present do not worry pass self.ListView.takeItem(item.row()) @@ -128,7 +128,7 @@ class ImageMediaItem(MediaManagerItem): def loadList(self, list): for file in list: - (path, filename) = os.path.split(unicode(file)) + filename = os.path.split(unicode(file))[1] thumb = os.path.join(self.servicePath, filename) if os.path.exists(thumb): if self.validate(file, thumb): diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 715aecc60..82579f24b 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -148,7 +148,7 @@ class MediaMediaItem(MediaManagerItem): def loadList(self, list): for file in list: - (path, filename) = os.path.split(unicode(file)) + filename = os.path.split(unicode(file))[1] item_name = QtGui.QListWidgetItem(filename) img = QtGui.QPixmap(u':/media/media_video.png').toImage() item_name.setIcon(build_icon(img)) diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index d79062a2a..d75136e21 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -176,14 +176,12 @@ class ImpressController(PresentationController): return doc class ImpressDocument(PresentationDocument): - def __init__(self, controller, presentation): log.debug(u'Init Presentation OpenOffice') - self.controller = controller + PresentationDocument.__init__(controller, presentation) self.document = None self.presentation = None self.control = None - self.store_filename(presentation) def load_presentation(self): """ diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 91dc6aed5..54c6a9488 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -136,7 +136,7 @@ class PresentationMediaItem(MediaManagerItem): for file in list: if currlist.count(file) > 0: continue - (path, filename) = os.path.split(unicode(file)) + filename = os.path.split(unicode(file))[1] if titles.count(filename) > 0: QtGui.QMessageBox.critical( self, translate(u'PresentationPlugin.MediaItem', diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index b5b6b6879..0e98b377a 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -256,35 +256,35 @@ class MessageListener(object): self.previewHandler.slide(slide, isLive) def first(self, message): - isLive, item = self.decode_message(message) + isLive = self.decode_message(message)[0] if isLive: self.liveHandler.first() else: self.previewHandler.first() def last(self, message): - isLive, item = self.decode_message(message) + isLive = self.decode_message(message)[0] if isLive: self.liveHandler.last() else: self.previewHandler.last() def next(self, message): - isLive, item = self.decode_message(message) + isLive = self.decode_message(message)[0] if isLive: self.liveHandler.next() else: self.previewHandler.next() def previous(self, message): - isLive, item = self.decode_message(message) + isLive = self.decode_message(message)[0] if isLive: self.liveHandler.previous() else: self.previewHandler.previous() def shutdown(self, message): - isLive, item = self.decode_message(message) + isLive = self.decode_message(message)[0] if isLive: Receiver.send_message(u'maindisplay_show') self.liveHandler.shutdown() @@ -292,17 +292,17 @@ class MessageListener(object): self.previewHandler.shutdown() def hide(self, message): - isLive, item = self.decode_message(message) + isLive = self.decode_message(message)[0] if isLive: self.liveHandler.stop() def blank(self, message): - isLive, item = self.decode_message(message) + isLive = self.decode_message(message)[0] if isLive: self.liveHandler.blank() def unblank(self, message): - isLive, item = self.decode_message(message) + isLive = self.decode_message(message)[0] if isLive: self.liveHandler.unblank() diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 3ea95f509..05ef7e4f1 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -102,12 +102,10 @@ class PowerpointController(PresentationController): return doc class PowerpointDocument(PresentationDocument): - def __init__(self, controller, presentation): log.debug(u'Init Presentation Powerpoint') + PresentationDocument.__init__(controller, presentation) self.presentation = None - self.controller = controller - self.store_filename(presentation) def load_presentation(self): """ diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index b4102f5fe..59cf1ff3b 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -102,11 +102,10 @@ class PptviewController(PresentationController): class PptviewDocument(PresentationDocument): def __init__(self, controller, presentation): log.debug(u'Init Presentation PowerPoint') + PresentationDocument.__init__(controller, presentation) self.presentation = None self.pptid = None self.blanked = False - self.controller = controller - self.store_filename(presentation) def load_presentation(self): """ diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index c0eb7e5f1..3d2836041 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -100,16 +100,17 @@ class PresentationController(object): self.docs = [] self.plugin = plugin self.name = name - self.settingsSection = self.plugin.settingsSection + self.settings_section = self.plugin.settingsSection self.available = self.check_available() if self.available: self.enabled = QtCore.QSettings().value( - self.settingsSection + u'/' + name, - QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] == QtCore.Qt.Checked + self.settings_section + u'/' + name, + QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] == \ + QtCore.Qt.Checked else: self.enabled = False self.thumbnailroot = os.path.join( - AppLocation.get_section_data_path(self.settingsSection), + AppLocation.get_section_data_path(self.settings_section), name, u'thumbnails') self.thumbnailprefix = u'slide' if not os.path.isdir(self.thumbnailroot): @@ -123,7 +124,8 @@ class PresentationController(object): def start_process(self): """ - Loads a running version of the presentation application in the background. + Loads a running version of the presentation application in the + background. """ pass @@ -231,7 +233,10 @@ class PresentationDocument(object): Cleans up/deletes any controller specific files created for a file, e.g. thumbnails """ - shutil.rmtree(self.thumbnailpath) + try: + shutil.rmtree(self.thumbnailpath) + except OSError: + log.exception(u'Failed to delete presentation controller files') def store_filename(self, presentation): """ @@ -388,3 +393,4 @@ class PresentationDocument(object): The slide the notes are required for, starting at 1 """ return '' + diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 0ac21b924..36515df16 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -191,7 +191,7 @@ class HttpConnection(object): path = os.path.normpath(os.path.join(self.parent.html_dir, filename)) if not path.startswith(self.parent.html_dir): return None - (fileroot, ext) = os.path.splitext(filename) + ext = os.path.splitext(filename)[1] if ext == u'.html': mimetype = u'text/html' elif ext == u'.css': diff --git a/openlp/plugins/songs/forms/__init__.py b/openlp/plugins/songs/forms/__init__.py index 1073b6866..90b983b97 100644 --- a/openlp/plugins/songs/forms/__init__.py +++ b/openlp/plugins/songs/forms/__init__.py @@ -23,6 +23,52 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +from openlp.core.lib import translate + +class VerseType(object): + Verse = 0 + Chorus = 1 + Bridge = 2 + PreChorus = 3 + Intro = 4 + Ending = 5 + Other = 6 + + @staticmethod + def to_string(verse_type): + if verse_type == VerseType.Verse: + return translate('VerseType', 'Verse') + elif verse_type == VerseType.Chorus: + return translate('VerseType', 'Chorus') + elif verse_type == VerseType.Bridge: + return translate('VerseType', 'Bridge') + elif verse_type == VerseType.PreChorus: + return translate('VerseType', 'Pre-Chorus') + elif verse_type == VerseType.Intro: + return translate('VerseType', 'Intro') + elif verse_type == VerseType.Ending: + return translate('VerseType', 'Ending') + elif verse_type == VerseType.Other: + return translate('VerseType', 'Other') + + @staticmethod + def from_string(verse_type): + verse_type = verse_type.lower() + if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower(): + return VerseType.Verse + elif verse_type == unicode(VerseType.to_string(VerseType.Chorus)).lower(): + return VerseType.Chorus + elif verse_type == unicode(VerseType.to_string(VerseType.Bridge)).lower(): + return VerseType.Bridge + elif verse_type == unicode(VerseType.to_string(VerseType.PreChorus)).lower(): + return VerseType.PreChorus + elif verse_type == unicode(VerseType.to_string(VerseType.Intro)).lower(): + return VerseType.Intro + elif verse_type == unicode(VerseType.to_string(VerseType.Ending)).lower(): + return VerseType.Ending + elif verse_type == unicode(VerseType.to_string(VerseType.Other)).lower(): + return VerseType.Other + from authorsform import AuthorsForm from topicsform import TopicsForm from songbookform import SongBookForm diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index 04d0f8c28..4d7fcd4b6 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -39,11 +39,13 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) - self.autoDisplayName = False + self._autoDisplayName = False QtCore.QObject.connect(self.FirstNameEdit, - QtCore.SIGNAL(u'textEdited(QString)'), self.onFirstNameEditTextEdited) + QtCore.SIGNAL(u'textEdited(QString)'), + self.onFirstNameEditTextEdited) QtCore.QObject.connect(self.LastNameEdit, - QtCore.SIGNAL(u'textEdited(QString)'), self.onLastNameEditTextEdited) + QtCore.SIGNAL(u'textEdited(QString)'), + self.onLastNameEditTextEdited) def exec_(self, clear=True): if clear: @@ -54,7 +56,7 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): return QtGui.QDialog.exec_(self) def onFirstNameEditTextEdited(self, text): - if not self.autoDisplayName: + if not self._autoDisplayName: return display_name = text if self.LastNameEdit.text() != u'': @@ -62,7 +64,7 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): self.DisplayEdit.setText(display_name) def onLastNameEditTextEdited(self, text): - if not self.autoDisplayName: + if not self._autoDisplayName: return display_name = text if self.FirstNameEdit.text() != u'': @@ -70,10 +72,10 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): self.DisplayEdit.setText(display_name) def autoDisplayName(self): - return self.autoDisplayName + return self._autoDisplayName def setAutoDisplayName(self, on): - self.autoDisplayName = on + self._autoDisplayName = on def accept(self): if not self.FirstNameEdit.text(): @@ -110,3 +112,4 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): return False else: return QtGui.QDialog.accept(self) + diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 7c258387d..d989cb7b7 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -101,6 +101,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): QtCore.QObject.connect(self.VerseOrderEdit, QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus) self.previewButton = QtGui.QPushButton() + self.previewButton.setObjectName(u'previewButton') self.previewButton.setText( translate(u'SongsPlugin.EditSongForm', u'Save && Preview')) self.ButtonBox.addButton( @@ -371,7 +372,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): item.setText(afterText) self.VerseListWidget.setRowCount( self.VerseListWidget.rowCount() + 1) - self.VerseListWidget.setItem(int(self.VerseListWidget.rowCount() - 1), 0, item) + self.VerseListWidget.setItem( + int(self.VerseListWidget.rowCount() - 1), 0, item) self.VerseListWidget.setColumnWidth(0, self.width) self.VerseListWidget.resizeRowsToContents() self.tagRows() @@ -472,47 +474,35 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.SongTabWidget.setCurrentIndex(1) self.AuthorsListView.setFocus() #split the verse list by space and mark lower case for testing - taglist = unicode(translate(u'SongsPlugin.EditSongForm', u' bitped')) + taglist = unicode(translate(u'SongsPlugin.EditSongForm', u' bitpeovc')) for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '): if len(verse) > 1: - if (verse[0:1] == u'%s' % translate(u'SongsPlugin.EditSongForm', - u'v') or - verse[0:1] == u'%s' % translate(u'SongsPlugin.EditSongForm', - u'c')) \ + if taglist.find(verse[0:1]) > -1 \ and verse[1:].isdigit(): pass else: self.SongTabWidget.setCurrentIndex(0) self.VerseOrderEdit.setFocus() return False, \ - translate(u'SongsPlugin.EditSongForm', - u'Invalid verse entry - Vx or Cx') - else: - if taglist.find(verse) > -1: - pass - else: - self.SongTabWidget.setCurrentIndex(0) - self.VerseOrderEdit.setFocus() - return False, \ - translate(u'SongsPlugin.EditSongForm',\ - u'Invalid verse entry, values must be ' - u'I,B,T,P,E,O,Vx,Cx') + translate(u'SongsPlugin.EditSongForm', + u'Invalid verse entry, values must be I,B,T,P,E,O,V,C ' + u'followed by a number') return True, u'' def onTitleEditItemLostFocus(self): - self.song.title = self.TitleEditItem.text() + self.song.title = unicode(self.TitleEditItem.text()) def onVerseOrderEditLostFocus(self): - self.song.verse_order = self.VerseOrderEdit.text() + self.song.verse_order = unicode(self.VerseOrderEdit.text()) def onCommentsEditLostFocus(self): - self.song.comments = self.CommentsEdit.text() + self.song.comments = unicode(self.CommentsEdit.text()) def onCCLNumberEditLostFocus(self): self.song.ccli_number = self.CCLNumberEdit.text() def onCopyrightInsertButtonTriggered(self): - text = self.CopyrightEditItem.displayText() + text = self.CopyrightEditItem.text() pos = self.CopyrightEditItem.cursorPosition() text = text[:pos] + u'©' + text[pos:] self.CopyrightEditItem.setText(text) @@ -531,9 +521,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): The Song is valid so as the plugin to add it to preview to see. """ log.debug(u'onPreview') - if button.text() == unicode( - translate(u'SongsPlugin.EditSongForm', u'Save && Preview')) \ - and self.saveSong(): + if unicode(button.objectName()) == u'previewButton' and self.saveSong(): Receiver.send_message(u'songs_preview') def closePressed(self): @@ -553,13 +541,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self, translate(u'SongsPlugin.EditSongForm', u'Error'), message, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return False - self.song.title = unicode(self.TitleEditItem.displayText()) - self.song.copyright = unicode(self.CopyrightEditItem.displayText()) - self.song.search_title = unicode(self.TitleEditItem.displayText()) + \ - u'@'+ unicode(self.AlternativeEdit.displayText()) + self.song.title = unicode(self.TitleEditItem.text()) + self.song.copyright = unicode(self.CopyrightEditItem.text()) + self.song.search_title = unicode(self.TitleEditItem.text()) + \ + u'@'+ unicode(self.AlternativeEdit.text()) self.song.comments = unicode(self.CommentsEdit.toPlainText()) self.song.verse_order = unicode(self.VerseOrderEdit.text()) - self.song.ccli_number = unicode(self.CCLNumberEdit.displayText()) + self.song.ccli_number = unicode(self.CCLNumberEdit.text()) self.processLyrics() self.processTitle() self.songmanager.save_song(self.song) @@ -577,7 +565,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode((item.data(QtCore.Qt.UserRole)).toString()) bits = verseId.split(u':') sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text())) - text = text + unicode(self.VerseListWidget.item(i, 0).text()) + u' ' + text = text + unicode(self.VerseListWidget.item(i, 0).text()) \ + + u' ' text = text.replace(u'\'', u'') text = text.replace(u',', u'') text = text.replace(u';', u'') @@ -595,6 +584,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def processTitle(self): log.debug(u'processTitle') + self.song.search_title = unicode(self.song.search_title) 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'') @@ -606,6 +596,5 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): 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 = unicode(self.song.search_title) diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 81db6303d..c4d098671 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -24,7 +24,9 @@ ############################################################################### from PyQt4 import QtCore, QtGui + from openlp.core.lib import translate +from openlp.plugins.songs.forms import VerseType class Ui_EditVerseDialog(object): def setupUi(self, EditVerseDialog): @@ -94,20 +96,13 @@ class Ui_EditVerseDialog(object): translate(u'SongsPlugin.EditVerseForm', u'Edit Verse')) self.VerseTypeLabel.setText( translate(u'SongsPlugin.EditVerseForm', u'Verse Type:')) - self.VerseTypeComboBox.setItemText(0, - translate(u'SongsPlugin.EditVerseForm', u'Verse')) - self.VerseTypeComboBox.setItemText(1, - translate(u'SongsPlugin.EditVerseForm', u'Chorus')) - self.VerseTypeComboBox.setItemText(2, - translate(u'SongsPlugin.EditVerseForm', u'Bridge')) - self.VerseTypeComboBox.setItemText(3, - translate(u'SongsPlugin.EditVerseForm', u'Pre-Chorus')) - self.VerseTypeComboBox.setItemText(4, - translate(u'SongsPlugin.EditVerseForm', u'Intro')) - self.VerseTypeComboBox.setItemText(5, - translate(u'SongsPlugin.EditVerseForm', u'Ending')) - self.VerseTypeComboBox.setItemText(6, - translate(u'SongsPlugin.EditVerseForm', u'Other')) + self.VerseTypeComboBox.setItemText(0, VerseType.to_string(VerseType.Verse)) + self.VerseTypeComboBox.setItemText(1, VerseType.to_string(VerseType.Chorus)) + self.VerseTypeComboBox.setItemText(2, VerseType.to_string(VerseType.Bridge)) + self.VerseTypeComboBox.setItemText(3, VerseType.to_string(VerseType.PreChorus)) + self.VerseTypeComboBox.setItemText(4, VerseType.to_string(VerseType.Intro)) + self.VerseTypeComboBox.setItemText(5, VerseType.to_string(VerseType.Ending)) + self.VerseTypeComboBox.setItemText(6, VerseType.to_string(VerseType.Other)) self.InsertButton.setText( translate(u'SongsPlugin.EditVerseForm', u'Insert')) diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index 6dbe21cea..eb74cfd84 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -28,55 +28,12 @@ import logging from PyQt4 import QtCore, QtGui +from openlp.plugins.songs.forms import VerseType + from editversedialog import Ui_EditVerseDialog log = logging.getLogger(__name__) -class VerseType(object): - Verse = 0 - Chorus = 1 - Bridge = 2 - PreChorus = 3 - Intro = 4 - Ending = 5 - Other = 6 - - @staticmethod - def to_string(verse_type): - if verse_type == VerseType.Verse: - return u'Verse' - elif verse_type == VerseType.Chorus: - return u'Chorus' - elif verse_type == VerseType.Bridge: - return u'Bridge' - elif verse_type == VerseType.PreChorus: - return u'Pre-Chorus' - elif verse_type == VerseType.Intro: - return u'Intro' - elif verse_type == VerseType.Ending: - return u'Ending' - elif verse_type == VerseType.Other: - return u'Other' - - @staticmethod - def from_string(verse_type): - verse_type = verse_type.lower() - if verse_type == u'verse': - return VerseType.Verse - elif verse_type == u'chorus': - return VerseType.Chorus - elif verse_type == u'bridge': - return VerseType.Bridge - elif verse_type == u'pre-chorus': - return VerseType.PreChorus - elif verse_type == u'intro': - return VerseType.Intro - elif verse_type == u'ending': - return VerseType.Ending - elif verse_type == u'other': - return VerseType.Other - - class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): """ This is the form that is used to edit the verses of the song. @@ -97,8 +54,6 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.SIGNAL(u'cursorPositionChanged()'), self.onCursorPositionChanged ) -# QtCore.QObject.connect(self.VerseListComboBox, -# QtCore.SIGNAL(u'activated(int)'), self.onVerseComboChanged) self.verse_regex = re.compile(r'---\[([-\w]+):([\d]+)\]---') def insertVerse(self, title, num=1): @@ -112,19 +67,21 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): self.VerseTextEdit.insertPlainText(u'\n') verse_type = self.VerseTypeComboBox.currentIndex() if verse_type == VerseType.Verse: - self.insertVerse('Verse', self.VerseNumberBox.value()) + self.insertVerse(VerseType.to_string(VerseType.Verse), + self.VerseNumberBox.value()) elif verse_type == VerseType.Chorus: - self.insertVerse('Chorus', self.VerseNumberBox.value()) + self.insertVerse(VerseType.to_string(VerseType.Chorus), + self.VerseNumberBox.value()) elif verse_type == VerseType.Bridge: - self.insertVerse('Bridge') + self.insertVerse(VerseType.to_string(VerseType.Bridge)) elif verse_type == VerseType.PreChorus: - self.insertVerse('Pre-Chorus') + self.insertVerse(VerseType.to_string(VerseType.PreChorus)) elif verse_type == VerseType.Intro: - self.insertVerse('Intro') + self.insertVerse(VerseType.to_string(VerseType.Intro)) elif verse_type == VerseType.Ending: - self.insertVerse('Ending') + self.insertVerse(VerseType.to_string(VerseType.Ending)) elif verse_type == VerseType.Other: - self.insertVerse('Other') + self.insertVerse(VerseType.to_string(VerseType.Other)) def onCursorPositionChanged(self): position = self.VerseTextEdit.textCursor().position() @@ -149,7 +106,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): self.VerseTypeComboBox.setCurrentIndex(VerseType.from_string(verse_type)) self.VerseNumberBox.setValue(verse_number) - def setVerse(self, text, single=False, tag=u'Verse:1'): + def setVerse(self, text, single=False, + tag=u'%s:1' % VerseType.to_string(VerseType.Verse)): if single: verse_type, verse_number = tag.split(u':') self.VerseTypeComboBox.setCurrentIndex(VerseType.from_string(verse_type)) @@ -157,12 +115,13 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): self.InsertButton.setVisible(False) else: if not text: - text = u'---[Verse:1]---\n' + text = u'---[%s:1]---\n' % VerseType.to_string(VerseType.Verse) self.VerseTypeComboBox.setCurrentIndex(0) self.VerseNumberBox.setValue(1) self.InsertButton.setVisible(True) self.VerseTextEdit.setPlainText(text) self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason) + self.VerseTextEdit.moveCursor(QtGui.QTextCursor.End) def getVerse(self): return self.VerseTextEdit.toPlainText(), \ @@ -172,7 +131,6 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): def getVerseAll(self): text = self.VerseTextEdit.toPlainText() if not text.startsWith(u'---['): - text = u'---[Verse:1]---\n%s' % text + text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse), text) return text - diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 33d158e6e..21908c26b 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -130,12 +130,9 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.authorform.setAutoDisplayName(True) if self.authorform.exec_(): author = Author.populate( - first_name=unicode( - self.authorform.FirstNameEdit.text(), u'utf-8'), - last_name=unicode( - self.authorform.LastNameEdit.text(), u'utf-8'), - display_name=unicode( - self.authorform.DisplayEdit.text(), u'utf-8')) + first_name=unicode(self.authorform.FirstNameEdit.text()), + last_name=unicode(self.authorform.LastNameEdit.text()), + display_name=unicode(self.authorform.DisplayEdit.text())) if self.songmanager.save_author(author): self.resetAuthors() else: @@ -147,8 +144,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): def onTopicAddButtonClick(self): if self.topicform.exec_(): - topic = Topic.populate( - name=unicode(self.topicform.NameEdit.text(), u'utf-8')) + topic = Topic.populate(name=unicode(self.topicform.NameEdit.text())) if self.songmanager.save_topic(topic): self.resetTopics() else: @@ -161,8 +157,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): def onBookAddButtonClick(self): if self.bookform.exec_(): book = Book.populate( - name=unicode(self.bookform.NameEdit.text(), u'utf-8'), - publisher=unicode(self.bookform.PublisherEdit.text(), u'utf-8')) + name=unicode(self.bookform.NameEdit.text()), + publisher=unicode(self.bookform.PublisherEdit.text())) if self.songmanager.save_book(book): self.resetBooks() else: @@ -181,12 +177,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.authorform.LastNameEdit.setText(author.last_name) self.authorform.DisplayEdit.setText(author.display_name) if self.authorform.exec_(False): - author.first_name = unicode( - self.authorform.FirstNameEdit.text(), u'utf-8') - author.last_name = unicode( - self.authorform.LastNameEdit.text(), u'utf-8') - author.display_name = unicode( - self.authorform.DisplayEdit.text(), u'utf-8') + author.first_name = unicode( + self.authorform.FirstNameEdit.text()) + author.last_name = unicode(self.authorform.LastNameEdit.text()) + author.display_name = unicode( + self.authorform.DisplayEdit.text()) if self.songmanager.save_author(author): self.resetAuthors() else: @@ -202,7 +197,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): topic = self.songmanager.get_topic(topic_id) self.topicform.NameEdit.setText(topic.name) if self.topicform.exec_(False): - topic.name = unicode(self.topicform.NameEdit.text(), u'utf-8') + topic.name = unicode(self.topicform.NameEdit.text()) if self.songmanager.save_topic(topic): self.resetTopics() else: @@ -219,9 +214,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.bookform.NameEdit.setText(book.name) self.bookform.PublisherEdit.setText(book.publisher) if self.bookform.exec_(False): - book.name = unicode(self.bookform.NameEdit.text(), u'utf-8') - book.publisher = unicode( - self.bookform.PublisherEdit.text(), u'utf-8') + book.name = unicode(self.bookform.NameEdit.text()) + book.publisher = unicode(self.bookform.PublisherEdit.text()) if self.songmanager.save_book(book): self.resetBooks() else: diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 3825a4abf..bbb9260c6 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -29,3 +29,4 @@ from mediaitem import SongMediaItem from sofimport import SofImport from oooimport import OooImport from songimport import SongImport + diff --git a/openlp/plugins/songs/lib/classes.py b/openlp/plugins/songs/lib/classes.py index 115943814..c465588a4 100644 --- a/openlp/plugins/songs/lib/classes.py +++ b/openlp/plugins/songs/lib/classes.py @@ -23,21 +23,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -class BaseModel(object): - """ - BaseModel provides a base object with a set of generic functions - """ - - @classmethod - def populate(cls, **kwargs): - """ - Creates an instance of a class and populates it, returning the instance - """ - me = cls() - keys = kwargs.keys() - for key in keys: - me.__setattr__(key, kwargs[key]) - return me +from openlp.core.lib import BaseModel class Author(BaseModel): """ diff --git a/openlp/plugins/songs/lib/manager.py b/openlp/plugins/songs/lib/manager.py index 7147f4d79..43b10aeec 100644 --- a/openlp/plugins/songs/lib/manager.py +++ b/openlp/plugins/songs/lib/manager.py @@ -26,6 +26,7 @@ import logging from PyQt4 import QtCore +from sqlalchemy.exceptions import InvalidRequestError from openlp.core.utils import AppLocation from openlp.plugins.songs.lib.models import init_models, metadata, Song, \ @@ -161,7 +162,7 @@ class SongManager(object): self.session.add(song) self.session.commit() return True - except: + except InvalidRequestError: log.exception(u'Could not save song to song database') self.session.rollback() return False @@ -172,7 +173,7 @@ class SongManager(object): self.session.delete(song) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not delete song from song database') return False @@ -203,7 +204,7 @@ class SongManager(object): self.session.add(author) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not save author to song database') return False @@ -217,7 +218,7 @@ class SongManager(object): self.session.delete(author) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not delete author from song database') return False @@ -248,7 +249,7 @@ class SongManager(object): self.session.add(topic) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not save topic to song database') return False @@ -262,7 +263,7 @@ class SongManager(object): self.session.delete(topic) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not delete topic from song database') return False @@ -293,7 +294,7 @@ class SongManager(object): self.session.add(book) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not save book to song database') return False @@ -307,10 +308,11 @@ class SongManager(object): self.session.delete(book) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Could not delete book from song database') return False def get_songs_for_theme(self, theme): return self.session.query(Song).filter(Song.theme_name == theme).all() + diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 240b5ea93..1ffb462c0 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -196,12 +196,7 @@ class SongMediaItem(MediaManagerItem): if author_list != u'': author_list = author_list + u', ' author_list = author_list + author.display_name - if not isinstance(author_list, unicode): - author_list = unicode(author_list, u'utf8') - if isinstance(song.title, unicode): - song_title = song.title - else: - song_title = unicode(song.title, u'utf8') + song_title = unicode(song.title) song_detail = u'%s (%s)' % (song_title, author_list) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) @@ -213,8 +208,8 @@ class SongMediaItem(MediaManagerItem): for author in searchresults: for song in author.songs: song_detail = unicode( - translate(u'SongsPlugin.MediaItem', u'%s (%s)' % \ - (unicode(author.display_name), unicode(song.title)))) + translate(u'SongsPlugin.MediaItem', u'%s (%s)') % + (author.display_name, song.title)) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) self.ListView.addItem(song_name) @@ -347,21 +342,12 @@ class SongMediaItem(MediaManagerItem): if len(order) == 0: break for verse in verseList: - if verse[1]: - if verse[0][u'type'] == "Verse" \ - or verse[0][u'type'] == "Chorus": - if verse[0][u'label'] == order[1:] and \ - verse[0][u'type'][0] == order[0]: - verseTag = u'%s:%s' % \ - (verse[0][u'type'], verse[0][u'label']) - service_item.add_from_text\ - (verse[1][:30], verse[1], verseTag) - else: - if verse[0][u'type'][0] == order[0]: - verseTag = u'%s:%s' % \ - (verse[0][u'type'], verse[0][u'label']) - service_item.add_from_text\ - (verse[1][:30], verse[1], verseTag) + if verse[0][u'label'] == order[1:] and \ + verse[0][u'type'][0] == order[0]: + verseTag = u'%s:%s' % \ + (verse[0][u'type'], verse[0][u'label']) + service_item.add_from_text\ + (verse[1][:30], verse[1], verseTag) else: verses = song.lyrics.split(u'\n\n') for slide in verses: diff --git a/openlp/plugins/songs/lib/models.py b/openlp/plugins/songs/lib/models.py index 400bd7477..272981d20 100644 --- a/openlp/plugins/songs/lib/models.py +++ b/openlp/plugins/songs/lib/models.py @@ -33,15 +33,16 @@ from openlp.plugins.songs.lib.classes import * def init_models(url): engine = create_engine(url) metadata.bind = engine - session = scoped_session(sessionmaker(autoflush=False, - autocommit=False, bind=engine)) + session = scoped_session(sessionmaker(autoflush=False, autocommit=False, + bind=engine)) mapper(Author, authors_table) mapper(Book, song_books_table) mapper(Song, songs_table, - properties={'authors': relation(Author, backref='songs', - secondary=authors_songs_table), - 'book': relation(Book, backref='songs'), - 'topics': relation(Topic, backref='songs', - secondary=songs_topics_table)}) + properties={'authors': relation(Author, backref='songs', + secondary=authors_songs_table), + 'book': relation(Book, backref='songs'), + 'topics': relation(Topic, backref='songs', + secondary=songs_topics_table)}) mapper(Topic, topics_table) return session + diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 403738973..a2a75a872 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -24,7 +24,9 @@ ############################################################################### import os + from PyQt4 import QtCore + from songimport import SongImport if os.name == u'nt': @@ -35,9 +37,11 @@ if os.name == u'nt': else: try: import uno - from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH - except: + from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \ + PAGE_BOTH + except ImportError: pass + class OooImport(object): """ Import songs from Impress/Powerpoint docs using Impress @@ -75,7 +79,8 @@ class OooImport(object): """ if os.name == u'nt': self.start_ooo_process() - self.desktop = self.manager.createInstance(u'com.sun.star.frame.Desktop') + self.desktop = self.manager.createInstance( + u'com.sun.star.frame.Desktop') else: context = uno.getComponentContext() resolver = context.ServiceManager.createInstanceWithContext( @@ -101,8 +106,8 @@ class OooImport(object): self.manager._FlagAsMethod(u'Bridge_GetStruct') self.manager._FlagAsMethod(u'Bridge_GetValueObject') else: - cmd = u'openoffice.org -nologo -norestore -minimized -invisible ' \ - + u'-nofirststartwizard ' \ + cmd = u'openoffice.org -nologo -norestore -minimized ' \ + + u'-invisible -nofirststartwizard ' \ + '-accept="socket,host=localhost,port=2002;urp;"' process = QtCore.QProcess() process.startDetached(cmd) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index b697f508c..fa016729d 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -29,20 +29,21 @@ from PyQt4 import QtGui from openlp.core.lib import SongXMLBuilder from openlp.plugins.songs.lib.models import Song, Author, Topic, Book - +from openlp.plugins.songs.forms import VerseType + class SongImport(object): """ Helper class for import a song from a third party source into OpenLP This class just takes the raw strings, and will work out for itself - whether the authors etc already exist and add them or refer to them + whether the authors etc already exist and add them or refer to them as necessary """ def __init__(self, song_manager): """ Initialise and create defaults for properties - + song_manager is an instance of a SongManager, through which all database access is performed """ @@ -53,13 +54,13 @@ class SongImport(object): self.copyright = u'' self.comment = u'' self.theme_name = u'' - self.ccli_number = u'' - self.authors = [] - self.topics = [] - self.song_book_name = u'' - self.song_book_pub = u'' - self.verse_order_list = [] - self.verses = [] + self.ccli_number = u'' + self.authors = [] + self.topics = [] + self.song_book_name = u'' + self.song_book_pub = u'' + self.verse_order_list = [] + self.verses = [] self.versecount = 0 self.choruscount = 0 self.copyright_string = unicode(QtGui.QApplication.translate( \ @@ -128,39 +129,39 @@ class SongImport(object): copyright_found = True self.add_copyright(line) else: - self.parse_author(line) - return + self.parse_author(line) + return if len(lines) == 1: self.parse_author(lines[0]) return if not self.get_title(): self.set_title(lines[0]) self.add_verse(text) - + def get_title(self): """ Return the title """ return self.title - + def get_copyright(self): """ Return the copyright """ return self.copyright - + def get_song_number(self): - """ - Return the song number + """ + Return the song number """ return self.song_number - + def set_title(self, title): """ Set the title """ self.title = title - + def set_alternate_title(self, title): """ Set the alternate title @@ -168,11 +169,11 @@ class SongImport(object): self.alternate_title = title def set_song_number(self, song_number): - """ + """ Set the song number """ self.song_number = song_number - + def set_song_book(self, song_book, publisher): """ Set the song book name and publisher @@ -181,7 +182,7 @@ class SongImport(object): self.song_book_pub = publisher def add_copyright(self, copyright): - """ + """ Build the copyright field """ if self.copyright.find(copyright) >= 0: @@ -194,7 +195,7 @@ class SongImport(object): """ Add the author. OpenLP stores them individually so split by 'and', '&' and comma. - However need to check for "Mr and Mrs Smith" and turn it to + However need to check for "Mr and Mrs Smith" and turn it to "Mr Smith" and "Mrs Smith". """ for author in text.split(u','): @@ -210,13 +211,13 @@ class SongImport(object): self.add_author(author2) def add_author(self, author): - """ + """ Add an author to the list """ if author in self.authors: return self.authors.append(author) - + def add_verse(self, verse, versetag=None): """ Add a verse. This is the whole verse, lines split by \n @@ -224,7 +225,7 @@ class SongImport(object): choruses itself) or None, where it will assume verse It will also attempt to detect duplicates. In this case it will just add to the verse order - """ + """ for (oldversetag, oldverse) in self.verses: if oldverse.strip() == verse.strip(): self.verse_order_list.append(oldversetag) @@ -253,22 +254,22 @@ class SongImport(object): def check_complete(self): """ Check the mandatory fields are entered (i.e. title and a verse) - Author not checked here, if no author then "Author unknown" is + Author not checked here, if no author then "Author unknown" is automatically added """ if self.title == u'' or len(self.verses) == 0: return False else: return True - - def remove_punctuation(self, text): + + def remove_punctuation(self, text): """ Remove punctuation from the string for searchable fields """ for character in string.punctuation: text = text.replace(character, u'') return text - + def finish(self): """ All fields have been set to this song. Write it away @@ -277,7 +278,7 @@ class SongImport(object): self.authors.append(u'Author unknown') self.commit_song() #self.print_song() - + def commit_song(self): """ Write the song and it's fields to disk @@ -293,27 +294,27 @@ class SongImport(object): sxml.add_lyrics_to_song() for (versetag, versetext) in self.verses: if versetag[0] == u'C': - versetype = u'Chorus' + versetype = VerseType.to_string(VerseType.Chorus) elif versetag[0] == u'V': - versetype = u'Verse' + versetype = VerseType.to_string(VerseType.Verse) elif versetag[0] == u'B': - versetype = u'Bridge' + versetype = VerseType.to_string(VerseType.Bridge) elif versetag[0] == u'I': - versetype = u'Intro' + versetype = VerseType.to_string(VerseType.Intro) elif versetag[0] == u'P': - versetype = u'Prechorus' + versetype = VerseType.to_string(VerseType.PreChorus) elif versetag[0] == u'E': - versetype = u'Ending' + versetype = VerseType.to_string(VerseType.Ending) else: - versetype = u'Other' + versetype = VerseType.to_string(VerseType.Other) sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext) song.search_lyrics += u' ' + self.remove_punctuation(versetext) song.lyrics = unicode(sxml.extract_xml(), u'utf-8') song.verse_order = u' '.join(self.verse_order_list) song.copyright = self.copyright - song.comment = self.comment - song.theme_name = self.theme_name - song.ccli_number = self.ccli_number + song.comment = self.comment + song.theme_name = self.theme_name + song.ccli_number = self.ccli_number for authortext in self.authors: author = self.manager.get_author_by_name(authortext) if author is None: @@ -339,15 +340,15 @@ class SongImport(object): self.manager.save_topic(topic) song.topics.append(topictext) self.manager.save_song(song) - + def print_song(self): - """ - For debugging + """ + For debugging """ print u'========================================' \ + u'========================================' - print u'TITLE: ' + self.title - print u'ALT TITLE: ' + self.alternate_title + print u'TITLE: ' + self.title + print u'ALT TITLE: ' + self.alternate_title for (versetag, versetext) in self.verses: print u'VERSE ' + versetag + u': ' + versetext print u'ORDER: ' + u' '.join(self.verse_order_list) @@ -361,7 +362,7 @@ class SongImport(object): print u'BOOK PUBLISHER: ' + self.song_book_pub if self.song_number: print u'NUMBER: ' + self.song_number - for topictext in self.topics: + for topictext in self.topics: print u'TOPIC: ' + topictext if self.comment: print u'COMMENT: ' + self.comment @@ -369,5 +370,5 @@ class SongImport(object): print u'THEME: ' + self.theme_name if self.ccli_number: print u'CCLI: ' + self.ccli_number - + diff --git a/openlp/plugins/songs/lib/songxml.py b/openlp/plugins/songs/lib/songxml.py index 0979eb2b8..336fc080e 100644 --- a/openlp/plugins/songs/lib/songxml.py +++ b/openlp/plugins/songs/lib/songxml.py @@ -60,7 +60,7 @@ class SongFeatureError(SongException): # TODO: Song: Import ChangingSong # TODO: Song: Export ChangingSong -_blankOpenSongXml = \ +_BLANK_OPENSONG_XML = \ ''' @@ -84,7 +84,7 @@ class _OpenSong(XmlRootClass): def _reset(self): """Reset all song attributes""" - self._setFromXml(_blankOpenSongXml, 'song') + self._setFromXml(_BLANK_OPENSONG_XML, 'song') def from_buffer(self, xmlContent): """Initialize from buffer(string) with xml content""" @@ -288,7 +288,7 @@ class Song(object): osfile.close() xml = "".join(list) self.from_opensong_buffer(xml) - except: + except IOError: log.exception(u'Failed to load opensong xml file') finally: if osfile: @@ -394,7 +394,7 @@ class Song(object): ccli_file = open(textFileName, 'r') lines = [orgline.rstrip() for orgline in ccli_file] self.from_ccli_text_buffer(lines) - except: + except IOError: log.exception(u'Failed to load CCLI text file') finally: if ccli_file: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 51fbad6b0..2be9573a2 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -24,6 +24,7 @@ ############################################################################### from lxml import objectify +from lxml.etree import XMLSyntaxError class LyricsXML(object): """ @@ -73,7 +74,7 @@ class LyricsXML(object): }) self.lyrics.append(language) return True - except: + except XMLSyntaxError: return False def extract(self, text): diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index 2a4dfb39e..fb1d1c73d 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -86,7 +86,7 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): (instance.usagedate,instance.usagetime, instance.title, instance.copyright, instance.ccl_number , instance.authors) file.write(record) - except: + except IOError: log.exception(u'Failed to write out song usage records') finally: if file: diff --git a/openlp/plugins/songusage/lib/classes.py b/openlp/plugins/songusage/lib/classes.py index a780b57ac..298380f58 100644 --- a/openlp/plugins/songusage/lib/classes.py +++ b/openlp/plugins/songusage/lib/classes.py @@ -23,21 +23,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -class BaseModel(object): - """ - BaseModel provides a base object with a set of generic functions - """ - - @classmethod - def populate(cls, **kwargs): - """ - Creates an instance of a class and populates it, returning the instance - """ - me = cls() - keys = kwargs.keys() - for key in keys: - me.__setattr__(key, kwargs[key]) - return me +from openlp.core.lib import BaseModel class SongUsageItem(BaseModel): """ diff --git a/openlp/plugins/songusage/lib/manager.py b/openlp/plugins/songusage/lib/manager.py index cb8ea91bf..b830fdafd 100644 --- a/openlp/plugins/songusage/lib/manager.py +++ b/openlp/plugins/songusage/lib/manager.py @@ -26,6 +26,7 @@ import logging from PyQt4 import QtCore +from sqlalchemy.exceptions import InvalidRequestError from openlp.core.utils import AppLocation from openlp.plugins.songusage.lib.models import init_models, metadata, \ @@ -87,7 +88,7 @@ class SongUsageManager(object): self.session.add(songusageitem) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'SongUsage item failed to save') return False @@ -111,7 +112,7 @@ class SongUsageManager(object): self.session.delete(songusageitem) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'SongUsage Item failed to delete') return False @@ -126,7 +127,7 @@ class SongUsageManager(object): self.session.query(SongUsageItem).delete(synchronize_session=False) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Failed to delete all Song Usage items') return False @@ -141,7 +142,8 @@ class SongUsageManager(object): .delete(synchronize_session=False) self.session.commit() return True - except: + except InvalidRequestError: self.session.rollback() log.exception(u'Failed to delete all Song Usage items to %s' % date) return False + diff --git a/openlp/plugins/songusage/lib/models.py b/openlp/plugins/songusage/lib/models.py index a053ffc34..a7babbaed 100644 --- a/openlp/plugins/songusage/lib/models.py +++ b/openlp/plugins/songusage/lib/models.py @@ -34,6 +34,6 @@ def init_models(url): engine = create_engine(url) metadata.bind = engine session = scoped_session(sessionmaker(autoflush=True, autocommit=False, - bind=engine)) + bind=engine)) mapper(SongUsageItem, songusage_table) return session diff --git a/resources/i18n/openlp_et.ts b/resources/i18n/openlp_et.ts new file mode 100644 index 000000000..9ac4b8239 --- /dev/null +++ b/resources/i18n/openlp_et.ts @@ -0,0 +1,3098 @@ + + + AboutForm + + build + komplieering + + + About OpenLP + OpenLP-st lähemalt + + + OpenLP <version><revision> - Open Source Lyrics Projection + +OpenLP is free church presentation software, or lyrics projection software, used to display slides of songs, Bible verses, videos, images, and even presentations (if OpenOffice.org, PowerPoint or PowerPoint Viewer is installed) for church worship using a computer and a data projector. + +Find out more about OpenLP: http://openlp.org/ + +OpenLP is written and maintained by volunteers. If you would like to see more free Christian software being written, please consider contributing by using the button below. + OpenLP <version><revision> - avatud lähtekoodiga laulusõnade kuvaja + +OpenLP on vaba esitlustarkvara kirikusse võib öelda ka laulusõnade projitseerimise tarkvara, mida kasutatakse lauluslaidide, piiblisalmide, videote, piltide ja isegi esitluste (kui OpenOffice.org, PowerPoint või PowerPoint Viewer on paigaldatud) kirikus installed) kuvamiseks dataprojektori kaudu kirikus. + +OpenLP kohta võid lähemalt uurida aadressil: http://openlp.org/ + +OpenLP on kirjutatud vabatahtlike poolt. Kui sulle meeldiks näha rohkem kristlikku tarkvara, siis võid kaaluda annetamist, selleks klõpsa alumisele nupule. + + + About + Programmist + + + Project Lead + Raoul "superfly" Snyman + +Developers + Tim "TRB143" Bentley + Jonathan "gushie" Corwin + Michael "cocooncrash" Gorven + Scott "sguerrieri" Guerrieri + Raoul "superfly" Snyman + Martin "mijiti" Thompson + Jon "Meths" Tibble + +Contributors + Meinert "m2j" Jordan + Christian "crichter" Richter + Maikel Stuivenberg + Carsten "catini" Tingaard + +Testers + Philip "Phill" Ridout + Wesley "wrst" Stout (lead) + +Packagers + Thomas "tabthorpe" Abthorpe (FreeBSD) + Tim "TRB143" Bentley (Fedora) + Michael "cocooncrash" Gorven (Ubuntu) + Matthias "matthub" Hub (Mac OS X) + Raoul "superfly" Snyman (Windows) + + Projekti juht + Raoul "superfly" Snyman + +Arendajad + Tim "TRB143" Bentley + Jonathan "gushie" Corwin + Michael "cocooncrash" Gorven + Scott "sguerrieri" Guerrieri + Raoul "superfly" Snyman + Martin "mijiti" Thompson + Jon "Meths" Tibble + +Kaastöölised + Meinert "m2j" Jordan + Christian "crichter" Richter + Maikel Stuivenberg + Carsten "catini" Tingaard + +Testijad + Philip "Phill" Ridout + Wesley "wrst" Stout (juht) + +Pakendajad + Thomas "tabthorpe" Abthorpe (FreeBSD) + Tim "TRB143" Bentley (Fedora) + Michael "cocooncrash" Gorven (Ubuntu) + Matthias "matthub" Hub (Mac OS X) + Raoul "superfly" Snyman (Windows) + + + Credits + Autorid + + + Copyright © 2004-2010 Raoul Snyman +Portions copyright © 2004-2010 Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 below for more details. + + +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + +c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version', you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + +<one line to give the program's name and a brief idea of what it does.> +Copyright (C) <year> <name of author> + +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; either version 2 of the License, or (at your option) any later version. + +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type "show w". +This is free software, and you are welcome to redistribute it under certain conditions; type "show c" for details. + +The hypothetical commands "show w" and "show c" should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than "show w" and "show c"; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program "Gnomovision" (which makes passes at compilers) written by James Hacker. + +<signature of Ty Coon>, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. + + + + License + Litsents + + + Contribute + Aita kaasa + + + Close + Sulge + + + + AlertForm + + Alert Message + Teate sõnum + + + Alert &text: + Teate &tekst: + + + &Parameter(s): + &Parameetrid: + + + &New + &Uus + + + &Save + &Salvesta + + + &Delete + &Kustuta + + + Displ&ay + &Kuva + + + Display && Cl&ose + Kuva && &sulge + + + &Close + &Sulge + + + Item selected to Add + Lisamiseks valitud kirje + + + Missing data + Puuduvad andmed + + + + AlertsTab + + pt + pt + + + Location: + Asukoht: + + + Font Color: + Kirja värvus: + + + Font + Kirjastiil + + + Font Name: + Kirja nimi: + + + Preview + Eelvaade + + + Alerts + Teated + + + Alert timeout: + Teate aegumine: + + + openlp.org + openlp.org + + + Background Color: + Tausta värvus: + + + s + s + + + Bottom + All + + + Top + Üleval + + + Font Size: + Kirja suurus: + + + + AmendThemeForm + + Background Color: + Tausta värvus: + + + Slide Height is %s rows + Slaidi kõrgus on %s rida + + + First Color: + Esimene värvus: + + + Second Color: + Teine värvus: + + + Theme Maintenance + Kujunduste haldus + + + Theme Name: + Kujunduse nimi: + + + Background: + Taust: + + + Opaque + Läbipaistmatu + + + Transparent + Läbipaistev + + + Background Type: + Tausta liik: + + + Solid Color + Ühtlane värv + + + Gradient + Üleminek + + + Image + Pilt + + + <Color1> + <värv1> + + + <Color2> + <värv2> + + + Image: + Pilt: + + + Gradient : + Üleminek: + + + Horizontal + Horisontaalne + + + Vertical + Vertikaalne + + + Circular + Ümmargune + + + Background + Taust + + + Main Font + Peamine kirjastiil + + + Font: + Kirjastiil: + + + Font Color: + Kirja värvus: + + + Size: + Suurus: + + + pt + pt + + + Wrap Indentation + Murtud ridade taane + + + Adjust Line Spacing + Joone vahe seadmine + + + Normal + Tavaline + + + Bold + Rasvane + + + Italics + Kursiiv + + + Bold/Italics + Rasvane/kaldkiri + + + Font Weight: + Kirja jämedus: + + + Display Location + Kuva asukoht + + + Use Default Location: + Kasutatakse vaikimisi asukohta: + + + X Position: + X-asukoht: + + + Y Position: + Y-asukoht: + + + Width: + Laius: + + + Height: + Kõrgus: + + + px + px + + + Font Main + Peamine kirjastiil + + + Footer Font + Jaluse kirjatüüp + + + Font Footer + Jaluse kirjatüüp + + + Outline + Välisjoon + + + Outline Size: + Kontuurjoone suurus: + + + Outline Color: + Kontuurjoone värv: + + + Show Outline: + Kontuurjoon: + + + Shadow + Vari + + + Shadow Size: + Varju suurus: + + + Shadow Color: + Varju värvus: + + + Show Shadow: + Taustal näidatakse: + + + Alignment + Joondus + + + Horizontal Align: + Rõhtpaigutus: + + + Left + Vasakul + + + Right + Paremal + + + Center + Keskel + + + Vertical Align: + Püstpaigutus: + + + Top + Üleval + + + Middle + Keskel + + + Bottom + All + + + Slide Transition + Slaidide üleminek + + + Transition Active: + Slaidisiire aktiivne: + + + Other Options + Muud valikud + + + Preview + Eelvaade + + + + AuditDeleteDialog + + Song Usage Delete + Laulukasutuse kustutamine + + + + AuditDetailDialog + + Song Usage Extraction + Laulukasutuse salvestamine + + + Select Date Range + Vali kuupäevade vahemik + + + to + kuni + + + Report Location + Asukohast raporteerimine + + + + AuthorsForm + + You need to type in the first name of the author. + Pead sisestama autori eesnime. + + + You haven't set a display name for the author, would you like me to combine the first and last names for you? + Sa pole sisestanud autori kuvatavat nime. Kas see tuleks kombineerida ees- ja perekonnanimest? + + + Error + Viga + + + You need to type in the last name of the author. + Pead sisestama autori perekonnanime. + + + Author Maintenance + Autorite haldus + + + Display name: + Kuvatav nimi: + + + First name: + Eesnimi: + + + Last name: + Perekonnanimi: + + + + BibleMediaItem + + Quick + Kiire + + + Bible + Piibel + + + Clear + Puhasta + + + Search + Otsi + + + Book: + Raamat: + + + Text Search + Tekstiotsing + + + No matching book could be found in this Bible. + Sellest Piiblist ei leitud seda raamatut. + + + Dual: + Teine: + + + Chapter: + Peatükk: + + + No Book Found + Ühtegi raamatut ei leitud + + + Keep + Säilita + + + Results: + Tulemused: + + + Verse Search + Salmi otsing + + + Version: + Versioon: + + + From: + Algus: + + + Find: + Otsing: + + + Advanced + Täpsem + + + To: + Kuni: + + + Verse: + Salm: + + + Search Type: + Otsingu liik: + + + Bible not fully loaded + Piibel ei ole täielikult laaditud + + + + BiblePlugin + + <strong>Bible Plugin</strong><br />This plugin allows bible verses from different sources to be displayed on the screen during the service. + <strong>Piibli plugin</strong><br />See plugin võimaldab teenistuse ajal kuvada erinevatest allikatest pärinevaid piiblisalme. + + + + BiblesTab + + ( and ) + ( ja ) + + + verse per line + iga salm eraldi real + + + Display Style: + Kuvamise stiil: + + + Bibles + Piiblid + + + continuous + jätkuv + + + [ and ] + [ ja ] + + + Bible Theme: + Piibli kujundus: + + + Display Dual Bible Verses + Piiblit kuvatakse kahes keeles + + + Only show new chapter numbers + Kuvatakse ainult uute peatükkide numbreid + + + Verse Display + Salmi kuva + + + No brackets + Ilma sulgudeta + + + { and } + { ja } + + + Note: +Changes don't affect verses already in the service + Märkus: +Muudatused ei mõjuta juba teenistusse lisatud salme + + + verse per slide + üks salm slaidil + + + Layout Style: + Kuvastiil: + + + + CustomMediaItem + + Custom + Kohandatud + + + + CustomPlugin + + <b>Custom Plugin</b><br>This plugin allows slides to be displayed on the screen in the same way songs are. This plugin provides greater freedom over the songs plugin.<br> + <b>Kohandatud plugin</b>Selle pluginaga saab näidata ekraanil lauludega sarnaseid kohandatud slaide. See pakub suuremat vabadust, kui laulude plugin.<br> + + + + CustomTab + + Custom + Kohandatud + + + Custom Display + Kohandatud kuva + + + Display Footer + Jalust kuvatakse + + + + DisplayTab + + Displays + Kuva + + + + EditCustomForm + + You need to enter a title + Pead sisestama pealkirja + + + Error + Viga + + + You need to enter a slide + Pead sisenema slaidile + + + Save && Preview + Salvesta && eelvaatle + + + Edit Custom Slides + Kohandatud slaidide muutmine + + + Move slide Up 1 + Slaidi liigutamine 1 võrra üles + + + Move slide down 1 + Slaidi liigutamine 1 võrra alla + + + Title: + Pealkiri: + + + Add New + Uue lisamine + + + Add new slide at bottom + Uue slaidi lisamine lõppu + + + Edit + Muuda + + + Edit selected slide + Valitud slaidi muutmine + + + Edit All + Kõigi muutmine + + + Edit all slides + Kõigi slaidide muutmine + + + Save + Salvesta + + + Replace edited slide + Muudetud slaidi asendamine + + + Delete + Kustuta + + + Delete selected slide + Valitud slaidi kustutamine + + + Clear + Puhasta + + + Clear edit area + Muutmise ala puhastamine + + + Split Slide + Tükelda slaid + + + Add slide split + Lisa slaidide tükeldus + + + Theme: + Kujundus: + + + Credits: + Autorid: + + + You have unsaved data, please save or clear + Sul on salvestamata andmeid, palun salvesta või tühjenda + + + + EditSongForm + + You need to enter a song title. + Pead sisestama laulu pealkirja. + + + Invalid verse entry - Vx or Cx + Vigane salmi kirje - Vx või Cx + + + v + s + + + c + ref + + + Invalid verse entry, values must be I,B,T,P,E,O,Vx,Cx + Sobimatu salmi sisend, väärtused peavad olema I,B,T,P,E,O,Vx,Cx + + + You need to enter some verses. + Pead sisestama mõned salmid. + + + Save && Preview + Salvesta && eelvaatle + + + bitped + + + + Error + Viga + + + Song Editor + Lauluredaktor + + + Title: + Pealkiri: + + + Alternative Title: + Alternatiivne pealkiri: + + + Lyrics: + Laulusõnad: + + + Verse Order: + Salmide järjekord: + + + Add + Lisa + + + Edit + Muuda + + + Edit All + Kõigi muutmine + + + Delete + Kustuta + + + Title && Lyrics + Pealkiri && laulusõnad + + + Authors + Autorid + + + &Add to Song + &Lisa laulule + + + &Remove + &Eemalda + + + &Manage Authors, Topics, Books + &Autorite, teemade, raamatute haldamine + + + Topic + Teema + + + A&dd to Song + L&isa laulule + + + R&emove + &Eemalda + + + Song Book + Laulik + + + Authors, Topics && Book + Autorid, teemad && laulik + + + Theme + Kujundus + + + Add a Theme + Lisa kujundus + + + Copyright Information + Autoriõiguse andmed + + + CCLI Number: + CCLI number: + + + Comments + Kommentaarid + + + Theme, Copyright Info && Comments + Kujundus, autoriõigus && kommentaarid + + + + EditVerseForm + + Verse + Salm + + + Edit Verse + Salmi muutmine + + + Verse Type: + Salmi liik: + + + Chorus + Refrään + + + Bridge + Vahemäng + + + Pre-Chorus + Eelrefrään + + + Intro + Intro + + + Ending + Lõpetus + + + Other + Muu + + + Insert + Sisesta + + + + GeneralTab + + CCLI Details + CCLI andmed + + + SongSelect Password: + SongSelecti parool: + + + primary + peamine + + + Application Startup + Rakenduse käivitumine + + + Select monitor for output display: + Vali väljundkuva monitor: + + + Application Settings + Rakenduse sätted + + + SongSelect Username: + SongSelecti kasutajanimi: + + + CCLI Number: + CCLI number: + + + Automatically open the last service + Automaatselt avatakse viimane teenistus + + + Preview Next Song from Service Manager + Teenistuse haldurist kuvatakse järgmise laulu eelvaade + + + Show blank screen warning + Kuvatakse tühja ekraani hoiatust + + + Prompt to save Service before starting New + Uue teenistuse loomise pakutakse vana salvestamist + + + General + Üldine + + + Show the splash screen + Käivitumisel kuvatakse logo + + + Screen + Ekraan + + + Monitors + Monitorid + + + Display if a single screen + Kuvatakse, kui on ainult üks ekraan + + + + ImageMediaItem + + Select Image(s) + Pildi (piltide) valimine + + + You must select one item + Pead valima ühe kirje + + + No item selected + Ühtegi kirjet pole valitud + + + Replace Live Background + Ekraani tausta asendamine + + + Image(s) + Pilt(pildid) + + + Image + Pilt + + + Images (*.jpg *.jpeg *.gif *.png *.bmp);; All files (*) + Pildid (*.jpg *.jpeg *.gif *.png *.bmp);; Kõik failid (*) + + + + ImagePlugin + + <b>Image Plugin</b><br>Allows images of all types to be displayed. If a number of images are selected together and presented on the live controller it is possible to turn them into a timed loop.<br<br>From the plugin if the <i>Override background</i> is chosen and an image is selected any songs which are rendered will use the selected image from the background instead of the one provied by the theme.<br> + <b>Piltide plugin</b><br>Võimaldab igat tüüpi piltide kuvamise. Kui valitakse hulk pilte korraga ning näidatakse neid ekraanil, on võimalik panna need kordama.<br>Kui pluginas on valitud <i>Asenda taustapilt</i> ja mõni pilt on valitud, siis kujunduse taustapildi asemel näidatakse valitud pilti.<br> + + + + ImageTab + + sec + s + + + Image Settings + Pildi sätted + + + Slide Loop Delay: + Slaidide vahetuse viivitus: + + + Images + Pildid + + + + ImportWizardForm + + Invalid Bible Location + Ebakorrektne Piibli asukoht + + + You need to specify a file with books of the Bible to use in the import. + Pead määrama faili, mis sisaldab piibliraamatuid, mida tahad importida. + + + You need to set a copyright for your Bible! Bibles in the Public Domain need to be marked as such. + Pead määrama Piiblitõlke autoriõiguse! Avalikkuse omandisse kuuluvad Piiblid tuleb vastavalt tähistada. + + + Empty Copyright + Autoriõigused määramata + + + Empty Version Name + Versiooni nimi määramata + + + Invalid OpenSong Bible + Mittekorrektne OpenSong Piibel + + + Your Bible import failed. + Piibli importimine nurjus. + + + You need to specify a file to import your Bible from. + Pead määrama faili, millest Piibel importida. + + + Bible Exists + Piibel on olemas + + + Finished import. + Importimine lõpetatud. + + + You need to specify a file of Bible verses to import. + Pead ette andma piiblisalmide faili, mida importida. + + + Open Books CSV File + Open Books CSV fail + + + You need to specify a version name for your Bible. + Pead määrama Piibli versiooni nime. + + + This Bible already exists! Please import a different Bible or first delete the existing one. + See piibel on juba olemas! Palun impordi mingi muu piibel või kustuta enne olemasolev. + + + Starting import... + Importimise alustamine... + + + Invalid Books File + Vigane raamatute fail + + + You need to specify an OpenSong Bible file to import. + Pead määrama OpenSong piiblifaili, mida importida. + + + Invalid Verse File + Vigane salmide fail + + + Open Verses CSV File + Open Verses CSV fail + + + Open OSIS File + Open OSIS fail + + + Open OpenSong Bible + OpenSong piibli avamine + + + Bible Import Wizard + Piibli importimise nõustaja + + + Welcome to the Bible Import Wizard + Teretulemast Piibli importimise nõustajasse + + + This wizard will help you to import Bibles from a variety of formats. Click the next button below to start the process by selecting a format to import from. + See nõustaja aitab erinevatest vormingutest Piibleid importida. Klõpsa all asuvale edasi nupule, et alustada importimise vormingu valimisest. + + + Select Import Source + Importimise allika valimine + + + Select the import format, and where to import from. + Vali importimise vorming ning kust importida. + + + Format: + Vorming: + + + OSIS + OSIS + + + CSV + CSV + + + OpenSong + OpenSong + + + Web Download + Veebiallalaadimine + + + File Location: + Faili asukoht: + + + Books Location: + Raamatute asukoht: + + + Verse Location: + Salmide asukoht: + + + Bible Filename: + Piiblifaili nimi: + + + Location: + Asukoht: + + + Crosswalk + Crosswalk + + + BibleGateway + BibleGateway + + + Bible: + Piibel: + + + Download Options + Allalaadimise valikud + + + Server: + Server: + + + Username: + Kasutajanimi: + + + Password: + Parool: + + + Proxy Server (Optional) + Proksiserver (valikuline) + + + License Details + Litsentsist lähemalt + + + Set up the Bible's license details. + Määra Piibli litsentsi andmed. + + + Version Name: + Versiooninimi: + + + Copyright: + Autoriõigus: + + + Permission: + Õigus: + + + Importing + Importimine + + + Please wait while your Bible is imported. + Palun oota, kuni sinu Piiblit imporditakse. + + + Ready. + Valmis. + + + No OpenLyrics Files Selected + Ühtegi OpenLyrics faili pole valitud + + + You need to add at least one OpenLyrics song file to import from. + Sul peab olema vähemalt üks OpenLyrics laulufail, millest importida. + + + No OpenSong Files Selected + Ühtegi OpenSong faili pole valitud + + + You need to add at least one OpenSong song file to import from. + Pead lisama vähemalt ühe OpenSong faili, mida importida. + + + No CCLI Files Selected + Ühtegi CCLI faili pole valitud + + + You need to add at least one CCLI file to import from. + Tuleb lisada vähemalt üks CCLI fail, mida importida. + + + No CSV File Selected + Ühtegi CSV faili pole valitud + + + You need to specify a CSV file to import from. + Pead määrama CCLI faili, mida importida. + + + + LanguageManager + + Language + Keel + + + After restart new Language settings will be used. + Keele sätteid kasutatakse pärast taaskäivitust. + + + + MainWindow + + The Main Display has been blanked out + Peakuva on tühi + + + OpenLP Version Updated + OpenLP uuendus + + + Version %s of OpenLP is now available for download (you are currently running version %s). + +You can download the latest version from http://openlp.org + OpenLP versioon %s on nüüd saadaval allalaadimiseks (praegu kasutad versiooni %s). + +Värskeima versiooni saad alla laadida aadressilt http://openlp.org + + + Save Changes to Service? + Kas salvestada teenistusse tehtud muudatused? + + + OpenLP Main Display Blanked + OpenLP peakuva on tühi + + + Open an existing service + Olemasoleva teenistuse valimine + + + List the Plugins + Pluginate loend + + + &Service Manager + &Teenistuse haldur + + + Open Service + Teenistuse avamine + + + Media Manager + Meediahaldur + + + Alt+F4 + Alt+F4 + + + Toggle the visibility of the Preview Panel + Eelvaatluspaneeli nähtavuse muutmine + + + &User Guide + &Kasutajajuhend + + + &Import + &Impordi + + + Quit OpenLP + Lahku OpenLPst + + + &Preview Panel + &Eelvaatluspaneel + + + &New + &Uus + + + Ctrl+N + Ctrl+N + + + Default Theme: + Vaikimisi kujundus: + + + Toggle Preview Panel + Eelvaatluspaneeli lüliti + + + &Live + &Otse + + + F9 + F9 + + + F8 + F8 + + + Save the current service to disk + Selle teenistuse salvestamine kettale + + + Add &Tool... + Lisa &tööriist... + + + Create a new Service + Uue teenistuse loomine + + + &View + &Vaade + + + &Export + &Ekspordi + + + &Open + &Ava + + + Toggle Theme Manager + Kujunduse halduri lüliti + + + &Settings + &Sätted + + + &Options + &Valikud + + + Ctrl+S + Ctrl+S + + + Ctrl+O + Ctrl+O + + + &File + &Fail + + + E&xit + &Välju + + + &Help + A&bi + + + Toggle Service Manager + Teenistuse halduri lüliti + + + Ctrl+F1 + Ctrl+F1 + + + Save the current service under a new name + Salvesta see teenistus uue nimega + + + &Web Site + &Veebileht + + + M&ode + &Režiim + + + Service Manager + Teenistuse haldur + + + &Theme + &Kujundus + + + &Language + &Keel + + + &About + &Lähemalt + + + &Plugin List + &Pluginate loend + + + English + Eesti + + + Save Service As + Salvesta teenistus kui + + + New Service + Uus teenistus + + + &Online Help + &Abi veebis + + + Save Service + Salvesta teenistus + + + Save &As... + Salvesta &kui... + + + Toggle the visibility of the Media Manager + Meediahalduri nähtavuse lüliti + + + F11 + F11 + + + F10 + F10 + + + F12 + F12 + + + Alt+F7 + Alt+F7 + + + Add an application to the list of tools + Rakenduse lisamine tööriistade loendisse + + + Theme Manager + Kujunduse haldur + + + Toggle the visibility of the Theme Manager + Kujunduse halduri nähtavuse lüliti + + + &Preview Pane + &Eelvaatluspaan + + + &Theme Manager + &Kujunduse haldur + + + Toggle the visibility of the Service Manager + Teenistuse halduri nähtavuse lüliti + + + More information about OpenLP + Lähem teave OpenLP kohta + + + &Media Manager + &Meediahaldur + + + &Tools + &Tööriistad + + + Toggle Media Manager + Meediahalduri lüliti + + + &Save + &Salvesta + + + OpenLP 2.0 + OpenLP 2.0 + + + Look && &Feel + Välimus && &tunnetus + + + &Auto Detect + &Isetuvastus + + + Choose System language, if available + Võimalusel kasutatakse süsteemi keelt + + + Set the interface language to %1 + Määra kasutajaliidese keeleks %1 + + + Your service has changed. Do you want to save those changes? + Sinu teenistust on muudetud. Kas tahad need muudatused salvestada? + + + + MediaManagerItem + + Invalid Service Item + Vigane teenistuse element + + + No Items Selected + Ühtegi elementi pole valitud + + + You must select one or more items + Pead valima vähemalt ühe elemendi + + + &Add to selected Service Item + &Lisa valitud teenistuse elemendile + + + &Preview + &Eelvaatlus + + + Load a new + Laadi uus + + + &Edit + &Muuda + + + No items selected + Ühtegi elementi pole valitud + + + &Add to Service + &Lisa teenistusele + + + Send the selected item live + Valitud kirje saatmine ekraanile + + + Add the selected item(s) to the service + Valitud kirje(te) lisamine teenistusse + + + Edit the selected + Valitud kirje muutmine + + + Delete the selected item + Valitud elemendi kustutamine + + + No Service Item Selected + Ühtegi teenistuse elementi pole valitud + + + Import a + Impordi üks + + + &Delete + &Kustuta + + + &Show Live + &Kuva ekraanil + + + Add a new + Lisa uus + + + Preview the selected item + Valitud kirje eelvaatlus + + + You must select one or more items. + Pead valima vähemalt ühe elemendi. + + + You must select an existing service item to add to. + Pead valima olemasoleva teenistuse, millele lisada. + + + + MediaMediaItem + + Select Media + Meedia valimine + + + Media + Meedia + + + Videos (%s);;Audio (%s);;All files (*) + Videofailid (%s);;Helifailid (%s);;Kõik failid (*) + + + Replace Live Background + Ekraani tausta asendamine + + + No item selected + Ühtegi kirjet pole valitud + + + You must select one item + Pead valima ühe kirje + + + + MediaPlugin + + <b>Media Plugin</b><br>This plugin allows the playing of audio and video media + <b>Meedia plugin</b><br>See plugin võimaldab audio ja video esitamise + + + + OpenLPExportForm + + openlp.org Song Exporter + openlp.org laulude eksportija + + + Select openlp.org export filename: + Vali openlp.org eksportimise failinimi: + + + Full Song List + Täielik laulude loend + + + Song Title + Laulu pealkiri + + + Author + Autor + + + Select All + Vali kõik + + + Lyrics + Laulusõnad + + + Title + Pealkiri + + + Song Export List + Laulude eksportimise loend + + + Remove Selected + Valitute eemaldamine + + + Progress: + Edenemine: + + + Ready to export + Eksportimiseks valmis + + + Export + Ekspordi + + + Close + Sulge + + + + OpenLPImportForm + + openlp.org Song Importer + openlp.org lauluimportija + + + Select openlp.org songfile to import: + Openlp.org laulufaili valimine importimiseks: + + + Import File Song List + Laululoendi faili importimine + + + Song Title + Laulu pealkiri + + + Author + Autor + + + Select All + Vali kõik + + + Lyrics + Laulusõnad + + + Title + Pealkiri + + + Song Import List + Laulude importimise nimekiri + + + Remove Selected + Valitute eemaldamine + + + Progress: + Edenemine: + + + Ready to import + Importimiseks valmis + + + Import + Impordi + + + Close + Sulge + + + + OpenSongBible + + Importing + Importimine + + + + OpenSongExportForm + + OpenSong Song Exporter + OpenSong laulueksportija + + + Select OpenSong song folder: + Vali OpenSong laulude kataloog: + + + Full Song List + Täielik laulude loend + + + Song Title + Laulu pealkiri + + + Author + Autor + + + Select All + Vali kõik + + + Lyrics + Laulusõnad + + + Title + Pealkiri + + + Song Export List + Laulude eksportimise loend + + + Remove Selected + Valitute eemaldamine + + + Progress: + Edenemine: + + + Ready to export + Eksportimiseks valmis + + + Export + Ekspordi + + + Close + Sulge + + + + OpenSongImportForm + + OpenSong Song Importer + OpenSongi lauluimportija + + + OpenSong Folder: + OpenSongi kataloog: + + + Progress: + Edenemine: + + + Ready to import + Importimiseks valmis + + + Import + Impordi + + + Close + Sulge + + + + PluginForm + + Plugin List + Pluginate loend + + + Plugin Details + Plugina andmed + + + Version: + Versioon: + + + TextLabel + TekstiPealdis + + + About: + Kirjeldus: + + + Status: + Olek: + + + Active + Aktiivne + + + Inactive + Pole aktiivne + + + + PresentationMediaItem + + Presentation + Esitlus + + + Present using: + Esitluseks kasutatakse: + + + Automatic + Automaatne + + + A presentation with that filename already exists. + Sellise nimega esitluse fail on juba olemas. + + + Select Presentation(s) + Esitlus(t)e valimine + + + File exists + Fail on olemas + + + Presentations (%s) + Esitlused (%s) + + + + PresentationPlugin + + <b>Presentation Plugin</b> <br> Delivers the ability to show presentations using a number of different programs. The choice of available presentation programs is available to the user in a drop down box. + <b>Esitluse plugin</b><br>Võimaldab kuvada esitlusi teistest programmidest. Saadaolevad esitlusrakendused on valikumenüüs. + + + + PresentationTab + + Available Controllers + Saadaolevad kontrollerid + + + available + saadaval + + + Presentations + Esitlused + + + + RemoteTab + + Remotes + Kaugjuhtimispuldid + + + Remotes Receiver Port + Puldi vastuvõtu port + + + + RemotesPlugin + + <b>Remote Plugin</b><br>This plugin provides the ability to send messages to a running version of openlp on a different computer via a web browser or other app<br>The Primary use for this would be to send alerts from a creche + <b>Kaugjuhtimisplugin</b><br>See plugin võimaldab töötavale openlp programmile teadete saatmise teisest arvutist veebilehitseja või mõne muu rakenduse kaudu.<br>Selle peamine rakendus on teadete saatmine lastehoiust + + + + ServiceItemEditForm + + Service Item Maintenance + Teenistuse elementide haldus + + + Up + Üles + + + Delete + Kustuta + + + Down + Alla + + + + ServiceManager + + Save Changes to Service? + Kas salvestada teenistusse tehtud muudatused? + + + Open Service + Teenistuse avamine + + + Move to top + Tõsta üles + + + Save Service + Salvesta teenistus + + + Create a new service + Uue teenistuse loomine + + + Save this service + Selle teenistuse salvestamine + + + Theme: + Kujundus: + + + Delete From Service + Teenistusest kustutamine + + + &Preview Verse + &Salmi eelvaatlus + + + &Live Verse + &Otsesalm + + + Move to &top + Liiguta ü&lemiseks + + + New Service + Uus teenistus + + + &Notes + &Märkmed + + + &Delete From Service + &Kustuta teenistusest + + + Move up order + Järjekorras üles liigutamine + + + Move down order + Järjekorras alla liigutamine + + + Move &down + Liiguta &alla + + + Load an existing service + Välise teenistuse laadimine + + + Move to end + Viimaseks tõstmine + + + &Maintain Item + &Halda elementi + + + Move &up + Liiguta &üles + + + &Edit Item + &Muuda kirjet + + + Move to &bottom + Liiguta &alumiseks + + + &Add New Item + &Lisa uus element + + + &Add to Selected Item + &Lisa valitud elemendile + + + Your service is unsaved, do you want to save those changes before creating a new one? + See teenistus pole salvestatud, kas tahad selle uue avamist salvestada? + + + Your current service is unsaved, do you want to save the changes before opening a new one? + See teenistus pole salvestatud, kas tahad enne uue avamist muudatused salvestada? + + + Missing Display Handler + + + + Your item cannot be displayed as there is no handler to display it + Seda elementi pole võimalik näidata ekraanil, kuna puudub seda käsitsev programm + + + + ServiceNoteForm + + Service Item Notes + Teenistuse elemendi märkmed + + + + SettingsForm + + Settings + Sätted + + + + SlideController + + Move to previous + Eelmisele liikumine + + + Theme Screen + Kujunduse ekraan + + + Go to Verse + Liikumine salmile + + + Start continuous loop + Katkematu korduse alustamine + + + Live + Ekraan + + + Start playing media + Meediaesituse alustamine + + + Move to live + Tõsta ekraanile + + + Hide Screen + Peida ekraan + + + Move to last + Liikumine viimasele + + + Verse + Salm + + + Move to next + Liikumine järgmisele + + + Move to first + Liikumine esimesele + + + Blank Screen + Tühi ekraan + + + Delay between slides in seconds + Viivitus slaidide vahel sekundites + + + Preview + Eelvaade + + + Stop continuous loop + Katkematu korduse lõpetamine + + + s + s + + + Chorus + Refrään + + + Edit and re-preview Song + Muuda ja kuva laulu eelvaade uuesti + + + + SongBookForm + + Error + Viga + + + You need to type in a book name! + Pead sisestama laulikule nime! + + + Edit Book + Lauliku redigeerimine + + + Name: + Nimi: + + + Publisher: + Kirjastaja: + + + + SongMaintenanceForm + + Are you sure you want to delete the selected book? + Kas oled kindel, et tahad valitud lauliku kustutada? + + + Couldn't save your author. + Autorit ei suudetud salvestada. + + + This author can't be deleted, they are currently assigned to at least one song. + Seda autorit pole võimalik kustutada, see on seotud vähemalt ühe lauluga. + + + Couldn't add your book. + Laulikut ei suudetud lisada. + + + Error + Viga + + + No author selected! + Ühtegi autorit pole valitud! + + + Couldn't add your topic. + Teemat ei suudetud lisada. + + + This book can't be deleted, it is currently assigned to at least one song. + Seda laulikut pole võimalik kustutada, see on seotud vähemalt ühe lauluga. + + + Delete Book + Lauliku kustutamine + + + No book selected! + Ühtegi laulikut pole valitud! + + + Are you sure you want to delete the selected author? + Kas oled kindel, et tahad kustutada valitud autori? + + + Couldn't add your author. + Autorit ei suudetud lisada. + + + Couldn't save your topic. + Teemat ei suudetud salvestada. + + + Couldn't save your book. + Laulikut ei suudetud salvestada. + + + Delete Topic + Teema kustutamine + + + Delete Author + Autori kustutamine + + + No topic selected! + Ühtegi teemat pole valitud! + + + This topic can't be deleted, it is currently assigned to at least one song. + Seda teemat pole võimalik kustutada, see on seotud vähemalt ühe lauluga. + + + Are you sure you want to delete the selected topic? + Kas oled kindel, et tahad valitud teema kustutada? + + + Song Maintenance + Laulude haldus + + + Authors + Autorid + + + Topics + Teemad + + + Books/Hymnals + Laulikud + + + Add + Lisa + + + Edit + Muuda + + + Delete + Kustuta + + + + SongMediaItem + + CCLI Licence: + CCLI litsents: + + + Delete song? + Kas kustutada laul? + + + Song + Laul + + + Maintain the lists of authors, topics and books + Autorite, teemade ja raamatute loendi haldamine + + + Titles + Pealkirjad + + + Lyrics + Laulusõnad + + + Clear + Puhasta + + + Type: + Liik: + + + Search + Otsi + + + Authors + Autorid + + + Search: + Otsi: + + + Delete Confirmation + Kustutamise kinnitus + + + Song Maintenance + Laulude haldus + + + %s (%s) + %s (%s) + + + Delete %d songs? + Kas kustutada %d laulu? + + + + SongUsageDeleteForm + + Delete Selected Song Usage Events? + Kas kustutada valitud laulude kasutamise sündmused? + + + Are you sure you want to delete selected Song Usage data? + Kas oled kindel, et tahad kustutada valitud laulude kasutuse andmed? + + + + SongUsageDetailForm + + Output File Location + Väljundfaili asukoht + + + + SongUsagePlugin + + <b>SongUsage Plugin</b><br>This plugin records the use of songs and when they have been used during a live service + <b>Laulukasutuse plugin</b><br>See plugin salvestab laulude kasutuse koos nende suurele ekraanile näitamise kuupäevaga + + + + SongsPlugin + + Open Songs of Fellowship file + Open Songs of Fellowship fail + + + Open documents or presentations + Open document vormingus dokumendid või esitlused + + + <strong>Song Plugin</strong><br />This plugin allows songs to be managed and displayed. + <strong>Laulude plugin</strong><br />See plugin võimaldab laulude kuvamise ja haldamise. + + + + SongsTab + + Songs Mode + Laulurežiim + + + Songs + Laulud + + + Enable search as you type + Otsing sisestamise ajal + + + Display Verses on Live Tool bar + Salme kuvatakse ekraani tööriistaribal + + + + ThemeManager + + Import Theme + Teema importimine + + + Create a new theme + Uue teema loomine + + + Delete Theme + Teema kustutamine + + + Error + Viga + + + Delete a theme + Teema kustutamine + + + Edit a theme + Teema muutmine + + + Edit Theme + Kujunduse muutmine + + + Export Theme + Kujunduse eksportimine + + + You are unable to delete the default theme. + Vaikimisi kujundust pole võimalik kustutada. + + + File is not a valid theme. + See fail ei ole sobilik kujundus. + + + Theme Exists + Kujundus on juba olemas + + + Delete theme + Kustuta kujundus + + + Save Theme - (%s) + Salvesta kujundus - (%s) + + + default + vaikimisi + + + Select Theme Import File + Importimiseks kujunduse faili valimine + + + New Theme + Uus kujundus + + + Import a theme + Teema importimine + + + Export theme + Teema eksportimine + + + Make Global + Globaalseks tegemine + + + You have not selected a theme. + Sa ei ole teemat valinud. + + + A theme with this name already exists, would you like to overwrite it? + Sellise nimega teema on juba olemas, kas kirjutada üle? + + + Export a theme + Ekspordi teema + + + Theme %s is use in %s plugin + Kujundust %s kasutatakse pluginas %s + + + Theme %s is use by Service Manager + Kujundust %s kasutab teenistuste haldur + + + + ThemesTab + + Theme level + Teema tase + + + Global theme + Üleüldine tase + + + Use the global theme, overriding any themes associated with either the service or the songs. + Kasutatakse globaalset kujundust, eirates nii teenistuse kui laulu kujundust. + + + Use the theme from each song in the database. If a song doesn't have a theme associated with it, then use the service's theme. If the service doesn't have a theme, then use the global theme. + Iga laulu jaoks kasutatakse andmebaasis sellele määratud kujundust. Kui laulul kujundus puudub, kasutatakse teenistuse teemat. Kui teenistusel kujundus puudub, siis kasutatakse üleüldist teemat. + + + Service level + Teenistuse tase + + + Global level + Üleüldine teema + + + Song level + Laulu tase + + + Use the theme from the service, overriding any of the individual songs' themes. If the service doesn't have a theme, then use the global theme. + Kasutatakse teenistuse kujundust, eirates laulude kujundusi. Kui teenistusel kujundust pole, kasutatakse globaalset. + + + Themes + Kujundused + + + + TopicsForm + + You need to type in a topic name! + Pead sisestama teema nime! + + + Error + Viga + + + Topic Maintenance + Teemade haldus + + + Topic name: + Teema nimi: + + + + Ui_SongImportWizard + + Song Import Wizard + Laulude importimise nõustaja + + + Welcome to the Song Import Wizard + Tere tulemast laulude importimise nõustajasse + + + This wizard will help you to import songs from a variety of formats. Click the next button below to start the process by selecting a format to import from. + See nõustaja aitab sul laule importida paljudest erinevatest formaatidest. Klõpsa all asuvat edasi nuppu, et jätkata tegevust importimise vormingu valimisega. + + + Select Import Source + Importimise allika valimine + + + Select the import format, and where to import from. + Vali importimise vorming ning kust importida. + + + Format: + Vorming: + + + OpenLyrics + OpenLyrics + + + OpenSong + OpenSong + + + CCLI + CCLI + + + CSV + CSV + + + Add Files... + Lisa faile... + + + Remove File(s) + Kaugfail(id) + + + Filename: + Failinimi: + + + Browse... + Lehitse... + + + Importing + Importimine + + + Please wait while your songs are imported. + Palun oota, kuni laule imporditakse. + + + Ready. + Valmis. + + + %p% + %p% + + + + alertsPlugin + + Show an alert message + Teate kuvamine + + + <b>Alerts Plugin</b><br>This plugin controls the displaying of alerts on the presentations screen + <b>Teadete plugin</b><br>See plugin juhib esitlusekraanile teadete kuvamist + + + &Alert + &Teade + + + + export_menu + + &Bible + &Piibel + + + + import_menu + + &Bible + &Piibel + + + &Song + &Laul + + + Import songs using the import wizard. + Laulude importimine importimise nõustajaga. + + + Songs of Fellowship (temp menu item) + Vennaskonna laulud (ajutine menüükirje) + + + Import songs from the VOLS1_2.RTF, sof3words.rtf and sof4words.rtf supplied with the music books + Laulude importimine laulikutega kaasa pandud failidest VOLS1_2.RTF, sof3words.rtf ja sof4words.rtf + + + Generic Document/Presentation Import (temp menu item) + Üldine dokumentide/esitluste importimine (ajutine menüükirje) + + + Import songs from Word/Writer/Powerpoint/Impress + Laulude importimine Wordist/Writerist/Powerpointist/Impressist + + + + self.ImportSongMenu + + Import Error + Viga importimisel + + + Error importing Songs of Fellowship file. +OpenOffice.org must be installed and you must be using an unedited copy of the RTF included with the Songs of Fellowship Music Editions + Tõrge laulude importimisel Songs of Fellowship lauliku failist. +OpenOffice.org peab olema paigaldatud ja sul peab olema muutmata koopia RTF-ist, mis on kaasa pandud Sonfs of Fellowship Music Editions laulikuga + + + + self.splash_screen + + Starting + Käivitumine + + + Splash Screen + Käivitusekraan + + + + tools_menu + + &Song Usage + &Laulude kasutus + + + &Delete recorded data + &Salvestatud andmete kustutamine + + + Delete song usage to specified date + Kustuta laulude kasutus määratud kuupäevani + + + &Extract recorded data + &Kogutud andmete salvestamine + + + Generate report on Song Usage + Laulude kasutusraporti koostamine + + + Song Usage Status + Laulude kasutuse teave + + + Start/Stop live song usage recording + Alusta/lõpeta ekraanile näidatud laulude salvestamine + + +