This commit is contained in:
Andreas Preikschat 2011-02-25 18:32:17 +01:00
commit edff234857
204 changed files with 3534 additions and 2616 deletions

14
LICENSE
View File

@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it

21
README.txt Normal file
View File

@ -0,0 +1,21 @@
OpenLP 2.0
==========
You're probably reading this because you've just downloaded the source code for
OpenLP 2.0. If you are looking for the installer file, please go to the download
page on the web site::
http://openlp.org/en/download.html
If you're looking for how to contribute to OpenLP, then please look at the
contribution page on the web site::
http://openlp.org/en/documentation/introduction/contributing.html
If you've looked at that page, and are wanting to help develop, test or
translate OpenLP, have a look at the OpenLP wiki::
http://wiki.openlp.org/
Thanks for downloading OpenLP 2.0!

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -13,7 +13,7 @@ Object Library
:members:
:mod:`ListWidgetWithDnD`
----------------------
------------------------
.. autoclass:: openlp.core.lib.listwidgetwithdnd.ListWidgetWithDnD
:members:

View File

@ -54,9 +54,6 @@ Helper Classes & Functions
.. automodule:: openlp.plugins.songs.lib.mediaitem
:members:
.. autoclass:: openlp.plugins.songs.lib.mediaitem.SongListView
:members:
.. automodule:: openlp.plugins.songs.lib.songimport
:members:

View File

@ -7,9 +7,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -188,7 +188,8 @@ class OpenLP(QtGui.QApplication):
u'primary': (self.desktop().primaryScreen() == screen)})
log.info(u'Screen %d found with resolution %s', screen, size)
# start the main app window
self.mainWindow = MainWindow(screens, app_version)
self.appClipboard = self.clipboard()
self.mainWindow = MainWindow(screens, app_version, self.appClipboard)
self.mainWindow.show()
if show_splash:
# now kill the splashscreen

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -25,4 +25,4 @@
###############################################################################
"""
The :mod:`openlp` module contains all the project produced OpenLP functionality
"""
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -28,4 +28,4 @@ The :mod:`core` module provides all core application functions
All the core functions of the OpenLP application including the GUI, settings,
logging and a plugin framework are contained within the openlp.core module.
"""
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -321,8 +321,6 @@ def check_directory_exists(dir):
os.makedirs(dir)
from listwidgetwithdnd import ListWidgetWithDnD
from theme import ThemeLevel, ThemeXML, BackgroundGradientType, \
BackgroundType, HorizontalType, VerticalType
from displaytags import DisplayTags
from spelltextedit import SpellTextEdit
from eventreceiver import Receiver

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -28,8 +28,8 @@ import logging
from PyQt4 import QtWebKit
from openlp.core.lib import BackgroundType, BackgroundGradientType, \
VerticalType
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, \
VerticalType, HorizontalType
log = logging.getLogger(__name__)
@ -531,13 +531,8 @@ def build_lyrics_format_css(theme, width, height):
Height of the lyrics block
"""
if theme.display_horizontal_align == 2:
align = u'center'
elif theme.display_horizontal_align == 1:
align = u'right'
else:
align = u'left'
valign = VerticalType.to_string(theme.display_vertical_align)
align = HorizontalType.Names[theme.display_horizontal_align]
valign = VerticalType.Names[theme.display_vertical_align]
if theme.font_main_outline:
left_margin = int(theme.font_main_outline_size) * 2
else:
@ -630,7 +625,7 @@ def build_alert_css(alertTab, width):
"""
if not alertTab:
return u''
align = VerticalType.to_string(alertTab.location)
align = VerticalType.Names[alertTab.location]
alert = style % (width, align, alertTab.font_face, alertTab.font_size,
alertTab.font_color, alertTab.bg_color)
return alert

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -69,6 +69,7 @@ class ImageManager(QtCore.QObject):
log.info(u'Image Manager loaded')
def __init__(self):
QtCore.QObject.__init__(self)
self._cache = {}
self._thread_running = False
self._cache_dirty = False

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -34,6 +34,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import context_menu_action, context_menu_separator, \
SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \
translate, Receiver, ListWidgetWithDnD
from openlp.core.lib.ui import UiStrings
log = logging.getLogger(__name__)
@ -65,10 +66,11 @@ class MediaManagerItem(QtGui.QWidget):
When creating a descendant class from this class for your plugin,
the following member variables should be set.
``self.OnNewPrompt``
``self.onNewPrompt``
Defaults to *'Select Image(s)'*.
``self.OnNewFileMasks``
``self.onNewFileMasks``
Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This
assumes that the new action is to load a file. If not, you
need to override the ``OnNew`` method.
@ -240,7 +242,7 @@ class MediaManagerItem(QtGui.QWidget):
Creates the main widget for listing items the media item is tracking
"""
# Add the List widget
self.listView = ListWidgetWithDnD(self, self.title)
self.listView = ListWidgetWithDnD(self, self.plugin.name)
self.listView.uniformItemSizes = True
self.listView.setSpacing(1)
self.listView.setSelectionMode(
@ -316,9 +318,9 @@ class MediaManagerItem(QtGui.QWidget):
Add a file to the list widget to make it available for showing
"""
files = QtGui.QFileDialog.getOpenFileNames(
self, self.OnNewPrompt,
self, self.onNewPrompt,
SettingsManager.get_last_dir(self.settingsSection),
self.OnNewFileMasks)
self.onNewFileMasks)
log.info(u'New files(s) %s', unicode(files))
if files:
Receiver.send_message(u'cursor_busy')
@ -415,8 +417,7 @@ class MediaManagerItem(QtGui.QWidget):
item to the preview slide controller.
"""
if not self.listView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self,
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
QtGui.QMessageBox.information(self, UiStrings.NISp,
translate('OpenLP.MediaManagerItem',
'You must select one or more items to preview.'))
else:
@ -432,8 +433,7 @@ class MediaManagerItem(QtGui.QWidget):
item to the live slide controller.
"""
if not self.listView.selectedIndexes():
QtGui.QMessageBox.information(self,
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
QtGui.QMessageBox.information(self, UiStrings.NISp,
translate('OpenLP.MediaManagerItem',
'You must select one or more items to send live.'))
else:
@ -448,8 +448,7 @@ class MediaManagerItem(QtGui.QWidget):
Add a selected item to the current service
"""
if not self.listView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self,
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
QtGui.QMessageBox.information(self, UiStrings.NISp,
translate('OpenLP.MediaManagerItem',
'You must select one or more items.'))
else:
@ -475,17 +474,14 @@ class MediaManagerItem(QtGui.QWidget):
Add a selected item to an existing item in the current service.
"""
if not self.listView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self,
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
QtGui.QMessageBox.information(self, UiStrings.NISp,
translate('OpenLP.MediaManagerItem',
'You must select one or more items'))
'You must select one or more items.'))
else:
log.debug(u'%s Add requested', self.plugin.name)
serviceItem = self.parent.serviceManager.getServiceItem()
if not serviceItem:
QtGui.QMessageBox.information(self,
translate('OpenLP.MediaManagerItem',
'No Service Item Selected'),
QtGui.QMessageBox.information(self, UiStrings.NISs,
translate('OpenLP.MediaManagerItem',
'You must select an existing service item to add to.'))
elif self.plugin.name.lower() == serviceItem.name.lower():

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -144,6 +144,7 @@ class Plugin(QtCore.QObject):
self.name = name
self.textStrings = {}
self.setPluginTextStrings()
self.nameStrings = self.textStrings[StringContent.Name]
if version:
self.version = version
self.settingsSection = self.name.lower()

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -221,4 +221,4 @@ class PluginManager(object):
for plugin in self.plugins:
if plugin.isActive():
plugin.finalise()
log.info(u'Finalisation Complete for %s ' % plugin.name)
log.info(u'Finalisation Complete for %s ' % plugin.name)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -144,4 +144,4 @@ class Renderer(object):
html_text = html_text[:len(html_text)-4]
formatted.append(html_text)
log.debug(u'format_slide - End')
return formatted
return formatted

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -28,7 +28,8 @@ import logging
from PyQt4 import QtCore
from openlp.core.lib import Renderer, ThemeLevel, ServiceItem, ImageManager
from openlp.core.lib import Renderer, ServiceItem, ImageManager
from openlp.core.lib.theme import ThemeLevel
from openlp.core.ui import MainDisplay
log = logging.getLogger(__name__)
@ -173,14 +174,13 @@ class RenderManager(object):
main_rect = None
footer_rect = None
if not theme.font_main_override:
main_rect = QtCore.QRect(10, 0,
self.width - 20, self.footer_start)
main_rect = QtCore.QRect(10, 0, self.width - 20, self.footer_start)
else:
main_rect = QtCore.QRect(theme.font_main_x, theme.font_main_y,
theme.font_main_width - 1, theme.font_main_height - 1)
if not theme.font_footer_override:
footer_rect = QtCore.QRect(10, self.footer_start,
self.width - 20, self.height - self.footer_start)
footer_rect = QtCore.QRect(10, self.footer_start, self.width - 20,
self.height - self.footer_start)
else:
footer_rect = QtCore.QRect(theme.font_footer_x,
theme.font_footer_y, theme.font_footer_width - 1,
@ -215,7 +215,7 @@ class RenderManager(object):
else:
self.image_manager.del_image(theme_data.theme_name)
footer = []
footer.append(u'Arky Arky (Unknown)' )
footer.append(u'Arky Arky (Unknown)')
footer.append(u'Public Domain')
footer.append(u'CCLI 123456')
# build a service item to generate preview
@ -258,6 +258,6 @@ class RenderManager(object):
self.height = screen.height()
self.screen_ratio = float(self.height) / float(self.width)
log.debug(u'calculate default %d, %d, %f',
self.width, self.height, self.screen_ratio )
self.width, self.height, self.screen_ratio)
# 90% is start of footer
self.footer_start = int(self.height * 0.90)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -323,7 +323,7 @@ class ServiceItem(object):
for text_image in serviceitem[u'serviceitem'][u'data']:
filename = os.path.join(path, text_image[u'title'])
self.add_from_command(
path, text_image[u'title'], text_image[u'image'] )
path, text_image[u'title'], text_image[u'image'])
self._new_item()
def get_display_title(self):

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -178,4 +178,4 @@ class SettingsManager(object):
if extension == os.path.splitext(filename)[1]]
else:
# no filtering required
return files
return files

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -33,7 +33,8 @@ import logging
from xml.dom.minidom import Document
from lxml import etree, objectify
from openlp.core.lib import str_to_bool
from openlp.core.lib import str_to_bool, translate
from openlp.core.lib.ui import UiStrings
log = logging.getLogger(__name__)
@ -170,20 +171,14 @@ class HorizontalType(object):
Type enumeration for horizontal alignment.
"""
Left = 0
Center = 2
Right = 1
Center = 2
@staticmethod
def to_string(horizontal_type):
"""
Return a string representation of a horizontal type.
"""
if horizontal_type == HorizontalType.Right:
return u'right'
elif horizontal_type == HorizontalType.Center:
return u'center'
else:
return u'left'
Names = [u'left', u'right', u'center']
TranslatedNames = [
translate('OpenLP.ThemeWizard', 'Left'),
translate('OpenLP.ThemeWizard', 'Right'),
translate('OpenLP.ThemeWizard', 'Center')]
class VerticalType(object):
@ -194,17 +189,8 @@ class VerticalType(object):
Middle = 1
Bottom = 2
@staticmethod
def to_string(vertical_type):
"""
Return a string representation of a vertical type.
"""
if vertical_type == VerticalType.Bottom:
return u'bottom'
elif vertical_type == VerticalType.Middle:
return u'middle'
else:
return u'top'
Names = [u'top', u'middle', u'bottom']
TranslatedNames = [UiStrings.Top, UiStrings.Middle, UiStrings.Bottom]
BOOLEAN_LIST = [u'bold', u'italics', u'override', u'outline', u'shadow',

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -40,32 +40,59 @@ class UiStrings(object):
"""
# These strings should need a good reason to be retranslated elsewhere.
# Should some/more/less of these have an & attached?
About = translate('OpenLP.Ui', 'About')
Add = translate('OpenLP.Ui', '&Add')
Advanced = translate('OpenLP.Ui', 'Advanced')
AllFiles = translate('OpenLP.Ui', 'All Files')
Authors = translate('OpenLP.Ui', 'Authors')
Bottom = translate('OpenLP.Ui', 'Bottom')
Browse = translate('OpenLP.Ui', 'Browse...')
Cancel = translate('OpenLP.Ui', 'Cancel')
CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:')
CreateService = translate('OpenLP.Ui', 'Create a new service.')
Delete = translate('OpenLP.Ui', '&Delete')
Edit = translate('OpenLP.Ui', '&Edit')
EmptyField = translate('OpenLP.Ui', 'Empty Field')
Error = translate('OpenLP.Ui', 'Error')
Export = translate('OpenLP.Ui', 'Export')
FontSizePtUnit = translate('OpenLP.Ui', 'pt',
'Abbreviated font pointsize unit')
Image = translate('OpenLP.Ui', 'Image')
Import = translate('OpenLP.Ui', 'Import')
LengthTime = unicode(translate('OpenLP.Ui', 'Length %s'))
Live = translate('OpenLP.Ui', 'Live')
LiveBGError = translate('OpenLP.Ui', 'Live Background Error')
LivePanel = translate('OpenLP.Ui', 'Live Panel')
Load = translate('OpenLP.Ui', 'Load')
Middle = translate('OpenLP.Ui', 'Middle')
New = translate('OpenLP.Ui', 'New')
NewService = translate('OpenLP.Ui', 'New Service')
NewTheme = translate('OpenLP.Ui', 'New Theme')
NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular')
NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural')
NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular')
NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural')
OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x')
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
OpenService = translate('OpenLP.Ui', 'Open Service')
Preview = translate('OpenLP.Ui', 'Preview')
PreviewPanel = translate('OpenLP.Ui', 'Preview Panel')
PrintServiceOrder = translate('OpenLP.Ui', 'Print Service Order')
ReplaceBG = translate('OpenLP.Ui', 'Replace Background')
ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background')
ResetBG = translate('OpenLP.Ui', 'Reset Background')
ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background')
S = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds')
SaveAndPreview = translate('OpenLP.Ui', 'Save && Preview')
Search = translate('OpenLP.Ui', 'Search')
SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.')
SelectEdit = translate('OpenLP.Ui', 'You must select an item to edit.')
SaveService = translate('OpenLP.Ui', 'Save Service')
Service = translate('OpenLP.Ui', 'Service')
StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s'))
Theme = translate('OpenLP.Ui', 'Theme')
Themes = translate('OpenLP.Ui', 'Themes')
Theme = translate('OpenLP.Ui', 'Theme', 'Singular')
Themes = translate('OpenLP.Ui', 'Themes', 'Plural')
Top = translate('OpenLP.Ui', 'Top')
Version = translate('OpenLP.Ui', 'Version')
def add_welcome_page(parent, image):
"""
@ -278,8 +305,8 @@ def create_valign_combo(form, parent, layout):
verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:'))
form.verticalComboBox = QtGui.QComboBox(parent)
form.verticalComboBox.setObjectName(u'VerticalComboBox')
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Top'))
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle'))
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom'))
form.verticalComboBox.addItem(UiStrings.Top)
form.verticalComboBox.addItem(UiStrings.Middle)
form.verticalComboBox.addItem(UiStrings.Bottom)
verticalLabel.setBuddy(form.verticalComboBox)
layout.addRow(verticalLabel, form.verticalComboBox)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -24,4 +24,4 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
from openlp.core.theme.theme import Theme
from openlp.core.theme.theme import Theme

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -63,10 +63,10 @@ from splashscreen import SplashScreen
from generaltab import GeneralTab
from themestab import ThemesTab
from advancedtab import AdvancedTab
from displaytagtab import DisplayTagTab
from aboutform import AboutForm
from pluginform import PluginForm
from settingsform import SettingsForm
from displaytagform import DisplayTagForm
from shortcutlistform import ShortcutListForm
from mediadockmanager import MediaDockManager
from servicemanager import ServiceManager

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -27,6 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate
from openlp.core.lib.ui import UiStrings
class Ui_AboutDialog(object):
def setupUi(self, aboutDialog):
@ -86,8 +87,7 @@ class Ui_AboutDialog(object):
QtCore.QMetaObject.connectSlotsByName(aboutDialog)
def retranslateUi(self, aboutDialog):
aboutDialog.setWindowTitle(translate('OpenLP.AboutForm',
'About OpenLP'))
aboutDialog.setWindowTitle(u'%s OpenLP' % UiStrings.About)
self.aboutTextEdit.setPlainText(translate('OpenLP.AboutForm',
'OpenLP <version><revision> - Open Source Lyrics '
'Projection\n'
@ -105,8 +105,7 @@ class Ui_AboutDialog(object):
'consider contributing by using the button below.'
))
self.aboutNotebook.setTabText(
self.aboutNotebook.indexOf(self.aboutTab),
translate('OpenLP.AboutForm', 'About'))
self.aboutNotebook.indexOf(self.aboutTab), UiStrings.About)
self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm',
'Project Lead\n'
' Raoul "superfly" Snyman\n'

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -61,4 +61,4 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog):
import webbrowser
url = u'http://www.openlp.org/en/documentation/introduction/' \
+ u'contributing.html'
webbrowser.open_new(url)
webbrowser.open_new(url)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -28,8 +28,9 @@ The :mod:`advancedtab` provides an advanced settings facility.
"""
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, translate
from openlp.core.lib import SettingsTab, translate, build_icon
from openlp.core.lib.ui import UiStrings
from openlp.core.utils import get_images_filter
class AdvancedTab(SettingsTab):
"""
@ -41,6 +42,8 @@ class AdvancedTab(SettingsTab):
Initialise the settings tab
"""
SettingsTab.__init__(self, u'Advanced')
self.default_image = u':/graphics/openlp-splash-screen.png'
self.default_color = u'#ffffff'
def setupUi(self):
"""
@ -81,33 +84,38 @@ class AdvancedTab(SettingsTab):
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
self.leftLayout.addWidget(self.hideMouseGroupBox)
# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn)
# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')
# self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox)
# self.sharedCheckBox = QtGui.QCheckBox(self.sharedDirGroupBox)
# self.sharedCheckBox.setObjectName(u'sharedCheckBox')
# self.sharedDirLayout.addRow(self.sharedCheckBox)
# self.sharedLabel = QtGui.QLabel(self.sharedDirGroupBox)
# self.sharedLabel.setObjectName(u'sharedLabel')
# self.sharedSubLayout = QtGui.QHBoxLayout()
# self.sharedSubLayout.setObjectName(u'sharedSubLayout')
# self.sharedLineEdit = QtGui.QLineEdit(self.sharedDirGroupBox)
# self.sharedLineEdit.setObjectName(u'sharedLineEdit')
# self.sharedSubLayout.addWidget(self.sharedLineEdit)
# self.sharedPushButton = QtGui.QPushButton(self.sharedDirGroupBox)
# self.sharedPushButton.setObjectName(u'sharedPushButton')
# self.sharedSubLayout.addWidget(self.sharedPushButton)
# self.sharedDirLayout.addRow(self.sharedLabel, self.sharedSubLayout)
# self.leftLayout.addWidget(self.sharedDirGroupBox)
self.leftLayout.addStretch()
# self.databaseGroupBox = QtGui.QGroupBox(self.rightColumn)
# self.databaseGroupBox.setObjectName(u'databaseGroupBox')
# self.databaseGroupBox.setEnabled(False)
# self.databaseLayout = QtGui.QVBoxLayout(self.databaseGroupBox)
# self.rightLayout.addWidget(self.databaseGroupBox)
self.defaultImageGroupBox = QtGui.QGroupBox(self.rightColumn)
self.defaultImageGroupBox.setObjectName(u'defaultImageGroupBox')
self.defaultImageLayout = QtGui.QFormLayout(self.defaultImageGroupBox)
self.defaultImageLayout.setObjectName(u'defaultImageLayout')
self.defaultColorLabel = QtGui.QLabel(self.defaultImageGroupBox)
self.defaultColorLabel.setObjectName(u'defaultColorLabel')
self.defaultColorButton = QtGui.QPushButton(self.defaultImageGroupBox)
self.defaultColorButton.setObjectName(u'defaultColorButton')
self.defaultImageLayout.addRow(self.defaultColorLabel,
self.defaultColorButton)
self.defaultFileLabel = QtGui.QLabel(self.defaultImageGroupBox)
self.defaultFileLabel.setObjectName(u'defaultFileLabel')
self.defaultFileEdit = QtGui.QLineEdit(self.defaultImageGroupBox)
self.defaultFileEdit.setObjectName(u'defaultFileEdit')
self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox)
self.defaultBrowseButton.setObjectName(u'defaultBrowseButton')
self.defaultBrowseButton.setIcon(
build_icon(u':/general/general_open.png'))
self.defaultFileLayout = QtGui.QHBoxLayout()
self.defaultFileLayout.setObjectName(u'defaultFileLayout')
self.defaultFileLayout.addWidget(self.defaultFileEdit)
self.defaultFileLayout.addWidget(self.defaultBrowseButton)
self.defaultImageLayout.addRow(self.defaultFileLabel,
self.defaultFileLayout)
self.rightLayout.addWidget(self.defaultImageGroupBox)
self.rightLayout.addStretch()
# QtCore.QObject.connect(self.sharedCheckBox,
# QtCore.SIGNAL(u'stateChanged(int)'), self.onSharedCheckBoxChanged)
QtCore.QObject.connect(self.defaultColorButton,
QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed)
QtCore.QObject.connect(self.defaultBrowseButton,
QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed)
def retranslateUi(self):
"""
@ -129,14 +137,13 @@ class AdvancedTab(SettingsTab):
self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab',
'Mouse Cursor'))
self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab',
'Hide the mouse cursor when moved over the display window'))
# self.sharedDirGroupBox.setTitle(
# translate('AdvancedTab', 'Central Data Store'))
# self.sharedCheckBox.setText(
# translate('AdvancedTab', 'Enable a shared data location'))
# self.sharedLabel.setText(translate('AdvancedTab', 'Store location:'))
# self.sharedPushButton.setText(translate('AdvancedTab', 'Browse...'))
# self.databaseGroupBox.setTitle(translate('AdvancedTab', 'Databases'))
'Hide mouse cursor when over display window'))
self.defaultImageGroupBox.setTitle(translate('OpenLP.AdvancedTab',
'Default Image'))
self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab',
'Background color:'))
self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab',
'Image file:'))
def load(self):
"""
@ -165,7 +172,14 @@ class AdvancedTab(SettingsTab):
QtCore.QVariant(True)).toBool())
self.hideMouseCheckBox.setChecked(
settings.value(u'hide mouse', QtCore.QVariant(False)).toBool())
self.default_color = settings.value(u'default color',
QtCore.QVariant(u'#ffffff')).toString()
self.defaultFileEdit.setText(settings.value(u'default image',
QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
.toString())
settings.endGroup()
self.defaultColorButton.setStyleSheet(
u'background-color: %s' % self.default_color)
def save(self):
"""
@ -185,12 +199,24 @@ class AdvancedTab(SettingsTab):
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
settings.setValue(u'hide mouse',
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
settings.setValue(u'default color', self.default_color)
settings.setValue(u'default image', self.defaultFileEdit.text())
settings.endGroup()
# def onSharedCheckBoxChanged(self, checked):
# """
# Enables the widgets to allow a shared data location
# """
# self.sharedLabel.setEnabled(checked)
# self.sharedTextEdit.setEnabled(checked)
# self.sharedPushButton.setEnabled(checked)
def onDefaultColorButtonPressed(self):
new_color = QtGui.QColorDialog.getColor(
QtGui.QColor(self.default_color), self)
if new_color.isValid():
self.default_color = new_color.name()
self.defaultColorButton.setStyleSheet(
u'background-color: %s' % self.default_color)
def onDefaultBrowseButtonPressed(self):
file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(),
UiStrings.AllFiles)
filename = QtGui.QFileDialog.getOpenFileName(self,
translate('OpenLP.AdvancedTab', 'Open File'), '',
file_filters)
if filename:
self.defaultFileEdit.setText(filename)
self.defaultFileEdit.setFocus()

