forked from openlp/openlp
Head831
This commit is contained in:
commit
4b0dc2a83f
@ -100,7 +100,7 @@ class OpenLP(QtGui.QApplication):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
log.info(u'Openlp version %s' % app_version[u'version'])
|
log.info(u'Openlp version %s' % app_version[u'version'])
|
||||||
except:
|
except IOError:
|
||||||
log.exception('Error in version file.')
|
log.exception('Error in version file.')
|
||||||
app_version = {
|
app_version = {
|
||||||
u'full': u'1.9.0-bzr000',
|
u'full': u'1.9.0-bzr000',
|
||||||
|
@ -173,7 +173,6 @@ from settingsmanager import SettingsManager
|
|||||||
from plugin import PluginStatus, Plugin
|
from plugin import PluginStatus, Plugin
|
||||||
from pluginmanager import PluginManager
|
from pluginmanager import PluginManager
|
||||||
from settingstab import SettingsTab
|
from settingstab import SettingsTab
|
||||||
from mediamanageritem import MediaManagerItem
|
|
||||||
from xmlrootclass import XmlRootClass
|
from xmlrootclass import XmlRootClass
|
||||||
from serviceitem import ServiceItem
|
from serviceitem import ServiceItem
|
||||||
from serviceitem import ServiceItemType
|
from serviceitem import ServiceItemType
|
||||||
@ -184,4 +183,6 @@ from songxmlhandler import SongXMLBuilder, SongXMLParser
|
|||||||
from themexmlhandler import ThemeXML
|
from themexmlhandler import ThemeXML
|
||||||
from renderer import Renderer
|
from renderer import Renderer
|
||||||
from rendermanager import RenderManager
|
from rendermanager import RenderManager
|
||||||
|
from mediamanageritem import MediaManagerItem
|
||||||
|
from basemodel import BaseModel
|
||||||
from baselistwithdnd import BaseListWithDnD
|
from baselistwithdnd import BaseListWithDnD
|
||||||
|
40
openlp/core/lib/basemodel.py
Normal file
40
openlp/core/lib/basemodel.py
Normal file
@ -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
|
||||||
|
|
@ -23,15 +23,14 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
import logging
|
||||||
import types
|
import types
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib.toolbar import *
|
|
||||||
from openlp.core.lib import contextMenuAction, contextMenuSeparator, \
|
from openlp.core.lib import contextMenuAction, contextMenuSeparator, \
|
||||||
SettingsManager
|
SettingsManager, OpenLPToolbar, ServiceItem, build_icon
|
||||||
from serviceitem import ServiceItem
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -336,8 +335,8 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
log.info(u'New files(s) %s', unicode(files))
|
log.info(u'New files(s) %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
self.loadList(files)
|
self.loadList(files)
|
||||||
dir = os.path.split(unicode(files[0]))[0]
|
lastDir = os.path.split(unicode(files[0]))[0]
|
||||||
SettingsManager.set_last_dir(self.settingsSection, dir)
|
SettingsManager.set_last_dir(self.settingsSection, lastDir)
|
||||||
SettingsManager.set_list(self.settingsSection,
|
SettingsManager.set_list(self.settingsSection,
|
||||||
self.settingsSection, self.getFileList())
|
self.settingsSection, self.getFileList())
|
||||||
|
|
||||||
|
@ -38,30 +38,32 @@ class PluginManager(object):
|
|||||||
"""
|
"""
|
||||||
log.info(u'Plugin manager loaded')
|
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 constructor for the plugin manager. Passes the controllers on to
|
||||||
the plugins for them to interact with via their ServiceItems.
|
the plugins for them to interact with via their ServiceItems.
|
||||||
|
|
||||||
``dir``
|
``plugin_dir``
|
||||||
The directory to search for plugins.
|
The directory to search for plugins.
|
||||||
"""
|
"""
|
||||||
log.info(u'Plugin manager initing')
|
log.info(u'Plugin manager initing')
|
||||||
if not dir in sys.path:
|
if not plugin_dir in sys.path:
|
||||||
log.debug(u'Inserting %s into sys.path', dir)
|
log.debug(u'Inserting %s into sys.path', plugin_dir)
|
||||||
sys.path.insert(0, dir)
|
sys.path.insert(0, plugin_dir)
|
||||||
self.basepath = os.path.abspath(dir)
|
self.basepath = os.path.abspath(plugin_dir)
|
||||||
log.debug(u'Base path %s ', self.basepath)
|
log.debug(u'Base path %s ', self.basepath)
|
||||||
|
self.plugin_helpers = []
|
||||||
self.plugins = []
|
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')
|
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``
|
Scan the directory ``plugin_dir`` for objects inheriting from the
|
||||||
class.
|
``Plugin`` class.
|
||||||
|
|
||||||
``dir``
|
``plugin_dir``
|
||||||
The directory to scan.
|
The directory to scan.
|
||||||
|
|
||||||
``plugin_helpers``
|
``plugin_helpers``
|
||||||
@ -69,10 +71,11 @@ class PluginManager(object):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
self.plugin_helpers = plugin_helpers
|
self.plugin_helpers = plugin_helpers
|
||||||
startdepth = len(os.path.abspath(dir).split(os.sep))
|
startdepth = len(os.path.abspath(plugin_dir).split(os.sep))
|
||||||
log.debug(u'find plugins %s at depth %d', unicode(dir), startdepth)
|
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:
|
for name in files:
|
||||||
if name.endswith(u'.py') and not name.startswith(u'__'):
|
if name.endswith(u'.py') and not name.startswith(u'__'):
|
||||||
path = os.path.abspath(os.path.join(root, name))
|
path = os.path.abspath(os.path.join(root, name))
|
||||||
@ -80,7 +83,7 @@ class PluginManager(object):
|
|||||||
if thisdepth - startdepth > 2:
|
if thisdepth - startdepth > 2:
|
||||||
# skip anything lower down
|
# skip anything lower down
|
||||||
continue
|
continue
|
||||||
modulename, pyext = os.path.splitext(path)
|
modulename = os.path.splitext(path)[0]
|
||||||
prefix = os.path.commonprefix([self.basepath, path])
|
prefix = os.path.commonprefix([self.basepath, path])
|
||||||
# hack off the plugin base path
|
# hack off the plugin base path
|
||||||
modulename = modulename[len(prefix) + 1:]
|
modulename = modulename[len(prefix) + 1:]
|
||||||
@ -91,8 +94,8 @@ class PluginManager(object):
|
|||||||
try:
|
try:
|
||||||
__import__(modulename, globals(), locals(), [])
|
__import__(modulename, globals(), locals(), [])
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
log.exception(u'Failed to import module %s on path %s for reason %s',
|
log.exception(u'Failed to import module %s on path %s '
|
||||||
modulename, path, e.args[0])
|
'for reason %s', modulename, path, e.args[0])
|
||||||
plugin_classes = Plugin.__subclasses__()
|
plugin_classes = Plugin.__subclasses__()
|
||||||
plugin_objects = []
|
plugin_objects = []
|
||||||
for p in plugin_classes:
|
for p in plugin_classes:
|
||||||
@ -214,3 +217,4 @@ class PluginManager(object):
|
|||||||
if plugin.is_active():
|
if plugin.is_active():
|
||||||
plugin.finalise()
|
plugin.finalise()
|
||||||
log.info(u'Finalisation Complete for %s ' % plugin.name)
|
log.info(u'Finalisation Complete for %s ' % plugin.name)
|
||||||
|
|
||||||
|
@ -189,7 +189,8 @@ class Renderer(object):
|
|||||||
pos = split_text.rfind(u' ')
|
pos = split_text.rfind(u' ')
|
||||||
#no more spaces and we are still too long
|
#no more spaces and we are still too long
|
||||||
if pos == -1:
|
if pos == -1:
|
||||||
while metrics.width(split_text, -1) > line_width:
|
while \
|
||||||
|
metrics.width(split_text, -1) > line_width:
|
||||||
split_text = split_text[:-1]
|
split_text = split_text[:-1]
|
||||||
pos = len(split_text)
|
pos = len(split_text)
|
||||||
else:
|
else:
|
||||||
@ -199,12 +200,14 @@ class Renderer(object):
|
|||||||
#if we have more text add up to 10 spaces on the front.
|
#if we have more text add up to 10 spaces on the front.
|
||||||
if line and self._theme.font_main_indentation > 0:
|
if line and self._theme.font_main_indentation > 0:
|
||||||
line = u'%s%s' % \
|
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
|
#Text fits in a line now
|
||||||
for count, line in enumerate(split_lines):
|
for count, line in enumerate(split_lines):
|
||||||
page.append(line)
|
page.append(line)
|
||||||
#last but one line and only 2 lines to go or end of page
|
#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:
|
len(page) == page_length:
|
||||||
split_pages.append(page)
|
split_pages.append(page)
|
||||||
page = []
|
page = []
|
||||||
@ -559,7 +562,8 @@ class Renderer(object):
|
|||||||
self.painter.drawText(x, rowpos, line)
|
self.painter.drawText(x, rowpos, line)
|
||||||
if self._theme.display_slideTransition:
|
if self._theme.display_slideTransition:
|
||||||
# Print 2nd image with 70% weight
|
# 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 = QtGui.QPainterPath()
|
||||||
path.addText(QtCore.QPointF(x, rowpos), font, line)
|
path.addText(QtCore.QPointF(x, rowpos), font, line)
|
||||||
self.painter2.setBrush(self.painter2.pen().brush())
|
self.painter2.setBrush(self.painter2.pen().brush())
|
||||||
|
@ -181,7 +181,8 @@ class RenderManager(object):
|
|||||||
footer.append(u'CCLI 123456')
|
footer.append(u'CCLI 123456')
|
||||||
formatted = self.renderer.format_slide(verse, False)
|
formatted = self.renderer.format_slide(verse, False)
|
||||||
#Only Render the first slide page returned
|
#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):
|
def format_slide(self, words):
|
||||||
"""
|
"""
|
||||||
|
@ -172,11 +172,12 @@ class SettingsManager(object):
|
|||||||
path = os.path.join(path, section)
|
path = os.path.join(path, section)
|
||||||
try:
|
try:
|
||||||
files = os.listdir(path)
|
files = os.listdir(path)
|
||||||
except:
|
except OSError:
|
||||||
return []
|
return []
|
||||||
if extension:
|
if extension:
|
||||||
return [file for file in files
|
return [filename for filename in files
|
||||||
if extension == os.path.splitext(file)[1]]
|
if extension == os.path.splitext(filename)[1]]
|
||||||
else:
|
else:
|
||||||
# no filtering required
|
# no filtering required
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
@ -24,8 +24,10 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from xml.dom.minidom import Document
|
from xml.dom.minidom import Document
|
||||||
from xml.etree.ElementTree import ElementTree, XML, dump
|
from xml.etree.ElementTree import ElementTree, XML, dump
|
||||||
|
from xml.parsers.expat import ExpatError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -136,7 +138,7 @@ class SongXMLParser(object):
|
|||||||
try:
|
try:
|
||||||
self.song_xml = ElementTree(
|
self.song_xml = ElementTree(
|
||||||
element=XML(unicode(xml).encode('unicode-escape')))
|
element=XML(unicode(xml).encode('unicode-escape')))
|
||||||
except:
|
except ExpatError:
|
||||||
log.exception(u'Invalid xml %s', xml)
|
log.exception(u'Invalid xml %s', xml)
|
||||||
|
|
||||||
def get_verses(self):
|
def get_verses(self):
|
||||||
@ -144,9 +146,9 @@ class SongXMLParser(object):
|
|||||||
Iterates through the verses in the XML and returns a list of verses
|
Iterates through the verses in the XML and returns a list of verses
|
||||||
and their attributes.
|
and their attributes.
|
||||||
"""
|
"""
|
||||||
iter = self.song_xml.getiterator()
|
xml_iter = self.song_xml.getiterator()
|
||||||
verse_list = []
|
verse_list = []
|
||||||
for element in iter:
|
for element in xml_iter:
|
||||||
if element.tag == u'verse':
|
if element.tag == u'verse':
|
||||||
if element.text is None:
|
if element.text is None:
|
||||||
element.text = u''
|
element.text = u''
|
||||||
|
@ -30,7 +30,7 @@ from xml.etree.ElementTree import ElementTree, XML
|
|||||||
|
|
||||||
from openlp.core.lib import str_to_bool
|
from openlp.core.lib import str_to_bool
|
||||||
|
|
||||||
blankthemexml = \
|
BLANK_THEME_XML = \
|
||||||
'''<?xml version="1.0" encoding="utf-8"?>
|
'''<?xml version="1.0" encoding="utf-8"?>
|
||||||
<theme version="1.0">
|
<theme version="1.0">
|
||||||
<name>BlankStyle</name>
|
<name>BlankStyle</name>
|
||||||
@ -97,7 +97,8 @@ class ThemeXML(object):
|
|||||||
"""
|
"""
|
||||||
if self.background_filename and path:
|
if self.background_filename and path:
|
||||||
self.theme_name = self.theme_name.rstrip().lstrip()
|
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 = os.path.join(path, self.theme_name,
|
||||||
self.background_filename)
|
self.background_filename)
|
||||||
|
|
||||||
@ -244,7 +245,8 @@ class ThemeXML(object):
|
|||||||
background.appendChild(element)
|
background.appendChild(element)
|
||||||
|
|
||||||
def add_display(self, shadow, shadow_color, outline, outline_color,
|
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.
|
Add a Display options.
|
||||||
|
|
||||||
@ -349,13 +351,12 @@ class ThemeXML(object):
|
|||||||
"""
|
"""
|
||||||
self.base_parse_xml()
|
self.base_parse_xml()
|
||||||
self.parse_xml(xml)
|
self.parse_xml(xml)
|
||||||
self.theme_filename_extended = False
|
|
||||||
|
|
||||||
def base_parse_xml(self):
|
def base_parse_xml(self):
|
||||||
"""
|
"""
|
||||||
Pull in the blank theme XML as a starting point.
|
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):
|
def parse_xml(self, xml):
|
||||||
"""
|
"""
|
||||||
@ -365,9 +366,9 @@ class ThemeXML(object):
|
|||||||
The XML string to parse.
|
The XML string to parse.
|
||||||
"""
|
"""
|
||||||
theme_xml = ElementTree(element=XML(xml))
|
theme_xml = ElementTree(element=XML(xml))
|
||||||
iter = theme_xml.getiterator()
|
xml_iter = theme_xml.getiterator()
|
||||||
master = u''
|
master = u''
|
||||||
for element in iter:
|
for element in xml_iter:
|
||||||
element.text = unicode(element.text).decode('unicode-escape')
|
element.text = unicode(element.text).decode('unicode-escape')
|
||||||
if element.getchildren():
|
if element.getchildren():
|
||||||
master = element.tag + u'_'
|
master = element.tag + u'_'
|
||||||
@ -409,3 +410,4 @@ class ThemeXML(object):
|
|||||||
if key[0:1] != u'_':
|
if key[0:1] != u'_':
|
||||||
theme_strings.append(u'%30s: %s' % (key, getattr(self, key)))
|
theme_strings.append(u'%30s: %s' % (key, getattr(self, key)))
|
||||||
return u'\n'.join(theme_strings)
|
return u'\n'.join(theme_strings)
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class OpenLPToolbar(QtGui.QToolBar):
|
|||||||
try:
|
try:
|
||||||
if self.icons[title]:
|
if self.icons[title]:
|
||||||
return self.icons[title]
|
return self.icons[title]
|
||||||
except:
|
except NameError:
|
||||||
log.exception(u'getIconFromTitle - no icon for %s' % title)
|
log.exception(u'getIconFromTitle - no icon for %s' % title)
|
||||||
return QtGui.QIcon()
|
return QtGui.QIcon()
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ class XmlRootClass(object):
|
|||||||
The root tag of the xml.
|
The root tag of the xml.
|
||||||
"""
|
"""
|
||||||
root = ElementTree(element=XML(xml))
|
root = ElementTree(element=XML(xml))
|
||||||
iter = root.getiterator()
|
xml_iter = root.getiterator()
|
||||||
for element in iter:
|
for element in xml_iter:
|
||||||
if element.tag != root_tag:
|
if element.tag != root_tag:
|
||||||
text = element.text
|
text = element.text
|
||||||
if type(text) is NoneType:
|
if type(text) is NoneType:
|
||||||
@ -76,7 +76,8 @@ class XmlRootClass(object):
|
|||||||
# Ok, it seems to be a string.
|
# Ok, it seems to be a string.
|
||||||
val = text
|
val = text
|
||||||
if hasattr(self, u'post_tag_hook'):
|
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)
|
setattr(self, element.tag, val)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
@ -90,7 +91,8 @@ class XmlRootClass(object):
|
|||||||
attributes = []
|
attributes = []
|
||||||
for attrib in dir(self):
|
for attrib in dir(self):
|
||||||
if not attrib.startswith(u'_'):
|
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)
|
return u'\n'.join(attributes)
|
||||||
|
|
||||||
def _get_as_string(self):
|
def _get_as_string(self):
|
||||||
|
@ -28,13 +28,13 @@ import types
|
|||||||
from xml.etree.ElementTree import ElementTree, XML
|
from xml.etree.ElementTree import ElementTree, XML
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
DelphiColors = {"clRed":0xFF0000,
|
DELPHI_COLORS = {"clRed":0xFF0000,
|
||||||
"clBlue":0x0000FF,
|
"clBlue":0x0000FF,
|
||||||
"clYellow":0xFFFF00,
|
"clYellow":0xFFFF00,
|
||||||
"clBlack":0x000000,
|
"clBlack":0x000000,
|
||||||
"clWhite":0xFFFFFF}
|
"clWhite":0xFFFFFF}
|
||||||
|
|
||||||
blankstylexml = \
|
BLANK_STYLE_XML = \
|
||||||
'''<?xml version="1.0" encoding="iso-8859-1"?>
|
'''<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<Theme>
|
<Theme>
|
||||||
<Name>BlankStyle</Name>
|
<Name>BlankStyle</Name>
|
||||||
@ -97,7 +97,7 @@ class Theme(object):
|
|||||||
1 - lyrics
|
1 - lyrics
|
||||||
"""
|
"""
|
||||||
# init to defaults
|
# init to defaults
|
||||||
self._set_from_XML(blankstylexml)
|
self._set_from_XML(BLANK_STYLE_XML)
|
||||||
self._set_from_XML(xml)
|
self._set_from_XML(xml)
|
||||||
|
|
||||||
def _get_as_string(self):
|
def _get_as_string(self):
|
||||||
@ -115,26 +115,27 @@ class Theme(object):
|
|||||||
for element in iter:
|
for element in iter:
|
||||||
delphiColorChange = False
|
delphiColorChange = False
|
||||||
if element.tag != u'Theme':
|
if element.tag != u'Theme':
|
||||||
t = element.text
|
element_text = element.text
|
||||||
val = 0
|
val = 0
|
||||||
# easy!
|
# easy!
|
||||||
if type(t) == type(None):
|
if element_text is None:
|
||||||
val = t
|
val = element_text
|
||||||
# strings need special handling to sort the colours out
|
# strings need special handling to sort the colours out
|
||||||
if type(t) is types.StringType or type(t) is types.UnicodeType:
|
if type(element_text) is types.StringType or \
|
||||||
if t[0] == u'$': # might be a hex number
|
type(element_text) is types.UnicodeType:
|
||||||
|
if element_text[0] == u'$': # might be a hex number
|
||||||
try:
|
try:
|
||||||
val = int(t[1:], 16)
|
val = int(element_text[1:], 16)
|
||||||
except ValueError: # nope
|
except ValueError: # nope
|
||||||
pass
|
pass
|
||||||
elif DelphiColors.has_key(t):
|
elif DELPHI_COLORS.has_key(element_text):
|
||||||
val = DelphiColors[t]
|
val = DELPHI_COLORS[element_text]
|
||||||
delphiColorChange = True
|
delphiColorChange = True
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
val = int(t)
|
val = int(element_text)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
val = t
|
val = element_text
|
||||||
if (element.tag.find(u'Color') > 0 or
|
if (element.tag.find(u'Color') > 0 or
|
||||||
(element.tag.find(u'BackgroundParameter') == 0 and
|
(element.tag.find(u'BackgroundParameter') == 0 and
|
||||||
type(val) == type(0))):
|
type(val) == type(0))):
|
||||||
|
@ -132,7 +132,8 @@ class Ui_AboutDialog(object):
|
|||||||
'consider contributing by using the button below.'
|
'consider contributing by using the button below.'
|
||||||
))
|
))
|
||||||
self.AboutNotebook.setTabText(
|
self.AboutNotebook.setTabText(
|
||||||
self.AboutNotebook.indexOf(self.AboutTab), translate('AboutForm', 'About'))
|
self.AboutNotebook.indexOf(self.AboutTab),
|
||||||
|
translate('AboutForm', 'About'))
|
||||||
self.CreditsTextEdit.setPlainText(translate('AboutForm',
|
self.CreditsTextEdit.setPlainText(translate('AboutForm',
|
||||||
'Project Lead\n'
|
'Project Lead\n'
|
||||||
' Raoul "superfly" Snyman\n'
|
' Raoul "superfly" Snyman\n'
|
||||||
|
@ -57,5 +57,6 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog):
|
|||||||
Launch a web browser and go to the contribute page on the site.
|
Launch a web browser and go to the contribute page on the site.
|
||||||
"""
|
"""
|
||||||
import webbrowser
|
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)
|
webbrowser.open_new(url)
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
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):
|
class Ui_AmendThemeDialog(object):
|
||||||
def setupUi(self, AmendThemeDialog):
|
def setupUi(self, AmendThemeDialog):
|
||||||
@ -68,45 +68,56 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.BackgroundLayout.setObjectName(u'BackgroundLayout')
|
self.BackgroundLayout.setObjectName(u'BackgroundLayout')
|
||||||
self.BackgroundLabel = QtGui.QLabel(self.BackgroundTab)
|
self.BackgroundLabel = QtGui.QLabel(self.BackgroundTab)
|
||||||
self.BackgroundLabel.setObjectName(u'BackgroundLabel')
|
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 = QtGui.QComboBox(self.BackgroundTab)
|
||||||
self.BackgroundComboBox.setObjectName(u'BackgroundComboBox')
|
self.BackgroundComboBox.setObjectName(u'BackgroundComboBox')
|
||||||
self.BackgroundComboBox.addItem(QtCore.QString())
|
self.BackgroundComboBox.addItem(QtCore.QString())
|
||||||
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 = QtGui.QLabel(self.BackgroundTab)
|
||||||
self.BackgroundTypeLabel.setObjectName(u'BackgroundTypeLabel')
|
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 = QtGui.QComboBox(self.BackgroundTab)
|
||||||
self.BackgroundTypeComboBox.setObjectName(u'BackgroundTypeComboBox')
|
self.BackgroundTypeComboBox.setObjectName(u'BackgroundTypeComboBox')
|
||||||
self.BackgroundTypeComboBox.addItem(QtCore.QString())
|
self.BackgroundTypeComboBox.addItem(QtCore.QString())
|
||||||
self.BackgroundTypeComboBox.addItem(QtCore.QString())
|
self.BackgroundTypeComboBox.addItem(QtCore.QString())
|
||||||
self.BackgroundTypeComboBox.addItem(QtCore.QString())
|
self.BackgroundTypeComboBox.addItem(QtCore.QString())
|
||||||
self.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 = QtGui.QLabel(self.BackgroundTab)
|
||||||
self.Color1Label.setObjectName(u'Color1Label')
|
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 = QtGui.QPushButton(self.BackgroundTab)
|
||||||
self.Color1PushButton.setObjectName(u'Color1PushButton')
|
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 = QtGui.QLabel(self.BackgroundTab)
|
||||||
self.Color2Label.setObjectName(u'Color2Label')
|
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 = QtGui.QPushButton(self.BackgroundTab)
|
||||||
self.Color2PushButton.setObjectName(u'Color2PushButton')
|
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 = QtGui.QLabel(self.BackgroundTab)
|
||||||
self.ImageLabel.setObjectName(u'ImageLabel')
|
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 = QtGui.QLabel(self.BackgroundTab)
|
||||||
self.GradientLabel.setObjectName(u'GradientLabel')
|
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 = QtGui.QComboBox(self.BackgroundTab)
|
||||||
self.GradientComboBox.setObjectName(u'GradientComboBox')
|
self.GradientComboBox.setObjectName(u'GradientComboBox')
|
||||||
self.GradientComboBox.addItem(QtCore.QString())
|
self.GradientComboBox.addItem(QtCore.QString())
|
||||||
self.GradientComboBox.addItem(QtCore.QString())
|
self.GradientComboBox.addItem(QtCore.QString())
|
||||||
self.GradientComboBox.addItem(QtCore.QString())
|
self.GradientComboBox.addItem(QtCore.QString())
|
||||||
self.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 = QtGui.QWidget(self.BackgroundTab)
|
||||||
self.ImageFilenameWidget.setObjectName(u'ImageFilenameWidget')
|
self.ImageFilenameWidget.setObjectName(u'ImageFilenameWidget')
|
||||||
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImageFilenameWidget)
|
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImageFilenameWidget)
|
||||||
@ -121,7 +132,8 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.ImageToolButton.setIcon(icon1)
|
self.ImageToolButton.setIcon(icon1)
|
||||||
self.ImageToolButton.setObjectName(u'ImageToolButton')
|
self.ImageToolButton.setObjectName(u'ImageToolButton')
|
||||||
self.horizontalLayout_2.addWidget(self.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.ThemeTabWidget.addTab(self.BackgroundTab, u'')
|
||||||
self.FontMainTab = QtGui.QWidget()
|
self.FontMainTab = QtGui.QWidget()
|
||||||
self.FontMainTab.setObjectName(u'FontMainTab')
|
self.FontMainTab.setObjectName(u'FontMainTab')
|
||||||
@ -138,65 +150,88 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget)
|
self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget)
|
||||||
self.FontMainGroupBox.setObjectName(u'FontMainGroupBox')
|
self.FontMainGroupBox.setObjectName(u'FontMainGroupBox')
|
||||||
self.MainFontLayout = QtGui.QFormLayout(self.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.setMargin(8)
|
||||||
self.MainFontLayout.setSpacing(8)
|
self.MainFontLayout.setSpacing(8)
|
||||||
self.MainFontLayout.setObjectName(u'MainFontLayout')
|
self.MainFontLayout.setObjectName(u'MainFontLayout')
|
||||||
self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox)
|
self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox)
|
||||||
self.FontMainlabel.setObjectName(u'FontMainlabel')
|
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 = QtGui.QFontComboBox(self.FontMainGroupBox)
|
||||||
self.FontMainComboBox.setObjectName(u'FontMainComboBox')
|
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 = QtGui.QLabel(self.FontMainGroupBox)
|
||||||
self.FontMainColorLabel.setObjectName(u'FontMainColorLabel')
|
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 = QtGui.QPushButton(self.FontMainGroupBox)
|
||||||
self.FontMainColorPushButton.setObjectName(u'FontMainColorPushButton')
|
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 = QtGui.QLabel(self.FontMainGroupBox)
|
||||||
self.FontMainSize.setObjectName(u'FontMainSize')
|
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)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth())
|
||||||
self.FontMainSizeSpinBox.setSizePolicy(sizePolicy)
|
self.FontMainSizeSpinBox.setSizePolicy(sizePolicy)
|
||||||
self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
|
self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
|
||||||
self.FontMainSizeSpinBox.setProperty(u'value', QtCore.QVariant(16))
|
self.FontMainSizeSpinBox.setProperty(u'value', QtCore.QVariant(16))
|
||||||
self.FontMainSizeSpinBox.setMaximum(999)
|
self.FontMainSizeSpinBox.setMaximum(999)
|
||||||
self.FontMainSizeSpinBox.setObjectName(u'FontMainSizeSpinBox')
|
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 = 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.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 = QtGui.QLabel(self.FontMainGroupBox)
|
||||||
self.FontMainWeightLabel.setObjectName("FontMainWeightLabel")
|
self.FontMainWeightLabel.setObjectName(u'FontMainWeightLabel')
|
||||||
self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWeightLabel)
|
self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole,
|
||||||
|
self.FontMainWeightLabel)
|
||||||
self.MainLeftLayout.addWidget(self.FontMainGroupBox)
|
self.MainLeftLayout.addWidget(self.FontMainGroupBox)
|
||||||
self.FontMainWrapLineAdjustmentLabel = QtGui.QLabel(self.FontMainGroupBox)
|
self.FontMainWrapLineAdjustmentLabel = QtGui.QLabel(
|
||||||
self.FontMainWrapLineAdjustmentLabel.setObjectName("FontMainWrapLineAdjustmentLabel")
|
self.FontMainGroupBox)
|
||||||
self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainWrapLineAdjustmentLabel)
|
self.FontMainWrapLineAdjustmentLabel.setObjectName(
|
||||||
self.FontMainLineAdjustmentSpinBox = QtGui.QSpinBox(self.FontMainGroupBox)
|
u'FontMainWrapLineAdjustmentLabel')
|
||||||
self.FontMainLineAdjustmentSpinBox.setObjectName("FontMainLineAdjustmentSpinBox")
|
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.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 = QtGui.QLabel(self.FontMainGroupBox)
|
||||||
self.FontMainWrapIndentationLabel.setObjectName("FontMainWrapIndentationLabel")
|
self.FontMainWrapIndentationLabel.setObjectName(
|
||||||
self.MainFontLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.FontMainWrapIndentationLabel)
|
u'FontMainWrapIndentationLabel')
|
||||||
|
self.MainFontLayout.setWidget(5, QtGui.QFormLayout.LabelRole,
|
||||||
|
self.FontMainWrapIndentationLabel)
|
||||||
self.FontMainLineSpacingSpinBox = QtGui.QSpinBox(self.FontMainGroupBox)
|
self.FontMainLineSpacingSpinBox = QtGui.QSpinBox(self.FontMainGroupBox)
|
||||||
self.FontMainLineSpacingSpinBox.setObjectName("FontMainLineSpacingSpinBox")
|
self.FontMainLineSpacingSpinBox.setObjectName(
|
||||||
|
u'FontMainLineSpacingSpinBox')
|
||||||
self.FontMainLineSpacingSpinBox.setMaximum(10)
|
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 = QtGui.QLabel(self.FontMainGroupBox)
|
||||||
self.FontMainLinesPageLabel.setObjectName("FontMainLinesPageLabel")
|
self.FontMainLinesPageLabel.setObjectName(u'FontMainLinesPageLabel')
|
||||||
self.MainFontLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.FontMainLinesPageLabel)
|
self.MainFontLayout.setWidget(6, QtGui.QFormLayout.LabelRole,
|
||||||
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
self.FontMainLinesPageLabel)
|
||||||
|
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
|
||||||
|
QtGui.QSizePolicy.Expanding)
|
||||||
self.MainLeftLayout.addItem(spacerItem1)
|
self.MainLeftLayout.addItem(spacerItem1)
|
||||||
self.FontMainLayout.addWidget(self.MainLeftWidget)
|
self.FontMainLayout.addWidget(self.MainLeftWidget)
|
||||||
self.MainRightWidget = QtGui.QWidget(self.FontMainTab)
|
self.MainRightWidget = QtGui.QWidget(self.FontMainTab)
|
||||||
@ -213,66 +248,86 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.MainLocationLayout.setObjectName(u'MainLocationLayout')
|
self.MainLocationLayout.setObjectName(u'MainLocationLayout')
|
||||||
self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox)
|
self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox)
|
||||||
self.DefaultLocationLabel.setObjectName(u'DefaultLocationLabel')
|
self.DefaultLocationLabel.setObjectName(u'DefaultLocationLabel')
|
||||||
self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.DefaultLocationLabel)
|
self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole,
|
||||||
self.FontMainDefaultCheckBox = QtGui.QCheckBox(self.MainLocationGroupBox)
|
self.DefaultLocationLabel)
|
||||||
|
self.FontMainDefaultCheckBox = QtGui.QCheckBox(
|
||||||
|
self.MainLocationGroupBox)
|
||||||
self.FontMainDefaultCheckBox.setTristate(False)
|
self.FontMainDefaultCheckBox.setTristate(False)
|
||||||
self.FontMainDefaultCheckBox.setObjectName(u'FontMainDefaultCheckBox')
|
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 = QtGui.QLabel(self.MainLocationGroupBox)
|
||||||
self.FontMainXLabel.setObjectName(u'FontMainXLabel')
|
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 = QtGui.QLabel(self.MainLocationGroupBox)
|
||||||
self.FontMainYLabel.setObjectName(u'FontMainYLabel')
|
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 = QtGui.QLabel(self.MainLocationGroupBox)
|
||||||
self.FontMainWidthLabel.setObjectName(u'FontMainWidthLabel')
|
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 = QtGui.QLabel(self.MainLocationGroupBox)
|
||||||
self.FontMainHeightLabel.setObjectName(u'FontMainHeightLabel')
|
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)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.FontMainXSpinBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.FontMainXSpinBox.sizePolicy().hasHeightForWidth())
|
||||||
self.FontMainXSpinBox.setSizePolicy(sizePolicy)
|
self.FontMainXSpinBox.setSizePolicy(sizePolicy)
|
||||||
self.FontMainXSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
self.FontMainXSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
||||||
self.FontMainXSpinBox.setProperty(u'value', QtCore.QVariant(0))
|
self.FontMainXSpinBox.setProperty(u'value', QtCore.QVariant(0))
|
||||||
self.FontMainXSpinBox.setMaximum(9999)
|
self.FontMainXSpinBox.setMaximum(9999)
|
||||||
self.FontMainXSpinBox.setObjectName(u'FontMainXSpinBox')
|
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)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.FontMainYSpinBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.FontMainYSpinBox.sizePolicy().hasHeightForWidth())
|
||||||
self.FontMainYSpinBox.setSizePolicy(sizePolicy)
|
self.FontMainYSpinBox.setSizePolicy(sizePolicy)
|
||||||
self.FontMainYSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
self.FontMainYSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
||||||
self.FontMainYSpinBox.setMaximum(9999)
|
self.FontMainYSpinBox.setMaximum(9999)
|
||||||
self.FontMainYSpinBox.setObjectName(u'FontMainYSpinBox')
|
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)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.FontMainWidthSpinBox.sizePolicy().hasHeightForWidth())
|
||||||
self.FontMainWidthSpinBox.setSizePolicy(sizePolicy)
|
self.FontMainWidthSpinBox.setSizePolicy(sizePolicy)
|
||||||
self.FontMainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
self.FontMainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
||||||
self.FontMainWidthSpinBox.setMaximum(9999)
|
self.FontMainWidthSpinBox.setMaximum(9999)
|
||||||
self.FontMainWidthSpinBox.setObjectName(u'FontMainWidthSpinBox')
|
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)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.FontMainHeightSpinBox.sizePolicy().hasHeightForWidth())
|
||||||
self.FontMainHeightSpinBox.setSizePolicy(sizePolicy)
|
self.FontMainHeightSpinBox.setSizePolicy(sizePolicy)
|
||||||
self.FontMainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
self.FontMainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
||||||
self.FontMainHeightSpinBox.setMaximum(9999)
|
self.FontMainHeightSpinBox.setMaximum(9999)
|
||||||
self.FontMainHeightSpinBox.setObjectName(u'FontMainHeightSpinBox')
|
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)
|
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.MainRightLayout.addItem(spacerItem2)
|
||||||
self.FontMainLayout.addWidget(self.MainRightWidget)
|
self.FontMainLayout.addWidget(self.MainRightWidget)
|
||||||
self.ThemeTabWidget.addTab(self.FontMainTab, u'')
|
self.ThemeTabWidget.addTab(self.FontMainTab, u'')
|
||||||
@ -291,49 +346,64 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.FooterFontGroupBox = QtGui.QGroupBox(self.FooterLeftWidget)
|
self.FooterFontGroupBox = QtGui.QGroupBox(self.FooterLeftWidget)
|
||||||
self.FooterFontGroupBox.setObjectName(u'FooterFontGroupBox')
|
self.FooterFontGroupBox.setObjectName(u'FooterFontGroupBox')
|
||||||
self.FooterFontLayout = QtGui.QFormLayout(self.FooterFontGroupBox)
|
self.FooterFontLayout = QtGui.QFormLayout(self.FooterFontGroupBox)
|
||||||
self.FooterFontLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow)
|
self.FooterFontLayout.setFieldGrowthPolicy(
|
||||||
self.FooterFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
QtGui.QFormLayout.ExpandingFieldsGrow)
|
||||||
|
self.FooterFontLayout.setFormAlignment(QtCore.Qt.AlignLeading |
|
||||||
|
QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
||||||
self.FooterFontLayout.setMargin(8)
|
self.FooterFontLayout.setMargin(8)
|
||||||
self.FooterFontLayout.setSpacing(8)
|
self.FooterFontLayout.setSpacing(8)
|
||||||
self.FooterFontLayout.setObjectName(u'FooterFontLayout')
|
self.FooterFontLayout.setObjectName(u'FooterFontLayout')
|
||||||
self.FontFooterLabel = QtGui.QLabel(self.FooterFontGroupBox)
|
self.FontFooterLabel = QtGui.QLabel(self.FooterFontGroupBox)
|
||||||
self.FontFooterLabel.setObjectName(u'FontFooterLabel')
|
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 = QtGui.QFontComboBox(self.FooterFontGroupBox)
|
||||||
self.FontFooterComboBox.setObjectName(u'FontFooterComboBox')
|
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 = QtGui.QLabel(self.FooterFontGroupBox)
|
||||||
self.FontFooterColorLabel.setObjectName(u'FontFooterColorLabel')
|
self.FontFooterColorLabel.setObjectName(u'FontFooterColorLabel')
|
||||||
self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontFooterColorLabel)
|
self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole,
|
||||||
self.FontFooterColorPushButton = QtGui.QPushButton(self.FooterFontGroupBox)
|
self.FontFooterColorLabel)
|
||||||
self.FontFooterColorPushButton.setObjectName(u'FontFooterColorPushButton')
|
self.FontFooterColorPushButton = QtGui.QPushButton(
|
||||||
self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterColorPushButton)
|
self.FooterFontGroupBox)
|
||||||
|
self.FontFooterColorPushButton.setObjectName(
|
||||||
|
u'FontFooterColorPushButton')
|
||||||
|
self.FooterFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole,
|
||||||
|
self.FontFooterColorPushButton)
|
||||||
self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox)
|
self.FontFooterSizeLabel = QtGui.QLabel(self.FooterFontGroupBox)
|
||||||
self.FontFooterSizeLabel.setObjectName(u'FontFooterSizeLabel')
|
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)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth())
|
||||||
self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy)
|
self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy)
|
||||||
self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
|
self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0))
|
||||||
self.FontFooterSizeSpinBox.setProperty(u'value', QtCore.QVariant(10))
|
self.FontFooterSizeSpinBox.setProperty(u'value', QtCore.QVariant(10))
|
||||||
self.FontFooterSizeSpinBox.setMaximum(999)
|
self.FontFooterSizeSpinBox.setMaximum(999)
|
||||||
self.FontFooterSizeSpinBox.setObjectName(u'FontFooterSizeSpinBox')
|
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 = 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.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 = QtGui.QLabel(self.FooterFontGroupBox)
|
||||||
self.FontFooterWeightLabel.setObjectName("FontFooterWeightLabel")
|
self.FontFooterWeightLabel.setObjectName(u'FontFooterWeightLabel')
|
||||||
self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWeightLabel)
|
self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole,
|
||||||
|
self.FontFooterWeightLabel)
|
||||||
self.FooterLeftLayout.addWidget(self.FooterFontGroupBox)
|
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.FooterLeftLayout.addItem(spacerItem3)
|
||||||
self.FontFooterLayout.addWidget(self.FooterLeftWidget)
|
self.FontFooterLayout.addWidget(self.FooterLeftWidget)
|
||||||
self.FooterRightWidget = QtGui.QWidget(self.FontFooterTab)
|
self.FooterRightWidget = QtGui.QWidget(self.FontFooterTab)
|
||||||
@ -344,65 +414,87 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.FooterRightLayout.setObjectName(u'FooterRightLayout')
|
self.FooterRightLayout.setObjectName(u'FooterRightLayout')
|
||||||
self.LocationFooterGroupBox = QtGui.QGroupBox(self.FooterRightWidget)
|
self.LocationFooterGroupBox = QtGui.QGroupBox(self.FooterRightWidget)
|
||||||
self.LocationFooterGroupBox.setObjectName(u'LocationFooterGroupBox')
|
self.LocationFooterGroupBox.setObjectName(u'LocationFooterGroupBox')
|
||||||
self.LocationFooterLayout = QtGui.QFormLayout(self.LocationFooterGroupBox)
|
self.LocationFooterLayout = QtGui.QFormLayout(
|
||||||
self.LocationFooterLayout.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow)
|
self.LocationFooterGroupBox)
|
||||||
self.LocationFooterLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
self.LocationFooterLayout.setFieldGrowthPolicy(
|
||||||
|
QtGui.QFormLayout.ExpandingFieldsGrow)
|
||||||
|
self.LocationFooterLayout.setFormAlignment(QtCore.Qt.AlignLeading |
|
||||||
|
QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
||||||
self.LocationFooterLayout.setMargin(8)
|
self.LocationFooterLayout.setMargin(8)
|
||||||
self.LocationFooterLayout.setSpacing(8)
|
self.LocationFooterLayout.setSpacing(8)
|
||||||
self.LocationFooterLayout.setObjectName(u'LocationFooterLayout')
|
self.LocationFooterLayout.setObjectName(u'LocationFooterLayout')
|
||||||
self.FontFooterDefaultLabel = QtGui.QLabel(self.LocationFooterGroupBox)
|
self.FontFooterDefaultLabel = QtGui.QLabel(self.LocationFooterGroupBox)
|
||||||
self.FontFooterDefaultLabel.setObjectName(u'FontFooterDefaultLabel')
|
self.FontFooterDefaultLabel.setObjectName(u'FontFooterDefaultLabel')
|
||||||
self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontFooterDefaultLabel)
|
self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.LabelRole,
|
||||||
self.FontFooterDefaultCheckBox = QtGui.QCheckBox(self.LocationFooterGroupBox)
|
self.FontFooterDefaultLabel)
|
||||||
|
self.FontFooterDefaultCheckBox = QtGui.QCheckBox(
|
||||||
|
self.LocationFooterGroupBox)
|
||||||
self.FontFooterDefaultCheckBox.setTristate(False)
|
self.FontFooterDefaultCheckBox.setTristate(False)
|
||||||
self.FontFooterDefaultCheckBox.setObjectName(u'FontFooterDefaultCheckBox')
|
self.FontFooterDefaultCheckBox.setObjectName(
|
||||||
self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontFooterDefaultCheckBox)
|
u'FontFooterDefaultCheckBox')
|
||||||
|
self.LocationFooterLayout.setWidget(0, QtGui.QFormLayout.FieldRole,
|
||||||
|
self.FontFooterDefaultCheckBox)
|
||||||
self.FontFooterXLabel = QtGui.QLabel(self.LocationFooterGroupBox)
|
self.FontFooterXLabel = QtGui.QLabel(self.LocationFooterGroupBox)
|
||||||
self.FontFooterXLabel.setObjectName(u'FontFooterXLabel')
|
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 = QtGui.QLabel(self.LocationFooterGroupBox)
|
||||||
self.FontFooterYLabel.setObjectName(u'FontFooterYLabel')
|
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 = QtGui.QLabel(self.LocationFooterGroupBox)
|
||||||
self.FontFooterWidthLabel.setObjectName(u'FontFooterWidthLabel')
|
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 = QtGui.QLabel(self.LocationFooterGroupBox)
|
||||||
self.FontFooterHeightLabel.setObjectName(u'FontFooterHeightLabel')
|
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)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth())
|
||||||
self.FontFooterXSpinBox.setSizePolicy(sizePolicy)
|
self.FontFooterXSpinBox.setSizePolicy(sizePolicy)
|
||||||
self.FontFooterXSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
self.FontFooterXSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
||||||
self.FontFooterXSpinBox.setProperty(u'value', QtCore.QVariant(0))
|
self.FontFooterXSpinBox.setProperty(u'value', QtCore.QVariant(0))
|
||||||
self.FontFooterXSpinBox.setMaximum(9999)
|
self.FontFooterXSpinBox.setMaximum(9999)
|
||||||
self.FontFooterXSpinBox.setObjectName(u'FontFooterXSpinBox')
|
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)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth())
|
||||||
self.FontFooterYSpinBox.setSizePolicy(sizePolicy)
|
self.FontFooterYSpinBox.setSizePolicy(sizePolicy)
|
||||||
self.FontFooterYSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
self.FontFooterYSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
||||||
self.FontFooterYSpinBox.setProperty(u'value', QtCore.QVariant(0))
|
self.FontFooterYSpinBox.setProperty(u'value', QtCore.QVariant(0))
|
||||||
self.FontFooterYSpinBox.setMaximum(9999)
|
self.FontFooterYSpinBox.setMaximum(9999)
|
||||||
self.FontFooterYSpinBox.setObjectName(u'FontFooterYSpinBox')
|
self.FontFooterYSpinBox.setObjectName(u'FontFooterYSpinBox')
|
||||||
self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterYSpinBox)
|
self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.FieldRole,
|
||||||
self.FontFooterWidthSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
|
self.FontFooterYSpinBox)
|
||||||
|
self.FontFooterWidthSpinBox = QtGui.QSpinBox(
|
||||||
|
self.LocationFooterGroupBox)
|
||||||
self.FontFooterWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
self.FontFooterWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
||||||
self.FontFooterWidthSpinBox.setMaximum(9999)
|
self.FontFooterWidthSpinBox.setMaximum(9999)
|
||||||
self.FontFooterWidthSpinBox.setObjectName(u'FontFooterWidthSpinBox')
|
self.FontFooterWidthSpinBox.setObjectName(u'FontFooterWidthSpinBox')
|
||||||
self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthSpinBox)
|
self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole,
|
||||||
self.FontFooterHeightSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox)
|
self.FontFooterWidthSpinBox)
|
||||||
|
self.FontFooterHeightSpinBox = QtGui.QSpinBox(
|
||||||
|
self.LocationFooterGroupBox)
|
||||||
self.FontFooterHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
self.FontFooterHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0))
|
||||||
self.FontFooterHeightSpinBox.setMaximum(9999)
|
self.FontFooterHeightSpinBox.setMaximum(9999)
|
||||||
self.FontFooterHeightSpinBox.setObjectName(u'FontFooterHeightSpinBox')
|
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)
|
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.FooterRightLayout.addItem(spacerItem4)
|
||||||
self.FontFooterLayout.addWidget(self.FooterRightWidget)
|
self.FontFooterLayout.addWidget(self.FooterRightWidget)
|
||||||
self.ThemeTabWidget.addTab(self.FontFooterTab, u'')
|
self.ThemeTabWidget.addTab(self.FontFooterTab, u'')
|
||||||
@ -432,23 +524,29 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.OutlineLayout.setObjectName(u'OutlineLayout')
|
self.OutlineLayout.setObjectName(u'OutlineLayout')
|
||||||
self.OutlineCheckBox = QtGui.QCheckBox(self.OutlineWidget)
|
self.OutlineCheckBox = QtGui.QCheckBox(self.OutlineWidget)
|
||||||
self.OutlineCheckBox.setObjectName(u'OutlineCheckBox')
|
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 = QtGui.QSpinBox(self.OutlineWidget)
|
||||||
self.OutlineSpinBox.setObjectName("OutlineSpinBox")
|
self.OutlineSpinBox.setObjectName(u'OutlineSpinBox')
|
||||||
self.OutlineSpinBox.setMaximum(10)
|
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 = QtGui.QLabel(self.OutlineWidget)
|
||||||
self.OutlineSpinBoxLabel.setObjectName(u'OutlineSpinBoxLabel')
|
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 = QtGui.QLabel(self.OutlineWidget)
|
||||||
self.OutlineColorLabel.setObjectName(u'OutlineColorLabel')
|
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 = QtGui.QPushButton(self.OutlineWidget)
|
||||||
self.OutlineColorPushButton.setObjectName(u'OutlineColorPushButton')
|
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 = QtGui.QLabel(self.OutlineWidget)
|
||||||
self.OutlineEnabledLabel.setObjectName(u'OutlineEnabledLabel')
|
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.verticalLayout.addWidget(self.OutlineWidget)
|
||||||
self.OptionsLeftLayout.addWidget(self.OutlineGroupBox)
|
self.OptionsLeftLayout.addWidget(self.OutlineGroupBox)
|
||||||
self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsLeftWidget)
|
self.ShadowGroupBox = QtGui.QGroupBox(self.OptionsLeftWidget)
|
||||||
@ -465,26 +563,33 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.ShadowLayout.setObjectName(u'ShadowLayout')
|
self.ShadowLayout.setObjectName(u'ShadowLayout')
|
||||||
self.ShadowCheckBox = QtGui.QCheckBox(self.ShadowWidget)
|
self.ShadowCheckBox = QtGui.QCheckBox(self.ShadowWidget)
|
||||||
self.ShadowCheckBox.setObjectName(u'ShadowCheckBox')
|
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 = QtGui.QSpinBox(self.OutlineWidget)
|
||||||
self.ShadowSpinBox.setObjectName("ShadowSpinBox")
|
self.ShadowSpinBox.setObjectName(u'ShadowSpinBox')
|
||||||
self.ShadowSpinBox.setMaximum(10)
|
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 = QtGui.QLabel(self.OutlineWidget)
|
||||||
self.ShadowSpinBoxLabel.setObjectName(u'ShadowSpinBoxLabel')
|
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 = QtGui.QLabel(self.ShadowWidget)
|
||||||
self.ShadowColorLabel.setObjectName(u'ShadowColorLabel')
|
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 = QtGui.QPushButton(self.ShadowWidget)
|
||||||
self.ShadowColorPushButton.setObjectName(u'ShadowColorPushButton')
|
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 = QtGui.QLabel(self.ShadowWidget)
|
||||||
self.ShadowEnabledLabel.setObjectName(u'ShadowEnabledLabel')
|
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.verticalLayout.addWidget(self.ShadowWidget)
|
||||||
self.OptionsLeftLayout.addWidget(self.ShadowGroupBox)
|
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.OptionsLeftLayout.addItem(spacerItem5)
|
||||||
self.OtherOptionsLayout.addWidget(self.OptionsLeftWidget)
|
self.OtherOptionsLayout.addWidget(self.OptionsLeftWidget)
|
||||||
self.OptionsRightWidget = QtGui.QWidget(self.OtherOptionsTab)
|
self.OptionsRightWidget = QtGui.QWidget(self.OtherOptionsTab)
|
||||||
@ -520,14 +625,18 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.TransitionGroupBox.setObjectName(u'TransitionGroupBox')
|
self.TransitionGroupBox.setObjectName(u'TransitionGroupBox')
|
||||||
self.gridLayout_5 = QtGui.QGridLayout(self.TransitionGroupBox)
|
self.gridLayout_5 = QtGui.QGridLayout(self.TransitionGroupBox)
|
||||||
self.gridLayout_5.setObjectName(u'gridLayout_5')
|
self.gridLayout_5.setObjectName(u'gridLayout_5')
|
||||||
self.SlideTransitionCheckedBoxLabel = QtGui.QLabel(self.TransitionGroupBox)
|
self.SlideTransitionCheckedBoxLabel = QtGui.QLabel(
|
||||||
self.SlideTransitionCheckedBoxLabel.setObjectName(u'SlideTransitionCheckedBoxLabel')
|
self.TransitionGroupBox)
|
||||||
self.gridLayout_5.addWidget(self.SlideTransitionCheckedBoxLabel, 0, 0, 1, 1)
|
self.SlideTransitionCheckedBoxLabel.setObjectName(
|
||||||
|
u'SlideTransitionCheckedBoxLabel')
|
||||||
|
self.gridLayout_5.addWidget(
|
||||||
|
self.SlideTransitionCheckedBoxLabel, 0, 0, 1, 1)
|
||||||
self.SlideTransitionCheckedBox = QtGui.QCheckBox(self.AlignmentGroupBox)
|
self.SlideTransitionCheckedBox = QtGui.QCheckBox(self.AlignmentGroupBox)
|
||||||
self.SlideTransitionCheckedBox.setTristate(False)
|
self.SlideTransitionCheckedBox.setTristate(False)
|
||||||
self.gridLayout_5.addWidget(self.SlideTransitionCheckedBox, 0, 1, 1, 1)
|
self.gridLayout_5.addWidget(self.SlideTransitionCheckedBox, 0, 1, 1, 1)
|
||||||
self.OptionsRightLayout.addWidget(self.TransitionGroupBox)
|
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.OptionsRightLayout.addItem(spacerItem6)
|
||||||
self.OtherOptionsLayout.addWidget(self.OptionsRightWidget)
|
self.OtherOptionsLayout.addWidget(self.OptionsRightWidget)
|
||||||
self.ThemeTabWidget.addTab(self.OtherOptionsTab, u'')
|
self.ThemeTabWidget.addTab(self.OtherOptionsTab, u'')
|
||||||
@ -539,13 +648,16 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.ThemePreviewLayout.setSpacing(8)
|
self.ThemePreviewLayout.setSpacing(8)
|
||||||
self.ThemePreviewLayout.setMargin(8)
|
self.ThemePreviewLayout.setMargin(8)
|
||||||
self.ThemePreviewLayout.setObjectName(u'ThemePreviewLayout')
|
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.ThemePreviewLayout.addItem(spacerItem7)
|
||||||
self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.ThemePreview.sizePolicy().hasHeightForWidth())
|
||||||
self.ThemePreview.setSizePolicy(sizePolicy)
|
self.ThemePreview.setSizePolicy(sizePolicy)
|
||||||
self.ThemePreview.setMaximumSize(QtCore.QSize(300, 225))
|
self.ThemePreview.setMaximumSize(QtCore.QSize(300, 225))
|
||||||
self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel)
|
self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel)
|
||||||
@ -554,88 +666,142 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.ThemePreview.setScaledContents(True)
|
self.ThemePreview.setScaledContents(True)
|
||||||
self.ThemePreview.setObjectName(u'ThemePreview')
|
self.ThemePreview.setObjectName(u'ThemePreview')
|
||||||
self.ThemePreviewLayout.addWidget(self.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.ThemePreviewLayout.addItem(spacerItem8)
|
||||||
self.AmendThemeLayout.addWidget(self.PreviewGroupBox)
|
self.AmendThemeLayout.addWidget(self.PreviewGroupBox)
|
||||||
self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog)
|
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.ThemeButtonBox.setObjectName(u'ThemeButtonBox')
|
||||||
self.AmendThemeLayout.addWidget(self.ThemeButtonBox)
|
self.AmendThemeLayout.addWidget(self.ThemeButtonBox)
|
||||||
|
|
||||||
self.retranslateUi(AmendThemeDialog)
|
self.retranslateUi(AmendThemeDialog)
|
||||||
self.ThemeTabWidget.setCurrentIndex(0)
|
self.ThemeTabWidget.setCurrentIndex(0)
|
||||||
QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL(u'accepted()'), AmendThemeDialog.accept)
|
QtCore.QObject.connect(self.ThemeButtonBox,
|
||||||
QtCore.QObject.connect(self.ThemeButtonBox, QtCore.SIGNAL(u'rejected()'), AmendThemeDialog.reject)
|
QtCore.SIGNAL(u'accepted()'), AmendThemeDialog.accept)
|
||||||
|
QtCore.QObject.connect(self.ThemeButtonBox,
|
||||||
|
QtCore.SIGNAL(u'rejected()'), AmendThemeDialog.reject)
|
||||||
QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog)
|
QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog)
|
||||||
AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit)
|
AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit)
|
||||||
AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget)
|
AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget)
|
||||||
AmendThemeDialog.setTabOrder(self.ThemeTabWidget, self.BackgroundComboBox)
|
AmendThemeDialog.setTabOrder(self.ThemeTabWidget,
|
||||||
AmendThemeDialog.setTabOrder(self.BackgroundComboBox, self.BackgroundTypeComboBox)
|
self.BackgroundComboBox)
|
||||||
AmendThemeDialog.setTabOrder(self.BackgroundTypeComboBox, self.Color1PushButton)
|
AmendThemeDialog.setTabOrder(self.BackgroundComboBox,
|
||||||
AmendThemeDialog.setTabOrder(self.Color1PushButton, self.Color2PushButton)
|
self.BackgroundTypeComboBox)
|
||||||
|
AmendThemeDialog.setTabOrder(self.BackgroundTypeComboBox,
|
||||||
|
self.Color1PushButton)
|
||||||
|
AmendThemeDialog.setTabOrder(self.Color1PushButton,
|
||||||
|
self.Color2PushButton)
|
||||||
AmendThemeDialog.setTabOrder(self.Color2PushButton, self.ImageLineEdit)
|
AmendThemeDialog.setTabOrder(self.Color2PushButton, self.ImageLineEdit)
|
||||||
AmendThemeDialog.setTabOrder(self.ImageLineEdit, self.ImageToolButton)
|
AmendThemeDialog.setTabOrder(self.ImageLineEdit, self.ImageToolButton)
|
||||||
AmendThemeDialog.setTabOrder(self.ImageToolButton, self.GradientComboBox)
|
AmendThemeDialog.setTabOrder(self.ImageToolButton,
|
||||||
AmendThemeDialog.setTabOrder(self.GradientComboBox, self.FontMainComboBox)
|
self.GradientComboBox)
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainComboBox, self.FontMainColorPushButton)
|
AmendThemeDialog.setTabOrder(self.GradientComboBox,
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, self.FontMainSizeSpinBox)
|
self.FontMainComboBox)
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainWeightComboBox)
|
AmendThemeDialog.setTabOrder(self.FontMainComboBox,
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainWeightComboBox, self.FontMainLineSpacingSpinBox)
|
self.FontMainColorPushButton)
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainLineSpacingSpinBox, self.FontMainDefaultCheckBox)
|
AmendThemeDialog.setTabOrder(self.FontMainColorPushButton,
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, self.FontMainXSpinBox)
|
self.FontMainSizeSpinBox)
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, self.FontMainYSpinBox)
|
AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox,
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, self.FontMainWidthSpinBox)
|
self.FontMainWeightComboBox)
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox, self.FontMainHeightSpinBox)
|
AmendThemeDialog.setTabOrder(self.FontMainWeightComboBox,
|
||||||
AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox, self.FontFooterComboBox)
|
self.FontMainLineSpacingSpinBox)
|
||||||
AmendThemeDialog.setTabOrder(self.FontFooterComboBox, self.FontFooterColorPushButton)
|
AmendThemeDialog.setTabOrder(self.FontMainLineSpacingSpinBox,
|
||||||
AmendThemeDialog.setTabOrder(self.FontFooterColorPushButton, self.FontFooterSizeSpinBox)
|
self.FontMainDefaultCheckBox)
|
||||||
AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterWeightComboBox)
|
AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox,
|
||||||
AmendThemeDialog.setTabOrder(self.FontFooterWeightComboBox, self.FontFooterDefaultCheckBox)
|
self.FontMainXSpinBox)
|
||||||
AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox)
|
AmendThemeDialog.setTabOrder(self.FontMainXSpinBox,
|
||||||
AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, self.FontFooterYSpinBox)
|
self.FontMainYSpinBox)
|
||||||
AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthSpinBox)
|
AmendThemeDialog.setTabOrder(self.FontMainYSpinBox,
|
||||||
AmendThemeDialog.setTabOrder(self.FontFooterWidthSpinBox, self.FontFooterHeightSpinBox)
|
self.FontMainWidthSpinBox)
|
||||||
AmendThemeDialog.setTabOrder(self.FontFooterHeightSpinBox, self.OutlineCheckBox)
|
AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox,
|
||||||
AmendThemeDialog.setTabOrder(self.OutlineCheckBox, self.OutlineColorPushButton)
|
self.FontMainHeightSpinBox)
|
||||||
AmendThemeDialog.setTabOrder(self.OutlineColorPushButton, self.ShadowCheckBox)
|
AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox,
|
||||||
AmendThemeDialog.setTabOrder(self.ShadowCheckBox, self.ShadowColorPushButton)
|
self.FontFooterComboBox)
|
||||||
AmendThemeDialog.setTabOrder(self.ShadowColorPushButton, self.HorizontalComboBox)
|
AmendThemeDialog.setTabOrder(self.FontFooterComboBox,
|
||||||
AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox)
|
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):
|
def retranslateUi(self, AmendThemeDialog):
|
||||||
AmendThemeDialog.setWindowTitle(translate('AmendThemeForm', 'Theme Maintenance'))
|
AmendThemeDialog.setWindowTitle(
|
||||||
|
translate('AmendThemeForm', 'Theme Maintenance'))
|
||||||
self.ThemeNameLabel.setText(translate('AmendThemeForm', 'Theme Name:'))
|
self.ThemeNameLabel.setText(translate('AmendThemeForm', 'Theme Name:'))
|
||||||
self.BackgroundLabel.setText(translate('AmendThemeForm', 'Background:'))
|
self.BackgroundLabel.setText(translate('AmendThemeForm', 'Background:'))
|
||||||
self.BackgroundComboBox.setItemText(0, translate('AmendThemeForm', 'Opaque'))
|
self.BackgroundComboBox.setItemText(0,
|
||||||
self.BackgroundComboBox.setItemText(1, translate('AmendThemeForm', 'Transparent'))
|
translate('AmendThemeForm', 'Opaque'))
|
||||||
self.BackgroundTypeLabel.setText(translate('AmendThemeForm', 'Background Type:'))
|
self.BackgroundComboBox.setItemText(1,
|
||||||
self.BackgroundTypeComboBox.setItemText(0, translate('AmendThemeForm', 'Solid Color'))
|
translate('AmendThemeForm', 'Transparent'))
|
||||||
self.BackgroundTypeComboBox.setItemText(1, translate('AmendThemeForm', 'Gradient'))
|
self.BackgroundTypeLabel.setText(
|
||||||
self.BackgroundTypeComboBox.setItemText(2, translate('AmendThemeForm', 'Image'))
|
translate('AmendThemeForm', 'Background Type:'))
|
||||||
|
self.BackgroundTypeComboBox.setItemText(0,
|
||||||
|
translate('AmendThemeForm', 'Solid Color'))
|
||||||
|
self.BackgroundTypeComboBox.setItemText(1,
|
||||||
|
translate('AmendThemeForm', 'Gradient'))
|
||||||
|
self.BackgroundTypeComboBox.setItemText(2,
|
||||||
|
translate('AmendThemeForm', 'Image'))
|
||||||
self.Color1Label.setText(translate('AmendThemeForm', '<Color1>'))
|
self.Color1Label.setText(translate('AmendThemeForm', '<Color1>'))
|
||||||
self.Color2Label.setText(translate('AmendThemeForm', '<Color2>'))
|
self.Color2Label.setText(translate('AmendThemeForm', '<Color2>'))
|
||||||
self.ImageLabel.setText(translate('AmendThemeForm', 'Image:'))
|
self.ImageLabel.setText(translate('AmendThemeForm', 'Image:'))
|
||||||
self.GradientLabel.setText(translate('AmendThemeForm', 'Gradient :'))
|
self.GradientLabel.setText(translate('AmendThemeForm', 'Gradient :'))
|
||||||
self.GradientComboBox.setItemText(0, translate('AmendThemeForm', 'Horizontal'))
|
self.GradientComboBox.setItemText(0,
|
||||||
self.GradientComboBox.setItemText(1, translate('AmendThemeForm', 'Vertical'))
|
translate('AmendThemeForm', 'Horizontal'))
|
||||||
self.GradientComboBox.setItemText(2, translate('AmendThemeForm', 'Circular'))
|
self.GradientComboBox.setItemText(1,
|
||||||
|
translate('AmendThemeForm', 'Vertical'))
|
||||||
|
self.GradientComboBox.setItemText(2,
|
||||||
|
translate('AmendThemeForm', 'Circular'))
|
||||||
self.ThemeTabWidget.setTabText(
|
self.ThemeTabWidget.setTabText(
|
||||||
self.ThemeTabWidget.indexOf(self.BackgroundTab),
|
self.ThemeTabWidget.indexOf(self.BackgroundTab),
|
||||||
translate('AmendThemeForm', 'Background'))
|
translate('AmendThemeForm', 'Background'))
|
||||||
self.FontMainGroupBox.setTitle(translate('AmendThemeForm', 'Main Font'))
|
self.FontMainGroupBox.setTitle(translate('AmendThemeForm', 'Main Font'))
|
||||||
self.FontMainlabel.setText(translate('AmendThemeForm', 'Font:'))
|
self.FontMainlabel.setText(translate('AmendThemeForm', 'Font:'))
|
||||||
self.FontMainColorLabel.setText(translate('AmendThemeForm', 'Font Color:'))
|
self.FontMainColorLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Font Color:'))
|
||||||
self.FontMainSize.setText(translate('AmendThemeForm', 'Size:'))
|
self.FontMainSize.setText(translate('AmendThemeForm', 'Size:'))
|
||||||
self.FontMainSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt'))
|
self.FontMainSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt'))
|
||||||
self.FontMainWrapIndentationLabel.setText(translate('AmendThemeForm', 'Wrap Indentation'))
|
self.FontMainWrapIndentationLabel.setText(
|
||||||
self.FontMainWrapLineAdjustmentLabel.setText(translate('AmendThemeForm', 'Adjust Line Spacing'))
|
translate('AmendThemeForm', 'Wrap Indentation'))
|
||||||
self.FontMainWeightComboBox.setItemText(0, translate('AmendThemeForm', 'Normal'))
|
self.FontMainWrapLineAdjustmentLabel.setText(
|
||||||
self.FontMainWeightComboBox.setItemText(1, translate('AmendThemeForm', 'Bold'))
|
translate('AmendThemeForm', 'Adjust Line Spacing'))
|
||||||
self.FontMainWeightComboBox.setItemText(2, translate('AmendThemeForm', 'Italics'))
|
self.FontMainWeightComboBox.setItemText(0,
|
||||||
self.FontMainWeightComboBox.setItemText(3, translate('AmendThemeForm', 'Bold/Italics'))
|
translate('AmendThemeForm', 'Normal'))
|
||||||
self.FontMainWeightLabel.setText(translate('AmendThemeForm', 'Font Weight:'))
|
self.FontMainWeightComboBox.setItemText(1,
|
||||||
self.MainLocationGroupBox.setTitle(translate('AmendThemeForm', 'Display Location'))
|
translate('AmendThemeForm', 'Bold'))
|
||||||
self.DefaultLocationLabel.setText(translate('AmendThemeForm', 'Use Default Location:'))
|
self.FontMainWeightComboBox.setItemText(2,
|
||||||
|
translate('AmendThemeForm', 'Italics'))
|
||||||
|
self.FontMainWeightComboBox.setItemText(3,
|
||||||
|
translate('AmendThemeForm', 'Bold/Italics'))
|
||||||
|
self.FontMainWeightLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Font Weight:'))
|
||||||
|
self.MainLocationGroupBox.setTitle(
|
||||||
|
translate('AmendThemeForm', 'Display Location'))
|
||||||
|
self.DefaultLocationLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Use Default Location:'))
|
||||||
self.FontMainXLabel.setText(translate('AmendThemeForm', 'X Position:'))
|
self.FontMainXLabel.setText(translate('AmendThemeForm', 'X Position:'))
|
||||||
self.FontMainYLabel.setText(translate('AmendThemeForm', 'Y Position:'))
|
self.FontMainYLabel.setText(translate('AmendThemeForm', 'Y Position:'))
|
||||||
self.FontMainWidthLabel.setText(translate('AmendThemeForm', 'Width:'))
|
self.FontMainWidthLabel.setText(translate('AmendThemeForm', 'Width:'))
|
||||||
@ -647,51 +813,81 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.ThemeTabWidget.setTabText(
|
self.ThemeTabWidget.setTabText(
|
||||||
self.ThemeTabWidget.indexOf(self.FontMainTab),
|
self.ThemeTabWidget.indexOf(self.FontMainTab),
|
||||||
translate('AmendThemeForm', 'Font Main'))
|
translate('AmendThemeForm', 'Font Main'))
|
||||||
self.FooterFontGroupBox.setTitle(translate('AmendThemeForm', 'Footer Font'))
|
self.FooterFontGroupBox.setTitle(
|
||||||
|
translate('AmendThemeForm', 'Footer Font'))
|
||||||
self.FontFooterLabel.setText(translate('AmendThemeForm', 'Font:'))
|
self.FontFooterLabel.setText(translate('AmendThemeForm', 'Font:'))
|
||||||
self.FontFooterColorLabel.setText(translate('AmendThemeForm', 'Font Color:'))
|
self.FontFooterColorLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Font Color:'))
|
||||||
self.FontFooterSizeLabel.setText(translate('AmendThemeForm', 'Size:'))
|
self.FontFooterSizeLabel.setText(translate('AmendThemeForm', 'Size:'))
|
||||||
self.FontFooterSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt'))
|
self.FontFooterSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt'))
|
||||||
self.FontFooterWeightComboBox.setItemText(0, translate('AmendThemeForm', 'Normal'))
|
self.FontFooterWeightComboBox.setItemText(0,
|
||||||
self.FontFooterWeightComboBox.setItemText(1, translate('AmendThemeForm', 'Bold'))
|
translate('AmendThemeForm', 'Normal'))
|
||||||
self.FontFooterWeightComboBox.setItemText(2, translate('AmendThemeForm', 'Italics'))
|
self.FontFooterWeightComboBox.setItemText(1,
|
||||||
self.FontFooterWeightComboBox.setItemText(3, translate('AmendThemeForm', 'Bold/Italics'))
|
translate('AmendThemeForm', 'Bold'))
|
||||||
self.FontFooterWeightLabel.setText(translate('AmendThemeForm', 'Font Weight:'))
|
self.FontFooterWeightComboBox.setItemText(2,
|
||||||
self.LocationFooterGroupBox.setTitle(translate('AmendThemeForm', 'Display Location'))
|
translate('AmendThemeForm', 'Italics'))
|
||||||
self.FontFooterDefaultLabel.setText(translate('AmendThemeForm', 'Use Default Location:'))
|
self.FontFooterWeightComboBox.setItemText(3,
|
||||||
self.FontFooterXLabel.setText(translate('AmendThemeForm', 'X Position:'))
|
translate('AmendThemeForm', 'Bold/Italics'))
|
||||||
self.FontFooterYLabel.setText(translate('AmendThemeForm', 'Y Position:'))
|
self.FontFooterWeightLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Font Weight:'))
|
||||||
|
self.LocationFooterGroupBox.setTitle(
|
||||||
|
translate('AmendThemeForm', 'Display Location'))
|
||||||
|
self.FontFooterDefaultLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Use Default Location:'))
|
||||||
|
self.FontFooterXLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'X Position:'))
|
||||||
|
self.FontFooterYLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Y Position:'))
|
||||||
self.FontFooterWidthLabel.setText(translate('AmendThemeForm', 'Width:'))
|
self.FontFooterWidthLabel.setText(translate('AmendThemeForm', 'Width:'))
|
||||||
self.FontFooterHeightLabel.setText(translate('AmendThemeForm', 'Height:'))
|
self.FontFooterHeightLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Height:'))
|
||||||
self.FontFooterXSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
self.FontFooterXSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
||||||
self.FontFooterYSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
self.FontFooterYSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
||||||
self.FontFooterWidthSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
self.FontFooterWidthSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
||||||
self.FontFooterHeightSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
self.FontFooterHeightSpinBox.setSuffix(
|
||||||
|
translate('AmendThemeForm', 'px'))
|
||||||
self.ThemeTabWidget.setTabText(
|
self.ThemeTabWidget.setTabText(
|
||||||
self.ThemeTabWidget.indexOf(self.FontFooterTab),
|
self.ThemeTabWidget.indexOf(self.FontFooterTab),
|
||||||
translate('AmendThemeForm', 'Font Footer'))
|
translate('AmendThemeForm', 'Font Footer'))
|
||||||
self.OutlineGroupBox.setTitle(translate('AmendThemeForm', 'Outline'))
|
self.OutlineGroupBox.setTitle(translate('AmendThemeForm', 'Outline'))
|
||||||
self.OutlineSpinBoxLabel.setText(translate('AmendThemeForm', 'Outline Size:'))
|
self.OutlineSpinBoxLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Outline Size:'))
|
||||||
self.OutlineSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
self.OutlineSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
||||||
self.OutlineColorLabel.setText(translate('AmendThemeForm', 'Outline Color:'))
|
self.OutlineColorLabel.setText(
|
||||||
self.OutlineEnabledLabel.setText(translate('AmendThemeForm', 'Show Outline:'))
|
translate('AmendThemeForm', 'Outline Color:'))
|
||||||
|
self.OutlineEnabledLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Show Outline:'))
|
||||||
self.ShadowGroupBox.setTitle(translate('AmendThemeForm', 'Shadow'))
|
self.ShadowGroupBox.setTitle(translate('AmendThemeForm', 'Shadow'))
|
||||||
self.ShadowSpinBoxLabel.setText(translate('AmendThemeForm', 'Shadow Size:'))
|
self.ShadowSpinBoxLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Shadow Size:'))
|
||||||
self.ShadowSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
self.ShadowSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
|
||||||
self.ShadowColorLabel.setText(translate('AmendThemeForm', 'Shadow Color:'))
|
self.ShadowColorLabel.setText(
|
||||||
self.ShadowEnabledLabel.setText(translate('AmendThemeForm', 'Show Shadow:'))
|
translate('AmendThemeForm', 'Shadow Color:'))
|
||||||
self.AlignmentGroupBox.setTitle(translate('AmendThemeForm', 'Alignment'))
|
self.ShadowEnabledLabel.setText(
|
||||||
self.HorizontalLabel.setText(translate('AmendThemeForm', 'Horizontal Align:'))
|
translate('AmendThemeForm', 'Show Shadow:'))
|
||||||
self.HorizontalComboBox.setItemText(0, translate('AmendThemeForm', 'Left'))
|
self.AlignmentGroupBox.setTitle(
|
||||||
self.HorizontalComboBox.setItemText(1, translate('AmendThemeForm', 'Right'))
|
translate('AmendThemeForm', 'Alignment'))
|
||||||
self.HorizontalComboBox.setItemText(2, translate('AmendThemeForm', 'Center'))
|
self.HorizontalLabel.setText(
|
||||||
self.VerticalLabel.setText(translate('AmendThemeForm', 'Vertical Align:'))
|
translate('AmendThemeForm', 'Horizontal Align:'))
|
||||||
|
self.HorizontalComboBox.setItemText(0,
|
||||||
|
translate('AmendThemeForm', 'Left'))
|
||||||
|
self.HorizontalComboBox.setItemText(1,
|
||||||
|
translate('AmendThemeForm', 'Right'))
|
||||||
|
self.HorizontalComboBox.setItemText(2,
|
||||||
|
translate('AmendThemeForm', 'Center'))
|
||||||
|
self.VerticalLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Vertical Align:'))
|
||||||
self.VerticalComboBox.setItemText(0, translate('AmendThemeForm', 'Top'))
|
self.VerticalComboBox.setItemText(0, translate('AmendThemeForm', 'Top'))
|
||||||
self.VerticalComboBox.setItemText(1, translate('AmendThemeForm', 'Middle'))
|
self.VerticalComboBox.setItemText(1,
|
||||||
self.VerticalComboBox.setItemText(2, translate('AmendThemeForm', 'Bottom'))
|
translate('AmendThemeForm', 'Middle'))
|
||||||
self.TransitionGroupBox.setTitle(translate('AmendThemeForm', 'Slide Transition'))
|
self.VerticalComboBox.setItemText(2,
|
||||||
self.SlideTransitionCheckedBoxLabel.setText(translate('AmendThemeForm', 'Transition Active:'))
|
translate('AmendThemeForm', 'Bottom'))
|
||||||
|
self.TransitionGroupBox.setTitle(
|
||||||
|
translate('AmendThemeForm', 'Slide Transition'))
|
||||||
|
self.SlideTransitionCheckedBoxLabel.setText(
|
||||||
|
translate('AmendThemeForm', 'Transition Active:'))
|
||||||
self.ThemeTabWidget.setTabText(
|
self.ThemeTabWidget.setTabText(
|
||||||
self.ThemeTabWidget.indexOf(self.OtherOptionsTab),
|
self.ThemeTabWidget.indexOf(self.OtherOptionsTab),
|
||||||
translate('AmendThemeForm', 'Other Options'))
|
translate('AmendThemeForm', 'Other Options'))
|
||||||
self.PreviewGroupBox.setTitle(translate('AmendThemeForm', 'Preview'))
|
self.PreviewGroupBox.setTitle(translate('AmendThemeForm', 'Preview'))
|
||||||
|
|
||||||
|
@ -154,8 +154,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
unicode(self.theme.background_endColor),
|
unicode(self.theme.background_endColor),
|
||||||
self.theme.background_direction)
|
self.theme.background_direction)
|
||||||
else:
|
else:
|
||||||
(path, filename) = \
|
filename = \
|
||||||
os.path.split(unicode(self.theme.background_filename))
|
os.path.split(unicode(self.theme.background_filename))[0]
|
||||||
new_theme.add_background_image(filename)
|
new_theme.add_background_image(filename)
|
||||||
save_to = os.path.join(self.path, theme_name, filename)
|
save_to = os.path.join(self.path, theme_name, filename)
|
||||||
save_from = self.theme.background_filename
|
save_from = self.theme.background_filename
|
||||||
|
@ -33,7 +33,8 @@ from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
|
|||||||
ThemeManager, SlideController, PluginForm, MediaDockManager, DisplayManager
|
ThemeManager, SlideController, PluginForm, MediaDockManager, DisplayManager
|
||||||
from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \
|
from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \
|
||||||
SettingsManager, PluginManager, Receiver, translate
|
SettingsManager, PluginManager, Receiver, translate
|
||||||
from openlp.core.utils import check_latest_version, AppLocation, add_actions, LanguageManager
|
from openlp.core.utils import check_latest_version, AppLocation, add_actions, \
|
||||||
|
LanguageManager
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -61,7 +62,8 @@ class VersionThread(QtCore.QThread):
|
|||||||
QtCore.QThread.__init__(self, parent)
|
QtCore.QThread.__init__(self, parent)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.app_version = app_version
|
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):
|
def run(self):
|
||||||
"""
|
"""
|
||||||
@ -842,7 +844,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
recentFileCount = QtCore.QSettings().value(
|
recentFileCount = QtCore.QSettings().value(
|
||||||
self.generalSettingsSection + u'/max recent files',
|
self.generalSettingsSection + u'/max recent files',
|
||||||
QtCore.QVariant(4)).toInt()[0]
|
QtCore.QVariant(4)).toInt()[0]
|
||||||
if filename and not self.recentFiles.contains(filename):
|
if filename and filename not in self.recentFiles:
|
||||||
self.recentFiles.prepend(QtCore.QString(filename))
|
self.recentFiles.insert(0, QtCore.QString(filename))
|
||||||
while self.recentFiles.count() > recentFileCount:
|
while self.recentFiles.count() > recentFileCount:
|
||||||
self.recentFiles.takeLast()
|
self.recentFiles.pop()
|
||||||
|
|
||||||
|
@ -100,10 +100,12 @@ class Ui_PluginViewDialog(object):
|
|||||||
|
|
||||||
def retranslateUi(self, PluginViewDialog):
|
def retranslateUi(self, PluginViewDialog):
|
||||||
PluginViewDialog.setWindowTitle(translate('PluginForm', 'Plugin List'))
|
PluginViewDialog.setWindowTitle(translate('PluginForm', 'Plugin List'))
|
||||||
self.PluginInfoGroupBox.setTitle(translate('PluginForm', 'Plugin Details'))
|
self.PluginInfoGroupBox.setTitle(
|
||||||
|
translate('PluginForm', 'Plugin Details'))
|
||||||
self.VersionLabel.setText(translate('PluginForm', 'Version:'))
|
self.VersionLabel.setText(translate('PluginForm', 'Version:'))
|
||||||
self.VersionNumberLabel.setText(translate('PluginForm', 'TextLabel'))
|
self.VersionNumberLabel.setText(translate('PluginForm', 'TextLabel'))
|
||||||
self.AboutLabel.setText(translate('PluginForm', 'About:'))
|
self.AboutLabel.setText(translate('PluginForm', 'About:'))
|
||||||
self.StatusLabel.setText(translate('PluginForm', 'Status:'))
|
self.StatusLabel.setText(translate('PluginForm', 'Status:'))
|
||||||
self.StatusComboBox.setItemText(0, translate('PluginForm', 'Active'))
|
self.StatusComboBox.setItemText(0, translate('PluginForm', 'Active'))
|
||||||
self.StatusComboBox.setItemText(1, translate('PluginForm', 'Inactive'))
|
self.StatusComboBox.setItemText(1, translate('PluginForm', 'Inactive'))
|
||||||
|
|
||||||
|
@ -67,7 +67,8 @@ class Ui_ServiceItemEditDialog(object):
|
|||||||
QtCore.QMetaObject.connectSlotsByName(ServiceItemEditDialog)
|
QtCore.QMetaObject.connectSlotsByName(ServiceItemEditDialog)
|
||||||
|
|
||||||
def retranslateUi(self, ServiceItemEditDialog):
|
def retranslateUi(self, ServiceItemEditDialog):
|
||||||
ServiceItemEditDialog.setWindowTitle(translate('ServiceItemEditForm', 'Service Item Maintenance'))
|
ServiceItemEditDialog.setWindowTitle(
|
||||||
|
translate('ServiceItemEditForm', 'Service Item Maintenance'))
|
||||||
self.upButton.setText(translate('ServiceItemEditForm', 'Up'))
|
self.upButton.setText(translate('ServiceItemEditForm', 'Up'))
|
||||||
self.deleteButton.setText(translate('ServiceItemEditForm', 'Delete'))
|
self.deleteButton.setText(translate('ServiceItemEditForm', 'Delete'))
|
||||||
self.downButton.setText(translate('ServiceItemEditForm', 'Down'))
|
self.downButton.setText(translate('ServiceItemEditForm', 'Down'))
|
||||||
|
@ -147,9 +147,11 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.ServiceManagerList.setAlternatingRowColors(True)
|
self.ServiceManagerList.setAlternatingRowColors(True)
|
||||||
self.ServiceManagerList.setHeaderHidden(True)
|
self.ServiceManagerList.setHeaderHidden(True)
|
||||||
self.ServiceManagerList.setExpandsOnDoubleClick(False)
|
self.ServiceManagerList.setExpandsOnDoubleClick(False)
|
||||||
self.ServiceManagerList.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
self.ServiceManagerList.setContextMenuPolicy(
|
||||||
|
QtCore.Qt.CustomContextMenu)
|
||||||
QtCore.QObject.connect(self.ServiceManagerList,
|
QtCore.QObject.connect(self.ServiceManagerList,
|
||||||
QtCore.SIGNAL('customContextMenuRequested(QPoint)'), self.contextMenu)
|
QtCore.SIGNAL('customContextMenuRequested(QPoint)'),
|
||||||
|
self.contextMenu)
|
||||||
self.ServiceManagerList.setObjectName(u'ServiceManagerList')
|
self.ServiceManagerList.setObjectName(u'ServiceManagerList')
|
||||||
# enable drop
|
# enable drop
|
||||||
self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
|
self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
|
||||||
@ -172,7 +174,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.trUtf8('Move to end'), self.onServiceEnd)
|
self.trUtf8('Move to end'), self.onServiceEnd)
|
||||||
self.OrderToolbar.addSeparator()
|
self.OrderToolbar.addSeparator()
|
||||||
self.OrderToolbar.addToolbarButton(
|
self.OrderToolbar.addToolbarButton(
|
||||||
self.trUtf8('&Delete From Service'), u':/general/general_delete.png',
|
self.trUtf8('&Delete From Service'),
|
||||||
|
u':/general/general_delete.png',
|
||||||
self.trUtf8('Delete From Service'), self.onDeleteFromService)
|
self.trUtf8('Delete From Service'), self.onDeleteFromService)
|
||||||
self.Layout.addWidget(self.OrderToolbar)
|
self.Layout.addWidget(self.OrderToolbar)
|
||||||
# Connect up our signals and slots
|
# Connect up our signals and slots
|
||||||
@ -205,7 +208,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.dndMenu = QtGui.QMenu()
|
self.dndMenu = QtGui.QMenu()
|
||||||
self.newAction = self.dndMenu.addAction(self.trUtf8('&Add New Item'))
|
self.newAction = self.dndMenu.addAction(self.trUtf8('&Add New Item'))
|
||||||
self.newAction.setIcon(build_icon(u':/general/general_edit.png'))
|
self.newAction.setIcon(build_icon(u':/general/general_edit.png'))
|
||||||
self.addToAction = self.dndMenu.addAction(self.trUtf8('&Add to Selected Item'))
|
self.addToAction = self.dndMenu.addAction(
|
||||||
|
self.trUtf8('&Add to Selected Item'))
|
||||||
self.addToAction.setIcon(build_icon(u':/general/general_edit.png'))
|
self.addToAction.setIcon(build_icon(u':/general/general_edit.png'))
|
||||||
#build the context menu
|
#build the context menu
|
||||||
self.menu = QtGui.QMenu()
|
self.menu = QtGui.QMenu()
|
||||||
@ -269,7 +273,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.makeLive()
|
self.makeLive()
|
||||||
|
|
||||||
def onServiceItemNoteForm(self):
|
def onServiceItemNoteForm(self):
|
||||||
item, count = self.findServiceItem()
|
item = self.findServiceItem()[0]
|
||||||
self.serviceNoteForm.textEdit.setPlainText(
|
self.serviceNoteForm.textEdit.setPlainText(
|
||||||
self.serviceItems[item][u'service_item'].notes)
|
self.serviceItems[item][u'service_item'].notes)
|
||||||
if self.serviceNoteForm.exec_():
|
if self.serviceNoteForm.exec_():
|
||||||
@ -278,7 +282,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.repaintServiceList(item, 0)
|
self.repaintServiceList(item, 0)
|
||||||
|
|
||||||
def onServiceItemEditForm(self):
|
def onServiceItemEditForm(self):
|
||||||
item, count = self.findServiceItem()
|
item = self.findServiceItem()[0]
|
||||||
self.serviceItemEditForm.setServiceItem(
|
self.serviceItemEditForm.setServiceItem(
|
||||||
self.serviceItems[item][u'service_item'])
|
self.serviceItems[item][u'service_item'])
|
||||||
if self.serviceItemEditForm.exec_():
|
if self.serviceItemEditForm.exec_():
|
||||||
@ -477,7 +481,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Remove the current ServiceItem from the list
|
Remove the current ServiceItem from the list
|
||||||
"""
|
"""
|
||||||
item, count = self.findServiceItem()
|
item = self.findServiceItem()[0]
|
||||||
if item is not -1:
|
if item is not -1:
|
||||||
self.serviceItems.remove(self.serviceItems[item])
|
self.serviceItems.remove(self.serviceItems[item])
|
||||||
self.repaintServiceList(0, 0)
|
self.repaintServiceList(0, 0)
|
||||||
@ -514,7 +518,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
treewidgetitem.setIcon(0, serviceitem.iconic_representation)
|
treewidgetitem.setIcon(0, serviceitem.iconic_representation)
|
||||||
else:
|
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.setText(0, serviceitem.title)
|
||||||
treewidgetitem.setToolTip(0, serviceitem.notes)
|
treewidgetitem.setToolTip(0, serviceitem.notes)
|
||||||
treewidgetitem.setData(0, QtCore.Qt.UserRole,
|
treewidgetitem.setData(0, QtCore.Qt.UserRole,
|
||||||
@ -576,7 +581,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
cPickle.dump(service, file)
|
cPickle.dump(service, file)
|
||||||
file.close()
|
file.close()
|
||||||
zip.write(servicefile)
|
zip.write(servicefile)
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Failed to save service to disk')
|
log.exception(u'Failed to save service to disk')
|
||||||
finally:
|
finally:
|
||||||
if file:
|
if file:
|
||||||
@ -585,7 +590,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
zip.close()
|
zip.close()
|
||||||
try:
|
try:
|
||||||
os.remove(servicefile)
|
os.remove(servicefile)
|
||||||
except:
|
except (IOError, OSError):
|
||||||
pass #if not present do not worry
|
pass #if not present do not worry
|
||||||
name = filename.split(os.path.sep)
|
name = filename.split(os.path.sep)
|
||||||
self.serviceName = name[-1]
|
self.serviceName = name[-1]
|
||||||
@ -636,23 +641,23 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.parent.serviceSettingsSection,
|
self.parent.serviceSettingsSection,
|
||||||
os.path.split(filename)[0])
|
os.path.split(filename)[0])
|
||||||
zip = None
|
zip = None
|
||||||
f = None
|
file_to = None
|
||||||
try:
|
try:
|
||||||
zip = zipfile.ZipFile(unicode(filename))
|
zip = zipfile.ZipFile(unicode(filename))
|
||||||
for file in zip.namelist():
|
for file in zip.namelist():
|
||||||
osfile = unicode(QtCore.QDir.toNativeSeparators(file))
|
osfile = unicode(QtCore.QDir.toNativeSeparators(file))
|
||||||
names = osfile.split(os.path.sep)
|
names = osfile.split(os.path.sep)
|
||||||
file_to = os.path.join(self.servicePath,
|
file_path = os.path.join(self.servicePath,
|
||||||
names[len(names) - 1])
|
names[len(names) - 1])
|
||||||
f = open(file_to, u'wb')
|
file_to = open(file_path, u'wb')
|
||||||
f.write(zip.read(file))
|
file_to.write(zip.read(file))
|
||||||
f.flush()
|
file_to.flush()
|
||||||
f.close()
|
file_to.close()
|
||||||
if file_to.endswith(u'osd'):
|
if file_path.endswith(u'osd'):
|
||||||
p_file = file_to
|
p_file = file_path
|
||||||
f = open(p_file, u'r')
|
file_to = open(p_file, u'r')
|
||||||
items = cPickle.load(f)
|
items = cPickle.load(file_to)
|
||||||
f.close()
|
file_to.close()
|
||||||
self.onNewService()
|
self.onNewService()
|
||||||
for item in items:
|
for item in items:
|
||||||
serviceitem = ServiceItem()
|
serviceitem = ServiceItem()
|
||||||
@ -663,13 +668,13 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
try:
|
try:
|
||||||
if os.path.isfile(p_file):
|
if os.path.isfile(p_file):
|
||||||
os.remove(p_file)
|
os.remove(p_file)
|
||||||
except:
|
except (IOError, OSError):
|
||||||
log.exception(u'Failed to remove osd file')
|
log.exception(u'Failed to remove osd file')
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Problem loading a service file')
|
log.exception(u'Problem loading a service file')
|
||||||
finally:
|
finally:
|
||||||
if f:
|
if file_to:
|
||||||
f.close()
|
file_to.close()
|
||||||
if zip:
|
if zip:
|
||||||
zip.close()
|
zip.close()
|
||||||
self.isNew = False
|
self.isNew = False
|
||||||
@ -696,7 +701,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
try:
|
try:
|
||||||
if os.path.isfile(file_path):
|
if os.path.isfile(file_path):
|
||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
except:
|
except OSError:
|
||||||
log.exception(u'Failed to clean up servicePath')
|
log.exception(u'Failed to clean up servicePath')
|
||||||
|
|
||||||
def onThemeComboBoxSelected(self, currentIndex):
|
def onThemeComboBoxSelected(self, currentIndex):
|
||||||
@ -737,7 +742,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Service Item to be added
|
Service Item to be added
|
||||||
|
|
||||||
"""
|
"""
|
||||||
sitem, count = self.findServiceItem()
|
sitem = self.findServiceItem()[0]
|
||||||
item.render()
|
item.render()
|
||||||
if replace:
|
if replace:
|
||||||
item.merge(self.serviceItems[sitem][u'service_item'])
|
item.merge(self.serviceItems[sitem][u'service_item'])
|
||||||
@ -789,7 +794,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Send the current item to the Preview slide controller
|
Send the current item to the Preview slide controller
|
||||||
"""
|
"""
|
||||||
item, count = self.findServiceItem()
|
item = self.findServiceItem()[0]
|
||||||
if item == -1:
|
if item == -1:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
@ -825,7 +830,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Posts a remote edit message to a plugin to allow item to be edited.
|
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']\
|
if self.serviceItems[item][u'service_item']\
|
||||||
.is_capable(ItemCapabilities.AllowsEdit):
|
.is_capable(ItemCapabilities.AllowsEdit):
|
||||||
Receiver.send_message(u'%s_edit' %
|
Receiver.send_message(u'%s_edit' %
|
||||||
@ -942,7 +947,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
|
|
||||||
def onThemeChangeAction(self):
|
def onThemeChangeAction(self):
|
||||||
theme = unicode(self.sender().text())
|
theme = unicode(self.sender().text())
|
||||||
item, count = self.findServiceItem()
|
item = self.findServiceItem()[0]
|
||||||
self.serviceItems[item][u'service_item'].theme = theme
|
self.serviceItems[item][u'service_item'].theme = theme
|
||||||
self.regenerateServiceItems()
|
self.regenerateServiceItems()
|
||||||
|
|
||||||
@ -955,7 +960,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
|
|
||||||
def listRequest(self, message=None):
|
def listRequest(self, message=None):
|
||||||
data = []
|
data = []
|
||||||
curindex, count = self.findServiceItem()
|
curindex = self.findServiceItem()[0]
|
||||||
if curindex >= 0 and curindex < len(self.serviceItems):
|
if curindex >= 0 and curindex < len(self.serviceItems):
|
||||||
curitem = self.serviceItems[curindex]
|
curitem = self.serviceItems[curindex]
|
||||||
else:
|
else:
|
||||||
@ -969,3 +974,4 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
data_item[u'selected'] = (item == curitem)
|
data_item[u'selected'] = (item == curitem)
|
||||||
data.append(data_item)
|
data.append(data_item)
|
||||||
Receiver.send_message(u'servicemanager_list_response', data)
|
Receiver.send_message(u'servicemanager_list_response', data)
|
||||||
|
|
||||||
|
@ -39,7 +39,8 @@ class Ui_ServiceNoteEdit(object):
|
|||||||
self.textEdit.setObjectName(u'textEdit')
|
self.textEdit.setObjectName(u'textEdit')
|
||||||
self.verticalLayout.addWidget(self.textEdit)
|
self.verticalLayout.addWidget(self.textEdit)
|
||||||
self.buttonBox = QtGui.QDialogButtonBox(self.widget)
|
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.buttonBox.setObjectName(u'buttonBox')
|
||||||
self.verticalLayout.addWidget(self.buttonBox)
|
self.verticalLayout.addWidget(self.buttonBox)
|
||||||
|
|
||||||
@ -47,4 +48,6 @@ class Ui_ServiceNoteEdit(object):
|
|||||||
QtCore.QMetaObject.connectSlotsByName(ServiceNoteEdit)
|
QtCore.QMetaObject.connectSlotsByName(ServiceNoteEdit)
|
||||||
|
|
||||||
def retranslateUi(self, ServiceNoteEdit):
|
def retranslateUi(self, ServiceNoteEdit):
|
||||||
ServiceNoteEdit.setWindowTitle(translate('ServiceNoteForm', 'Service Item Notes'))
|
ServiceNoteEdit.setWindowTitle(
|
||||||
|
translate('ServiceNoteForm', 'Service Item Notes'))
|
||||||
|
|
||||||
|
@ -377,9 +377,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
width = self.parent.ControlSplitter.sizes()[self.split]
|
width = self.parent.ControlSplitter.sizes()[self.split]
|
||||||
height = width * self.parent.RenderManager.screen_ratio
|
height = width * self.parent.RenderManager.screen_ratio
|
||||||
self.PreviewListWidget.setColumnWidth(0, width)
|
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():
|
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)
|
self.PreviewListWidget.setRowHeight(framenumber, height)
|
||||||
|
|
||||||
def trackSplitter(self, tab, pos):
|
def trackSplitter(self, tab, pos):
|
||||||
@ -777,7 +777,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
def updatePreview(self):
|
def updatePreview(self):
|
||||||
rm = self.parent.RenderManager
|
rm = self.parent.RenderManager
|
||||||
if not rm.screens.current[u'primary']:
|
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(0.5, self.grabMainDisplay)
|
||||||
QtCore.QTimer.singleShot(2.5, self.grabMainDisplay)
|
QtCore.QTimer.singleShot(2.5, self.grabMainDisplay)
|
||||||
else:
|
else:
|
||||||
|
@ -184,16 +184,14 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
for plugin in self.parent.plugin_manager.plugins:
|
for plugin in self.parent.plugin_manager.plugins:
|
||||||
if not plugin.can_delete_theme(theme):
|
if not plugin.can_delete_theme(theme):
|
||||||
QtGui.QMessageBox.critical(
|
QtGui.QMessageBox.critical(self, self.trUtf8('Error'),
|
||||||
self, self.trUtf8('Error'),
|
self.trUtf8('Theme %s is use in %s plugin' % (theme,
|
||||||
self.trUtf8('Theme %s is use in %s plugin' % (theme, plugin.name)),
|
plugin.name)))
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
|
||||||
return
|
return
|
||||||
if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme:
|
if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme:
|
||||||
QtGui.QMessageBox.critical(
|
QtGui.QMessageBox.critical(self, self.trUtf8('Error'),
|
||||||
self, self.trUtf8('Error'),
|
self.trUtf8('Theme %s is use by Service Manager' %
|
||||||
self.trUtf8('Theme %s is use by Service Manager' % theme),
|
theme))
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
|
||||||
return
|
return
|
||||||
self.themelist.remove(theme)
|
self.themelist.remove(theme)
|
||||||
th = theme + u'.png'
|
th = theme + u'.png'
|
||||||
@ -203,7 +201,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
os.remove(os.path.join(self.path, th))
|
os.remove(os.path.join(self.path, th))
|
||||||
os.remove(os.path.join(self.thumbPath, th))
|
os.remove(os.path.join(self.thumbPath, th))
|
||||||
shutil.rmtree(os.path.join(self.path, theme))
|
shutil.rmtree(os.path.join(self.path, theme))
|
||||||
except:
|
except OSError:
|
||||||
#if not present do not worry
|
#if not present do not worry
|
||||||
pass
|
pass
|
||||||
# As we do not reload the themes push out the change
|
# As we do not reload the themes push out the change
|
||||||
@ -233,12 +231,12 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
try:
|
try:
|
||||||
zip = zipfile.ZipFile(themePath, u'w')
|
zip = zipfile.ZipFile(themePath, u'w')
|
||||||
source = os.path.join(self.path, theme)
|
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:
|
for name in files:
|
||||||
zip.write(
|
zip.write(
|
||||||
os.path.join(source, name),
|
os.path.join(source, name),
|
||||||
os.path.join(theme, name))
|
os.path.join(theme, name))
|
||||||
except:
|
except (IOError, OSError):
|
||||||
log.exception(u'Export Theme Failed')
|
log.exception(u'Export Theme Failed')
|
||||||
finally:
|
finally:
|
||||||
if zip:
|
if zip:
|
||||||
@ -272,11 +270,9 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
#check to see file is in theme root directory
|
#check to see file is in theme root directory
|
||||||
theme = os.path.join(self.path, name)
|
theme = os.path.join(self.path, name)
|
||||||
if os.path.exists(theme):
|
if os.path.exists(theme):
|
||||||
(path, filename) = os.path.split(unicode(file))
|
|
||||||
textName = os.path.splitext(name)[0]
|
textName = os.path.splitext(name)[0]
|
||||||
if textName == self.global_theme:
|
if textName == self.global_theme:
|
||||||
name = u'%s (%s)' % (textName,
|
name = u'%s (%s)' % (textName, self.trUtf8('default'))
|
||||||
self.trUtf8('default'))
|
|
||||||
else:
|
else:
|
||||||
name = textName
|
name = textName
|
||||||
thumb = os.path.join(self.thumbPath, u'%s.png' % textName)
|
thumb = os.path.join(self.thumbPath, u'%s.png' % textName)
|
||||||
@ -360,11 +356,10 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
outfile = open(fullpath, u'wb')
|
outfile = open(fullpath, u'wb')
|
||||||
outfile.write(zip.read(file))
|
outfile.write(zip.read(file))
|
||||||
self.generateAndSaveImage(dir, themename, filexml)
|
self.generateAndSaveImage(dir, themename, filexml)
|
||||||
except:
|
except IOError:
|
||||||
QtGui.QMessageBox.critical(
|
QtGui.QMessageBox.critical(
|
||||||
self, self.trUtf8('Error'),
|
self, self.trUtf8('Error'),
|
||||||
self.trUtf8('File is not a valid theme.'),
|
self.trUtf8('File is not a valid theme.'))
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
|
||||||
log.exception(u'Importing theme from zip file failed %s' % filename)
|
log.exception(u'Importing theme from zip file failed %s' % filename)
|
||||||
finally:
|
finally:
|
||||||
if zip:
|
if zip:
|
||||||
@ -456,7 +451,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
try:
|
try:
|
||||||
outfile = open(theme_file, u'w')
|
outfile = open(theme_file, u'w')
|
||||||
outfile.write(theme_pretty_xml)
|
outfile.write(theme_pretty_xml)
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Saving theme to file failed')
|
log.exception(u'Saving theme to file failed')
|
||||||
finally:
|
finally:
|
||||||
if outfile:
|
if outfile:
|
||||||
@ -464,7 +459,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
if image_from and image_from != image_to:
|
if image_from and image_from != image_to:
|
||||||
try:
|
try:
|
||||||
shutil.copyfile(image_from, image_to)
|
shutil.copyfile(image_from, image_to)
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Failed to save theme image')
|
log.exception(u'Failed to save theme image')
|
||||||
self.generateAndSaveImage(self.path, name, theme_xml)
|
self.generateAndSaveImage(self.path, name, theme_xml)
|
||||||
self.loadThemes()
|
self.loadThemes()
|
||||||
@ -567,3 +562,4 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
#theme.theme_mode
|
#theme.theme_mode
|
||||||
theme.theme_name = theme.theme_name.strip()
|
theme.theme_name = theme.theme_name.strip()
|
||||||
#theme.theme_version
|
#theme.theme_version
|
||||||
|
|
||||||
|
@ -27,10 +27,10 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
from sqlalchemy import create_engine
|
from sqlalchemy.exceptions import InvalidRequestError
|
||||||
from sqlalchemy.orm import scoped_session, sessionmaker, mapper
|
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.core.utils import AppLocation
|
||||||
from openlp.plugins.bibles.lib.models import *
|
from openlp.plugins.bibles.lib.models import *
|
||||||
|
|
||||||
@ -85,13 +85,6 @@ mapper(TTestament, temp_testament_table)
|
|||||||
mapper(TBook, temp_book_table)
|
mapper(TBook, temp_book_table)
|
||||||
mapper(TVerse, temp_verse_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):
|
class MigrateBibles(object):
|
||||||
def __init__(self, display):
|
def __init__(self, display):
|
||||||
self.display = display
|
self.display = display
|
||||||
@ -105,8 +98,8 @@ class MigrateBibles(object):
|
|||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
self.progress(u'Bibles processing started')
|
self.progress(u'Bibles processing started')
|
||||||
for f in self.database_files:
|
for db_file in self.database_files:
|
||||||
self.v_1_9_0(f)
|
self.v_1_9_0(db_file)
|
||||||
self.progress(u'Bibles processing finished')
|
self.progress(u'Bibles processing finished')
|
||||||
|
|
||||||
def v_1_9_0(self, database):
|
def v_1_9_0(self, database):
|
||||||
@ -143,7 +136,7 @@ class MigrateBibles(object):
|
|||||||
try:
|
try:
|
||||||
self.session.add(testament)
|
self.session.add(testament)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
print u'Error thrown = ', sys.exc_info()[1]
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
self.progress(u'Create book table')
|
self.progress(u'Create book table')
|
||||||
@ -157,7 +150,7 @@ class MigrateBibles(object):
|
|||||||
try:
|
try:
|
||||||
self.session.add(book)
|
self.session.add(book)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
print u'Error thrown = ', sys.exc_info()[1]
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
self.progress(u'Create verse table')
|
self.progress(u'Create verse table')
|
||||||
@ -171,12 +164,8 @@ class MigrateBibles(object):
|
|||||||
verse.text = verse_temp.text
|
verse.text = verse_temp.text
|
||||||
try:
|
try:
|
||||||
self.session.add(verse)
|
self.session.add(verse)
|
||||||
except:
|
|
||||||
self.session.rollback()
|
|
||||||
print u'Error thrown = ', sys.exc_info()[1]
|
|
||||||
try:
|
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
print u'Error thrown = ', sys.exc_info()[1]
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
self.progress(u'Create metadata table')
|
self.progress(u'Create metadata table')
|
||||||
@ -188,7 +177,7 @@ class MigrateBibles(object):
|
|||||||
try:
|
try:
|
||||||
self.session.add(biblemeta)
|
self.session.add(biblemeta)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
print u'Error thrown = ', sys.exc_info()[1]
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
|
|
||||||
@ -206,3 +195,4 @@ class MigrateBibles(object):
|
|||||||
conn.commit()
|
conn.commit()
|
||||||
conn.execute(u'vacuum;')
|
conn.execute(u'vacuum;')
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
@ -27,11 +27,11 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
from sqlalchemy import *
|
|
||||||
from sqlalchemy import create_engine
|
from sqlalchemy import create_engine
|
||||||
|
from sqlalchemy.exceptions import InvalidRequestError
|
||||||
from sqlalchemy.orm import scoped_session, sessionmaker, mapper, relation
|
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.core.utils import AppLocation
|
||||||
from openlp.plugins.songs.lib.models import metadata, songs_table, Song, \
|
from openlp.plugins.songs.lib.models import metadata, songs_table, Song, \
|
||||||
Author, Topic, Book
|
Author, Topic, Book
|
||||||
@ -159,7 +159,7 @@ class MigrateSongs(object):
|
|||||||
try:
|
try:
|
||||||
self.session.add(song)
|
self.session.add(song)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
print u'Error thrown = ', sys.exc_info()[1]
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
|
|
||||||
class Ui_AlertDialog(object):
|
class Ui_AlertDialog(object):
|
||||||
@ -31,7 +32,8 @@ class Ui_AlertDialog(object):
|
|||||||
AlertDialog.setObjectName(u'AlertDialog')
|
AlertDialog.setObjectName(u'AlertDialog')
|
||||||
AlertDialog.resize(567, 440)
|
AlertDialog.resize(567, 440)
|
||||||
icon = QtGui.QIcon()
|
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)
|
AlertDialog.setWindowIcon(icon)
|
||||||
self.AlertDialogLayout = QtGui.QVBoxLayout(AlertDialog)
|
self.AlertDialogLayout = QtGui.QVBoxLayout(AlertDialog)
|
||||||
self.AlertDialogLayout.setSpacing(8)
|
self.AlertDialogLayout.setSpacing(8)
|
||||||
@ -42,22 +44,28 @@ class Ui_AlertDialog(object):
|
|||||||
self.AlertTextLayout.setSpacing(8)
|
self.AlertTextLayout.setSpacing(8)
|
||||||
self.AlertTextLayout.setObjectName(u'AlertTextLayout')
|
self.AlertTextLayout.setObjectName(u'AlertTextLayout')
|
||||||
self.AlertEntryLabel = QtGui.QLabel(AlertDialog)
|
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.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.AlertEntryLabel.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.AlertEntryLabel.sizePolicy().hasHeightForWidth())
|
||||||
self.AlertEntryLabel.setSizePolicy(sizePolicy)
|
self.AlertEntryLabel.setSizePolicy(sizePolicy)
|
||||||
self.AlertEntryLabel.setObjectName(u'AlertEntryLabel')
|
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 = QtGui.QLabel(AlertDialog)
|
||||||
self.AlertParameter.setObjectName(u'AlertParameter')
|
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 = QtGui.QLineEdit(AlertDialog)
|
||||||
self.ParameterEdit.setObjectName(u'ParameterEdit')
|
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 = QtGui.QLineEdit(AlertDialog)
|
||||||
self.AlertTextEdit.setObjectName(u'AlertTextEdit')
|
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.AlertDialogLayout.addLayout(self.AlertTextLayout)
|
||||||
self.ManagementLayout = QtGui.QHBoxLayout()
|
self.ManagementLayout = QtGui.QHBoxLayout()
|
||||||
self.ManagementLayout.setSpacing(8)
|
self.ManagementLayout.setSpacing(8)
|
||||||
@ -72,24 +80,28 @@ class Ui_AlertDialog(object):
|
|||||||
self.ManageButtonLayout.setObjectName(u'ManageButtonLayout')
|
self.ManageButtonLayout.setObjectName(u'ManageButtonLayout')
|
||||||
self.NewButton = QtGui.QPushButton(AlertDialog)
|
self.NewButton = QtGui.QPushButton(AlertDialog)
|
||||||
icon1 = QtGui.QIcon()
|
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.setIcon(icon1)
|
||||||
self.NewButton.setObjectName(u'NewButton')
|
self.NewButton.setObjectName(u'NewButton')
|
||||||
self.ManageButtonLayout.addWidget(self.NewButton)
|
self.ManageButtonLayout.addWidget(self.NewButton)
|
||||||
self.SaveButton = QtGui.QPushButton(AlertDialog)
|
self.SaveButton = QtGui.QPushButton(AlertDialog)
|
||||||
self.SaveButton.setEnabled(False)
|
self.SaveButton.setEnabled(False)
|
||||||
icon2 = QtGui.QIcon()
|
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.setIcon(icon2)
|
||||||
self.SaveButton.setObjectName(u'SaveButton')
|
self.SaveButton.setObjectName(u'SaveButton')
|
||||||
self.ManageButtonLayout.addWidget(self.SaveButton)
|
self.ManageButtonLayout.addWidget(self.SaveButton)
|
||||||
self.DeleteButton = QtGui.QPushButton(AlertDialog)
|
self.DeleteButton = QtGui.QPushButton(AlertDialog)
|
||||||
icon3 = QtGui.QIcon()
|
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.setIcon(icon3)
|
||||||
self.DeleteButton.setObjectName(u'DeleteButton')
|
self.DeleteButton.setObjectName(u'DeleteButton')
|
||||||
self.ManageButtonLayout.addWidget(self.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.ManageButtonLayout.addItem(spacerItem)
|
||||||
self.ManagementLayout.addLayout(self.ManageButtonLayout)
|
self.ManagementLayout.addLayout(self.ManageButtonLayout)
|
||||||
self.AlertDialogLayout.addLayout(self.ManagementLayout)
|
self.AlertDialogLayout.addLayout(self.ManagementLayout)
|
||||||
@ -122,7 +134,8 @@ class Ui_AlertDialog(object):
|
|||||||
self.AlertParameter.setBuddy(self.ParameterEdit)
|
self.AlertParameter.setBuddy(self.ParameterEdit)
|
||||||
|
|
||||||
self.retranslateUi(AlertDialog)
|
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)
|
QtCore.QMetaObject.connectSlotsByName(AlertDialog)
|
||||||
AlertDialog.setTabOrder(self.AlertTextEdit, self.ParameterEdit)
|
AlertDialog.setTabOrder(self.AlertTextEdit, self.ParameterEdit)
|
||||||
AlertDialog.setTabOrder(self.ParameterEdit, self.AlertListWidget)
|
AlertDialog.setTabOrder(self.ParameterEdit, self.AlertListWidget)
|
||||||
@ -141,6 +154,7 @@ class Ui_AlertDialog(object):
|
|||||||
self.SaveButton.setText(translate('AlertForm', '&Save'))
|
self.SaveButton.setText(translate('AlertForm', '&Save'))
|
||||||
self.DeleteButton.setText(translate('AlertForm', '&Delete'))
|
self.DeleteButton.setText(translate('AlertForm', '&Delete'))
|
||||||
self.DisplayButton.setText(translate('AlertForm', 'Displ&ay'))
|
self.DisplayButton.setText(translate('AlertForm', 'Displ&ay'))
|
||||||
self.DisplayCloseButton.setText(translate('AlertForm', 'Display && Cl&ose'))
|
self.DisplayCloseButton.setText(
|
||||||
|
translate('AlertForm', 'Display && Cl&ose'))
|
||||||
self.CloseButton.setText(translate('AlertForm', '&Close'))
|
self.CloseButton.setText(translate('AlertForm', '&Close'))
|
||||||
|
|
||||||
|
@ -23,21 +23,7 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
class BaseModel(object):
|
from openlp.core.lib import BaseModel
|
||||||
"""
|
|
||||||
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
|
|
||||||
|
|
||||||
class AlertItem(BaseModel):
|
class AlertItem(BaseModel):
|
||||||
"""
|
"""
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
from sqlalchemy.exceptions import InvalidRequestError
|
||||||
|
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.plugins.alerts.lib.models import init_models, metadata, AlertItem
|
from openlp.plugins.alerts.lib.models import init_models, metadata, AlertItem
|
||||||
@ -80,7 +81,7 @@ class DBManager(object):
|
|||||||
self.session.commit()
|
self.session.commit()
|
||||||
log.debug(u'Alert saved')
|
log.debug(u'Alert saved')
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Alert save failed')
|
log.exception(u'Alert save failed')
|
||||||
return False
|
return False
|
||||||
@ -104,7 +105,7 @@ class DBManager(object):
|
|||||||
self.session.delete(alert_item)
|
self.session.delete(alert_item)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Alert deleton failed')
|
log.exception(u'Alert deleton failed')
|
||||||
return False
|
return False
|
||||||
|
@ -308,29 +308,41 @@ class Ui_BibleImportWizard(object):
|
|||||||
QtCore.QMetaObject.connectSlotsByName(BibleImportWizard)
|
QtCore.QMetaObject.connectSlotsByName(BibleImportWizard)
|
||||||
|
|
||||||
def retranslateUi(self, BibleImportWizard):
|
def retranslateUi(self, BibleImportWizard):
|
||||||
BibleImportWizard.setWindowTitle(translate('ImportWizardForm', 'Bible Import Wizard'))
|
BibleImportWizard.setWindowTitle(
|
||||||
|
translate('ImportWizardForm', 'Bible Import Wizard'))
|
||||||
self.TitleLabel.setText(
|
self.TitleLabel.setText(
|
||||||
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
|
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
|
||||||
translate('ImportWizardForm', 'Welcome to the Bible Import Wizard'))
|
translate('ImportWizardForm', 'Welcome to the Bible Import Wizard'))
|
||||||
self.InformationLabel.setText(
|
self.InformationLabel.setText(
|
||||||
translate('ImportWizardForm', 'This wizard will help you to import Bibles from a '
|
translate('ImportWizardForm',
|
||||||
|
'This wizard will help you to import Bibles from a '
|
||||||
'variety of formats. Click the next button below to start the '
|
'variety of formats. Click the next button below to start the '
|
||||||
'process by selecting a format to import from.'))
|
'process by selecting a format to import from.'))
|
||||||
self.SelectPage.setTitle(translate('ImportWizardForm', 'Select Import Source'))
|
self.SelectPage.setTitle(
|
||||||
self.SelectPage.setSubTitle(
|
translate('ImportWizardForm', 'Select Import Source'))
|
||||||
translate('ImportWizardForm', 'Select the import format, and where to import from.'))
|
self.SelectPage.setSubTitle(translate('ImportWizardForm',
|
||||||
|
'Select the import format, and where to import from.'))
|
||||||
self.FormatLabel.setText(translate('ImportWizardForm', 'Format:'))
|
self.FormatLabel.setText(translate('ImportWizardForm', 'Format:'))
|
||||||
self.FormatComboBox.setItemText(0, translate('ImportWizardForm', 'OSIS'))
|
self.FormatComboBox.setItemText(0,
|
||||||
|
translate('ImportWizardForm', 'OSIS'))
|
||||||
self.FormatComboBox.setItemText(1, translate('ImportWizardForm', 'CSV'))
|
self.FormatComboBox.setItemText(1, translate('ImportWizardForm', 'CSV'))
|
||||||
self.FormatComboBox.setItemText(2, translate('ImportWizardForm', 'OpenSong'))
|
self.FormatComboBox.setItemText(2,
|
||||||
self.FormatComboBox.setItemText(3, translate('ImportWizardForm', 'Web Download'))
|
translate('ImportWizardForm', 'OpenSong'))
|
||||||
self.OsisLocationLabel.setText(translate('ImportWizardForm', 'File Location:'))
|
self.FormatComboBox.setItemText(3,
|
||||||
self.BooksLocationLabel.setText(translate('ImportWizardForm', 'Books Location:'))
|
translate('ImportWizardForm', 'Web Download'))
|
||||||
self.VerseLocationLabel.setText(translate('ImportWizardForm', 'Verse Location:'))
|
self.OsisLocationLabel.setText(
|
||||||
self.OpenSongFileLabel.setText(translate('ImportWizardForm', 'Bible Filename:'))
|
translate('ImportWizardForm', 'File Location:'))
|
||||||
|
self.BooksLocationLabel.setText(
|
||||||
|
translate('ImportWizardForm', 'Books Location:'))
|
||||||
|
self.VerseLocationLabel.setText(
|
||||||
|
translate('ImportWizardForm', 'Verse Location:'))
|
||||||
|
self.OpenSongFileLabel.setText(
|
||||||
|
translate('ImportWizardForm', 'Bible Filename:'))
|
||||||
self.LocationLabel.setText(translate('ImportWizardForm', 'Location:'))
|
self.LocationLabel.setText(translate('ImportWizardForm', 'Location:'))
|
||||||
self.LocationComboBox.setItemText(0, translate('ImportWizardForm', 'Crosswalk'))
|
self.LocationComboBox.setItemText(0,
|
||||||
self.LocationComboBox.setItemText(1, translate('ImportWizardForm', 'BibleGateway'))
|
translate('ImportWizardForm', 'Crosswalk'))
|
||||||
|
self.LocationComboBox.setItemText(1,
|
||||||
|
translate('ImportWizardForm', 'BibleGateway'))
|
||||||
self.BibleLabel.setText(translate('ImportWizardForm', 'Bible:'))
|
self.BibleLabel.setText(translate('ImportWizardForm', 'Bible:'))
|
||||||
self.WebDownloadTabWidget.setTabText(
|
self.WebDownloadTabWidget.setTabText(
|
||||||
self.WebDownloadTabWidget.indexOf(self.DownloadOptionsTab),
|
self.WebDownloadTabWidget.indexOf(self.DownloadOptionsTab),
|
||||||
@ -341,16 +353,19 @@ class Ui_BibleImportWizard(object):
|
|||||||
self.WebDownloadTabWidget.setTabText(
|
self.WebDownloadTabWidget.setTabText(
|
||||||
self.WebDownloadTabWidget.indexOf(self.ProxyServerTab),
|
self.WebDownloadTabWidget.indexOf(self.ProxyServerTab),
|
||||||
translate('ImportWizardForm', 'Proxy Server (Optional)'))
|
translate('ImportWizardForm', 'Proxy Server (Optional)'))
|
||||||
self.LicenseDetailsPage.setTitle(translate('ImportWizardForm', 'License Details'))
|
self.LicenseDetailsPage.setTitle(
|
||||||
self.LicenseDetailsPage.setSubTitle(
|
translate('ImportWizardForm', 'License Details'))
|
||||||
translate('ImportWizardForm', 'Set up the Bible\'s license details.'))
|
self.LicenseDetailsPage.setSubTitle(translate('ImportWizardForm',
|
||||||
self.VersionNameLabel.setText(translate('ImportWizardForm', 'Version Name:'))
|
'Set up the Bible\'s license details.'))
|
||||||
|
self.VersionNameLabel.setText(
|
||||||
|
translate('ImportWizardForm', 'Version Name:'))
|
||||||
self.CopyrightLabel.setText(translate('ImportWizardForm', 'Copyright:'))
|
self.CopyrightLabel.setText(translate('ImportWizardForm', 'Copyright:'))
|
||||||
self.PermissionLabel.setText(translate('ImportWizardForm', 'Permission:'))
|
self.PermissionLabel.setText(
|
||||||
|
translate('ImportWizardForm', 'Permission:'))
|
||||||
self.ImportPage.setTitle(translate('ImportWizardForm', 'Importing'))
|
self.ImportPage.setTitle(translate('ImportWizardForm', 'Importing'))
|
||||||
self.ImportPage.setSubTitle(
|
self.ImportPage.setSubTitle(translate('ImportWizardForm',
|
||||||
translate('ImportWizardForm', 'Please wait while your Bible is imported.'))
|
'Please wait while your Bible is imported.'))
|
||||||
self.ImportProgressLabel.setText(translate('ImportWizardForm', 'Ready.'))
|
self.ImportProgressLabel.setText(
|
||||||
|
translate('ImportWizardForm', 'Ready.'))
|
||||||
self.ImportProgressBar.setFormat(u'%p%')
|
self.ImportProgressBar.setFormat(u'%p%')
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,7 +146,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||||
self.CsvVerseLocationEdit.setFocus()
|
self.CsvVerseLocationEdit.setFocus()
|
||||||
return False
|
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'':
|
if self.field(u'opensong_file').toString() == u'':
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
self.trUtf8('Invalid OpenSong Bible'),
|
self.trUtf8('Invalid OpenSong Bible'),
|
||||||
@ -159,7 +160,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
elif self.currentId() == 2:
|
elif self.currentId() == 2:
|
||||||
# License details
|
# License details
|
||||||
license_version = variant_to_unicode(self.field(u'license_version'))
|
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'':
|
if license_version == u'':
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
self.trUtf8('Empty Version Name'),
|
self.trUtf8('Empty Version Name'),
|
||||||
@ -317,7 +319,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
if not isinstance(name, unicode):
|
if not isinstance(name, unicode):
|
||||||
name = unicode(name, u'utf8')
|
name = unicode(name, u'utf8')
|
||||||
self.web_bible_list[WebDownload.Crosswalk][ver] = name.strip()
|
self.web_bible_list[WebDownload.Crosswalk][ver] = name.strip()
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Crosswalk resources missing')
|
log.exception(u'Crosswalk resources missing')
|
||||||
finally:
|
finally:
|
||||||
if books_file:
|
if books_file:
|
||||||
@ -336,8 +338,9 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
ver = unicode(ver, u'utf8')
|
ver = unicode(ver, u'utf8')
|
||||||
if not isinstance(name, unicode):
|
if not isinstance(name, unicode):
|
||||||
name = unicode(name, u'utf8')
|
name = unicode(name, u'utf8')
|
||||||
self.web_bible_list[WebDownload.BibleGateway][ver] = name.strip()
|
self.web_bible_list[WebDownload.BibleGateway][ver] = \
|
||||||
except:
|
name.strip()
|
||||||
|
except IOError:
|
||||||
log.exception(u'Biblegateway resources missing')
|
log.exception(u'Biblegateway resources missing')
|
||||||
finally:
|
finally:
|
||||||
if books_file:
|
if books_file:
|
||||||
@ -399,16 +402,19 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
if not isinstance(bible_version, unicode):
|
if not isinstance(bible_version, unicode):
|
||||||
bible_version = unicode(bible_version, u'utf8')
|
bible_version = unicode(bible_version, u'utf8')
|
||||||
if download_location == WebDownload.Crosswalk:
|
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:
|
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(
|
importer = self.manager.import_bible(
|
||||||
BibleFormat.WebDownload,
|
BibleFormat.WebDownload,
|
||||||
name=license_version,
|
name=license_version,
|
||||||
download_source=WebDownload.get_name(download_location),
|
download_source=WebDownload.get_name(download_location),
|
||||||
download_name=bible,
|
download_name=bible,
|
||||||
proxy_server=variant_to_unicode(self.field(u'proxy_server')),
|
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'))
|
proxy_password=variant_to_unicode(self.field(u'proxy_password'))
|
||||||
)
|
)
|
||||||
success = importer.do_import()
|
success = importer.do_import()
|
||||||
@ -428,4 +434,3 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
self.cancelButton.setVisible(False)
|
self.cancelButton.setVisible(False)
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +30,8 @@ import chardet
|
|||||||
import htmlentitydefs
|
import htmlentitydefs
|
||||||
|
|
||||||
only_verses = re.compile(r'([\w .]+)[ ]+([0-9]+)[ ]*[:|v|V][ ]*([0-9]+)'
|
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)
|
re.UNICODE)
|
||||||
chapter_range = re.compile(r'([\w .]+)[ ]+([0-9]+)[ ]*[:|v|V][ ]*'
|
chapter_range = re.compile(r'([\w .]+)[ ]+([0-9]+)[ ]*[:|v|V][ ]*'
|
||||||
r'([0-9]+|end)[ ]*-[ ]*([0-9]+)[ ]*[:|v|V][ ]*([0-9]+|end)',
|
r'([0-9]+|end)[ ]*-[ ]*([0-9]+)[ ]*[:|v|V][ ]*([0-9]+|end)',
|
||||||
|
@ -80,7 +80,7 @@ class CSVBible(BibleDB):
|
|||||||
self.create_book(unicode(line[1], details['encoding']),
|
self.create_book(unicode(line[1], details['encoding']),
|
||||||
line[2], int(line[0]))
|
line[2], int(line[0]))
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Loading books from file failed')
|
log.exception(u'Loading books from file failed')
|
||||||
success = False
|
success = False
|
||||||
finally:
|
finally:
|
||||||
@ -109,7 +109,7 @@ class CSVBible(BibleDB):
|
|||||||
unicode(line[3], details['encoding']))
|
unicode(line[3], details['encoding']))
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
self.commit()
|
self.commit()
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Loading verses from file failed')
|
log.exception(u'Loading verses from file failed')
|
||||||
success = False
|
success = False
|
||||||
finally:
|
finally:
|
||||||
|
@ -87,8 +87,8 @@ class BibleDB(QtCore.QObject):
|
|||||||
unicode(settings.value(u'db hostname').toString()),
|
unicode(settings.value(u'db hostname').toString()),
|
||||||
unicode(settings.value(u'db database').toString()))
|
unicode(settings.value(u'db database').toString()))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
self.metadata, self.session = init_models(db_url)
|
self.session = init_models(db_url)
|
||||||
self.metadata.create_all(checkfirst=True)
|
metadata.create_all(checkfirst=True)
|
||||||
if u'file' in kwargs:
|
if u'file' in kwargs:
|
||||||
self.get_name()
|
self.get_name()
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ class BibleDB(QtCore.QObject):
|
|||||||
try:
|
try:
|
||||||
os.remove(self.db_file)
|
os.remove(self.db_file)
|
||||||
return True
|
return True
|
||||||
except:
|
except OSError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def register(self, wizard):
|
def register(self, wizard):
|
||||||
@ -320,12 +320,14 @@ class BibleDB(QtCore.QObject):
|
|||||||
verses = self.session.query(Verse)
|
verses = self.session.query(Verse)
|
||||||
if text.find(u',') > -1:
|
if text.find(u',') > -1:
|
||||||
or_clause = []
|
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:
|
for keyword in keywords:
|
||||||
or_clause.append(Verse.text.like(keyword))
|
or_clause.append(Verse.text.like(keyword))
|
||||||
verses = verses.filter(or_(*or_clause))
|
verses = verses.filter(or_(*or_clause))
|
||||||
else:
|
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:
|
for keyword in keywords:
|
||||||
verses = verses.filter(Verse.text.like(keyword))
|
verses = verses.filter(Verse.text.like(keyword))
|
||||||
verses = verses.all()
|
verses = verses.all()
|
||||||
|
@ -33,8 +33,9 @@ from BeautifulSoup import BeautifulSoup, Tag, NavigableString
|
|||||||
|
|
||||||
from openlp.core.lib import Receiver
|
from openlp.core.lib import Receiver
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from common import BibleCommon, SearchResults, unescape
|
from openlp.plugins.bibles.lib.common import BibleCommon, SearchResults, \
|
||||||
from db import BibleDB
|
unescape
|
||||||
|
from openlp.plugins.bibles.lib.db import BibleDB
|
||||||
from openlp.plugins.bibles.lib.models import Book
|
from openlp.plugins.bibles.lib.models import Book
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -462,7 +463,8 @@ class HTTPBible(BibleDB):
|
|||||||
"""
|
"""
|
||||||
Return the list of books.
|
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):
|
def lookup_book(self, book):
|
||||||
"""
|
"""
|
||||||
|
@ -181,7 +181,7 @@ class BibleManager(object):
|
|||||||
Returns a list of the names of available Bibles.
|
Returns a list of the names of available Bibles.
|
||||||
"""
|
"""
|
||||||
log.debug(u'get_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):
|
def get_books(self, bible):
|
||||||
"""
|
"""
|
||||||
|
@ -460,10 +460,26 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
if bible2:
|
if bible2:
|
||||||
bible2_verses = []
|
bible2_verses = []
|
||||||
for scripture in self.lastReference:
|
for scripture in self.lastReference:
|
||||||
bible2_verses.extend(self.parent.manager.get_verses(bible2, scripture))
|
bible2_verses.extend(self.parent.manager.get_verses(bible2,
|
||||||
bible2_version = self.parent.manager.get_meta_data(bible2, u'Version')
|
scripture))
|
||||||
bible2_copyright = self.parent.manager.get_meta_data(bible2, u'Copyright')
|
bible2_version = self.parent.manager.get_meta_data(bible2,
|
||||||
bible2_permission = self.parent.manager.get_meta_data(bible2, u'Permission')
|
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:
|
||||||
|
bible2_version = u''
|
||||||
|
if bible2_copyright:
|
||||||
|
bible2_copyright = bible2_copyright.value
|
||||||
|
else:
|
||||||
|
bible2_copyright = u''
|
||||||
|
if bible2_permission:
|
||||||
|
bible2_permission = bible2_permission.value
|
||||||
|
else:
|
||||||
|
bible2_permission = u''
|
||||||
# Let's loop through the main lot, and assemble our verses
|
# Let's loop through the main lot, and assemble our verses
|
||||||
for item in items:
|
for item in items:
|
||||||
bitem = self.ListView.item(item.row())
|
bitem = self.ListView.item(item.row())
|
||||||
@ -479,25 +495,30 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
copyright = self._decodeQtObject(reference, 'copyright')
|
copyright = self._decodeQtObject(reference, 'copyright')
|
||||||
permission = self._decodeQtObject(reference, 'permission')
|
permission = self._decodeQtObject(reference, 'permission')
|
||||||
if self.parent.settings_tab.display_style == 1:
|
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:
|
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:
|
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:
|
else:
|
||||||
verse_text = self.formatVerse(old_chapter, chapter, verse, u'', u'')
|
verse_text = self.formatVerse(old_chapter, chapter, verse,
|
||||||
|
u'', u'')
|
||||||
old_chapter = chapter
|
old_chapter = chapter
|
||||||
footer = u'%s (%s %s)' % (book, version, copyright)
|
footer = u'%s (%s %s)' % (book, version, copyright)
|
||||||
#If not found add to footer
|
#If not found add to footer
|
||||||
if footer not in raw_footer:
|
if footer not in raw_footer:
|
||||||
raw_footer.append(footer)
|
raw_footer.append(footer)
|
||||||
if bible2:
|
if bible2:
|
||||||
footer = u'%s (%s %s)' % (book, version, copyright)
|
footer = u'%s (%s %s)' % (book, bible2_version,
|
||||||
#If not found add to footer
|
bible2_copyright)
|
||||||
|
#If not found add second version and copyright to footer
|
||||||
if footer not in raw_footer:
|
if footer not in raw_footer:
|
||||||
raw_footer.append(footer)
|
raw_footer.append(footer)
|
||||||
bible_text = u'%s %s \n\n %s %s' % \
|
bible_text = u'%s %s \n\n %s %s' % (verse_text, text,
|
||||||
(verse_text, text, verse_text, bible2_verses[item.row()].text)
|
verse_text, bible2_verses[item.row()].text)
|
||||||
raw_slides.append(bible_text)
|
raw_slides.append(bible_text)
|
||||||
bible_text = u''
|
bible_text = u''
|
||||||
else:
|
else:
|
||||||
@ -580,7 +601,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
def displayResults(self, bible):
|
def displayResults(self, bible):
|
||||||
version = self.parent.manager.get_meta_data(bible, u'Version')
|
version = self.parent.manager.get_meta_data(bible, u'Version')
|
||||||
copyright = self.parent.manager.get_meta_data(bible, u'Copyright')
|
copyright = self.parent.manager.get_meta_data(bible, u'Copyright')
|
||||||
permission = self.parent.manager.get_meta_data(bible, u'Permission')
|
permission = self.parent.manager.get_meta_data(bible, u'Permissions')
|
||||||
if not permission:
|
if not permission:
|
||||||
permission = u''
|
permission = u''
|
||||||
else:
|
else:
|
||||||
|
@ -27,20 +27,7 @@ from sqlalchemy import Column, Table, MetaData, ForeignKey, types, \
|
|||||||
create_engine
|
create_engine
|
||||||
from sqlalchemy.orm import mapper, relation, sessionmaker, scoped_session
|
from sqlalchemy.orm import mapper, relation, sessionmaker, scoped_session
|
||||||
|
|
||||||
class BaseModel(object):
|
from openlp.core.lib import BaseModel
|
||||||
"""
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
class BibleMeta(BaseModel):
|
class BibleMeta(BaseModel):
|
||||||
@ -73,10 +60,9 @@ class Verse(BaseModel):
|
|||||||
def init_models(db_url):
|
def init_models(db_url):
|
||||||
engine = create_engine(db_url)
|
engine = create_engine(db_url)
|
||||||
metadata.bind = engine
|
metadata.bind = engine
|
||||||
session = scoped_session(sessionmaker(autoflush=True,
|
session = scoped_session(sessionmaker(autoflush=True, autocommit=False,
|
||||||
autocommit=False,
|
|
||||||
bind=engine))
|
bind=engine))
|
||||||
return metadata, session
|
return session
|
||||||
|
|
||||||
metadata = MetaData()
|
metadata = MetaData()
|
||||||
meta_table = Table(u'metadata', metadata,
|
meta_table = Table(u'metadata', metadata,
|
||||||
|
@ -97,7 +97,7 @@ class OpenSongBible(BibleDB):
|
|||||||
QtCore.QString('%s %s %s' % (self.trUtf8('Importing'),\
|
QtCore.QString('%s %s %s' % (self.trUtf8('Importing'),\
|
||||||
db_book.name, chapter.attrib[u'n'])))
|
db_book.name, chapter.attrib[u'n'])))
|
||||||
self.commit()
|
self.commit()
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Loading bible from OpenSong file failed')
|
log.exception(u'Loading bible from OpenSong file failed')
|
||||||
success = False
|
success = False
|
||||||
finally:
|
finally:
|
||||||
|
@ -78,7 +78,7 @@ class OSISBible(BibleDB):
|
|||||||
book = line.split(u',')
|
book = line.split(u',')
|
||||||
self.books[book[0]] = (book[1].lstrip().rstrip(),
|
self.books[book[0]] = (book[1].lstrip().rstrip(),
|
||||||
book[2].lstrip().rstrip())
|
book[2].lstrip().rstrip())
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'OSIS bible import failed')
|
log.exception(u'OSIS bible import failed')
|
||||||
finally:
|
finally:
|
||||||
if fbibles:
|
if fbibles:
|
||||||
@ -104,7 +104,7 @@ class OSISBible(BibleDB):
|
|||||||
try:
|
try:
|
||||||
detect_file = open(self.filename, u'r')
|
detect_file = open(self.filename, u'r')
|
||||||
details = chardet.detect(detect_file.read())
|
details = chardet.detect(detect_file.read())
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Failed to detect OSIS file encoding')
|
log.exception(u'Failed to detect OSIS file encoding')
|
||||||
return
|
return
|
||||||
finally:
|
finally:
|
||||||
@ -173,7 +173,7 @@ class OSISBible(BibleDB):
|
|||||||
self.wizard.incrementProgressBar(u'Finishing import...')
|
self.wizard.incrementProgressBar(u'Finishing import...')
|
||||||
if match_count == 0:
|
if match_count == 0:
|
||||||
success = False
|
success = False
|
||||||
except:
|
except (ValueError, IOError):
|
||||||
log.exception(u'Loading bible from OSIS file failed')
|
log.exception(u'Loading bible from OSIS file failed')
|
||||||
success = False
|
success = False
|
||||||
finally:
|
finally:
|
||||||
@ -185,4 +185,3 @@ class OSISBible(BibleDB):
|
|||||||
else:
|
else:
|
||||||
return success
|
return success
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,21 +23,7 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
class BaseModel(object):
|
from openlp.core.lib import BaseModel
|
||||||
"""
|
|
||||||
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
|
|
||||||
|
|
||||||
class CustomSlide(BaseModel):
|
class CustomSlide(BaseModel):
|
||||||
"""
|
"""
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
from sqlalchemy.exceptions import InvalidRequestError
|
||||||
|
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.plugins.custom.lib.models import init_models, metadata, CustomSlide
|
from openlp.plugins.custom.lib.models import init_models, metadata, CustomSlide
|
||||||
@ -80,7 +81,7 @@ class CustomManager(object):
|
|||||||
self.session.commit()
|
self.session.commit()
|
||||||
log.debug(u'Custom Slide saved')
|
log.debug(u'Custom Slide saved')
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Custom Slide save failed')
|
log.exception(u'Custom Slide save failed')
|
||||||
return False
|
return False
|
||||||
@ -104,7 +105,7 @@ class CustomManager(object):
|
|||||||
self.session.delete(customslide)
|
self.session.delete(customslide)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Custom Slide deleton failed')
|
log.exception(u'Custom Slide deleton failed')
|
||||||
return False
|
return False
|
||||||
|
@ -117,7 +117,7 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
try:
|
try:
|
||||||
os.remove(
|
os.remove(
|
||||||
os.path.join(self.servicePath, unicode(text.text())))
|
os.path.join(self.servicePath, unicode(text.text())))
|
||||||
except:
|
except OSError:
|
||||||
#if not present do not worry
|
#if not present do not worry
|
||||||
pass
|
pass
|
||||||
self.ListView.takeItem(item.row())
|
self.ListView.takeItem(item.row())
|
||||||
@ -126,7 +126,7 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def loadList(self, list):
|
def loadList(self, list):
|
||||||
for file in 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)
|
thumb = os.path.join(self.servicePath, filename)
|
||||||
if os.path.exists(thumb):
|
if os.path.exists(thumb):
|
||||||
if self.validate(file, thumb):
|
if self.validate(file, thumb):
|
||||||
|
@ -143,7 +143,7 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def loadList(self, list):
|
def loadList(self, list):
|
||||||
for file in list:
|
for file in list:
|
||||||
(path, filename) = os.path.split(unicode(file))
|
filename = os.path.split(unicode(file))[1]
|
||||||
item_name = QtGui.QListWidgetItem(filename)
|
item_name = QtGui.QListWidgetItem(filename)
|
||||||
img = QtGui.QPixmap(u':/media/media_video.png').toImage()
|
img = QtGui.QPixmap(u':/media/media_video.png').toImage()
|
||||||
item_name.setIcon(build_icon(img))
|
item_name.setIcon(build_icon(img))
|
||||||
|
@ -176,14 +176,12 @@ class ImpressController(PresentationController):
|
|||||||
return doc
|
return doc
|
||||||
|
|
||||||
class ImpressDocument(PresentationDocument):
|
class ImpressDocument(PresentationDocument):
|
||||||
|
|
||||||
def __init__(self, controller, presentation):
|
def __init__(self, controller, presentation):
|
||||||
log.debug(u'Init Presentation OpenOffice')
|
log.debug(u'Init Presentation OpenOffice')
|
||||||
self.controller = controller
|
PresentationDocument.__init__(controller, presentation)
|
||||||
self.document = None
|
self.document = None
|
||||||
self.presentation = None
|
self.presentation = None
|
||||||
self.control = None
|
self.control = None
|
||||||
self.store_filename(presentation)
|
|
||||||
|
|
||||||
def load_presentation(self):
|
def load_presentation(self):
|
||||||
"""
|
"""
|
||||||
|
@ -131,7 +131,7 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
for file in list:
|
for file in list:
|
||||||
if currlist.count(file) > 0:
|
if currlist.count(file) > 0:
|
||||||
continue
|
continue
|
||||||
(path, filename) = os.path.split(unicode(file))
|
filename = os.path.split(unicode(file))[1]
|
||||||
if titles.count(filename) > 0:
|
if titles.count(filename) > 0:
|
||||||
QtGui.QMessageBox.critical(
|
QtGui.QMessageBox.critical(
|
||||||
self, self.trUtf8('File exists'), self.trUtf8(
|
self, self.trUtf8('File exists'), self.trUtf8(
|
||||||
|
@ -256,35 +256,35 @@ class MessageListener(object):
|
|||||||
self.previewHandler.slide(slide, isLive)
|
self.previewHandler.slide(slide, isLive)
|
||||||
|
|
||||||
def first(self, message):
|
def first(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive = self.decode_message(message)[0]
|
||||||
if isLive:
|
if isLive:
|
||||||
self.liveHandler.first()
|
self.liveHandler.first()
|
||||||
else:
|
else:
|
||||||
self.previewHandler.first()
|
self.previewHandler.first()
|
||||||
|
|
||||||
def last(self, message):
|
def last(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive = self.decode_message(message)[0]
|
||||||
if isLive:
|
if isLive:
|
||||||
self.liveHandler.last()
|
self.liveHandler.last()
|
||||||
else:
|
else:
|
||||||
self.previewHandler.last()
|
self.previewHandler.last()
|
||||||
|
|
||||||
def next(self, message):
|
def next(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive = self.decode_message(message)[0]
|
||||||
if isLive:
|
if isLive:
|
||||||
self.liveHandler.next()
|
self.liveHandler.next()
|
||||||
else:
|
else:
|
||||||
self.previewHandler.next()
|
self.previewHandler.next()
|
||||||
|
|
||||||
def previous(self, message):
|
def previous(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive = self.decode_message(message)[0]
|
||||||
if isLive:
|
if isLive:
|
||||||
self.liveHandler.previous()
|
self.liveHandler.previous()
|
||||||
else:
|
else:
|
||||||
self.previewHandler.previous()
|
self.previewHandler.previous()
|
||||||
|
|
||||||
def shutdown(self, message):
|
def shutdown(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive = self.decode_message(message)[0]
|
||||||
if isLive:
|
if isLive:
|
||||||
Receiver.send_message(u'maindisplay_show')
|
Receiver.send_message(u'maindisplay_show')
|
||||||
self.liveHandler.shutdown()
|
self.liveHandler.shutdown()
|
||||||
@ -292,17 +292,17 @@ class MessageListener(object):
|
|||||||
self.previewHandler.shutdown()
|
self.previewHandler.shutdown()
|
||||||
|
|
||||||
def hide(self, message):
|
def hide(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive = self.decode_message(message)[0]
|
||||||
if isLive:
|
if isLive:
|
||||||
self.liveHandler.stop()
|
self.liveHandler.stop()
|
||||||
|
|
||||||
def blank(self, message):
|
def blank(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive = self.decode_message(message)[0]
|
||||||
if isLive:
|
if isLive:
|
||||||
self.liveHandler.blank()
|
self.liveHandler.blank()
|
||||||
|
|
||||||
def unblank(self, message):
|
def unblank(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive = self.decode_message(message)[0]
|
||||||
if isLive:
|
if isLive:
|
||||||
self.liveHandler.unblank()
|
self.liveHandler.unblank()
|
||||||
|
|
||||||
|
@ -102,12 +102,10 @@ class PowerpointController(PresentationController):
|
|||||||
return doc
|
return doc
|
||||||
|
|
||||||
class PowerpointDocument(PresentationDocument):
|
class PowerpointDocument(PresentationDocument):
|
||||||
|
|
||||||
def __init__(self, controller, presentation):
|
def __init__(self, controller, presentation):
|
||||||
log.debug(u'Init Presentation Powerpoint')
|
log.debug(u'Init Presentation Powerpoint')
|
||||||
|
PresentationDocument.__init__(controller, presentation)
|
||||||
self.presentation = None
|
self.presentation = None
|
||||||
self.controller = controller
|
|
||||||
self.store_filename(presentation)
|
|
||||||
|
|
||||||
def load_presentation(self):
|
def load_presentation(self):
|
||||||
"""
|
"""
|
||||||
|
@ -102,11 +102,10 @@ class PptviewController(PresentationController):
|
|||||||
class PptviewDocument(PresentationDocument):
|
class PptviewDocument(PresentationDocument):
|
||||||
def __init__(self, controller, presentation):
|
def __init__(self, controller, presentation):
|
||||||
log.debug(u'Init Presentation PowerPoint')
|
log.debug(u'Init Presentation PowerPoint')
|
||||||
|
PresentationDocument.__init__(controller, presentation)
|
||||||
self.presentation = None
|
self.presentation = None
|
||||||
self.pptid = None
|
self.pptid = None
|
||||||
self.blanked = False
|
self.blanked = False
|
||||||
self.controller = controller
|
|
||||||
self.store_filename(presentation)
|
|
||||||
|
|
||||||
def load_presentation(self):
|
def load_presentation(self):
|
||||||
"""
|
"""
|
||||||
|
@ -100,16 +100,17 @@ class PresentationController(object):
|
|||||||
self.docs = []
|
self.docs = []
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.name = name
|
self.name = name
|
||||||
self.settingsSection = self.plugin.settingsSection
|
self.settings_section = self.plugin.settingsSection
|
||||||
self.available = self.check_available()
|
self.available = self.check_available()
|
||||||
if self.available:
|
if self.available:
|
||||||
self.enabled = QtCore.QSettings().value(
|
self.enabled = QtCore.QSettings().value(
|
||||||
self.settingsSection + u'/' + name,
|
self.settings_section + u'/' + name,
|
||||||
QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] == QtCore.Qt.Checked
|
QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] == \
|
||||||
|
QtCore.Qt.Checked
|
||||||
else:
|
else:
|
||||||
self.enabled = False
|
self.enabled = False
|
||||||
self.thumbnailroot = os.path.join(
|
self.thumbnailroot = os.path.join(
|
||||||
AppLocation.get_section_data_path(self.settingsSection),
|
AppLocation.get_section_data_path(self.settings_section),
|
||||||
name, u'thumbnails')
|
name, u'thumbnails')
|
||||||
self.thumbnailprefix = u'slide'
|
self.thumbnailprefix = u'slide'
|
||||||
if not os.path.isdir(self.thumbnailroot):
|
if not os.path.isdir(self.thumbnailroot):
|
||||||
@ -123,7 +124,8 @@ class PresentationController(object):
|
|||||||
|
|
||||||
def start_process(self):
|
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
|
pass
|
||||||
|
|
||||||
@ -231,7 +233,10 @@ class PresentationDocument(object):
|
|||||||
Cleans up/deletes any controller specific files created for
|
Cleans up/deletes any controller specific files created for
|
||||||
a file, e.g. thumbnails
|
a file, e.g. thumbnails
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
shutil.rmtree(self.thumbnailpath)
|
shutil.rmtree(self.thumbnailpath)
|
||||||
|
except OSError:
|
||||||
|
log.exception(u'Failed to delete presentation controller files')
|
||||||
|
|
||||||
def store_filename(self, presentation):
|
def store_filename(self, presentation):
|
||||||
"""
|
"""
|
||||||
@ -388,3 +393,4 @@ class PresentationDocument(object):
|
|||||||
The slide the notes are required for, starting at 1
|
The slide the notes are required for, starting at 1
|
||||||
"""
|
"""
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ class HttpConnection(object):
|
|||||||
path = os.path.normpath(os.path.join(self.parent.html_dir, filename))
|
path = os.path.normpath(os.path.join(self.parent.html_dir, filename))
|
||||||
if not path.startswith(self.parent.html_dir):
|
if not path.startswith(self.parent.html_dir):
|
||||||
return None
|
return None
|
||||||
(fileroot, ext) = os.path.splitext(filename)
|
ext = os.path.splitext(filename)[1]
|
||||||
if ext == u'.html':
|
if ext == u'.html':
|
||||||
mimetype = u'text/html'
|
mimetype = u'text/html'
|
||||||
elif ext == u'.css':
|
elif ext == u'.css':
|
||||||
|
@ -74,7 +74,9 @@ class Ui_AuthorsDialog(object):
|
|||||||
QtCore.QMetaObject.connectSlotsByName(AuthorsDialog)
|
QtCore.QMetaObject.connectSlotsByName(AuthorsDialog)
|
||||||
|
|
||||||
def retranslateUi(self, AuthorsDialog):
|
def retranslateUi(self, AuthorsDialog):
|
||||||
AuthorsDialog.setWindowTitle(translate('AuthorsForm', 'Author Maintenance'))
|
AuthorsDialog.setWindowTitle(
|
||||||
|
translate('AuthorsForm', 'Author Maintenance'))
|
||||||
self.DisplayLabel.setText(translate('AuthorsForm', 'Display name:'))
|
self.DisplayLabel.setText(translate('AuthorsForm', 'Display name:'))
|
||||||
self.FirstNameLabel.setText(translate('AuthorsForm', 'First name:'))
|
self.FirstNameLabel.setText(translate('AuthorsForm', 'First name:'))
|
||||||
self.LastNameLabel.setText(translate('AuthorsForm', 'Last name:'))
|
self.LastNameLabel.setText(translate('AuthorsForm', 'Last name:'))
|
||||||
|
|
||||||
|
@ -37,11 +37,13 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
|||||||
"""
|
"""
|
||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.autoDisplayName = False
|
self._autoDisplayName = False
|
||||||
QtCore.QObject.connect(self.FirstNameEdit,
|
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.QObject.connect(self.LastNameEdit,
|
||||||
QtCore.SIGNAL(u'textEdited(QString)'), self.onLastNameEditTextEdited)
|
QtCore.SIGNAL(u'textEdited(QString)'),
|
||||||
|
self.onLastNameEditTextEdited)
|
||||||
|
|
||||||
def exec_(self, clear=True):
|
def exec_(self, clear=True):
|
||||||
if clear:
|
if clear:
|
||||||
@ -52,7 +54,7 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
|||||||
return QtGui.QDialog.exec_(self)
|
return QtGui.QDialog.exec_(self)
|
||||||
|
|
||||||
def onFirstNameEditTextEdited(self, text):
|
def onFirstNameEditTextEdited(self, text):
|
||||||
if not self.autoDisplayName:
|
if not self._autoDisplayName:
|
||||||
return
|
return
|
||||||
display_name = text
|
display_name = text
|
||||||
if self.LastNameEdit.text() != u'':
|
if self.LastNameEdit.text() != u'':
|
||||||
@ -60,7 +62,7 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
|||||||
self.DisplayEdit.setText(display_name)
|
self.DisplayEdit.setText(display_name)
|
||||||
|
|
||||||
def onLastNameEditTextEdited(self, text):
|
def onLastNameEditTextEdited(self, text):
|
||||||
if not self.autoDisplayName:
|
if not self._autoDisplayName:
|
||||||
return
|
return
|
||||||
display_name = text
|
display_name = text
|
||||||
if self.FirstNameEdit.text() != u'':
|
if self.FirstNameEdit.text() != u'':
|
||||||
@ -68,24 +70,20 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
|||||||
self.DisplayEdit.setText(display_name)
|
self.DisplayEdit.setText(display_name)
|
||||||
|
|
||||||
def autoDisplayName(self):
|
def autoDisplayName(self):
|
||||||
return self.autoDisplayName
|
return self._autoDisplayName
|
||||||
|
|
||||||
def setAutoDisplayName(self, on):
|
def setAutoDisplayName(self, on):
|
||||||
self.autoDisplayName = on
|
self._autoDisplayName = on
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
if not self.FirstNameEdit.text():
|
if not self.FirstNameEdit.text():
|
||||||
QtGui.QMessageBox.critical(
|
QtGui.QMessageBox.critical(self, self.trUtf8('Error'), self.trUtf8(
|
||||||
self, self.trUtf8('Error'),
|
'You need to type in the first name of the author.'))
|
||||||
self.trUtf8('You need to type in the first name of the author.'),
|
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
|
||||||
self.FirstNameEdit.setFocus()
|
self.FirstNameEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif not self.LastNameEdit.text():
|
elif not self.LastNameEdit.text():
|
||||||
QtGui.QMessageBox.critical(
|
QtGui.QMessageBox.critical(self, self.trUtf8('Error'),
|
||||||
self, self.trUtf8('Error'),
|
self.trUtf8('You need to type in the last name of the author.'))
|
||||||
self.trUtf8('You need to type in the last name of the author.'),
|
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
|
||||||
self.LastNameEdit.setFocus()
|
self.LastNameEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif not self.DisplayEdit.text():
|
elif not self.DisplayEdit.text():
|
||||||
@ -105,3 +103,4 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
|||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return QtGui.QDialog.accept(self)
|
return QtGui.QDialog.accept(self)
|
||||||
|
|
||||||
|
@ -569,7 +569,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
verseId = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
verseId = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
||||||
bits = verseId.split(u':')
|
bits = verseId.split(u':')
|
||||||
sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text()))
|
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'')
|
text = text.replace(u',', u'')
|
||||||
text = text.replace(u';', u'')
|
text = text.replace(u';', u'')
|
||||||
|
@ -23,21 +23,7 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
class BaseModel(object):
|
from openlp.core.lib import BaseModel
|
||||||
"""
|
|
||||||
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
|
|
||||||
|
|
||||||
class Author(BaseModel):
|
class Author(BaseModel):
|
||||||
"""
|
"""
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
from sqlalchemy.exceptions import InvalidRequestError
|
||||||
|
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.plugins.songs.lib.models import init_models, metadata, Song, \
|
from openlp.plugins.songs.lib.models import init_models, metadata, Song, \
|
||||||
@ -161,7 +162,7 @@ class SongManager(object):
|
|||||||
self.session.add(song)
|
self.session.add(song)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
log.exception(u'Could not save song to song database')
|
log.exception(u'Could not save song to song database')
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
return False
|
return False
|
||||||
@ -172,7 +173,7 @@ class SongManager(object):
|
|||||||
self.session.delete(song)
|
self.session.delete(song)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Could not delete song from song database')
|
log.exception(u'Could not delete song from song database')
|
||||||
return False
|
return False
|
||||||
@ -203,7 +204,7 @@ class SongManager(object):
|
|||||||
self.session.add(author)
|
self.session.add(author)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Could not save author to song database')
|
log.exception(u'Could not save author to song database')
|
||||||
return False
|
return False
|
||||||
@ -217,7 +218,7 @@ class SongManager(object):
|
|||||||
self.session.delete(author)
|
self.session.delete(author)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Could not delete author from song database')
|
log.exception(u'Could not delete author from song database')
|
||||||
return False
|
return False
|
||||||
@ -248,7 +249,7 @@ class SongManager(object):
|
|||||||
self.session.add(topic)
|
self.session.add(topic)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Could not save topic to song database')
|
log.exception(u'Could not save topic to song database')
|
||||||
return False
|
return False
|
||||||
@ -262,7 +263,7 @@ class SongManager(object):
|
|||||||
self.session.delete(topic)
|
self.session.delete(topic)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Could not delete topic from song database')
|
log.exception(u'Could not delete topic from song database')
|
||||||
return False
|
return False
|
||||||
@ -293,7 +294,7 @@ class SongManager(object):
|
|||||||
self.session.add(book)
|
self.session.add(book)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Could not save book to song database')
|
log.exception(u'Could not save book to song database')
|
||||||
return False
|
return False
|
||||||
@ -307,10 +308,11 @@ class SongManager(object):
|
|||||||
self.session.delete(book)
|
self.session.delete(book)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Could not delete book from song database')
|
log.exception(u'Could not delete book from song database')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_songs_for_theme(self, theme):
|
def get_songs_for_theme(self, theme):
|
||||||
return self.session.query(Song).filter(Song.theme_name == theme).all()
|
return self.session.query(Song).filter(Song.theme_name == theme).all()
|
||||||
|
|
||||||
|
@ -33,8 +33,8 @@ from openlp.plugins.songs.lib.classes import *
|
|||||||
def init_models(url):
|
def init_models(url):
|
||||||
engine = create_engine(url)
|
engine = create_engine(url)
|
||||||
metadata.bind = engine
|
metadata.bind = engine
|
||||||
session = scoped_session(sessionmaker(autoflush=False,
|
session = scoped_session(sessionmaker(autoflush=False, autocommit=False,
|
||||||
autocommit=False, bind=engine))
|
bind=engine))
|
||||||
mapper(Author, authors_table)
|
mapper(Author, authors_table)
|
||||||
mapper(Book, song_books_table)
|
mapper(Book, song_books_table)
|
||||||
mapper(Song, songs_table,
|
mapper(Song, songs_table,
|
||||||
@ -45,3 +45,4 @@ def init_models(url):
|
|||||||
secondary=songs_topics_table)})
|
secondary=songs_topics_table)})
|
||||||
mapper(Topic, topics_table)
|
mapper(Topic, topics_table)
|
||||||
return session
|
return session
|
||||||
|
|
||||||
|
@ -24,7 +24,9 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
from songimport import SongImport
|
from songimport import SongImport
|
||||||
|
|
||||||
if os.name == u'nt':
|
if os.name == u'nt':
|
||||||
@ -35,9 +37,11 @@ if os.name == u'nt':
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
import uno
|
import uno
|
||||||
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH
|
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \
|
||||||
except:
|
PAGE_BOTH
|
||||||
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class OooImport(object):
|
class OooImport(object):
|
||||||
"""
|
"""
|
||||||
Import songs from Impress/Powerpoint docs using Impress
|
Import songs from Impress/Powerpoint docs using Impress
|
||||||
@ -75,7 +79,8 @@ class OooImport(object):
|
|||||||
"""
|
"""
|
||||||
if os.name == u'nt':
|
if os.name == u'nt':
|
||||||
self.start_ooo_process()
|
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:
|
else:
|
||||||
context = uno.getComponentContext()
|
context = uno.getComponentContext()
|
||||||
resolver = context.ServiceManager.createInstanceWithContext(
|
resolver = context.ServiceManager.createInstanceWithContext(
|
||||||
@ -101,8 +106,8 @@ class OooImport(object):
|
|||||||
self.manager._FlagAsMethod(u'Bridge_GetStruct')
|
self.manager._FlagAsMethod(u'Bridge_GetStruct')
|
||||||
self.manager._FlagAsMethod(u'Bridge_GetValueObject')
|
self.manager._FlagAsMethod(u'Bridge_GetValueObject')
|
||||||
else:
|
else:
|
||||||
cmd = u'openoffice.org -nologo -norestore -minimized -invisible ' \
|
cmd = u'openoffice.org -nologo -norestore -minimized ' \
|
||||||
+ u'-nofirststartwizard ' \
|
+ u'-invisible -nofirststartwizard ' \
|
||||||
+ '-accept="socket,host=localhost,port=2002;urp;"'
|
+ '-accept="socket,host=localhost,port=2002;urp;"'
|
||||||
process = QtCore.QProcess()
|
process = QtCore.QProcess()
|
||||||
process.startDetached(cmd)
|
process.startDetached(cmd)
|
||||||
|
@ -60,7 +60,7 @@ class SongFeatureError(SongException):
|
|||||||
# TODO: Song: Import ChangingSong
|
# TODO: Song: Import ChangingSong
|
||||||
# TODO: Song: Export ChangingSong
|
# TODO: Song: Export ChangingSong
|
||||||
|
|
||||||
_blankOpenSongXml = \
|
_BLANK_OPENSONG_XML = \
|
||||||
'''<?xml version="1.0" encoding="UTF-8"?>
|
'''<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<song>
|
<song>
|
||||||
<title></title>
|
<title></title>
|
||||||
@ -84,7 +84,7 @@ class _OpenSong(XmlRootClass):
|
|||||||
|
|
||||||
def _reset(self):
|
def _reset(self):
|
||||||
"""Reset all song attributes"""
|
"""Reset all song attributes"""
|
||||||
self._setFromXml(_blankOpenSongXml, 'song')
|
self._setFromXml(_BLANK_OPENSONG_XML, 'song')
|
||||||
|
|
||||||
def from_buffer(self, xmlContent):
|
def from_buffer(self, xmlContent):
|
||||||
"""Initialize from buffer(string) with xml content"""
|
"""Initialize from buffer(string) with xml content"""
|
||||||
@ -288,7 +288,7 @@ class Song(object):
|
|||||||
osfile.close()
|
osfile.close()
|
||||||
xml = "".join(list)
|
xml = "".join(list)
|
||||||
self.from_opensong_buffer(xml)
|
self.from_opensong_buffer(xml)
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Failed to load opensong xml file')
|
log.exception(u'Failed to load opensong xml file')
|
||||||
finally:
|
finally:
|
||||||
if osfile:
|
if osfile:
|
||||||
@ -394,7 +394,7 @@ class Song(object):
|
|||||||
ccli_file = open(textFileName, 'r')
|
ccli_file = open(textFileName, 'r')
|
||||||
lines = [orgline.rstrip() for orgline in ccli_file]
|
lines = [orgline.rstrip() for orgline in ccli_file]
|
||||||
self.from_ccli_text_buffer(lines)
|
self.from_ccli_text_buffer(lines)
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Failed to load CCLI text file')
|
log.exception(u'Failed to load CCLI text file')
|
||||||
finally:
|
finally:
|
||||||
if ccli_file:
|
if ccli_file:
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from lxml import objectify
|
from lxml import objectify
|
||||||
|
from lxml.etree import XMLSyntaxError
|
||||||
|
|
||||||
class LyricsXML(object):
|
class LyricsXML(object):
|
||||||
"""
|
"""
|
||||||
@ -73,7 +74,7 @@ class LyricsXML(object):
|
|||||||
})
|
})
|
||||||
self.lyrics.append(language)
|
self.lyrics.append(language)
|
||||||
return True
|
return True
|
||||||
except:
|
except XMLSyntaxError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def extract(self, text):
|
def extract(self, text):
|
||||||
|
@ -85,7 +85,7 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
|
|||||||
(instance.usagedate,instance.usagetime, instance.title,
|
(instance.usagedate,instance.usagetime, instance.title,
|
||||||
instance.copyright, instance.ccl_number , instance.authors)
|
instance.copyright, instance.ccl_number , instance.authors)
|
||||||
file.write(record)
|
file.write(record)
|
||||||
except:
|
except IOError:
|
||||||
log.exception(u'Failed to write out song usage records')
|
log.exception(u'Failed to write out song usage records')
|
||||||
finally:
|
finally:
|
||||||
if file:
|
if file:
|
||||||
|
@ -23,21 +23,7 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
class BaseModel(object):
|
from openlp.core.lib import BaseModel
|
||||||
"""
|
|
||||||
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
|
|
||||||
|
|
||||||
class SongUsageItem(BaseModel):
|
class SongUsageItem(BaseModel):
|
||||||
"""
|
"""
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
from sqlalchemy.exceptions import InvalidRequestError
|
||||||
|
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.plugins.songusage.lib.models import init_models, metadata, \
|
from openlp.plugins.songusage.lib.models import init_models, metadata, \
|
||||||
@ -87,7 +88,7 @@ class SongUsageManager(object):
|
|||||||
self.session.add(songusageitem)
|
self.session.add(songusageitem)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'SongUsage item failed to save')
|
log.exception(u'SongUsage item failed to save')
|
||||||
return False
|
return False
|
||||||
@ -111,7 +112,7 @@ class SongUsageManager(object):
|
|||||||
self.session.delete(songusageitem)
|
self.session.delete(songusageitem)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'SongUsage Item failed to delete')
|
log.exception(u'SongUsage Item failed to delete')
|
||||||
return False
|
return False
|
||||||
@ -126,7 +127,7 @@ class SongUsageManager(object):
|
|||||||
self.session.query(SongUsageItem).delete(synchronize_session=False)
|
self.session.query(SongUsageItem).delete(synchronize_session=False)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Failed to delete all Song Usage items')
|
log.exception(u'Failed to delete all Song Usage items')
|
||||||
return False
|
return False
|
||||||
@ -141,7 +142,8 @@ class SongUsageManager(object):
|
|||||||
.delete(synchronize_session=False)
|
.delete(synchronize_session=False)
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
return True
|
return True
|
||||||
except:
|
except InvalidRequestError:
|
||||||
self.session.rollback()
|
self.session.rollback()
|
||||||
log.exception(u'Failed to delete all Song Usage items to %s' % date)
|
log.exception(u'Failed to delete all Song Usage items to %s' % date)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
3098
resources/i18n/openlp_et.ts
Normal file
3098
resources/i18n/openlp_et.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
|||||||
hiddenimports = ['lxml.etree']
|
|
@ -28,11 +28,48 @@ Windows Build Script
|
|||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
This script is used to build the Windows binary and the accompanying installer.
|
This script is used to build the Windows binary and the accompanying installer.
|
||||||
|
For this script to work out of the box, it depends on a number of things:
|
||||||
|
|
||||||
|
Inno Setup 5
|
||||||
|
Inno Setup should be installed into "C:\%PROGRAMFILES%\Inno Setup 5"
|
||||||
|
|
||||||
|
UPX
|
||||||
|
This is used to compress DLLs and EXEs so that they take up less space, but
|
||||||
|
still function exactly the same. To install UPS, download it from
|
||||||
|
http://upx.sourceforge.net/, extract it into C:\%PROGRAMFILES%\UPX, and then
|
||||||
|
add that directory to your PATH environment variable.
|
||||||
|
|
||||||
|
PyInstaller
|
||||||
|
PyInstaller should be a checkout of trunk, and in a directory called,
|
||||||
|
"pyinstaller" on the same level as OpenLP's Bazaar shared repository
|
||||||
|
directory.
|
||||||
|
|
||||||
|
To install PyInstaller, first checkout trunk from Subversion. The easiest
|
||||||
|
way is to install TortoiseSVN and then checkout the following URL to a
|
||||||
|
directory called "pyinstaller"::
|
||||||
|
|
||||||
|
http://svn.pyinstaller.org/trunk
|
||||||
|
|
||||||
|
Then you need to copy the two hook-*.py files from the "pyinstaller"
|
||||||
|
subdirectory in OpenLP's "resources" directory into PyInstaller's "hooks"
|
||||||
|
directory.
|
||||||
|
|
||||||
|
Once you've done that, open a command prompt (DOS shell), navigate to the
|
||||||
|
PyInstaller directory and run::
|
||||||
|
|
||||||
|
C:\Projects\pyinstaller>python Configure.py
|
||||||
|
|
||||||
|
Bazaar
|
||||||
|
You need the command line "bzr" client installed.
|
||||||
|
|
||||||
|
OpenLP
|
||||||
|
A checkout of the latest code, in a branch directory, which is in a Bazaar
|
||||||
|
shared repository directory. This means your code should be in a directory
|
||||||
|
structure like this: "openlp\branch-name".
|
||||||
|
|
||||||
|
windows-builder.py
|
||||||
|
This script, of course. It should be in the "scripts" directory of OpenLP.
|
||||||
|
|
||||||
For this script to work out of the box, it depends on being inside the
|
|
||||||
"resources/pyinstaller" directory in the OpenLP source tree, it depends on
|
|
||||||
OpenLP having it's own project directory which all the branches live in, and it
|
|
||||||
depends on PyInstaller being
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@ -40,12 +77,12 @@ from shutil import copy
|
|||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
script_path = os.path.split(os.path.abspath(__file__))[0]
|
script_path = os.path.split(os.path.abspath(__file__))[0]
|
||||||
pyinstaller_path = os.path.abspath(os.path.join(script_path, u'..', u'..', u'..', u'..', u'pyinstaller'))
|
branch_path = os.path.abspath(os.path.join(script_path, u'..'))
|
||||||
innosetup_path = os.path.join(os.getenv(u'PROGRAMFILES'), 'Inno Setup 5')
|
|
||||||
iss_path = os.path.abspath(os.path.join(script_path, u'..', u'innosetup'))
|
|
||||||
branch_path = os.path.abspath(os.path.join(script_path, u'..', u'..'))
|
|
||||||
source_path = os.path.join(branch_path, u'openlp')
|
source_path = os.path.join(branch_path, u'openlp')
|
||||||
dist_path = os.path.join(branch_path, u'dist', u'OpenLP')
|
dist_path = os.path.join(branch_path, u'dist', u'OpenLP')
|
||||||
|
pyinstaller_path = os.path.abspath(os.path.join(branch_path, u'..', u'..', u'pyinstaller'))
|
||||||
|
innosetup_path = os.path.join(os.getenv(u'PROGRAMFILES'), 'Inno Setup 5')
|
||||||
|
iss_path = os.path.join(branch_path, u'resources', u'innosetup')
|
||||||
|
|
||||||
|
|
||||||
def run_pyinstaller():
|
def run_pyinstaller():
|
||||||
@ -113,12 +150,12 @@ def run_innosetup():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
print "Script path:", script_path
|
print "Script path:", script_path
|
||||||
print "PyInstaller path:", pyinstaller_path
|
|
||||||
print "Inno Setup path:", innosetup_path
|
|
||||||
print "ISS file path:", iss_path
|
|
||||||
print "Branch path:", branch_path
|
print "Branch path:", branch_path
|
||||||
print "Source path:", source_path
|
print "Source path:", source_path
|
||||||
print "\"dist\" path:", dist_path
|
print "\"dist\" path:", dist_path
|
||||||
|
print "PyInstaller path:", pyinstaller_path
|
||||||
|
print "Inno Setup path:", innosetup_path
|
||||||
|
print "ISS file path:", iss_path
|
||||||
run_pyinstaller()
|
run_pyinstaller()
|
||||||
write_version_file()
|
write_version_file()
|
||||||
copy_plugins()
|
copy_plugins()
|
Loading…
Reference in New Issue
Block a user