View File

@ -0,0 +1,154 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box
class Ui_DisplayTagDialog(object):
def setupUi(self, displayTagDialog):
displayTagDialog.setObjectName(u'displayTagDialog')
displayTagDialog.resize(725, 548)
self.widget = QtGui.QWidget(displayTagDialog)
self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521))
self.widget.setObjectName(u'widget')
self.listdataGridLayout = QtGui.QGridLayout(self.widget)
self.listdataGridLayout.setMargin(0)
self.listdataGridLayout.setObjectName(u'listdataGridLayout')
self.tagTableWidget = QtGui.QTableWidget(self.widget)
self.tagTableWidget.setHorizontalScrollBarPolicy(
QtCore.Qt.ScrollBarAlwaysOff)
self.tagTableWidget.setEditTriggers(
QtGui.QAbstractItemView.NoEditTriggers)
self.tagTableWidget.setAlternatingRowColors(True)
self.tagTableWidget.setSelectionMode(
QtGui.QAbstractItemView.SingleSelection)
self.tagTableWidget.setSelectionBehavior(
QtGui.QAbstractItemView.SelectRows)
self.tagTableWidget.setCornerButtonEnabled(False)
self.tagTableWidget.setObjectName(u'tagTableWidget')
self.tagTableWidget.setColumnCount(4)
self.tagTableWidget.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(2, item)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(3, item)
self.listdataGridLayout.addWidget(self.tagTableWidget, 0, 0, 1, 1)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(u'horizontalLayout')
spacerItem = QtGui.QSpacerItem(40, 20,
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.defaultPushButton = QtGui.QPushButton(self.widget)
self.defaultPushButton.setObjectName(u'defaultPushButton')
self.horizontalLayout.addWidget(self.defaultPushButton)
self.deletePushButton = QtGui.QPushButton(self.widget)
self.deletePushButton.setObjectName(u'deletePushButton')
self.horizontalLayout.addWidget(self.deletePushButton)
self.listdataGridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
self.editGroupBox = QtGui.QGroupBox(self.widget)
self.editGroupBox.setObjectName(u'editGroupBox')
self.dataGridLayout = QtGui.QGridLayout(self.editGroupBox)
self.dataGridLayout.setObjectName(u'dataGridLayout')
self.descriptionLabel = QtGui.QLabel(self.editGroupBox)
self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter)
self.descriptionLabel.setObjectName(u'descriptionLabel')
self.dataGridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1)
self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox)
self.descriptionLineEdit.setObjectName(u'descriptionLineEdit')
self.dataGridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1)
self.newPushButton = QtGui.QPushButton(self.editGroupBox)
self.newPushButton.setObjectName(u'newPushButton')
self.dataGridLayout.addWidget(self.newPushButton, 0, 2, 2, 1)
self.tagLabel = QtGui.QLabel(self.editGroupBox)
self.tagLabel.setAlignment(QtCore.Qt.AlignCenter)
self.tagLabel.setObjectName(u'tagLabel')
self.dataGridLayout.addWidget(self.tagLabel, 2, 0, 1, 1)
self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox)
self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215))
self.tagLineEdit.setMaxLength(5)
self.tagLineEdit.setObjectName(u'tagLineEdit')
self.dataGridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1)
self.startTagLabel = QtGui.QLabel(self.editGroupBox)
self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter)
self.startTagLabel.setObjectName(u'startTagLabel')
self.dataGridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1)
self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox)
self.startTagLineEdit.setObjectName(u'startTagLineEdit')
self.dataGridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1)
self.endTagLabel = QtGui.QLabel(self.editGroupBox)
self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter)
self.endTagLabel.setObjectName(u'endTagLabel')
self.dataGridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1)
self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox)
self.endTagLineEdit.setObjectName(u'endTagLineEdit')
self.dataGridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1)
self.updatePushButton = QtGui.QPushButton(self.editGroupBox)
self.updatePushButton.setObjectName(u'updatePushButton')
self.dataGridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1)
self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1)
self.buttonBox = create_accept_reject_button_box(displayTagDialog)
self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1)
self.retranslateUi(displayTagDialog)
QtCore.QMetaObject.connectSlotsByName(displayTagDialog)
def retranslateUi(self, displayTagDialog):
displayTagDialog.setWindowTitle(translate('OpenLP.displayTagDialog',
'Configure Display Tags'))
self.editGroupBox.setTitle(
translate('OpenLP.DisplayTagDialog', 'Edit Selection'))
self.updatePushButton.setText(
translate('OpenLP.DisplayTagDialog', 'Update'))
self.descriptionLabel.setText(
translate('OpenLP.DisplayTagDialog', 'Description'))
self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag'))
self.startTagLabel.setText(
translate('OpenLP.DisplayTagDialog', 'Start tag'))
self.endTagLabel.setText(
translate('OpenLP.DisplayTagDialog', 'End tag'))
self.deletePushButton.setText(UiStrings.Delete)
self.defaultPushButton.setText(
translate('OpenLP.DisplayTagDialog', 'Default'))
self.newPushButton.setText(UiStrings.New)
self.tagTableWidget.horizontalHeaderItem(0).setText(
translate('OpenLP.DisplayTagDialog', 'Description'))
self.tagTableWidget.horizontalHeaderItem(1).setText(
translate('OpenLP.DisplayTagDialog', 'Tag id'))
self.tagTableWidget.horizontalHeaderItem(2).setText(
translate('OpenLP.DisplayTagDialog', 'Start Html'))
self.tagTableWidget.horizontalHeaderItem(3).setText(
translate('OpenLP.DisplayTagDialog', 'End Html'))
self.tagTableWidget.setColumnWidth(0, 120)
self.tagTableWidget.setColumnWidth(1, 40)
self.tagTableWidget.setColumnWidth(2, 240)
self.tagTableWidget.setColumnWidth(3, 240)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -33,154 +33,21 @@ import cPickle
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, translate, DisplayTags
from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.lib import translate, DisplayTags
from openlp.core.lib.ui import critical_error_message_box
from openlp.core.ui.displaytagdialog import Ui_DisplayTagDialog
class DisplayTagTab(SettingsTab):
class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
"""
The :class:`DisplayTagTab` manages the settings tab .
"""
def __init__(self):
def __init__(self, parent):
"""
Initialise the settings tab
Constructor
"""
SettingsTab.__init__(self, u'Display Tags')
def resizeEvent(self, event=None):
pass
def preLoad(self):
"""
Initialise values before the Load takes place
"""
# Create initial copy from master
DisplayTags.reset_html_tags()
user_expands = QtCore.QSettings().value(u'displayTags/html_tags',
QtCore.QVariant(u'')).toString()
# cPickle only accepts str not unicode strings
user_expands_string = str(unicode(user_expands).encode(u'utf8'))
if user_expands_string:
user_tags = cPickle.loads(user_expands_string)
# If we have some user ones added them as well
for t in user_tags:
DisplayTags.add_html_tag(t)
self.selected = -1
def setupUi(self):
"""
Configure the UI elements for the tab.
"""
self.setObjectName(u'DisplayTagTab')
self.tabTitleVisible = \
translate(u'OpenLP.DisplayTagTab', 'Display Tags')
self.displayTagEdit = QtGui.QWidget(self)
self.editGroupBox = QtGui.QGroupBox(self.displayTagEdit)
self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181))
self.editGroupBox.setObjectName(u'editGroupBox')
self.updatePushButton = QtGui.QPushButton(self.editGroupBox)
self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26))
self.updatePushButton.setObjectName(u'updatePushButton')
self.layoutWidget = QtGui.QWidget(self.editGroupBox)
self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114))
self.layoutWidget.setObjectName(u'layoutWidget')
self.formLayout = QtGui.QFormLayout(self.layoutWidget)
self.formLayout.setObjectName(u'formLayout')
self.descriptionLabel = QtGui.QLabel(self.layoutWidget)
self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter)
self.descriptionLabel.setObjectName(u'descriptionLabel')
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole,
self.descriptionLabel)
self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget)
self.descriptionLineEdit.setObjectName(u'descriptionLineEdit')
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole,
self.descriptionLineEdit)
self.tagLabel = QtGui.QLabel(self.layoutWidget)
self.tagLabel.setAlignment(QtCore.Qt.AlignCenter)
self.tagLabel.setObjectName(u'tagLabel')
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel)
self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget)
self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215))
self.tagLineEdit.setMaxLength(5)
self.tagLineEdit.setObjectName(u'tagLineEdit')
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole,
self.tagLineEdit)
self.startTagLabel = QtGui.QLabel(self.layoutWidget)
self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter)
self.startTagLabel.setObjectName(u'startTagLabel')
self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole,
self.startTagLabel)
self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget)
self.startTagLineEdit.setObjectName(u'startTagLineEdit')
self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole,
self.startTagLineEdit)
self.endTagLabel = QtGui.QLabel(self.layoutWidget)
self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter)
self.endTagLabel.setObjectName(u'endTagLabel')
self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole,
self.endTagLabel)
self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget)
self.endTagLineEdit.setObjectName(u'endTagLineEdit')
self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole,
self.endTagLineEdit)
self.defaultPushButton = QtGui.QPushButton(self.displayTagEdit)
self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26))
self.defaultPushButton.setObjectName(u'updatePushButton')
self.deletePushButton = QtGui.QPushButton(self.displayTagEdit)
self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26))
self.deletePushButton.setObjectName(u'deletePushButton')
self.newPushButton = QtGui.QPushButton(self.displayTagEdit)
self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26))
self.newPushButton.setObjectName(u'newPushButton')
self.tagTableWidget = QtGui.QTableWidget(self.displayTagEdit)
self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171))
self.tagTableWidget.setHorizontalScrollBarPolicy(
QtCore.Qt.ScrollBarAlwaysOff)
self.tagTableWidget.setEditTriggers(
QtGui.QAbstractItemView.NoEditTriggers)
self.tagTableWidget.setAlternatingRowColors(True)
self.tagTableWidget.setSelectionMode(
QtGui.QAbstractItemView.SingleSelection)
self.tagTableWidget.setSelectionBehavior(
QtGui.QAbstractItemView.SelectRows)
self.tagTableWidget.setCornerButtonEnabled(False)
self.tagTableWidget.setObjectName(u'tagTableWidget')
self.tagTableWidget.setColumnCount(4)
self.tagTableWidget.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(2, item)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(3, item)
self.editGroupBox.setTitle(
translate('OpenLP.DisplayTagTab', 'Edit Selection'))
self.updatePushButton.setText(
translate('OpenLP.DisplayTagTab', 'Update'))
self.descriptionLabel.setText(
translate('OpenLP.DisplayTagTab', 'Description'))
self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag'))
self.startTagLabel.setText(
translate('OpenLP.DisplayTagTab', 'Start tag'))
self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag'))
self.deletePushButton.setText(UiStrings.Delete)
self.defaultPushButton.setText(
translate('OpenLP.DisplayTagTab', 'Default'))
self.newPushButton.setText(translate('OpenLP.DisplayTagTab', 'New'))
self.tagTableWidget.horizontalHeaderItem(0)\
.setText(translate('OpenLP.DisplayTagTab', 'Description'))
self.tagTableWidget.horizontalHeaderItem(1)\
.setText(translate('OpenLP.DisplayTagTab', 'Tag id'))
self.tagTableWidget.horizontalHeaderItem(2)\
.setText(translate('OpenLP.DisplayTagTab', 'Start Html'))
self.tagTableWidget.horizontalHeaderItem(3)\
.setText(translate('OpenLP.DisplayTagTab', 'End Html'))
QtCore.QMetaObject.connectSlotsByName(self.displayTagEdit)
self.tagTableWidget.setColumnWidth(0, 120)
self.tagTableWidget.setColumnWidth(1, 40)
self.tagTableWidget.setColumnWidth(2, 240)
self.tagTableWidget.setColumnWidth(3, 200)
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
self.preLoad()
QtCore.QObject.connect(self.tagTableWidget,
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected)
QtCore.QObject.connect(self.defaultPushButton,
@ -192,35 +59,35 @@ class DisplayTagTab(SettingsTab):
QtCore.QObject.connect(self.deletePushButton,
QtCore.SIGNAL(u'pressed()'), self.onDeletePushed)
def load(self):
def exec_(self):
"""
Load Display and set field state.
"""
self.newPushButton.setEnabled(True)
self.updatePushButton.setEnabled(False)
self.deletePushButton.setEnabled(False)
for linenumber, html in enumerate(DisplayTags.get_html_tags()):
self.tagTableWidget.setRowCount(
self.tagTableWidget.rowCount() + 1)
self.tagTableWidget.setItem(linenumber, 0,
QtGui.QTableWidgetItem(html[u'desc']))
self.tagTableWidget.setItem(linenumber, 1,
QtGui.QTableWidgetItem(self._strip(html[u'start tag'])))
self.tagTableWidget.setItem(linenumber, 2,
QtGui.QTableWidgetItem(html[u'start html']))
self.tagTableWidget.setItem(linenumber, 3,
QtGui.QTableWidgetItem(html[u'end html']))
self.tagTableWidget.resizeRowsToContents()
self.descriptionLineEdit.setText(u'')
self.tagLineEdit.setText(u'')
self.startTagLineEdit.setText(u'')
self.endTagLineEdit.setText(u'')
self.descriptionLineEdit.setEnabled(False)
self.tagLineEdit.setEnabled(False)
self.startTagLineEdit.setEnabled(False)
self.endTagLineEdit.setEnabled(False)
# Create initial copy from master
self.preLoad()
self._resetTable()
self.selected = -1
return QtGui.QDialog.exec_(self)
def save(self):
def preLoad(self):
"""
Load the Tags from store so can be used in the system or used to
update the display. If Cancel was selected this is needed to reset the
dsiplay to the correct version.
"""
# Initial Load of the Tags
DisplayTags.reset_html_tags()
user_expands = QtCore.QSettings().value(u'displayTags/html_tags',
QtCore.QVariant(u'')).toString()
# cPickle only accepts str not unicode strings
user_expands_string = str(unicode(user_expands).encode(u'utf8'))
if user_expands_string:
user_tags = cPickle.loads(user_expands_string)
# If we have some user ones added them as well
for t in user_tags:
DisplayTags.add_html_tag(t)
def accept(self):
"""
Save Custom tags in a pickle .
"""
@ -235,13 +102,14 @@ class DisplayTagTab(SettingsTab):
else:
QtCore.QSettings().setValue(u'displayTags/html_tags',
QtCore.QVariant(u''))
return QtGui.QDialog.accept(self)
def cancel(self):
def reject(self):
"""
Reset Custom tags from Settings.
"""
self.preLoad()
self._resetTable()
return QtGui.QDialog.reject(self)
def onRowSelected(self):
"""
@ -288,6 +156,7 @@ class DisplayTagTab(SettingsTab):
self._resetTable()
# Highlight new row
self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1)
self.onRowSelected()
def onDefaultPushed(self):
"""
@ -335,7 +204,29 @@ class DisplayTagTab(SettingsTab):
"""
self.tagTableWidget.clearContents()
self.tagTableWidget.setRowCount(0)
self.load()
self.newPushButton.setEnabled(True)
self.updatePushButton.setEnabled(False)
self.deletePushButton.setEnabled(False)
for linenumber, html in enumerate(DisplayTags.get_html_tags()):
self.tagTableWidget.setRowCount(
self.tagTableWidget.rowCount() + 1)
self.tagTableWidget.setItem(linenumber, 0,
QtGui.QTableWidgetItem(html[u'desc']))
self.tagTableWidget.setItem(linenumber, 1,
QtGui.QTableWidgetItem(self._strip(html[u'start tag'])))
self.tagTableWidget.setItem(linenumber, 2,
QtGui.QTableWidgetItem(html[u'start html']))
self.tagTableWidget.setItem(linenumber, 3,
QtGui.QTableWidgetItem(html[u'end html']))
self.tagTableWidget.resizeRowsToContents()
self.descriptionLineEdit.setText(u'')
self.tagLineEdit.setText(u'')
self.startTagLineEdit.setText(u'')
self.endTagLineEdit.setText(u'')
self.descriptionLineEdit.setEnabled(False)
self.tagLineEdit.setEnabled(False)
self.startTagLineEdit.setEnabled(False)
self.endTagLineEdit.setEnabled(False)
def _strip(self, tag):
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -35,24 +35,24 @@ from PyQt4 import Qt, QtCore, QtGui
try:
from PyQt4.phonon import Phonon
phonon_version = Phonon.phononVersion()
PHONON_VERSION = Phonon.phononVersion()
except ImportError:
phonon_version = u'-'
PHONON_VERSION = u'-'
try:
import chardet
chardet_version = chardet.__version__
CHARDET_VERSION = chardet.__version__
except ImportError:
chardet_version = u'-'
CHARDET_VERSION = u'-'
try:
import enchant
enchant_version = enchant.__version__
ENCHANT_VERSION = enchant.__version__
except ImportError:
enchant_version = u'-'
ENCHANT_VERSION = u'-'
try:
import sqlite
sqlite_version = sqlite.version
SQLITE_VERSION = sqlite.version
except ImportError:
sqlite_version = u'-'
SQLITE_VERSION = u'-'
from openlp.core.lib import translate, SettingsManager
from openlp.core.lib.mailto import mailto
@ -85,14 +85,14 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
'Platform: %s\n')) % platform.platform()
libraries = u'Python: %s\n' % platform.python_version() + \
u'Qt4: %s\n' % Qt.qVersion() + \
u'Phonon: %s\n' % phonon_version + \
u'Phonon: %s\n' % PHONON_VERSION + \
u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \
u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \
u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \
u'lxml: %s\n' % etree.__version__ + \
u'Chardet: %s\n' % chardet_version + \
u'PyEnchant: %s\n' % enchant_version + \
u'PySQLite: %s\n' % sqlite_version
u'Chardet: %s\n' % CHARDET_VERSION + \
u'PyEnchant: %s\n' % ENCHANT_VERSION + \
u'PySQLite: %s\n' % SQLITE_VERSION
if platform.system() == u'Linux':
if os.environ.get(u'KDE_FULL_SESSION') == u'true':
system = system + u'Desktop: KDE SC\n'
@ -170,7 +170,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
self.__buttonState(False)
self.descriptionWordCount.setText(
unicode(translate('OpenLP.ExceptionDialog',
'Description characters to enter : %s')) % count )
'Description characters to enter : %s')) % count)
def onAttachFileButtonPressed(self):
files = QtGui.QFileDialog.getOpenFileName(

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -28,6 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver, translate
from openlp.core.lib.ui import UiStrings
log = logging.getLogger(__name__)
@ -267,8 +268,7 @@ class GeneralTab(SettingsTab):
translate('OpenLP.GeneralTab', ' sec'))
self.ccliGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'CCLI Details'))
self.numberLabel.setText(
translate('OpenLP.GeneralTab', 'CCLI number:'))
self.numberLabel.setText(UiStrings.CCLINumberLabel)
self.usernameLabel.setText(
translate('OpenLP.GeneralTab', 'SongSelect username:'))
self.passwordLabel.setText(

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -132,14 +132,22 @@ class MainDisplay(DisplayWidget):
painter_image.begin(self.black)
painter_image.fillRect(self.black.rect(), QtCore.Qt.black)
# Build the initial frame.
image_file = QtCore.QSettings().value(u'advanced/default image',
QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
.toString()
background_color = QtGui.QColor(QtCore.QSettings().value(
u'advanced/default color',
QtCore.QVariant(u'#ffffff')).toString())
if not background_color.isValid():
background_color = QtCore.Qt.white
splash_image = QtGui.QImage(image_file)
initialFrame = QtGui.QImage(
self.screens.current[u'size'].width(),
self.screens.current[u'size'].height(),
QtGui.QImage.Format_ARGB32_Premultiplied)
splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png')
painter_image = QtGui.QPainter()
painter_image.begin(initialFrame)
painter_image.fillRect(initialFrame.rect(), QtCore.Qt.white)
painter_image.fillRect(initialFrame.rect(), background_color)
painter_image.drawImage(
(self.screens.current[u'size'].width() -
splash_image.width()) / 2,

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -34,7 +34,7 @@ from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \
icon_action
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
ThemeManager, SlideController, PluginForm, MediaDockManager, \
ShortcutListForm
ShortcutListForm, DisplayTagForm
from openlp.core.utils import AppLocation, add_actions, LanguageManager, \
ActionList
@ -73,15 +73,15 @@ class Ui_MainWindow(object):
# Set up the main container, which contains all the other form widgets.
self.MainContent = QtGui.QWidget(mainWindow)
self.MainContent.setObjectName(u'MainContent')
self.MainContentLayout = QtGui.QHBoxLayout(self.MainContent)
self.MainContentLayout.setSpacing(0)
self.MainContentLayout.setMargin(0)
self.MainContentLayout.setObjectName(u'MainContentLayout')
self.mainContentLayout = QtGui.QHBoxLayout(self.MainContent)
self.mainContentLayout.setSpacing(0)
self.mainContentLayout.setMargin(0)
self.mainContentLayout.setObjectName(u'mainContentLayout')
mainWindow.setCentralWidget(self.MainContent)
self.controlSplitter = QtGui.QSplitter(self.MainContent)
self.controlSplitter.setOrientation(QtCore.Qt.Horizontal)
self.controlSplitter.setObjectName(u'controlSplitter')
self.MainContentLayout.addWidget(self.controlSplitter)
self.mainContentLayout.addWidget(self.controlSplitter)
# Create slide controllers
self.previewController = SlideController(self, self.settingsmanager,
self.screens)
@ -152,10 +152,10 @@ class Ui_MainWindow(object):
u'themeManagerDock', u':/system/system_thememanager.png')
self.themeManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_right)
self.ThemeManagerContents = ThemeManager(mainWindow,
self.themeManagerContents = ThemeManager(mainWindow,
self.themeManagerDock)
self.ThemeManagerContents.setObjectName(u'ThemeManagerContents')
self.themeManagerDock.setWidget(self.ThemeManagerContents)
self.themeManagerContents.setObjectName(u'themeManagerContents')
self.themeManagerDock.setWidget(self.themeManagerContents)
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
self.themeManagerDock)
# Create the menu items
@ -240,8 +240,10 @@ class Ui_MainWindow(object):
languageItem.setChecked(True)
add_actions(self.LanguageGroup, [languageItem])
self.SettingsShortcutsItem = icon_action(mainWindow,
u'SettingsShortcutsItem',
u'SettingsShortcutsItem',
u':/system/system_configure_shortcuts.png')
self.DisplayTagItem = icon_action(mainWindow,
u'DisplayTagItem', u':/system/tag_editor.png')
self.SettingsConfigureItem = icon_action(mainWindow,
u'SettingsConfigureItem', u':/system/system_settings.png')
mainWindow.actionList.add_action(self.SettingsShortcutsItem,
@ -256,8 +258,8 @@ class Ui_MainWindow(object):
self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem')
self.HelpOnlineHelpItem.setEnabled(False)
mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help')
self.HelpWebSiteItem = base_action(mainWindow, u'HelpWebSiteItem')
mainWindow.actionList.add_action(self.HelpWebSiteItem, u'Help')
self.helpWebSiteItem = base_action(mainWindow, u'helpWebSiteItem')
mainWindow.actionList.add_action(self.helpWebSiteItem, u'Help')
add_actions(self.FileImportMenu,
(self.ImportThemeItem, self.ImportLanguageItem))
add_actions(self.FileExportMenu,
@ -277,11 +279,12 @@ class Ui_MainWindow(object):
add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions())
add_actions(self.SettingsMenu, (self.settingsPluginListItem,
self.SettingsLanguageMenu.menuAction(), None,
self.SettingsShortcutsItem, self.SettingsConfigureItem))
self.SettingsShortcutsItem, self.DisplayTagItem,
self.SettingsConfigureItem))
add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None))
add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None))
add_actions(self.HelpMenu, (self.HelpDocumentationItem,
self.HelpOnlineHelpItem, None, self.HelpWebSiteItem,
self.HelpOnlineHelpItem, None, self.helpWebSiteItem,
self.HelpAboutItem))
add_actions(self.MenuBar, (self.FileMenu.menuAction(),
self.viewMenu.menuAction(), self.ToolsMenu.menuAction(),
@ -340,8 +343,7 @@ class Ui_MainWindow(object):
'Save the current service under a new name.'))
self.FileSaveAsItem.setShortcut(
translate('OpenLP.MainWindow', 'Ctrl+Shift+S'))
self.printServiceOrderItem.setText(
translate('OpenLP.MainWindow', 'Print Service Order'))
self.printServiceOrderItem.setText(UiStrings.PrintServiceOrder)
self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow',
'Print the current Service Order.'))
self.printServiceOrderItem.setShortcut(
@ -362,6 +364,8 @@ class Ui_MainWindow(object):
translate('OpenLP.MainWindow', '&Language'))
self.SettingsShortcutsItem.setText(
translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
self.DisplayTagItem.setText(
translate('OpenLP.MainWindow', '&Configure Display Tags'))
self.SettingsConfigureItem.setText(
translate('OpenLP.MainWindow', '&Configure OpenLP...'))
self.ViewMediaManagerItem.setText(
@ -419,7 +423,7 @@ class Ui_MainWindow(object):
translate('OpenLP.MainWindow', 'Ctrl+F1'))
self.HelpOnlineHelpItem.setText(
translate('OpenLP.MainWindow', '&Online Help'))
self.HelpWebSiteItem.setText(
self.helpWebSiteItem.setText(
translate('OpenLP.MainWindow', '&Web Site'))
self.AutoLanguageItem.setText(
translate('OpenLP.MainWindow', '&Auto Detect'))
@ -457,7 +461,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
actionList = ActionList()
def __init__(self, screens, applicationVersion):
def __init__(self, screens, applicationVersion, clipboard):
"""
This constructor sets up the interface, the various managers, and the
plugins.
@ -466,6 +470,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.screens = screens
self.actionList = ActionList()
self.applicationVersion = applicationVersion
self.clipboard = clipboard
# Set up settings sections for the main application
# (not for use by plugins)
self.uiSettingsSection = u'user interface'
@ -476,6 +481,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.settingsmanager = SettingsManager(screens)
self.aboutForm = AboutForm(self, applicationVersion)
self.settingsForm = SettingsForm(self.screens, self, self)
self.displayTagForm = DisplayTagForm(self)
self.shortcutForm = ShortcutListForm(self)
self.recentFiles = QtCore.QStringList()
# Set up the path with plugins
@ -492,10 +498,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# Set up signals and slots
QtCore.QObject.connect(self.ImportThemeItem,
QtCore.SIGNAL(u'triggered()'),
self.ThemeManagerContents.onImportTheme)
self.themeManagerContents.onImportTheme)
QtCore.QObject.connect(self.ExportThemeItem,
QtCore.SIGNAL(u'triggered()'),
self.ThemeManagerContents.onExportTheme)
self.themeManagerContents.onExportTheme)
QtCore.QObject.connect(self.ViewMediaManagerItem,
QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager)
QtCore.QObject.connect(self.ViewServiceManagerItem,
@ -515,7 +521,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtCore.QObject.connect(self.themeManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.ViewThemeManagerItem.setChecked)
QtCore.QObject.connect(self.HelpWebSiteItem,
QtCore.QObject.connect(self.helpWebSiteItem,
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
QtCore.QObject.connect(self.HelpAboutItem,
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
@ -523,6 +529,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
QtCore.QObject.connect(self.settingsPluginListItem,
QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked)
QtCore.QObject.connect(self.DisplayTagItem,
QtCore.SIGNAL(u'triggered()'), self.onDisplayTagItemClicked)
QtCore.QObject.connect(self.SettingsConfigureItem,
QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked)
QtCore.QObject.connect(self.SettingsShortcutsItem,
@ -574,7 +582,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# RenderManager needs to call ThemeManager and
# ThemeManager needs to call RenderManager
self.renderManager = RenderManager(
self.ThemeManagerContents, self.screens)
self.themeManagerContents, self.screens)
# Define the media Dock Manager
self.mediaDockManager = MediaDockManager(self.MediaToolBox)
log.info(u'Load Plugins')
@ -608,7 +616,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.pluginManager.initialise_plugins()
# Once all components are initialised load the Themes
log.info(u'Load Themes')
self.ThemeManagerContents.loadThemes()
self.themeManagerContents.loadThemes()
log.info(u'Load data from Settings')
if QtCore.QSettings().value(u'advanced/save current plugin',
QtCore.QVariant(False)).toBool():
@ -716,6 +724,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
path = AppLocation.get_data_path()
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path))
def onDisplayTagItemClicked(self):
"""
Show the Settings dialog
"""
self.displayTagForm.exec_()
def onSettingsConfigureItemClicked(self):
"""
Show the Settings dialog

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -85,4 +85,4 @@ class MediaDockManager(object):
if self.media_dock.widget(dock_index).settingsSection == \
media_item.plugin.name.lower():
self.media_dock.widget(dock_index).hide()
self.media_dock.removeItem(dock_index)
self.media_dock.removeItem(dock_index)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -25,7 +25,9 @@
###############################################################################
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
from openlp.core.lib.ui import UiStrings
class Ui_PluginViewDialog(object):
def setupUi(self, pluginViewDialog):
@ -76,10 +78,8 @@ class Ui_PluginViewDialog(object):
translate('OpenLP.PluginForm', 'Plugin List'))
self.pluginInfoGroupBox.setTitle(
translate('OpenLP.PluginForm', 'Plugin Details'))
self.versionLabel.setText(
translate('OpenLP.PluginForm', 'Version:'))
self.aboutLabel.setText(
translate('OpenLP.PluginForm', 'About:'))
self.versionLabel.setText(u'%s:' % UiStrings.Version)
self.aboutLabel.setText(u'%s:' % UiStrings.About)
self.statusLabel.setText(
translate('OpenLP.PluginForm', 'Status:'))
self.statusComboBox.setItemText(0,

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import PluginStatus, Receiver, StringContent, translate
from openlp.core.lib import PluginStatus, Receiver, translate
from plugindialog import Ui_PluginViewDialog
log = logging.getLogger(__name__)
@ -80,15 +80,14 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
# PluginStatus.Inactive
status_text = unicode(
translate('OpenLP.PluginForm', '%s (Inactive)'))
name_string = plugin.getString(StringContent.Name)
item.setText(status_text % name_string[u'singular'])
item.setText(status_text % plugin.nameStrings[u'singular'])
# If the plugin has an icon, set it!
if plugin.icon:
item.setIcon(plugin.icon)
self.pluginListWidget.addItem(item)
pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
unicode(translate('OpenLP.PluginForm', '%s (Inactive)')) %
name_string[u'singular']))
plugin.nameStrings[u'singular']))
self.pluginListWidget.setFixedWidth(pluginListWidth +
self.pluginListWidget.iconSize().width() + 48)
@ -118,8 +117,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self.pluginListWidget.currentItem().text().split(u' ')[0]
self.activePlugin = None
for plugin in self.parent.pluginManager.plugins:
name_string = plugin.getString(StringContent.Name)
if name_string[u'singular'] == plugin_name_singular:
if plugin.nameStrings[u'singular'] == plugin_name_singular:
self.activePlugin = plugin
break
if self.activePlugin:
@ -147,6 +145,5 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
elif self.activePlugin.status == PluginStatus.Disabled:
status_text = unicode(
translate('OpenLP.PluginForm', '%s (Disabled)'))
name_string = self.activePlugin.getString(StringContent.Name)
self.pluginListWidget.currentItem().setText(
status_text % name_string[u'singular'])
status_text % self.activePlugin.nameStrings[u'singular'])

View File

@ -0,0 +1,165 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate, SpellTextEdit
from openlp.core.lib.ui import UiStrings
class ZoomSize(object):
"""
Type enumeration for Combo Box sizes
"""
Page = 0
Width = 1
OneHundred = 2
SeventyFive = 3
Fifty = 4
TwentyFive = 5
Sizes = [
translate('OpenLP.PrintServiceDialog', 'Fit Page'),
translate('OpenLP.PrintServiceDialog', 'Fit Width'),
u'100%', u'75%', u'50%', u'25%']
class Ui_PrintServiceDialog(object):
def setupUi(self, printServiceDialog):
printServiceDialog.setObjectName(u'printServiceDialog')
printServiceDialog.resize(664, 594)
self.mainLayout = QtGui.QVBoxLayout(printServiceDialog)
self.mainLayout.setSpacing(0)
self.mainLayout.setMargin(0)
self.mainLayout.setObjectName(u'mainLayout')
self.toolbar = QtGui.QToolBar(printServiceDialog)
self.toolbar.setIconSize(QtCore.QSize(22, 22))
self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
self.printButton = self.toolbar.addAction(
build_icon(u':/general/general_print.png'), 'Print')
self.optionsButton = QtGui.QToolButton(self.toolbar)
self.optionsButton.setText(translate('OpenLP.PrintServiceForm',
'Options'))
self.optionsButton.setToolButtonStyle(
QtCore.Qt.ToolButtonTextBesideIcon)
self.optionsButton.setIcon(QtGui.QIcon(
build_icon(u':/system/system_configure.png')))
self.optionsButton.setCheckable(True)
self.toolbar.addWidget(self.optionsButton)
self.closeButton = self.toolbar.addAction(
build_icon(u':/system/system_close.png'),
translate('OpenLP.PrintServiceForm', 'Close'))
self.toolbar.addSeparator()
self.plainCopy = self.toolbar.addAction(
build_icon(u':/system/system_edit_copy.png'),
translate('OpenLP.PrintServiceForm', 'Copy'))
self.htmlCopy = self.toolbar.addAction(
build_icon(u':/system/system_edit_copy.png'),
translate('OpenLP.PrintServiceForm', 'Copy as HTML'))
self.toolbar.addSeparator()
self.zoomInButton = QtGui.QToolButton(self.toolbar)
self.zoomInButton.setIcon(QtGui.QIcon(
build_icon(u':/general/general_zoom_in.png')))
self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm',
'Zoom In'))
self.zoomInButton.setObjectName(u'zoomInButton')
self.zoomInButton.setIconSize(QtCore.QSize(22, 22))
self.toolbar.addWidget(self.zoomInButton)
self.zoomOutButton = QtGui.QToolButton(self.toolbar)
self.zoomOutButton.setIcon(QtGui.QIcon(
build_icon(u':/general/general_zoom_out.png')))
self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm',
'Zoom Out'))
self.zoomOutButton.setObjectName(u'zoomOutButton')
self.zoomOutButton.setIconSize(QtCore.QSize(22, 22))
self.toolbar.addWidget(self.zoomOutButton)
self.zoomOriginalButton = QtGui.QToolButton(self.toolbar)
self.zoomOriginalButton.setIcon(QtGui.QIcon(
build_icon(u':/general/general_zoom_original.png')))
self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm',
'Zoom Original'))
self.zoomOriginalButton.setObjectName(u'zoomOriginalButton')
self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22))
self.toolbar.addWidget(self.zoomOriginalButton)
self.zoomComboBox = QtGui.QComboBox(printServiceDialog)
self.zoomComboBox.setObjectName(u'zoomComboBox')
self.toolbar.addWidget(self.zoomComboBox)
self.mainLayout.addWidget(self.toolbar)
self.previewWidget = QtGui.QPrintPreviewWidget(printServiceDialog)
self.mainLayout.addWidget(self.previewWidget)
self.optionsWidget = QtGui.QWidget(printServiceDialog)
self.optionsWidget.hide()
self.optionsWidget.resize(400, 300)
self.optionsWidget.setAutoFillBackground(True)
self.optionsLayout = QtGui.QVBoxLayout(self.optionsWidget)
self.optionsLayout.setContentsMargins(8, 8, 8, 8)
self.titleLabel = QtGui.QLabel(self.optionsWidget)
self.titleLabel.setObjectName(u'titleLabel')
self.titleLabel.setText(u'Title:')
self.optionsLayout.addWidget(self.titleLabel)
self.titleLineEdit = QtGui.QLineEdit(self.optionsWidget)
self.titleLineEdit.setObjectName(u'titleLineEdit')
self.optionsLayout.addWidget(self.titleLineEdit)
self.footerLabel = QtGui.QLabel(self.optionsWidget)
self.footerLabel.setObjectName(u'footerLabel')
self.footerLabel.setText(u'Custom Footer Text:')
self.optionsLayout.addWidget(self.footerLabel)
self.footerTextEdit = SpellTextEdit(self.optionsWidget)
self.footerTextEdit.setObjectName(u'footerTextEdit')
self.optionsLayout.addWidget(self.footerTextEdit)
self.optionsGroupBox = QtGui.QGroupBox(
translate('OpenLP.PrintServiceForm','Other Options'))
self.groupLayout = QtGui.QVBoxLayout()
self.slideTextCheckBox = QtGui.QCheckBox()
self.groupLayout.addWidget(self.slideTextCheckBox)
self.notesCheckBox = QtGui.QCheckBox()
self.groupLayout.addWidget(self.notesCheckBox)
self.metaDataCheckBox = QtGui.QCheckBox()
self.groupLayout.addWidget(self.metaDataCheckBox)
self.groupLayout.addStretch(1)
self.optionsGroupBox.setLayout(self.groupLayout)
self.optionsLayout.addWidget(self.optionsGroupBox)
self.retranslateUi(printServiceDialog)
QtCore.QMetaObject.connectSlotsByName(printServiceDialog)
QtCore.QObject.connect(self.optionsButton,
QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
def retranslateUi(self, printServiceDialog):
printServiceDialog.setWindowTitle(UiStrings.PrintServiceOrder)
self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm',
'Include slide text if available'))
self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm',
'Include service item notes'))
self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm',
'Include play length of media items'))
self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm',
'Service Order Sheet'))
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Page])
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Width])
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.OneHundred])
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.SeventyFive])
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Fifty])
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.TwentyFive])

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -28,51 +28,65 @@ import datetime
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
from openlp.core.ui.printserviceorderdialog import Ui_PrintServiceOrderDialog
from openlp.core.lib.ui import UiStrings
from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize
class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
def __init__(self, parent, serviceManager):
"""
Constructor
"""
QtGui.QDialog.__init__(self, parent)
self.parent = parent
self.serviceManager = serviceManager
self.printer = QtGui.QPrinter()
self.printDialog = QtGui.QPrintDialog(self.printer, self)
self.document = QtGui.QTextDocument()
self.zoom = 0
self.setupUi(self)
# Load the settings for the dialog.
settings = QtCore.QSettings()
settings.beginGroup(u'advanced')
self.printSlideTextCheckBox.setChecked(settings.value(
self.slideTextCheckBox.setChecked(settings.value(
u'print slide text', QtCore.QVariant(False)).toBool())
self.printMetaDataCheckBox.setChecked(settings.value(
self.metaDataCheckBox.setChecked(settings.value(
u'print file meta data', QtCore.QVariant(False)).toBool())
self.printNotesCheckBox.setChecked(settings.value(
self.notesCheckBox.setChecked(settings.value(
u'print notes', QtCore.QVariant(False)).toBool())
self.zoomComboBox.setCurrentIndex(settings.value(
u'display size', QtCore.QVariant(0)).toInt()[0])
settings.endGroup()
# Signals
QtCore.QObject.connect(self.printButton,
QtCore.SIGNAL(u'clicked()'), self.printServiceOrder)
QtCore.SIGNAL(u'triggered()'), self.printServiceOrder)
QtCore.QObject.connect(self.closeButton,
QtCore.SIGNAL(u'triggered()'), self.accept)
QtCore.QObject.connect(self.zoomOutButton,
QtCore.SIGNAL(u'clicked()'), self.zoomOut)
QtCore.QObject.connect(self.zoomInButton,
QtCore.SIGNAL(u'clicked()'), self.zoomIn)
QtCore.QObject.connect(self.zoomOriginalButton,
QtCore.SIGNAL(u'clicked()'), self.zoomOriginal)
QtCore.QObject.connect(self.previewWidget,
QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested)
QtCore.QObject.connect(self.serviceTitleLineEdit,
QtCore.SIGNAL(u'textChanged(const QString)'),
self.updatePreviewText)
QtCore.QObject.connect(self.printSlideTextCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText)
QtCore.QObject.connect(self.printNotesCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText)
QtCore.QObject.connect(self.printMetaDataCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText)
QtCore.QObject.connect(self.customNoteEdit,
QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText)
QtCore.QObject.connect(self.cancelButton,
QtCore.SIGNAL(u'clicked()'), self.reject)
QtCore.QObject.connect(self.zoomComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged)
QtCore.QObject.connect(self.plainCopy,
QtCore.SIGNAL(u'triggered()'), self.copyText)
QtCore.QObject.connect(self.htmlCopy,
QtCore.SIGNAL(u'triggered()'), self.copyHtmlText)
self.updatePreviewText()
def toggleOptions(self, checked):
self.optionsWidget.setVisible(checked)
if checked:
left = self.optionsButton.pos().x()
top = self.toolbar.height()
self.optionsWidget.move(left, top)
self.titleLineEdit.setFocus()
else:
self.saveOptions()
self.updatePreviewText()
def updatePreviewText(self):
@ -80,19 +94,28 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
Creates the html text and updates the html of *self.document*.
"""
text = u''
if self.serviceTitleLineEdit.text():
text += u'<h2>%s</h2>' % unicode(self.serviceTitleLineEdit.text())
if self.titleLineEdit.text():
text += u'<h2>%s</h2>' % unicode(self.titleLineEdit.text())
for item in self.serviceManager.serviceItems:
item = item[u'service_item']
# Add the title of the service item.
text += u'<h4><img src="%s" /> %s</h4>' % (item.icon,
text += u'<h3><img src="%s" /> %s</h3>' % (item.icon,
item.get_display_title())
# Add slide text of the service item.
if self.printSlideTextCheckBox.isChecked():
if self.slideTextCheckBox.isChecked():
if item.is_text():
# Add the text of the service item.
verse = None
for slide in item.get_frames():
text += u'<p>' + slide[u'text'] + u'</p>'
if not verse:
text += u'<p>' + slide[u'html']
verse = slide[u'verseTag']
elif verse != slide[u'verseTag']:
text += u'<\p><p>' + slide[u'html']
verse = slide[u'verseTag']
else:
text += u'<br/>' + slide[u'html']
text += u'</p>'
elif item.is_image():
# Add the image names of the service item.
text += u'<ol>'
@ -104,19 +127,19 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
# add footer
text += u'<p>%s</p>' % item.foot_text
# Add service items' notes.
if self.printNotesCheckBox.isChecked():
if self.notesCheckBox.isChecked():
if item.notes:
text += u'<p><b>%s</b></p>%s' % (translate(
text += u'<p><strong>%s</strong></p>%s' % (translate(
'OpenLP.ServiceManager', 'Notes:'),
item.notes.replace(u'\n', u'<br />'))
# Add play length of media files.
if item.is_media() and self.printMetaDataCheckBox.isChecked():
text += u'<p><b>%s</b> %s</p>' % (translate(
if item.is_media() and self.metaDataCheckBox.isChecked():
text += u'<p><strong>%s</strong> %s</p>' % (translate(
'OpenLP.ServiceManager', u'Playing time:'),
unicode(datetime.timedelta(seconds=item.media_length)))
if self.customNoteEdit.toPlainText():
if self.footerTextEdit.toPlainText():
text += u'<h4>%s</h4>%s' % (translate('OpenLP.ServiceManager',
u'Custom Service Notes:'), self.customNoteEdit.toPlainText())
u'Custom Service Notes:'), self.footerTextEdit.toPlainText())
self.document.setHtml(text)
self.previewWidget.updatePreview()
@ -129,6 +152,43 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
"""
self.document.print_(printer)
def displaySizeChanged(self, display):
"""
The Zoom Combo box has changed so set up the size.
"""
if display == ZoomSize.Page:
self.previewWidget.fitInView()
elif display == ZoomSize.Width:
self.previewWidget.fitToWidth()
elif display == ZoomSize.OneHundred:
self.previewWidget.fitToWidth()
self.previewWidget.zoomIn(1)
elif display == ZoomSize.SeventyFive:
self.previewWidget.fitToWidth()
self.previewWidget.zoomIn(0.75)
elif display == ZoomSize.Fifty:
self.previewWidget.fitToWidth()
self.previewWidget.zoomIn(0.5)
elif display == ZoomSize.TwentyFive:
self.previewWidget.fitToWidth()
self.previewWidget.zoomIn(0.25)
settings = QtCore.QSettings()
settings.beginGroup(u'advanced')
settings.setValue(u'display size', QtCore.QVariant(display))
settings.endGroup()
def copyText(self):
"""
Copies the display text to the clipboard as plain text
"""
self.parent.clipboard.setText(self.document.toPlainText())
def copyHtmlText(self):
"""
Copies the display text to the clipboard as Html
"""
self.parent.clipboard.setText(self.document.toHtml())
def printServiceOrder(self):
"""
Called, when the *printButton* is clicked. Opens the *printDialog*.
@ -137,21 +197,38 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
return
# Print the document.
self.document.print_(self.printer)
self.accept()
def zoomIn(self):
"""
Called when *zoomInButton* is clicked.
"""
self.previewWidget.zoomIn()
self.zoom -= 0.1
def zoomOut(self):
"""
Called when *zoomOutButton* is clicked.
"""
self.previewWidget.zoomOut()
self.zoom += 0.1
def accept(self):
def zoomOriginal(self):
"""
Called when *zoomOutButton* is clicked.
"""
self.previewWidget.zoomIn(1 + self.zoom)
self.zoom = 0
def updateTextFormat(self, value):
"""
Called when html copy check box is selected.
"""
if value == QtCore.Qt.Checked:
self.copyTextButton.setText(UiStrings.CopyToHtml)
else:
self.copyTextButton.setText(UiStrings.CopyToText)
def saveOptions(self):
"""
Save the settings and close the dialog.
"""
@ -159,17 +236,9 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
settings = QtCore.QSettings()
settings.beginGroup(u'advanced')
settings.setValue(u'print slide text',
QtCore.QVariant(self.printSlideTextCheckBox.isChecked()))
QtCore.QVariant(self.slideTextCheckBox.isChecked()))
settings.setValue(u'print file meta data',
QtCore.QVariant(self.printMetaDataCheckBox.isChecked()))
QtCore.QVariant(self.metaDataCheckBox.isChecked()))
settings.setValue(u'print notes',
QtCore.QVariant(self.printNotesCheckBox.isChecked()))
QtCore.QVariant(self.notesCheckBox.isChecked()))
settings.endGroup()
# Close the dialog.
return QtGui.QDialog.accept(self)
def reject(self):
"""
Close the dialog, do not print the service and do not save the settings.
"""
return QtGui.QDialog.reject(self)

View File

@ -1,137 +0,0 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate, SpellTextEdit
class Ui_PrintServiceOrderDialog(object):
def setupUi(self, printServiceOrderDialog):
printServiceOrderDialog.setObjectName(u'printServiceOrderDialog')
self.dialogLayout = QtGui.QGridLayout(printServiceOrderDialog)
self.dialogLayout.setObjectName(u'dialogLayout')
self.perviewLayout = QtGui.QVBoxLayout()
self.perviewLayout.setObjectName(u'perviewLayout')
self.previewLabel = QtGui.QLabel(printServiceOrderDialog)
self.previewLabel.setSizePolicy(
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
self.previewLabel.setObjectName(u'previewLabel')
self.perviewLayout.addWidget(self.previewLabel)
self.previewWidget = QtGui.QPrintPreviewWidget(
self.printer, self, QtCore.Qt.Widget)
self.previewWidget.setEnabled(True)
self.previewWidget.setSizePolicy(
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding)
self.previewWidget.setObjectName(u'previewWidget')
# Give the previewWidget a fixed size, to prevent resizing when clicking
# the zoom buttons.
self.previewWidget.setFixedWidth(350)
self.perviewLayout.addWidget(self.previewWidget)
self.dialogLayout.addLayout(self.perviewLayout, 0, 0, 1, 1)
self.settingsLayout = QtGui.QVBoxLayout()
self.settingsLayout.setObjectName(u'settingsLayout')
self.serviceTitleLayout = QtGui.QGridLayout()
self.serviceTitleLayout.setObjectName(u'serviceTitleLayout')
self.serviceTitleLineEdit = QtGui.QLineEdit(printServiceOrderDialog)
self.serviceTitleLineEdit.setSizePolicy(
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)
self.serviceTitleLineEdit.setObjectName(u'serviceTitleLineEdit')
self.serviceTitleLayout.addWidget(self.serviceTitleLineEdit, 1, 1, 1, 1)
self.serviceTitleLabel = QtGui.QLabel(printServiceOrderDialog)
self.serviceTitleLabel.setSizePolicy(
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
self.serviceTitleLabel.setObjectName(u'serviceTitleLabel')
self.serviceTitleLayout.addWidget(self.serviceTitleLabel, 1, 0, 1, 1)
self.settingsLayout.addLayout(self.serviceTitleLayout)
self.printSlideTextCheckBox = QtGui.QCheckBox(printServiceOrderDialog)
self.printSlideTextCheckBox.setObjectName(u'printSlideTextCheckBox')
self.settingsLayout.addWidget(self.printSlideTextCheckBox)
self.printNotesCheckBox = QtGui.QCheckBox(printServiceOrderDialog)
self.printNotesCheckBox.setObjectName(u'printNotesCheckBox')
self.settingsLayout.addWidget(self.printNotesCheckBox)
self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog)
self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox')
self.settingsLayout.addWidget(self.printMetaDataCheckBox)
spacerItem = QtGui.QSpacerItem(20, 40,
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.settingsLayout.addItem(spacerItem)
self.customNotesLabel = QtGui.QLabel(self)
self.customNotesLabel.setObjectName(u'customNotesLabel')
self.settingsLayout.addWidget(self.customNotesLabel)
self.customNoteEdit = SpellTextEdit(self)
self.customNoteEdit.setObjectName(u'customNoteEdit')
self.settingsLayout.addWidget(self.customNoteEdit)
self.dialogLayout.addLayout(self.settingsLayout, 0, 3, 1, 1)
self.buttonLayout = QtGui.QHBoxLayout()
self.buttonLayout.setObjectName(u'buttonLayout')
spacerItem = QtGui.QSpacerItem(40, 20,
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.buttonLayout.addItem(spacerItem)
self.cancelButton = QtGui.QPushButton(printServiceOrderDialog)
self.cancelButton.setObjectName(u'cancelButton')
self.buttonLayout.addWidget(self.cancelButton)
self.printButton = QtGui.QPushButton(printServiceOrderDialog)
self.printButton.setObjectName(u'printButton')
self.buttonLayout.addWidget(self.printButton)
self.dialogLayout.addLayout(self.buttonLayout, 1, 3, 1, 1)
self.zoomButtonLayout = QtGui.QHBoxLayout()
self.zoomButtonLayout.setObjectName(u'zoomButtonLayout')
spacerItem = QtGui.QSpacerItem(40, 20,
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.zoomButtonLayout.addItem(spacerItem)
self.zoomOutButton = QtGui.QToolButton(printServiceOrderDialog)
self.zoomOutButton.setIcon(
build_icon(u':/general/general_zoom_out.png'))
self.zoomOutButton.setObjectName(u'zoomOutButton')
self.zoomButtonLayout.addWidget(self.zoomOutButton)
self.zoomInButton = QtGui.QToolButton(printServiceOrderDialog)
self.zoomInButton.setIcon(build_icon(u':/general/general_zoom_in.png'))
self.zoomInButton.setObjectName(u'zoomInButton')
self.zoomButtonLayout.addWidget(self.zoomInButton)
self.dialogLayout.addLayout(self.zoomButtonLayout, 1, 0, 1, 1)
self.retranslateUi(printServiceOrderDialog)
QtCore.QMetaObject.connectSlotsByName(printServiceOrderDialog)
def retranslateUi(self, printServiceOrderDialog):
printServiceOrderDialog.setWindowTitle(
translate('OpenLP.PrintServiceOrderForm', 'Print Service Order'))
self.previewLabel.setText(
translate('OpenLP.ServiceManager', '<b>Preview:</b>'))
self.printSlideTextCheckBox.setText(translate(
'OpenLP.PrintServiceOrderForm', 'Include slide text if available'))
self.printNotesCheckBox.setText(translate(
'OpenLP.PrintServiceOrderForm', 'Include service item notes'))
self.printMetaDataCheckBox.setText(
translate('OpenLP.PrintServiceOrderForm',
'Include play length of media items'))
self.serviceTitleLabel.setText(translate(
'OpenLP.PrintServiceOrderForm', 'Title:'))
self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager',
'Service Order Sheet'))
self.printButton.setText(translate('OpenLP.ServiceManager', 'Print'))
self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel'))
self.customNotesLabel.setText(
translate('OpenLP.ServiceManager', '<b>Custom Service Notes:</b>'))

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -71,7 +71,7 @@ class ScreenList(object):
"""
Set up the current screen dimensions
"""
log.debug(u'set_current_display %s', number, )
log.debug(u'set_current_display %s', number)
if number + 1 > self.display_count:
self.current = self.screen_list[0]
self.override = copy.deepcopy(self.current)
@ -99,4 +99,4 @@ class ScreenList(object):
user wants to use the correct screen attributes
"""
log.debug(u'reset_current_display')
self.set_current_display(self.current_display)
self.set_current_display(self.current_display)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -33,11 +33,11 @@ log = logging.getLogger(__name__)
from PyQt4 import QtCore, QtGui
from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \
Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \
ThemeLevel
Receiver, build_icon, ItemCapabilities, SettingsManager, translate
from openlp.core.lib.theme import ThemeLevel
from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm
from openlp.core.ui.printserviceorderform import PrintServiceOrderForm
from openlp.core.ui.printserviceform import PrintServiceForm
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
split_filename
@ -107,8 +107,7 @@ class ServiceManager(QtGui.QWidget):
translate('OpenLP.ServiceManager', 'Save this service'),
self.saveFile)
self.toolbar.addSeparator()
self.themeLabel = QtGui.QLabel(translate('OpenLP.ServiceManager',
'Theme:'), self)
self.themeLabel = QtGui.QLabel(u'%s:' % UiStrings.Theme, self)
self.themeLabel.setMargin(3)
self.themeLabel.setObjectName(u'themeLabel')
self.toolbar.addToolbarWidget(u'ThemeLabel', self.themeLabel)
@ -1062,8 +1061,8 @@ class ServiceManager(QtGui.QWidget):
if self.serviceItems[item][u'service_item']\
.is_capable(ItemCapabilities.AllowsEdit):
Receiver.send_message(u'%s_edit' %
self.serviceItems[item][u'service_item'].name.lower(), u'L:%s' %
self.serviceItems[item][u'service_item'].edit_id )
self.serviceItems[item][u'service_item'].name.lower(),
u'L:%s' % self.serviceItems[item][u'service_item'].edit_id)
def findServiceItem(self):
"""
@ -1208,5 +1207,5 @@ class ServiceManager(QtGui.QWidget):
"""
Print a Service Order Sheet.
"""
settingDialog = PrintServiceOrderForm(self.mainwindow, self)
settingDialog = PrintServiceForm(self.mainwindow, self)
settingDialog.exec_()

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -53,4 +53,4 @@ class ServiceNoteForm(QtGui.QDialog):
def retranslateUi(self):
self.setWindowTitle(
translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))
translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -31,7 +31,7 @@ import logging
from PyQt4 import QtGui
from openlp.core.lib import Receiver
from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab, DisplayTagTab
from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab
from settingsdialog import Ui_SettingsDialog
log = logging.getLogger(__name__)
@ -47,17 +47,14 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
# General tab
self.generalTab = GeneralTab(screens)
self.addTab(u'General', self.generalTab)
generalTab = GeneralTab(screens)
self.addTab(u'General', generalTab)
# Themes tab
self.themesTab = ThemesTab(mainWindow)
self.addTab(u'Themes', self.themesTab)
themesTab = ThemesTab(mainWindow)
self.addTab(u'Themes', themesTab)
# Advanced tab
self.advancedTab = AdvancedTab()
self.addTab(u'Advanced', self.advancedTab)
# Edit Display Tags tab
self.displayTagTab = DisplayTagTab()
self.addTab(u'Display Tags', self.displayTagTab)
advancedTab = AdvancedTab()
self.addTab(u'Advanced', advancedTab)
def addTab(self, name, tab):
"""
@ -71,9 +68,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
Add a tab to the form at a specific location
"""
log.debug(u'Inserting %s tab' % tab.tabTitle)
# 15 : There are 4 tables currently and locations starts at -10
# 14 : There are 3 tables currently and locations starts at -10
self.settingsTabWidget.insertTab(
location + 15, tab, tab.tabTitleVisible)
location + 14, tab, tab.tabTitleVisible)
def removeTab(self, tab):
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -78,7 +78,7 @@ class Ui_ShortcutListDialog(object):
translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts'))
self.treeWidget.setHeaderLabels([
translate('OpenLP.ShortcutListDialog', 'Action'),
translate('OpenLP.ShortcutListDialog', 'Shortcut'),
translate('OpenLP.ShortcutListDialog', 'Shortcut'),
translate('OpenLP.ShortcutListDialog', 'Alternate')])
self.defaultButton.setText(
translate('OpenLP.ShortcutListDialog', 'Default: %s'))

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -101,7 +101,8 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
else:
shortcutText = action.shortcut().toString()
alternateText = u''
actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText, alternateText])
actionItem = QtGui.QTreeWidgetItem(
[actionText, shortcutText, alternateText])
actionItem.setIcon(0, action.icon())
item.addChild(actionItem)
item.setExpanded(True)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -191,8 +191,7 @@ class SlideController(QtGui.QWidget):
self.delaySpinBox.setMinimum(1)
self.delaySpinBox.setMaximum(180)
self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox)
self.delaySpinBox.setSuffix(translate('OpenLP.SlideController',
's'))
self.delaySpinBox.setSuffix(UiStrings.S)
self.delaySpinBox.setToolTip(translate('OpenLP.SlideController',
'Delay between slides in seconds'))
else:
@ -603,14 +602,15 @@ class SlideController(QtGui.QWidget):
slideHeight = 0
if self.serviceItem.is_text():
if frame[u'verseTag']:
bits = frame[u'verseTag'].split(u':')
tag = u'%s\n%s' % (bits[0][0], bits[1][0:] )
tag1 = u'%s%s' % (bits[0][0], bits[1][0:] )
row = tag
# These tags are already translated.
verse_def = frame[u'verseTag']
verse_def = u'%s%s' % (verse_def[0].upper(), verse_def[1:])
two_line_def = u'%s\n%s' % (verse_def[0], verse_def[1:])
row = two_line_def
if self.isLive:
if tag1 not in self.slideList:
self.slideList[tag1] = framenumber
self.songMenu.menu().addAction(tag1,
if verse_def not in self.slideList:
self.slideList[verse_def] = framenumber
self.songMenu.menu().addAction(verse_def,
self.onSongBarHandler)
else:
row += 1

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
from openlp.core.lib.ui import create_accept_reject_button_box
from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box
class Ui_StartTimeDialog(object):
def setupUi(self, StartTimeDialog):
@ -65,6 +65,6 @@ class Ui_StartTimeDialog(object):
self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:'))
self.hourSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'h'))
self.minuteSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'm'))
self.secondSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 's'))
self.secondSpinBox.setSuffix(UiStrings.S)
self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:'))
self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:'))

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -29,8 +29,8 @@ import os
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \
Receiver
from openlp.core.lib import Receiver, translate
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType
from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.utils import get_images_filter
from themewizard import Ui_ThemeWizard
@ -204,7 +204,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
# Do not trigger on start up
if self.currentPage != self.welcomePage:
self.updateTheme()
frame = self.thememanager.generateImage(self.theme, True)
self.thememanager.generateImage(self.theme, True)
def updateLinesText(self, lines):
"""
@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
'Edit Theme - %s')) % self.theme.theme_name)
self.next()
else:
self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme'))
self.setWindowTitle(UiStrings.NewTheme)
return QtGui.QWizard.exec_(self)
def initializePage(self, id):

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -32,10 +32,11 @@ import logging
from xml.etree.ElementTree import ElementTree, XML
from PyQt4 import QtCore, QtGui
from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \
build_icon, Receiver, SettingsManager, translate, check_item_selected, \
BackgroundType, BackgroundGradientType, check_directory_exists, \
VerticalType
from openlp.core.lib import OpenLPToolbar, get_text_file_string, build_icon, \
Receiver, SettingsManager, translate, check_item_selected, \
check_directory_exists
from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, \
BackgroundGradientType
from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.theme import Theme
from openlp.core.ui import FileRenameForm, ThemeForm
@ -62,8 +63,7 @@ class ThemeManager(QtGui.QWidget):
self.layout.setMargin(0)
self.layout.setObjectName(u'layout')
self.toolbar = OpenLPToolbar(self)
self.toolbar.addToolbarButton(
translate('OpenLP.ThemeManager', 'New Theme'),
self.toolbar.addToolbarButton(UiStrings.NewTheme,
u':/themes/theme_new.png',
translate('OpenLP.ThemeManager', 'Create a new theme.'),
self.onAddTheme)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -26,7 +26,8 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate
from openlp.core.lib import SettingsTab, Receiver, translate
from openlp.core.lib.theme import ThemeLevel
from openlp.core.lib.ui import UiStrings
class ThemesTab(SettingsTab):
@ -199,7 +200,7 @@ class ThemesTab(SettingsTab):
"""
Utility method to update the global theme preview image.
"""
image = self.parent.ThemeManagerContents.getPreviewImage(
image = self.parent.themeManagerContents.getPreviewImage(
self.global_theme)
preview = QtGui.QPixmap(unicode(image))
if not preview.isNull():

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -27,7 +27,9 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, build_icon
from openlp.core.lib.ui import add_welcome_page, create_valign_combo
from openlp.core.lib.theme import HorizontalType, BackgroundType, \
BackgroundGradientType
from openlp.core.lib.ui import UiStrings, add_welcome_page, create_valign_combo
class Ui_ThemeWizard(object):
def setupUi(self, themeWizard):
@ -417,12 +419,12 @@ class Ui_ThemeWizard(object):
'according to the parameters below.'))
self.backgroundLabel.setText(
translate('OpenLP.ThemeWizard', 'Background type:'))
self.backgroundComboBox.setItemText(0,
self.backgroundComboBox.setItemText(BackgroundType.Solid,
translate('OpenLP.ThemeWizard', 'Solid Color'))
self.backgroundComboBox.setItemText(1,
self.backgroundComboBox.setItemText(BackgroundType.Gradient,
translate('OpenLP.ThemeWizard', 'Gradient'))
self.backgroundComboBox.setItemText(2,
translate('OpenLP.ThemeWizard', 'Image'))
self.backgroundComboBox.setItemText(
BackgroundType.Image, UiStrings.Image)
self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
self.gradientStartLabel.setText(
translate(u'OpenLP.ThemeWizard', 'Starting color:'))
@ -430,17 +432,17 @@ class Ui_ThemeWizard(object):
translate(u'OpenLP.ThemeWizard', 'Ending color:'))
self.gradientTypeLabel.setText(
translate('OpenLP.ThemeWizard', 'Gradient:'))
self.gradientComboBox.setItemText(0,
self.gradientComboBox.setItemText(BackgroundGradientType.Horizontal,
translate('OpenLP.ThemeWizard', 'Horizontal'))
self.gradientComboBox.setItemText(1,
self.gradientComboBox.setItemText(BackgroundGradientType.Vertical,
translate('OpenLP.ThemeWizard', 'Vertical'))
self.gradientComboBox.setItemText(2,
self.gradientComboBox.setItemText(BackgroundGradientType.Circular,
translate('OpenLP.ThemeWizard', 'Circular'))
self.gradientComboBox.setItemText(3,
self.gradientComboBox.setItemText(BackgroundGradientType.LeftTop,
translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right'))
self.gradientComboBox.setItemText(4,
self.gradientComboBox.setItemText(BackgroundGradientType.LeftBottom,
translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right'))
self.imageLabel.setText(translate('OpenLP.ThemeWizard', 'Image:'))
self.imageLabel.setText(u'%s:' % UiStrings.Image)
self.mainAreaPage.setTitle(
translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
self.mainAreaPage.setSubTitle(
@ -449,17 +451,17 @@ class Ui_ThemeWizard(object):
self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
self.mainSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
self.lineSpacingLabel.setText(
translate('OpenLP.ThemeWizard', 'Line Spacing:'))
self.lineSpacingSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
self.lineSpacingSpinBox.setSuffix(UiStrings.FontSizePtUnit)
self.outlineCheckBox.setText(
translate('OpenLP.ThemeWizard', '&Outline:'))
self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.outlineSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
self.outlineSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:'))
self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
self.shadowSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold'))
self.mainItalicsCheckBox.setText(
translate('OpenLP.ThemeWizard', 'Italic'))
@ -471,7 +473,7 @@ class Ui_ThemeWizard(object):
self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.footerSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
self.footerSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
self.alignmentPage.setTitle(
translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
self.alignmentPage.setSubTitle(
@ -479,11 +481,11 @@ class Ui_ThemeWizard(object):
'formatting information to be defined'))
self.horizontalLabel.setText(
translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
self.horizontalComboBox.setItemText(0,
self.horizontalComboBox.setItemText(HorizontalType.Left,
translate('OpenLP.ThemeWizard', 'Left'))
self.horizontalComboBox.setItemText(1,
self.horizontalComboBox.setItemText(HorizontalType.Right,
translate('OpenLP.ThemeWizard', 'Right'))
self.horizontalComboBox.setItemText(2,
self.horizontalComboBox.setItemText(HorizontalType.Center,
translate('OpenLP.ThemeWizard', 'Center'))
self.transitionsLabel.setText(
translate('OpenLP.ThemeWizard', 'Transitions:'))

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -31,11 +31,51 @@ import os
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, Receiver, SettingsManager
from openlp.core.lib import build_icon, Receiver, SettingsManager, translate
from openlp.core.lib.ui import UiStrings, add_welcome_page
log = logging.getLogger(__name__)
class WizardStrings(object):
"""
Provide standard strings for wizards to use.
"""
# Applications/Formats we import from or export to. These get used in
# multiple places but do not need translating unless you find evidence of
# the writers translating their own product name.
CCLI = u'CCLI/SongSelect'
CSV = u'CSV'
EW = u'EasyWorship'
ES = u'EasiSlides'
FP = u'Foilpresenter'
OL = u'OpenLyrics'
OS = u'OpenSong'
OSIS = u'OSIS'
SB = u'SongBeamer'
SoF = u'Songs of Fellowship'
SSP = u'SongShow Plus'
WoW = u'Words of Worship'
# These strings should need a good reason to be retranslated elsewhere.
FinishedImport = translate('OpenLP.Ui', 'Finished import.')
FormatLabel = translate('OpenLP.Ui', 'Format:')
HeaderStyle = u'<span style="font-size:14pt; font-weight:600;">%s</span>'
Importing = translate('OpenLP.Ui', 'Importing')
ImportingType = unicode(translate('OpenLP.Ui', 'Importing "%s"...'))
ImportSelect = translate('OpenLP.Ui', 'Select Import Source')
ImportSelectLong = unicode(translate('OpenLP.Ui',
'Select the import format and the location to import from.'))
NoSqlite = translate('OpenLP.Ui', 'The openlp.org 1.x importer has been '
'disabled due to a missing Python module. If you want to use this '
'importer, you will need to install the "python-sqlite" '
'module.')
OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File'))
PercentSymbolFormat = unicode(translate('OpenLP.Ui', '%p%'))
Ready = translate('OpenLP.Ui', 'Ready.')
StartingImport = translate('OpenLP.Ui', 'Starting import...')
YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at '
'least one %s file to import from.', 'A file type e.g. OpenSong'))
class OpenLPWizard(QtGui.QWizard):
"""
Generic OpenLP wizard to provide generic functionality and a unified look
@ -43,6 +83,7 @@ class OpenLPWizard(QtGui.QWizard):
"""
def __init__(self, parent, plugin, name, image):
QtGui.QWizard.__init__(self, parent)
self.plugin = plugin
self.setObjectName(name)
self.openIcon = build_icon(u':/general/general_open.png')
self.deleteIcon = build_icon(u':/general/general_delete.png')
@ -50,7 +91,6 @@ class OpenLPWizard(QtGui.QWizard):
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
self.setupUi(image)
self.registerFields()
self.plugin = plugin
self.customInit()
self.customSignals()
QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'),

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -387,7 +387,7 @@ def get_uno_command():
if UNO_CONNECTION_TYPE == u'pipe':
CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"'
else:
CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"'
CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"'
return u'%s %s %s' % (COMMAND, OPTIONS, CONNECTION)
def get_uno_instance(resolver):

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -25,4 +25,4 @@
###############################################################################
"""
The :mod:`plugins` module provides all the project produced plugins
"""
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -26,4 +26,4 @@
"""
The :mod:`alerts` module provides the Alerts plugin for producing impromptu
on-screen announcements during a service.
"""
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -24,4 +24,4 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
from alertform import AlertForm
from alertform import AlertForm

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -25,4 +25,4 @@
###############################################################################
from alertsmanager import AlertsManager
from alertstab import AlertsTab
from alertstab import AlertsTab

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -109,12 +109,10 @@ class AlertsTab(SettingsTab):
translate('AlertsPlugin.AlertsTab', 'Background color:'))
self.FontSizeLabel.setText(
translate('AlertsPlugin.AlertsTab', 'Font size:'))
self.FontSizeSpinBox.setSuffix(
translate('AlertsPlugin.AlertsTab', 'pt'))
self.FontSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
self.TimeoutLabel.setText(
translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
self.TimeoutSpinBox.setSuffix(
translate('AlertsPlugin.AlertsTab', 's'))
self.TimeoutSpinBox.setSuffix(UiStrings.S)
self.PreviewGroupBox.setTitle(UiStrings.Preview)
self.FontPreview.setText(UiStrings.OLPV2)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -55,4 +55,4 @@ def init_schema(url):
mapper(AlertItem, alerts_table)
metadata.create_all(checkfirst=True)
return session
return session

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -26,4 +26,4 @@
"""
The :mod:`bibles` module provides the Bible plugin to enable OpenLP to display
scripture.
"""
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -53,4 +53,4 @@ from the .ui files later if necessary.
from bibleimportform import BibleImportForm
__all__ = ['BibleImportForm']
__all__ = ['BibleImportForm']

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -35,8 +35,8 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, translate
from openlp.core.lib.db import delete_database
from openlp.core.lib.ui import critical_error_message_box
from openlp.core.ui.wizard import OpenLPWizard
from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
from openlp.core.utils import AppLocation, string_is_unicode
from openlp.plugins.bibles.lib.manager import BibleFormat
@ -51,18 +51,7 @@ class WebDownload(object):
BibleGateway = 1
Bibleserver = 2
Names = {
0: u'Crosswalk',
1: u'BibleGateway',
2: u'Bibleserver'
}
@classmethod
def get_name(cls, name):
"""
Get the web bible type name.
"""
return cls.Names[name]
Names = [u'Crosswalk', u'BibleGateway', u'Bibleserver']
class BibleImportForm(OpenLPWizard):
@ -363,32 +352,22 @@ class BibleImportForm(OpenLPWizard):
"""
self.setWindowTitle(
translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard'))
self.titleLabel.setText(
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
translate('BiblesPlugin.ImportWizardForm',
'Welcome to the Bible Import Wizard'))
self.titleLabel.setText(WizardStrings.HeaderStyle %
translate('OpenLP.Ui', 'Welcome to the Bible Import Wizard'))
self.informationLabel.setText(
translate('BiblesPlugin.ImportWizardForm',
'This wizard will help you to import Bibles from a '
'variety of formats. Click the next button below to start the '
'process by selecting a format to import from.'))
self.selectPage.setTitle(translate('BiblesPlugin.ImportWizardForm',
'Select Import Source'))
self.selectPage.setSubTitle(
translate('BiblesPlugin.ImportWizardForm',
'Select the import format, and where to import from.'))
self.formatLabel.setText(
translate('BiblesPlugin.ImportWizardForm', 'Format:'))
self.formatComboBox.setItemText(0,
translate('BiblesPlugin.ImportWizardForm', 'OSIS'))
self.formatComboBox.setItemText(1,
translate('BiblesPlugin.ImportWizardForm', 'CSV'))
self.formatComboBox.setItemText(2,
translate('BiblesPlugin.ImportWizardForm', 'OpenSong'))
self.formatComboBox.setItemText(3,
'This wizard will help you to import Bibles from a variety of '
'formats. Click the next button below to start the process by '
'selecting a format to import from.'))
self.selectPage.setTitle(WizardStrings.ImportSelect)
self.selectPage.setSubTitle(WizardStrings.ImportSelectLong)
self.formatLabel.setText(WizardStrings.FormatLabel)
self.formatComboBox.setItemText(BibleFormat.OSIS, WizardStrings.OSIS)
self.formatComboBox.setItemText(BibleFormat.CSV, WizardStrings.CSV)
self.formatComboBox.setItemText(BibleFormat.OpenSong, WizardStrings.OS)
self.formatComboBox.setItemText(BibleFormat.WebDownload,
translate('BiblesPlugin.ImportWizardForm', 'Web Download'))
self.formatComboBox.setItemText(4,
translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x'))
self.formatComboBox.setItemText(BibleFormat.OpenLP1, UiStrings.OLPV1)
self.openlp1FileLabel.setText(
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
self.osisFileLabel.setText(
@ -403,11 +382,11 @@ class BibleImportForm(OpenLPWizard):
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
self.webSourceLabel.setText(
translate('BiblesPlugin.ImportWizardForm', 'Location:'))
self.webSourceComboBox.setItemText(0,
self.webSourceComboBox.setItemText(WebDownload.Crosswalk,
translate('BiblesPlugin.ImportWizardForm', 'Crosswalk'))
self.webSourceComboBox.setItemText(1,
self.webSourceComboBox.setItemText(WebDownload.BibleGateway,
translate('BiblesPlugin.ImportWizardForm', 'BibleGateway'))
self.webSourceComboBox.setItemText(2,
self.webSourceComboBox.setItemText(WebDownload.Bibleserver,
translate('BiblesPlugin.ImportWizardForm', 'Bibleserver'))
self.webTranslationLabel.setText(
translate('BiblesPlugin.ImportWizardForm', 'Bible:'))
@ -435,19 +414,13 @@ class BibleImportForm(OpenLPWizard):
translate('BiblesPlugin.ImportWizardForm', 'Copyright:'))
self.permissionsLabel.setText(
translate('BiblesPlugin.ImportWizardForm', 'Permissions:'))
self.progressPage.setTitle(
translate('BiblesPlugin.ImportWizardForm', 'Importing'))
self.progressPage.setTitle(WizardStrings.Importing)
self.progressPage.setSubTitle(
translate('BiblesPlugin.ImportWizardForm',
'Please wait while your Bible is imported.'))
self.progressLabel.setText(
translate('BiblesPlugin.ImportWizardForm', 'Ready.'))
self.progressLabel.setText(WizardStrings.Ready)
self.progressBar.setFormat(u'%p%')
self.openlp1DisabledLabel.setText(
translate('BiblesPlugin.ImportWizardForm', 'The openlp.org 1.x '
'importer has been disabled due to a missing Python module. If '
'you want to use this importer, you will need to install the '
'"python-sqlite" module.'))
self.openlp1DisabledLabel.setText(WizardStrings.NoSqlite)
# Align all QFormLayouts towards each other.
labelWidth = max(self.formatLabel.minimumSizeHint().width(),
self.osisFileLabel.minimumSizeHint().width(),
@ -468,37 +441,28 @@ class BibleImportForm(OpenLPWizard):
elif self.currentPage() == self.selectPage:
if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS:
if not self.field(u'osis_location').toString():
critical_error_message_box(
translate('BiblesPlugin.ImportWizardForm',
'Invalid Bible Location'),
translate('BiblesPlugin.ImportWizardForm',
'You need to specify a file to import your '
'Bible from.'))
critical_error_message_box(UiStrings.NFSs,
WizardStrings.YouSpecifyFile % WizardStrings.OSIS)
self.osisFileEdit.setFocus()
return False
elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV:
if not self.field(u'csv_testamentsfile').toString():
answer = critical_error_message_box(translate(
'BiblesPlugin.ImportWizardForm', 'No Testaments File'),
answer = critical_error_message_box(UiStrings.NFSs,
translate('BiblesPlugin.ImportWizardForm',
'You have not specified a testaments file. Do you '
'want to proceed with the import?'), question=True)
if answer == QtGui.QMessageBox.No:
self.csvTestamentsEdit.setFocus()
return False
elif not self.field(u'csv_booksfile').toString():
critical_error_message_box(
translate('BiblesPlugin.ImportWizardForm',
'Invalid Books File'),
if not self.field(u'csv_booksfile').toString():
critical_error_message_box(UiStrings.NFSs,
translate('BiblesPlugin.ImportWizardForm',
'You need to specify a file with books of '
'the Bible to use in the import.'))
self.csvBooksEdit.setFocus()
return False
elif not self.field(u'csv_versefile').toString():
critical_error_message_box(
translate('BiblesPlugin.ImportWizardForm',
'Invalid Verse File'),
critical_error_message_box(UiStrings.NFSs,
translate('BiblesPlugin.ImportWizardForm',
'You need to specify a file of Bible '
'verses to import.'))
@ -507,22 +471,14 @@ class BibleImportForm(OpenLPWizard):
elif self.field(u'source_format').toInt()[0] == \
BibleFormat.OpenSong:
if not self.field(u'opensong_file').toString():
critical_error_message_box(
translate('BiblesPlugin.ImportWizardForm',
'Invalid OpenSong Bible'),
translate('BiblesPlugin.ImportWizardForm',
'You need to specify an OpenSong Bible '
'file to import.'))
critical_error_message_box(UiStrings.NFSs,
WizardStrings.YouSpecifyFile % WizardStrings.OS)
self.openSongFileEdit.setFocus()
return False
elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenLP1:
if not self.field(u'openlp1_location').toString():
critical_error_message_box(
translate('BiblesPlugin.ImportWizardForm',
'Invalid Bible Location'),
translate('BiblesPlugin.ImportWizardForm',
'You need to specify a file to import your '
'Bible from.'))
critical_error_message_box(UiStrings.NFSs,
WizardStrings.YouSpecifyFile % UiStrings.OLPV1)
self.openlp1FileEdit.setFocus()
return False
return True
@ -531,17 +487,13 @@ class BibleImportForm(OpenLPWizard):
license_copyright = \
unicode(self.field(u'license_copyright').toString())
if not license_version:
critical_error_message_box(
translate('BiblesPlugin.ImportWizardForm',
'Empty Version Name'),
critical_error_message_box(UiStrings.EmptyField,
translate('BiblesPlugin.ImportWizardForm',
'You need to specify a version name for your Bible.'))
self.versionNameEdit.setFocus()
return False
elif not license_copyright:
critical_error_message_box(
translate('BiblesPlugin.ImportWizardForm',
'Empty Copyright'),
critical_error_message_box(UiStrings.EmptyField,
translate('BiblesPlugin.ImportWizardForm',
'You need to set a copyright for your Bible. '
'Bibles in the Public Domain need to be marked as such.'))
@ -576,24 +528,22 @@ class BibleImportForm(OpenLPWizard):
"""
Show the file open dialog for the OSIS file.
"""
self.getFileName(
translate('BiblesPlugin.ImportWizardForm', 'Open OSIS File'),
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OSIS,
self.osisFileEdit)
def onCsvTestamentsBrowseButtonClicked(self):
"""
Show the file open dialog for the testaments CSV file.
"""
self.getFileName(translate('BiblesPlugin.ImportWizardForm',
'Open Testaments CSV File'), self.csvTestamentsEdit, u'%s (*.csv)'
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV,
self.csvTestamentsEdit, u'%s (*.csv)'
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
def onCsvBooksBrowseButtonClicked(self):
"""
Show the file open dialog for the books CSV file.
"""
self.getFileName(
translate('BiblesPlugin.ImportWizardForm', 'Open Books CSV File'),
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV,
self.csvBooksEdit, u'%s (*.csv)'
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
@ -601,27 +551,24 @@ class BibleImportForm(OpenLPWizard):
"""
Show the file open dialog for the verses CSV file.
"""
self.getFileName(translate('BiblesPlugin.ImportWizardForm',
'Open Verses CSV File'), self.csvVersesEdit, u'%s (*.csv)'
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV,
self.csvVersesEdit, u'%s (*.csv)'
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
def onOpenSongBrowseButtonClicked(self):
"""
Show the file open dialog for the OpenSong file.
"""
self.getFileName(
translate('BiblesPlugin.ImportWizardForm', 'Open OpenSong Bible'),
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OS,
self.openSongFileEdit)
def onOpenlp1BrowseButtonClicked(self):
"""
Show the file open dialog for the openlp.org 1.x file.
"""
self.getFileName(
translate('BiblesPlugin.ImportWizardForm',
'Open openlp.org 1.x Bible'), self.openlp1FileEdit,
u'%s (*.bible)' % translate('BiblesPlugin.ImportWizardForm',
'openlp.org 1.x bible'))
self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV1,
self.openlp1FileEdit, u'%s (*.bible)' %
translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x bible'))
def registerFields(self):
"""
@ -722,7 +669,7 @@ class BibleImportForm(OpenLPWizard):
self.web_bible_list[download_type][ver] = name.strip()
except IOError:
log.exception(u'%s resources missing' %
WebDownload.get_name(download_type))
WebDownload.Names[download_type])
finally:
if books_file:
books_file.close()
@ -738,8 +685,7 @@ class BibleImportForm(OpenLPWizard):
'BiblesPlugin.ImportWizardForm',
'Starting Registering bible...'))
else:
self.progressLabel.setText(translate(
'BiblesPlugin.ImportWizardForm', 'Starting import...'))
self.progressLabel.setText(WizardStrings.StartingImport)
Receiver.send_message(u'openlp_process_events')
def performWizard(self):
@ -777,18 +723,10 @@ class BibleImportForm(OpenLPWizard):
self.progressBar.setMaximum(1)
download_location = self.field(u'web_location').toInt()[0]
bible_version = unicode(self.webTranslationComboBox.currentText())
if download_location == WebDownload.Crosswalk:
bible = \
self.web_bible_list[WebDownload.Crosswalk][bible_version]
elif download_location == WebDownload.BibleGateway:
bible = \
self.web_bible_list[WebDownload.BibleGateway][bible_version]
elif download_location == WebDownload.Bibleserver:
bible = \
self.web_bible_list[WebDownload.Bibleserver][bible_version]
bible = self.web_bible_list[download_location][bible_version]
importer = self.manager.import_bible(
BibleFormat.WebDownload, name=license_version,
download_source=WebDownload.get_name(download_location),
download_source=WebDownload.Names[download_location],
download_name=bible,
proxy_server=unicode(self.field(u'proxy_server').toString()),
proxy_username=\
@ -811,9 +749,9 @@ class BibleImportForm(OpenLPWizard):
'bible. Please note, that verses will be downloaded on\n'
'demand and thus an internet connection is required.'))
else:
self.progressLabel.setText(translate(
'BiblesPlugin.ImportWizardForm', 'Finished import.'))
self.progressLabel.setText(WizardStrings.FinishedImport)
else:
self.progressLabel.setText(translate(
'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.'))
del self.manager.db_cache[importer.name]
delete_database(self.plugin.settingsSection, importer.file)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -32,6 +32,25 @@ import re
log = logging.getLogger(__name__)
class LayoutStyle(object):
"""
An enumeration for bible screen layout styles.
"""
VersePerSlide = 0
VersePerLine = 1
Continuous = 2
class DisplayStyle(object):
"""
An enumeration for bible text bracket display styles.
"""
NoBrackets = 0
Round = 1
Curly = 2
Square = 3
def get_reference_match(match_type):
"""
Provides the regexes and matches to use while parsing strings for bible
@ -81,37 +100,37 @@ def parse_reference(reference):
this::
(book, chapter, from_verse, to_verse)
For example::
[(u'John', 3, 16, 18), (u'John', 4, 1, 1)]
**Reference string details:**
Each reference starts with the book name and a chapter number. These are
both mandatory.
* ``John 3`` refers to Gospel of John chapter 3
A reference range can be given after a range separator.
* ``John 3-5`` refers to John chapters 3 to 5
Single verses can be addressed after a verse separator.
* ``John 3:16`` refers to John chapter 3 verse 16
* ``John 3:16-4:3`` refers to John chapter 3 verse 16 to chapter 4 verse 3
After a verse reference all further single values are treat as verse in
the last selected chapter.
* ``John 3:16-18`` refers to John chapter 3 verses 16 to 18
After a list separator it is possible to refer to additional verses. They
are build analog to the first ones. This way it is possible to define each
number of verse references. It is not possible to refer to verses in
additional books.
* ``John 3:16,18`` refers to John chapter 3 verses 16 and 18
* ``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 and 20
* ``John 3:16-18,4:1`` refers to John chapter 3 verses 16 to 18 and

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -29,6 +29,7 @@ import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, SettingsTab, translate
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle
log = logging.getLogger(__name__)
@ -122,19 +123,19 @@ class BiblesTab(SettingsTab):
translate('BiblesPlugin.BiblesTab', 'Display style:'))
self.BibleThemeLabel.setText(
translate('BiblesPlugin.BiblesTab', 'Bible theme:'))
self.LayoutStyleComboBox.setItemText(0,
self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerSlide,
translate('BiblesPlugin.BiblesTab', 'Verse Per Slide'))
self.LayoutStyleComboBox.setItemText(1,
self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerLine,
translate('BiblesPlugin.BiblesTab', 'Verse Per Line'))
self.LayoutStyleComboBox.setItemText(2,
self.LayoutStyleComboBox.setItemText(LayoutStyle.Continuous,
translate('BiblesPlugin.BiblesTab', 'Continuous'))
self.DisplayStyleComboBox.setItemText(0,
self.DisplayStyleComboBox.setItemText(DisplayStyle.NoBrackets,
translate('BiblesPlugin.BiblesTab', 'No Brackets'))
self.DisplayStyleComboBox.setItemText(1,
self.DisplayStyleComboBox.setItemText(DisplayStyle.Round,
translate('BiblesPlugin.BiblesTab', '( And )'))
self.DisplayStyleComboBox.setItemText(2,
self.DisplayStyleComboBox.setItemText(DisplayStyle.Curly,
translate('BiblesPlugin.BiblesTab', '{ And }'))
self.DisplayStyleComboBox.setItemText(3,
self.DisplayStyleComboBox.setItemText(DisplayStyle.Square,
translate('BiblesPlugin.BiblesTab', '[ And ]'))
self.ChangeNoteLabel.setText(translate('BiblesPlugin.BiblesTab',
'Note:\nChanges do not affect verses already in the service.'))

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -94,8 +94,6 @@ class CSVBible(BibleDB):
self.testamentsfile = None
self.booksfile = kwargs[u'booksfile']
self.versesfile = kwargs[u'versefile']
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
def setup_testaments(self):
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -33,7 +33,7 @@ from sqlalchemy import Column, ForeignKey, or_, Table, types
from sqlalchemy.orm import class_mapper, mapper, relation
from sqlalchemy.orm.exc import UnmappedClassError
from openlp.core.lib import translate
from openlp.core.lib import Receiver, translate
from openlp.core.lib.db import BaseModel, init_db, Manager
from openlp.core.lib.ui import critical_error_message_box
@ -162,6 +162,8 @@ class BibleDB(QtCore.QObject, Manager):
if u'file' in kwargs:
self.get_name()
self.wizard = None
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
def stop_import(self):
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -236,8 +236,20 @@ class BGExtract(object):
while found_count < verse_count:
content = content.findNext(u'sup', u'versenum')
raw_verse_num = content.next
raw_verse_text = raw_verse_num.next
verse_list[int(str(raw_verse_num))] = unicode(raw_verse_text)
clean_verse_num = 0
# Not all verses exist in all translations and may or may not be
# represented by a verse number. If they are not fine, if they are
# it will probably be in a format that breaks int(). We will then
# have no idea what garbage may be sucked in to the verse text so
# if we do not get a clean int() then ignore the verse completely.
try:
clean_verse_num = int(str(raw_verse_num))
except ValueError:
log.exception(u'Illegal verse number in %s %s %s:%s',
version, bookname, chapter, unicode(raw_verse_num))
if clean_verse_num:
raw_verse_text = raw_verse_num.next
verse_list[clean_verse_num] = unicode(raw_verse_text)
found_count += 1
return SearchResults(bookname, chapter, verse_list)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -40,9 +40,9 @@ from osis import OSISBible
# Imports that might fail.
try:
from openlp1 import OpenLP1Bible
has_openlp1 = True
HAS_OPENLP1 = True
except ImportError:
has_openlp1 = False
HAS_OPENLP1 = False
log = logging.getLogger(__name__)
@ -367,6 +367,6 @@ class BibleManager(object):
for bible in self.db_cache:
self.db_cache[bible].finalise()
BibleFormat.set_availability(BibleFormat.OpenLP1, has_openlp1)
BibleFormat.set_availability(BibleFormat.OpenLP1, HAS_OPENLP1)
__all__ = [u'BibleFormat']

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -34,7 +34,8 @@ from openlp.core.lib.searchedit import SearchEdit
from openlp.core.lib.ui import UiStrings, add_widget_completer, \
media_item_combo_box, critical_error_message_box
from openlp.plugins.bibles.forms import BibleImportForm
from openlp.plugins.bibles.lib import get_reference_match
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \
get_reference_match
log = logging.getLogger(__name__)
@ -56,6 +57,7 @@ class BibleMediaItem(MediaManagerItem):
self.IconPath = u'songs/song'
MediaManagerItem.__init__(self, parent, plugin, icon)
# Place to store the search results for both bibles.
self.settings = self.parent.settings_tab
self.search_results = {}
self.second_search_results = {}
QtCore.QObject.connect(Receiver.get_receiver(),
@ -235,18 +237,15 @@ class BibleMediaItem(MediaManagerItem):
def retranslateUi(self):
log.debug(u'retranslateUi')
self.quickVersionLabel.setText(
translate('BiblesPlugin.MediaItem', 'Version:'))
self.quickVersionLabel.setText(u'%s:' % UiStrings.Version)
self.quickSecondLabel.setText(
translate('BiblesPlugin.MediaItem', 'Second:'))
self.quickSearchLabel.setText(
translate('BiblesPlugin.MediaItem', 'Find:'))
self.quickSearchButton.setText(
translate('BiblesPlugin.MediaItem', 'Search'))
self.quickSearchButton.setText(UiStrings.Search)
self.quickClearLabel.setText(
translate('BiblesPlugin.MediaItem', 'Results:'))
self.advancedVersionLabel.setText(
translate('BiblesPlugin.MediaItem', 'Version:'))
self.advancedVersionLabel.setText(u'%s:' % UiStrings.Version)
self.advancedSecondLabel.setText(
translate('BiblesPlugin.MediaItem', 'Second:'))
self.advancedBookLabel.setText(
@ -261,8 +260,7 @@ class BibleMediaItem(MediaManagerItem):
translate('BiblesPlugin.MediaItem', 'To:'))
self.advancedClearLabel.setText(
translate('BiblesPlugin.MediaItem', 'Results:'))
self.advancedSearchButton.setText(
translate('BiblesPlugin.MediaItem', 'Search'))
self.advancedSearchButton.setText(UiStrings.Search)
self.quickClearComboBox.addItem(
translate('BiblesPlugin.MediaItem', 'Clear'))
self.quickClearComboBox.addItem(
@ -670,12 +668,12 @@ class BibleMediaItem(MediaManagerItem):
raw_slides.append(bible_text.rstrip())
bible_text = u''
# If we are 'Verse Per Slide' then create a new slide.
elif self.parent.settings_tab.layout_style == 0:
elif self.settings.layout_style == LayoutStyle.VersePerSlide:
bible_text = u'%s&nbsp;%s' % (verse_text, text)
raw_slides.append(bible_text.rstrip())
bible_text = u''
# If we are 'Verse Per Line' then force a new line.
elif self.parent.settings_tab.layout_style == 1:
elif self.settings.layout_style == LayoutStyle.VersePerLine:
bible_text = u'%s %s&nbsp;%s\n' % (bible_text, verse_text, text)
# We have to be 'Continuous'.
else:
@ -693,7 +691,8 @@ class BibleMediaItem(MediaManagerItem):
raw_slides.append(bible_text.lstrip())
bible_text = u''
# Service Item: Capabilities
if self.parent.settings_tab.layout_style == 2 and not second_bible:
if self.settings.layout_style == LayoutStyle.Continuous and \
not second_bible:
# Split the line but do not replace line breaks in renderer.
service_item.add_capability(ItemCapabilities.NoLineBreaks)
service_item.add_capability(ItemCapabilities.AllowsPreview)
@ -705,10 +704,10 @@ class BibleMediaItem(MediaManagerItem):
else:
service_item.title += u', ' + title
# Service Item: Theme
if len(self.parent.settings_tab.bible_theme) == 0:
if len(self.settings.bible_theme) == 0:
service_item.theme = None
else:
service_item.theme = self.parent.settings_tab.bible_theme
service_item.theme = self.settings.bible_theme
for slide in raw_slides:
service_item.add_from_text(slide[:30], slide)
if service_item.raw_footer:
@ -817,16 +816,15 @@ class BibleMediaItem(MediaManagerItem):
The verse number (int).
"""
verse_separator = get_reference_match(u'sep_v_display')
if not self.parent.settings_tab.show_new_chapters or \
old_chapter != chapter:
if not self.settings.show_new_chapters or old_chapter != chapter:
verse_text = unicode(chapter) + verse_separator + unicode(verse)
else:
verse_text = unicode(verse)
if self.parent.settings_tab.display_style == 1:
if self.settings.display_style == DisplayStyle.Round:
verse_text = u'{su}(' + verse_text + u'){/su}'
elif self.parent.settings_tab.display_style == 2:
elif self.settings.display_style == DisplayStyle.Curly:
verse_text = u'{su}{' + verse_text + u'}{/su}'
elif self.parent.settings_tab.display_style == 3:
elif self.settings.display_style == DisplayStyle.Square:
verse_text = u'{su}[' + verse_text + u']{/su}'
else:
verse_text = u'{su}' + verse_text + u'{/su}'

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -29,7 +29,8 @@ import sqlite
from PyQt4 import QtCore
from openlp.core.lib import Receiver, translate
from openlp.core.lib import Receiver
from openlp.core.ui.wizard import WizardStrings
from openlp.plugins.bibles.lib.db import BibleDB
log = logging.getLogger(__name__)
@ -45,8 +46,6 @@ class OpenLP1Bible(BibleDB):
log.debug(self.__class__.__name__)
BibleDB.__init__(self, parent, **kwargs)
self.filename = kwargs[u'filename']
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
def do_import(self):
"""
@ -73,8 +72,7 @@ class OpenLP1Bible(BibleDB):
abbreviation = unicode(book[3], u'cp1252')
self.create_book(name, abbreviation, testament_id)
# Update the progess bar.
self.wizard.incrementProgressBar(unicode(translate(
'BiblesPlugin.OpenLP1Import', 'Importing %s...')) % name)
self.wizard.incrementProgressBar(WizardStrings.ImportingType % name)
# Import the verses for this book.
cursor.execute(u'SELECT chapter, verse, text || \'\' AS text FROM '
'verse WHERE book_id=%s' % book_id)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -46,8 +46,6 @@ class OpenSongBible(BibleDB):
log.debug(self.__class__.__name__)
BibleDB.__init__(self, parent, **kwargs)
self.filename = kwargs['filename']
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
def do_import(self):
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -41,15 +41,11 @@ log = logging.getLogger(__name__)
class OSISBible(BibleDB):
"""
OSIS Bible format importer class.
`OSIS <http://www.bibletechnologies.net/>`_ Bible format importer class.
"""
log.info(u'BibleOSISImpl loaded')
def __init__(self, parent, **kwargs):
"""
Constructor to create and set up an instance of the OpenSongBible
class. This class is used to import Bibles from OpenSong's XML format.
"""
log.debug(self.__class__.__name__)
BibleDB.__init__(self, parent, **kwargs)
self.filename = kwargs[u'filename']
@ -69,7 +65,7 @@ class OSISBible(BibleDB):
self.q1_regex = re.compile(r'<q(.*?)level="1"(.*?)>')
self.q2_regex = re.compile(r'<q(.*?)level="2"(.*?)>')
self.trans_regex = re.compile(r'<transChange(.*?)>(.*?)</transChange>')
self.divineName_regex = re.compile(
self.divine_name_regex = re.compile(
r'<divineName(.*?)>(.*?)</divineName>')
self.spaces_regex = re.compile(r'([ ]{2,})')
filepath = os.path.join(
@ -86,8 +82,6 @@ class OSISBible(BibleDB):
finally:
if fbibles:
fbibles.close()
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
def do_import(self):
"""
@ -126,7 +120,7 @@ class OSISBible(BibleDB):
verse_text = match.group(4)
if not db_book or db_book.name != self.books[book][0]:
log.debug(u'New book: "%s"', self.books[book][0])
if book == u'Matt':
if book == u'Matt' or book == u'Jdt':
testament += 1
db_book = self.create_book(
unicode(self.books[book][0]),
@ -161,7 +155,7 @@ class OSISBible(BibleDB):
verse_text = self.q1_regex.sub(u'"', verse_text)
verse_text = self.q2_regex.sub(u'\'', verse_text)
verse_text = self.trans_regex.sub(u'', verse_text)
verse_text = self.divineName_regex.sub(u'', verse_text)
verse_text = self.divine_name_regex.sub(u'', verse_text)
verse_text = verse_text.replace(u'</lb>', u'')\
.replace(u'</l>', u'').replace(u'<lg>', u'')\
.replace(u'</lg>', u'').replace(u'</q>', u'')\

View File

@ -64,3 +64,13 @@ Jas,James,Jas
3John,3 John,3John
Jude,Jude,Jude
Rev,Revelation,Rev
Jdt,Judith,Jdt
Wis,Wisdom,Wis
Tob,Tobit,Tob
Sir,Sirach,Sir
Bar,Baruch,Bar
1Macc,1 Maccabees,1Macc
2Macc,2 Maccabees,2Macc
AddDan,Rest of Daniel,AddDan
AddEsth,Rest of Esther,AddEsth
PrMan,Prayer of Manasses,PrMan

1 Gen Genesis Gen
64 3John 3 John 3John
65 Jude Jude Jude
66 Rev Revelation Rev
67 Jdt Judith Jdt
68 Wis Wisdom Wis
69 Tob Tobit Tob
70 Sir Sirach Sir
71 Bar Baruch Bar
72 1Macc 1 Maccabees 1Macc
73 2Macc 2 Maccabees 2Macc
74 AddDan Rest of Daniel AddDan
75 AddEsth Rest of Esther AddEsth
76 PrMan Prayer of Manasses PrMan

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -27,4 +27,4 @@
The :mod:`custom` module provides the Custom plugin which allows custom,
themed, text based items to be displayed without having to misuse another item
type.
"""
"""

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -51,7 +51,7 @@ class CustomPlugin(Plugin):
CustomMediaItem, CustomTab)
self.weight = -5
self.manager = Manager(u'custom', init_schema)
self.edit_custom_form = EditCustomForm(self.manager)
self.edit_custom_form = EditCustomForm(self)
self.icon_path = u':/plugins/plugin_custom.png'
self.icon = build_icon(self.icon_path)

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -25,4 +25,4 @@
###############################################################################
from editcustomform import EditCustomForm
from editcustomslideform import EditCustomSlideForm
from editcustomslideform import EditCustomSlideForm

View File

@ -6,9 +6,9 @@
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
@ -124,5 +124,4 @@ class Ui_CustomEditDialog(object):
translate('CustomPlugin.EditCustomForm', 'The&me:'))
self.creditLabel.setText(
translate('CustomPlugin.EditCustomForm', '&Credits:'))
self.previewButton.setText(
translate('CustomPlugin.EditCustomForm', 'Save && Preview'))
self.previewButton.setText(UiStrings.SaveAndPreview)

Some files were not shown because too many files have changed in this diff Show More