Merged with current trunk and used '\xa9' as (c) symbol

This commit is contained in:
Frode Woldsund 2010-06-25 10:07:51 +02:00
commit 5c5427d963
47 changed files with 49031 additions and 3473 deletions

View File

@ -159,6 +159,22 @@ def resize_image(image, width, height):
painter.drawImage((width - realw) / 2, (height - realh) / 2, preview) painter.drawImage((width - realw) / 2, (height - realh) / 2, preview)
return new_image return new_image
def check_item_selected(list_widget, message):
"""
Check if a list item is selected so an action may be performed on it
``list_widget``
The list to check for selected items
``message``
The message to give the user if no item is selected
"""
if not list_widget.selectedIndexes():
QtGui.QMessageBox.information(list_widget.parent(),
translate('MediaManagerItem', 'No Items Selected'), message)
return False
return True
class ThemeLevel(object): class ThemeLevel(object):
""" """

View File

@ -32,7 +32,6 @@ class BaseListWithDnD(QtGui.QListWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
QtGui.QListWidget.__init__(self, parent) QtGui.QListWidget.__init__(self, parent)
self.parent = parent
# this must be set by the class which is inheriting # this must be set by the class which is inheriting
assert(self.PluginName) assert(self.PluginName)

View File

@ -343,19 +343,6 @@ class MediaManagerItem(QtGui.QWidget):
""" """
pass pass
def checkItemSelected(self, message):
"""
Check if a list item is selected so an action may be performed on it
``message``
The message to give the user if no item is selected
"""
if not self.ListView.selectedIndexes():
QtGui.QMessageBox.information(self,
translate('MediaManagerItem', 'No Items Selected'), message)
return False
return True
def onFileClick(self): def onFileClick(self):
files = QtGui.QFileDialog.getOpenFileNames( files = QtGui.QFileDialog.getOpenFileNames(
self, self.OnNewPrompt, self, self.OnNewPrompt,

View File

@ -169,9 +169,8 @@ class Ui_AboutDialog(object):
self.AboutNotebook.indexOf(self.CreditsTab), self.AboutNotebook.indexOf(self.CreditsTab),
translate('AboutForm', 'Credits')) translate('AboutForm', 'Credits'))
self.LicenseTextEdit.setPlainText(translate('AboutForm', self.LicenseTextEdit.setPlainText(translate('AboutForm',
'Copyright ' + u'\u00a9'.encode('utf8') + 'Copyright \xa9 2004-2010 Raoul Snyman\n'
' 2004-2010 Raoul Snyman\n' 'Portions copyright \xa9 2004-2010 '
'Portions copyright ' + u'\u00a9'.encode('utf8') + '2004-2010 '
'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, ' 'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, '
'Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon ' 'Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon '
'Tibble, Carsten Tinggaard\n' 'Tibble, Carsten Tinggaard\n'

View File

@ -50,6 +50,7 @@ class Ui_AmendThemeDialog(object):
self.ThemeNameLayout.addWidget(self.ThemeNameLabel) self.ThemeNameLayout.addWidget(self.ThemeNameLabel)
self.ThemeNameEdit = QtGui.QLineEdit(self.ThemeNameWidget) self.ThemeNameEdit = QtGui.QLineEdit(self.ThemeNameWidget)
self.ThemeNameEdit.setObjectName(u'ThemeNameEdit') self.ThemeNameEdit.setObjectName(u'ThemeNameEdit')
self.ThemeNameLabel.setBuddy(self.ThemeNameEdit)
self.ThemeNameLayout.addWidget(self.ThemeNameEdit) self.ThemeNameLayout.addWidget(self.ThemeNameEdit)
self.AmendThemeLayout.addWidget(self.ThemeNameWidget) self.AmendThemeLayout.addWidget(self.ThemeNameWidget)
self.ContentWidget = QtGui.QWidget(AmendThemeDialog) self.ContentWidget = QtGui.QWidget(AmendThemeDialog)
@ -72,6 +73,7 @@ class Ui_AmendThemeDialog(object):
self.BackgroundLabel) self.BackgroundLabel)
self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab) self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab)
self.BackgroundComboBox.setObjectName(u'BackgroundComboBox') self.BackgroundComboBox.setObjectName(u'BackgroundComboBox')
self.BackgroundLabel.setBuddy(self.BackgroundComboBox)
self.BackgroundComboBox.addItem(QtCore.QString()) self.BackgroundComboBox.addItem(QtCore.QString())
self.BackgroundComboBox.addItem(QtCore.QString()) self.BackgroundComboBox.addItem(QtCore.QString())
self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole,
@ -752,9 +754,9 @@ class Ui_AmendThemeDialog(object):
AmendThemeDialog.setWindowTitle( AmendThemeDialog.setWindowTitle(
translate('AmendThemeForm', 'Theme Maintenance')) translate('AmendThemeForm', 'Theme Maintenance'))
self.ThemeNameLabel.setText( self.ThemeNameLabel.setText(
translate('AmendThemeForm', 'Theme Name:')) translate('AmendThemeForm', 'Theme &Name:'))
self.BackgroundLabel.setText( self.BackgroundLabel.setText(
translate('AmendThemeForm', 'Visibility:')) translate('AmendThemeForm', '&Visibility:'))
self.BackgroundComboBox.setItemText(0, self.BackgroundComboBox.setItemText(0,
translate('AmendThemeForm', 'Opaque')) translate('AmendThemeForm', 'Opaque'))
self.BackgroundComboBox.setItemText(1, self.BackgroundComboBox.setItemText(1,

View File

@ -655,6 +655,7 @@ class SlideController(QtGui.QWidget):
""" """
Allow the main display to blank the main display at startup time Allow the main display to blank the main display at startup time
""" """
log.debug(u'mainDisplaySetBackground')
if not self.mainDisplay.primary: if not self.mainDisplay.primary:
self.blankButton.setChecked(True) self.blankButton.setChecked(True)
@ -672,12 +673,12 @@ class SlideController(QtGui.QWidget):
def onBlankDisplay(self, checked): def onBlankDisplay(self, checked):
""" """
Handle the blank screen button Handle the blank screen button actions
""" """
log.debug(u'onBlankDisplay %d' % checked) log.debug(u'onBlankDisplay %d' % checked)
self.hideButton.setChecked(False) self.hideButton.setChecked(False)
self.themeButton.setChecked(False) self.themeButton.setChecked(False)
self.canDisplay = not checked self.canDisplay = not checked
QtCore.QSettings().setValue( QtCore.QSettings().setValue(
self.parent.generalSettingsSection + u'/screen blank', self.parent.generalSettingsSection + u'/screen blank',
QtCore.QVariant(checked)) QtCore.QVariant(checked))
@ -722,6 +723,7 @@ class SlideController(QtGui.QWidget):
""" """
Blank the display screen within a plugin if required. Blank the display screen within a plugin if required.
""" """
log.debug(u'blankPlugin %d ', blank)
if self.serviceItem is not None: if self.serviceItem is not None:
if blank: if blank:
Receiver.send_message(u'%s_blank' Receiver.send_message(u'%s_blank'

View File

@ -35,7 +35,7 @@ from openlp.core.ui import AmendThemeForm
from openlp.core.theme import Theme from openlp.core.theme import Theme
from openlp.core.lib import OpenLPToolbar, context_menu_action, \ from openlp.core.lib import OpenLPToolbar, context_menu_action, \
ThemeXML, str_to_bool, get_text_file_string, build_icon, Receiver, \ ThemeXML, str_to_bool, get_text_file_string, build_icon, Receiver, \
context_menu_separator, SettingsManager, translate context_menu_separator, SettingsManager, translate, check_item_selected
from openlp.core.utils import AppLocation, get_filesystem_encoding from openlp.core.utils import AppLocation, get_filesystem_encoding
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -182,8 +182,9 @@ class ThemeManager(QtGui.QWidget):
Loads the settings for the theme that is to be edited and launches the Loads the settings for the theme that is to be edited and launches the
theme editing form so the user can make their changes. theme editing form so the user can make their changes.
""" """
item = self.ThemeListWidget.currentItem() if check_item_selected(self.ThemeListWidget, translate('ThemeManager',
if item: 'You must select a theme to edit.')):
item = self.ThemeListWidget.currentItem()
theme = self.getThemeData( theme = self.getThemeData(
unicode(item.data(QtCore.Qt.UserRole).toString())) unicode(item.data(QtCore.Qt.UserRole).toString()))
self.amendThemeForm.loadTheme(theme) self.amendThemeForm.loadTheme(theme)
@ -198,8 +199,9 @@ class ThemeManager(QtGui.QWidget):
self.global_theme = unicode(QtCore.QSettings().value( self.global_theme = unicode(QtCore.QSettings().value(
self.settingsSection + u'/global theme', self.settingsSection + u'/global theme',
QtCore.QVariant(u'')).toString()) QtCore.QVariant(u'')).toString())
item = self.ThemeListWidget.currentItem() if check_item_selected(self.ThemeListWidget, translate('ThemeManager',
if item: 'You must select a theme to delete.')):
item = self.ThemeListWidget.currentItem()
theme = unicode(item.text()) theme = unicode(item.text())
# should be the same unless default # should be the same unless default
if theme != unicode(item.data(QtCore.Qt.UserRole).toString()): if theme != unicode(item.data(QtCore.Qt.UserRole).toString()):

View File

@ -37,7 +37,7 @@ class alertsPlugin(Plugin):
log.info(u'Alerts Plugin loaded') log.info(u'Alerts Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
Plugin.__init__(self, u'Alerts', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'Alerts', u'1.9.2', plugin_helpers)
self.weight = -3 self.weight = -3
self.icon = build_icon(u':/media/media_image.png') self.icon = build_icon(u':/media/media_image.png')
self.alertsmanager = AlertsManager(self) self.alertsmanager = AlertsManager(self)

View File

@ -36,7 +36,7 @@ class BiblePlugin(Plugin):
log.info(u'Bible Plugin loaded') log.info(u'Bible Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
Plugin.__init__(self, u'Bibles', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'Bibles', u'1.9.2', plugin_helpers)
self.weight = -9 self.weight = -9
self.icon = build_icon(u':/media/media_bible.png') self.icon = build_icon(u':/media/media_bible.png')
#Register the bible Manager #Register the bible Manager

View File

@ -43,7 +43,8 @@ class BibleListView(BaseListWithDnD):
BaseListWithDnD.__init__(self, parent) BaseListWithDnD.__init__(self, parent)
def resizeEvent(self, event): def resizeEvent(self, event):
self.parent.onListViewResize(event.size().width(), event.size().width()) self.parent().onListViewResize(event.size().width(),
event.size().width())
class BibleMediaItem(MediaManagerItem): class BibleMediaItem(MediaManagerItem):

View File

@ -62,10 +62,13 @@ class OSISBible(BibleDB):
self.fi_regex = re.compile(r'<FI>(.*?)<Fi>') self.fi_regex = re.compile(r'<FI>(.*?)<Fi>')
self.rf_regex = re.compile(r'<RF>(.*?)<Rf>') self.rf_regex = re.compile(r'<RF>(.*?)<Rf>')
self.lb_regex = re.compile(r'<lb(.*?)>') self.lb_regex = re.compile(r'<lb(.*?)>')
self.lg_regex = re.compile(r'<lg(.*?)>')
self.l_regex = re.compile(r'<l (.*?)>') self.l_regex = re.compile(r'<l (.*?)>')
self.w_regex = re.compile(r'<w (.*?)>') self.w_regex = re.compile(r'<w (.*?)>')
self.q_regex = re.compile(r'<q (.*?)>') 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.trans_regex = re.compile(r'<transChange(.*?)>(.*?)</transChange>')
self.divineName_regex = re.compile(r'<divineName(.*?)>(.*?)</divineName>')
self.spaces_regex = re.compile(r'([ ]{2,})') self.spaces_regex = re.compile(r'([ ]{2,})')
self.books = {} self.books = {}
filepath = os.path.join( filepath = os.path.join(
@ -96,7 +99,7 @@ class OSISBible(BibleDB):
detect_file = None detect_file = None
try: try:
detect_file = open(self.filename, u'r') detect_file = open(self.filename, u'r')
details = chardet.detect(detect_file.read()) details = chardet.detect(detect_file.read(1048576))
except IOError: except IOError:
log.exception(u'Failed to detect OSIS file encoding') log.exception(u'Failed to detect OSIS file encoding')
return return
@ -150,11 +153,14 @@ class OSISBible(BibleDB):
verse_text = self.milestone_regex.sub(u'', verse_text) verse_text = self.milestone_regex.sub(u'', verse_text)
verse_text = self.fi_regex.sub(u'', verse_text) verse_text = self.fi_regex.sub(u'', verse_text)
verse_text = self.rf_regex.sub(u'', verse_text) verse_text = self.rf_regex.sub(u'', verse_text)
verse_text = self.lb_regex.sub(u'', verse_text) verse_text = self.lb_regex.sub(u' ', verse_text)
verse_text = self.lg_regex.sub(u'', verse_text)
verse_text = self.l_regex.sub(u'', verse_text) verse_text = self.l_regex.sub(u'', verse_text)
verse_text = self.w_regex.sub(u'', verse_text) verse_text = self.w_regex.sub(u'', verse_text)
verse_text = self.q_regex.sub(u'', verse_text) 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.trans_regex.sub(u'', verse_text)
verse_text = self.divineName_regex.sub(u'', verse_text)
verse_text = verse_text.replace(u'</lb>', u'')\ verse_text = verse_text.replace(u'</lb>', u'')\
.replace(u'</l>', u'').replace(u'<lg>', u'')\ .replace(u'</l>', u'').replace(u'<lg>', u'')\
.replace(u'</lg>', u'').replace(u'</q>', u'')\ .replace(u'</lg>', u'').replace(u'</q>', u'')\

View File

@ -43,7 +43,7 @@ class CustomPlugin(Plugin):
log.info(u'Custom Plugin loaded') log.info(u'Custom Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
Plugin.__init__(self, u'Custom', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'Custom', u'1.9.2', plugin_helpers)
self.weight = -5 self.weight = -5
self.custommanager = CustomManager() self.custommanager = CustomManager()
self.edit_custom_form = EditCustomForm(self.custommanager) self.edit_custom_form = EditCustomForm(self.custommanager)

View File

@ -43,6 +43,7 @@ class Ui_customEditDialog(object):
self.TitleLabel.setObjectName(u'TitleLabel') self.TitleLabel.setObjectName(u'TitleLabel')
self.horizontalLayout.addWidget(self.TitleLabel) self.horizontalLayout.addWidget(self.TitleLabel)
self.TitleEdit = QtGui.QLineEdit(customEditDialog) self.TitleEdit = QtGui.QLineEdit(customEditDialog)
self.TitleLabel.setBuddy(self.TitleEdit)
self.TitleEdit.setObjectName(u'TitleEdit') self.TitleEdit.setObjectName(u'TitleEdit')
self.horizontalLayout.addWidget(self.TitleEdit) self.horizontalLayout.addWidget(self.TitleEdit)
self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1) self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
@ -118,6 +119,7 @@ class Ui_customEditDialog(object):
self.ThemeLabel.setObjectName(u'ThemeLabel') self.ThemeLabel.setObjectName(u'ThemeLabel')
self.horizontalLayout_3.addWidget(self.ThemeLabel) self.horizontalLayout_3.addWidget(self.ThemeLabel)
self.ThemeComboBox = QtGui.QComboBox(customEditDialog) self.ThemeComboBox = QtGui.QComboBox(customEditDialog)
self.ThemeLabel.setBuddy(self.ThemeComboBox)
self.ThemeComboBox.setObjectName(u'ThemeComboBox') self.ThemeComboBox.setObjectName(u'ThemeComboBox')
self.horizontalLayout_3.addWidget(self.ThemeComboBox) self.horizontalLayout_3.addWidget(self.ThemeComboBox)
self.gridLayout.addLayout(self.horizontalLayout_3, 3, 0, 1, 1) self.gridLayout.addLayout(self.horizontalLayout_3, 3, 0, 1, 1)
@ -127,6 +129,7 @@ class Ui_customEditDialog(object):
self.CreditLabel.setObjectName(u'CreditLabel') self.CreditLabel.setObjectName(u'CreditLabel')
self.horizontalLayout_2.addWidget(self.CreditLabel) self.horizontalLayout_2.addWidget(self.CreditLabel)
self.CreditEdit = QtGui.QLineEdit(customEditDialog) self.CreditEdit = QtGui.QLineEdit(customEditDialog)
self.CreditLabel.setBuddy(self.CreditEdit)
self.CreditEdit.setObjectName(u'CreditEdit') self.CreditEdit.setObjectName(u'CreditEdit')
self.horizontalLayout_2.addWidget(self.CreditEdit) self.horizontalLayout_2.addWidget(self.CreditEdit)
self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1) self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1)
@ -162,7 +165,7 @@ class Ui_customEditDialog(object):
self.DownButton.setToolTip( self.DownButton.setToolTip(
translate('CustomPlugin.EditCustomForm', 'Move slide down 1')) translate('CustomPlugin.EditCustomForm', 'Move slide down 1'))
self.TitleLabel.setText( self.TitleLabel.setText(
translate('CustomPlugin.EditCustomForm', 'Title:')) translate('CustomPlugin.EditCustomForm', '&Title:'))
self.AddButton.setText( self.AddButton.setText(
translate('CustomPlugin.EditCustomForm', 'Add New')) translate('CustomPlugin.EditCustomForm', 'Add New'))
self.AddButton.setToolTip( self.AddButton.setToolTip(
@ -192,7 +195,7 @@ class Ui_customEditDialog(object):
self.SplitButton.setToolTip( self.SplitButton.setToolTip(
translate('CustomPlugin.EditCustomForm', 'Add slide split')) translate('CustomPlugin.EditCustomForm', 'Add slide split'))
self.ThemeLabel.setText( self.ThemeLabel.setText(
translate('CustomPlugin.EditCustomForm', 'Theme:')) translate('CustomPlugin.EditCustomForm', 'The&me:'))
self.CreditLabel.setText( self.CreditLabel.setText(
translate('CustomPlugin.EditCustomForm', 'Credits:')) translate('CustomPlugin.EditCustomForm', '&Credits:'))

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD, \ from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD, \
Receiver, ItemCapabilities, translate Receiver, ItemCapabilities, translate, check_item_selected
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -118,7 +118,8 @@ class CustomMediaItem(MediaManagerItem):
""" """
Edit a custom item Edit a custom item
""" """
if self.checkItemSelected(translate('CustomPlugin.MediaItem', if check_item_selected(self.ListView,
translate('CustomPlugin.MediaItem',
'You must select an item to edit.')): 'You must select an item to edit.')):
item = self.ListView.currentItem() item = self.ListView.currentItem()
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
@ -130,7 +131,8 @@ class CustomMediaItem(MediaManagerItem):
""" """
Remove a custom item from the list and database Remove a custom item from the list and database
""" """
if self.checkItemSelected(translate('CustomPlugin.MediaItem', if check_item_selected(self.ListView,
translate('CustomPlugin.MediaItem',
'You must select an item to delete.')): 'You must select an item to delete.')):
item = self.ListView.currentItem() item = self.ListView.currentItem()
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]

View File

@ -34,7 +34,7 @@ class ImagePlugin(Plugin):
log.info(u'Image Plugin loaded') log.info(u'Image Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
Plugin.__init__(self, u'Images', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'Images', u'1.9.2', plugin_helpers)
self.weight = -7 self.weight = -7
self.icon = build_icon(u':/media/media_image.png') self.icon = build_icon(u':/media/media_image.png')
self.status = PluginStatus.Active self.status = PluginStatus.Active

View File

@ -29,7 +29,8 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
context_menu_action, ItemCapabilities, SettingsManager, translate context_menu_action, ItemCapabilities, SettingsManager, translate, \
check_item_selected
from openlp.core.utils import AppLocation, get_images_filter from openlp.core.utils import AppLocation, get_images_filter
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -116,7 +117,7 @@ class ImageMediaItem(MediaManagerItem):
""" """
Remove an image item from the list Remove an image item from the list
""" """
if self.checkItemSelected(translate('ImagePlugin.MediaItem', if check_item_selected(self.ListView, translate('ImagePlugin.MediaItem',
'You must select an item to delete.')): 'You must select an item to delete.')):
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
for item in items: for item in items:

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
ItemCapabilities, SettingsManager, translate ItemCapabilities, SettingsManager, translate, check_item_selected
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -141,7 +141,7 @@ class MediaMediaItem(MediaManagerItem):
""" """
Remove a media item from the list Remove a media item from the list
""" """
if self.checkItemSelected(translate('MediaPlugin.MediaItem', if check_item_selected(self.ListView, translate('MediaPlugin.MediaItem',
'You must select an item to delete.')): 'You must select an item to delete.')):
item = self.ListView.currentItem() item = self.ListView.currentItem()
row = self.ListView.row(item) row = self.ListView.row(item)

View File

@ -36,7 +36,7 @@ class MediaPlugin(Plugin):
log.info(u'%s MediaPlugin loaded', __name__) log.info(u'%s MediaPlugin loaded', __name__)
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
Plugin.__init__(self, u'Media', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'Media', u'1.9.2', plugin_helpers)
self.weight = -6 self.weight = -6
self.icon = build_icon(u':/media/media_video.png') self.icon = build_icon(u':/media/media_video.png')
# passed with drag and drop messages # passed with drag and drop messages
@ -85,4 +85,3 @@ class MediaPlugin(Plugin):
'<b>Media Plugin</b><br>This plugin ' '<b>Media Plugin</b><br>This plugin '
'allows the playing of audio and video media') 'allows the playing of audio and video media')
return about_text return about_text

View File

@ -331,7 +331,10 @@ class ImpressDocument(PresentationDocument):
def stop_presentation(self): def stop_presentation(self):
log.debug(u'stop presentation OpenOffice') log.debug(u'stop presentation OpenOffice')
self.control.deactivate() # deactivate should hide the screen according to docs, but doesn't
#self.control.deactivate()
self.presentation.end()
self.control = None
def start_presentation(self): def start_presentation(self):
log.debug(u'start presentation OpenOffice') log.debug(u'start presentation OpenOffice')

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
SettingsManager, translate SettingsManager, translate, check_item_selected
from openlp.core.utils import AppLocation from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import MessageListener from openlp.plugins.presentations.lib import MessageListener
@ -177,7 +177,8 @@ class PresentationMediaItem(MediaManagerItem):
""" """
Remove a presentation item from the list Remove a presentation item from the list
""" """
if self.checkItemSelected(translate('PresentationPlugin.MediaItem', if check_item_selected(self.ListView,
translate('PresentationPlugin.MediaItem',
'You must select an item to delete.')): 'You must select an item to delete.')):
item = self.ListView.currentItem() item = self.ListView.currentItem()
row = self.ListView.row(item) row = self.ListView.row(item)

View File

@ -41,31 +41,31 @@ class Controller(object):
log.info(u'Controller loaded') log.info(u'Controller loaded')
def __init__(self, live): def __init__(self, live):
self.isLive = live self.is_live = live
self.doc = None self.doc = None
log.info(u'%s controller loaded' % live) log.info(u'%s controller loaded' % live)
def addHandler(self, controller, file, isBlank): def add_handler(self, controller, file, is_blank):
log.debug(u'Live = %s, addHandler %s' % (self.isLive, file)) log.debug(u'Live = %s, add_handler %s' % (self.is_live, file))
self.controller = controller self.controller = controller
if self.doc is not None: if self.doc is not None:
self.shutdown() self.shutdown()
self.doc = self.controller.add_doc(file) self.doc = self.controller.add_doc(file)
self.doc.load_presentation() self.doc.load_presentation()
if self.isLive: if self.is_live:
self.doc.start_presentation() self.doc.start_presentation()
if isBlank: if is_blank:
self.blank() self.blank()
Receiver.send_message(u'maindisplay_hide', HideMode.Screen) Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
self.doc.slidenumber = 0 self.doc.slidenumber = 0
def activate(self): def activate(self):
log.debug(u'Live = %s, activate' % self.isLive) log.debug(u'Live = %s, activate' % self.is_live)
if self.doc.is_active(): if self.doc.is_active():
return return
if not self.doc.is_loaded(): if not self.doc.is_loaded():
self.doc.load_presentation() self.doc.load_presentation()
if self.isLive: if self.is_live:
self.doc.start_presentation() self.doc.start_presentation()
if self.doc.slidenumber > 1: if self.doc.slidenumber > 1:
self.doc.goto_slide(self.doc.slidenumber) self.doc.goto_slide(self.doc.slidenumber)
@ -85,36 +85,36 @@ class Controller(object):
""" """
Based on the handler passed at startup triggers the first slide Based on the handler passed at startup triggers the first slide
""" """
log.debug(u'Live = %s, first' % self.isLive) log.debug(u'Live = %s, first' % self.is_live)
if not self.isLive: if not self.is_live:
return return
if self.doc.is_blank(): if self.doc.is_blank():
self.doc.slidenumber = 1 self.doc.slidenumber = 1
return return
self.activate() self.activate()
self.doc.start_presentation() self.doc.start_presentation()
self.doc.poll_slidenumber(self.isLive) self.doc.poll_slidenumber(self.is_live)
def last(self): def last(self):
""" """
Based on the handler passed at startup triggers the first slide Based on the handler passed at startup triggers the first slide
""" """
log.debug(u'Live = %s, last' % self.isLive) log.debug(u'Live = %s, last' % self.is_live)
if not self.isLive: if not self.is_live:
return return
if self.doc.is_blank(): if self.doc.is_blank():
self.doc.slidenumber = self.doc.get_slide_count() self.doc.slidenumber = self.doc.get_slide_count()
return return
self.activate() self.activate()
self.doc.goto_slide(self.doc.get_slide_count()) self.doc.goto_slide(self.doc.get_slide_count())
self.doc.poll_slidenumber(self.isLive) self.doc.poll_slidenumber(self.is_live)
def next(self): def next(self):
""" """
Based on the handler passed at startup triggers the next slide event Based on the handler passed at startup triggers the next slide event
""" """
log.debug(u'Live = %s, next' % self.isLive) log.debug(u'Live = %s, next' % self.is_live)
if not self.isLive: if not self.is_live:
return return
if self.doc.is_blank(): if self.doc.is_blank():
if self.doc.slidenumber < self.doc.get_slide_count(): if self.doc.slidenumber < self.doc.get_slide_count():
@ -122,14 +122,14 @@ class Controller(object):
return return
self.activate() self.activate()
self.doc.next_step() self.doc.next_step()
self.doc.poll_slidenumber(self.isLive) self.doc.poll_slidenumber(self.is_live)
def previous(self): def previous(self):
""" """
Based on the handler passed at startup triggers the previous slide event Based on the handler passed at startup triggers the previous slide event
""" """
log.debug(u'Live = %s, previous' % self.isLive) log.debug(u'Live = %s, previous' % self.is_live)
if not self.isLive: if not self.is_live:
return return
if self.doc.is_blank(): if self.doc.is_blank():
if self.doc.slidenumber > 1: if self.doc.slidenumber > 1:
@ -137,14 +137,14 @@ class Controller(object):
return return
self.activate() self.activate()
self.doc.previous_step() self.doc.previous_step()
self.doc.poll_slidenumber(self.isLive) self.doc.poll_slidenumber(self.is_live)
def shutdown(self): def shutdown(self):
""" """
Based on the handler passed at startup triggers slide show to shut down Based on the handler passed at startup triggers slide show to shut down
""" """
log.debug(u'Live = %s, shutdown' % self.isLive) log.debug(u'Live = %s, shutdown' % self.is_live)
if self.isLive: if self.is_live:
Receiver.send_message(u'maindisplay_show') Receiver.send_message(u'maindisplay_show')
self.doc.close_presentation() self.doc.close_presentation()
self.doc = None self.doc = None
@ -152,8 +152,8 @@ class Controller(object):
#self.timer.stop() #self.timer.stop()
def blank(self): def blank(self):
log.debug(u'Live = %s, blank' % self.isLive) log.debug(u'Live = %s, blank' % self.is_live)
if not self.isLive: if not self.is_live:
return return
if not self.doc.is_loaded(): if not self.doc.is_loaded():
return return
@ -162,8 +162,8 @@ class Controller(object):
self.doc.blank_screen() self.doc.blank_screen()
def stop(self): def stop(self):
log.debug(u'Live = %s, stop' % self.isLive) log.debug(u'Live = %s, stop' % self.is_live)
if not self.isLive: if not self.is_live:
return return
if not self.doc.is_loaded(): if not self.doc.is_loaded():
return return
@ -172,8 +172,8 @@ class Controller(object):
self.doc.stop_presentation() self.doc.stop_presentation()
def unblank(self): def unblank(self):
log.debug(u'Live = %s, unblank' % self.isLive) log.debug(u'Live = %s, unblank' % self.is_live)
if not self.isLive: if not self.is_live:
return return
self.activate() self.activate()
if self.doc.slidenumber and \ if self.doc.slidenumber and \
@ -183,7 +183,7 @@ class Controller(object):
Receiver.send_message(u'maindisplay_hide', HideMode.Screen) Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
def poll(self): def poll(self):
self.doc.poll_slidenumber(self.isLive) self.doc.poll_slidenumber(self.is_live)
class MessageListener(object): class MessageListener(object):
""" """
@ -195,8 +195,8 @@ class MessageListener(object):
def __init__(self, mediaitem): def __init__(self, mediaitem):
self.controllers = mediaitem.controllers self.controllers = mediaitem.controllers
self.mediaitem = mediaitem self.mediaitem = mediaitem
self.previewHandler = Controller(False) self.preview_handler = Controller(False)
self.liveHandler = Controller(True) self.live_handler = Controller(True)
# messages are sent from core.ui.slidecontroller # messages are sent from core.ui.slidecontroller
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_start'), self.startup) QtCore.SIGNAL(u'presentations_start'), self.startup)
@ -228,9 +228,10 @@ class MessageListener(object):
Start of new presentation Start of new presentation
Save the handler as any new presentations start here Save the handler as any new presentations start here
""" """
isLive, item = self.decode_message(message) is_live = message[1]
item = message[0]
log.debug(u'Startup called with message %s' % message) log.debug(u'Startup called with message %s' % message)
isBlank = message[2] is_blank = message[2]
file = os.path.join(item.get_frame_path(), file = os.path.join(item.get_frame_path(),
item.get_frame_title()) item.get_frame_title())
self.handler = item.title self.handler = item.title
@ -238,75 +239,71 @@ class MessageListener(object):
self.handler = self.mediaitem.findControllerByType(file) self.handler = self.mediaitem.findControllerByType(file)
if not self.handler: if not self.handler:
return return
if isLive: if is_live:
controller = self.liveHandler controller = self.live_handler
else: else:
controller = self.previewHandler controller = self.preview_handler
controller.addHandler(self.controllers[self.handler], file, isBlank) controller.add_handler(self.controllers[self.handler], file, is_blank)
def decode_message(self, message):
if len(message) == 3:
return message[1], message[0], message[2]
else:
return message[1], message[0]
def slide(self, message): def slide(self, message):
isLive, item, slide = self.decode_message(message) is_live = message[1]
if isLive: slide = message[2]
self.liveHandler.slide(slide, isLive) item = message[0]
if is_live:
self.live_handler.slide(slide, item)
else: else:
self.previewHandler.slide(slide, isLive) self.preview_handler.slide(slide, item)
def first(self, message): def first(self, message):
isLive = self.decode_message(message)[0] is_live = message[1]
if isLive: if is_live:
self.liveHandler.first() self.live_handler.first()
else: else:
self.previewHandler.first() self.preview_handler.first()
def last(self, message): def last(self, message):
isLive = self.decode_message(message)[0] is_live = message[1]
if isLive: if is_live:
self.liveHandler.last() self.live_handler.last()
else: else:
self.previewHandler.last() self.preview_handler.last()
def next(self, message): def next(self, message):
isLive = self.decode_message(message)[0] is_live = message[1]
if isLive: if is_live:
self.liveHandler.next() self.live_handler.next()
else: else:
self.previewHandler.next() self.preview_handler.next()
def previous(self, message): def previous(self, message):
isLive = self.decode_message(message)[0] is_live = message[1]
if isLive: if is_live:
self.liveHandler.previous() self.live_handler.previous()
else: else:
self.previewHandler.previous() self.preview_handler.previous()
def shutdown(self, message): def shutdown(self, message):
isLive = self.decode_message(message)[0] is_live = message[1]
if isLive: if is_live:
Receiver.send_message(u'maindisplay_show') Receiver.send_message(u'maindisplay_show')
self.liveHandler.shutdown() self.live_handler.shutdown()
else: else:
self.previewHandler.shutdown() self.preview_handler.shutdown()
def hide(self, message): def hide(self, message):
isLive = self.decode_message(message)[0] is_live = message[1]
if isLive: if is_live:
self.liveHandler.stop() self.live_handler.stop()
def blank(self, message): def blank(self, message):
isLive = self.decode_message(message)[0] is_live = message[1]
if isLive: if is_live:
self.liveHandler.blank() self.live_handler.blank()
def unblank(self, message): def unblank(self, message):
isLive = self.decode_message(message)[0] is_live = message[1]
if isLive: if is_live:
self.liveHandler.unblank() self.live_handler.unblank()
def timeout(self): def timeout(self):
self.liveHandler.poll() self.live_handler.poll()

View File

@ -30,6 +30,7 @@ if os.name == u'nt':
from win32com.client import Dispatch from win32com.client import Dispatch
import _winreg import _winreg
import win32ui import win32ui
import pywintypes
from presentationcontroller import PresentationController, PresentationDocument from presentationcontroller import PresentationController, PresentationDocument
@ -65,7 +66,7 @@ class PowerpointController(PresentationController):
_winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,
u'PowerPoint.Application').Close() u'PowerPoint.Application').Close()
return True return True
except: except WindowsError:
pass pass
return False return False
@ -91,7 +92,7 @@ class PowerpointController(PresentationController):
return return
try: try:
self.process.Quit() self.process.Quit()
except: except pywintypes.com_error:
pass pass
self.process = None self.process = None
@ -121,11 +122,8 @@ class PowerpointDocument(PresentationDocument):
log.debug(u'LoadPresentation') log.debug(u'LoadPresentation')
if not self.controller.process.Visible: if not self.controller.process.Visible:
self.controller.start_process() self.controller.start_process()
#try:
self.controller.process.Presentations.Open(self.filepath, False, False, self.controller.process.Presentations.Open(self.filepath, False, False,
True) True)
#except:
# return
self.presentation = self.controller.process.Presentations( self.presentation = self.controller.process.Presentations(
self.controller.process.Presentations.Count) self.controller.process.Presentations.Count)
self.create_thumbnails() self.create_thumbnails()
@ -154,7 +152,7 @@ class PowerpointDocument(PresentationDocument):
if self.presentation: if self.presentation:
try: try:
self.presentation.Close() self.presentation.Close()
except: except pywintypes.com_error:
pass pass
self.presentation = None self.presentation = None
self.controller.remove_doc(self) self.controller.remove_doc(self)
@ -170,7 +168,7 @@ class PowerpointDocument(PresentationDocument):
return False return False
if self.controller.process.Presentations.Count == 0: if self.controller.process.Presentations.Count == 0:
return False return False
except: except (AttributeError, pywintypes.com_error):
return False return False
return True return True
@ -186,7 +184,7 @@ class PowerpointDocument(PresentationDocument):
return False return False
if self.presentation.SlideShowWindow.View is None: if self.presentation.SlideShowWindow.View is None:
return False return False
except: except (AttributeError, pywintypes.com_error):
return False return False
return True return True
@ -208,7 +206,10 @@ class PowerpointDocument(PresentationDocument):
""" """
Returns true if screen is blank Returns true if screen is blank
""" """
return self.presentation.SlideShowWindow.View.State == 3 if self.is_active():
return self.presentation.SlideShowWindow.View.State == 3
else:
return False
def stop_presentation(self): def stop_presentation(self):
""" """
@ -224,11 +225,11 @@ class PowerpointDocument(PresentationDocument):
#SlideShowWindow measures its size/position by points, not pixels #SlideShowWindow measures its size/position by points, not pixels
try: try:
dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88) dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88)
except: except win32ui.error:
try: try:
dpi = \ dpi = \
win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88) win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88)
except: except win32ui.error:
dpi = 96 dpi = 96
self.presentation.SlideShowSettings.Run() self.presentation.SlideShowSettings.Run()
self.presentation.SlideShowWindow.View.GotoSlide(1) self.presentation.SlideShowWindow.View.GotoSlide(1)

View File

@ -58,10 +58,7 @@ class PptviewController(PresentationController):
log.debug(u'check_available') log.debug(u'check_available')
if os.name != u'nt': if os.name != u'nt':
return False return False
try: return self.check_installed()
return self.check_installed()
except:
return False
if os.name == u'nt': if os.name == u'nt':
def check_installed(self): def check_installed(self):
@ -72,7 +69,7 @@ class PptviewController(PresentationController):
try: try:
self.start_process() self.start_process()
return self.process.CheckInstalled() return self.process.CheckInstalled()
except: except WindowsError:
return False return False
def start_process(self): def start_process(self):
@ -84,6 +81,7 @@ class PptviewController(PresentationController):
log.debug(u'start PPTView') log.debug(u'start PPTView')
self.process = cdll.LoadLibrary( self.process = cdll.LoadLibrary(
r'openlp\plugins\presentations\lib\pptviewlib\pptviewlib.dll') r'openlp\plugins\presentations\lib\pptviewlib\pptviewlib.dll')
#self.process.SetDebug(1)
def kill(self): def kill(self):
""" """
@ -106,6 +104,7 @@ class PptviewDocument(PresentationDocument):
self.presentation = None self.presentation = None
self.pptid = None self.pptid = None
self.blanked = False self.blanked = False
self.hidden = False
def load_presentation(self): def load_presentation(self):
""" """
@ -123,13 +122,11 @@ class PptviewDocument(PresentationDocument):
rect = rendermanager.screens.current[u'size'] rect = rendermanager.screens.current[u'size']
rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom()) rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom())
filepath = str(self.filepath.replace(u'/', u'\\')) filepath = str(self.filepath.replace(u'/', u'\\'))
try: self.pptid = self.controller.process.OpenPPT(filepath, None, rect,
self.pptid = self.controller.process.OpenPPT(filepath, None, rect, str(os.path.join(self.thumbnailpath,
str(os.path.join(self.thumbnailpath, self.controller.thumbnailprefix)))
self.controller.thumbnailprefix))) if self.pptid:
self.stop_presentation() self.stop_presentation()
except:
log.exception(u'Failed to load presentation')
def close_presentation(self): def close_presentation(self):
""" """
@ -156,7 +153,7 @@ class PptviewDocument(PresentationDocument):
""" """
Returns true if a presentation is currently active Returns true if a presentation is currently active
""" """
return self.is_loaded() return self.is_loaded() and not self.hidden
def blank_screen(self): def blank_screen(self):
""" """
@ -183,13 +180,18 @@ class PptviewDocument(PresentationDocument):
""" """
Stops the current presentation and hides the output Stops the current presentation and hides the output
""" """
self.hidden = True
self.controller.process.Stop(self.pptid) self.controller.process.Stop(self.pptid)
def start_presentation(self): def start_presentation(self):
""" """
Starts a presentation from the beginning Starts a presentation from the beginning
""" """
self.controller.process.RestartShow(self.pptid) if self.hidden:
self.hidden = False
self.controller.process.Resume(self.pptid)
else:
self.controller.process.RestartShow(self.pptid)
def get_slide_number(self): def get_slide_number(self):
""" """

View File

@ -23,6 +23,8 @@ This README.TXT must be distributed with the pptviewlib.dll
This library has a limit of 50 PowerPoints which can be opened simultaneously. This library has a limit of 50 PowerPoints which can be opened simultaneously.
This project can be built with the free Microsoft Visual C++ 2008 Express Edition.
USAGE USAGE
----- -----
BOOL CheckInstalled(void); BOOL CheckInstalled(void);

View File

@ -150,7 +150,7 @@ DllExport int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewp
pptviewobj[id].rect.bottom = rect.bottom; pptviewobj[id].rect.bottom = rect.bottom;
pptviewobj[id].rect.right = rect.right; pptviewobj[id].rect.right = rect.right;
} }
strcat_s(cmdline, MAX_PATH * 2, "/S \""); strcat_s(cmdline, MAX_PATH * 2, "/F /S \"");
strcat_s(cmdline, MAX_PATH * 2, filename); strcat_s(cmdline, MAX_PATH * 2, filename);
strcat_s(cmdline, MAX_PATH * 2, "\""); strcat_s(cmdline, MAX_PATH * 2, "\"");
memset(&si, 0, sizeof(si)); memset(&si, 0, sizeof(si));
@ -211,7 +211,7 @@ DllExport int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewp
} }
DEBUG("OpenPPT: Steps %d, first slide steps %d\n",pptviewobj[id].steps,pptviewobj[id].firstSlideSteps); DEBUG("OpenPPT: Steps %d, first slide steps %d\n",pptviewobj[id].steps,pptviewobj[id].firstSlideSteps);
SavePPTInfo(id); SavePPTInfo(id);
if(pptviewobj[id].state==PPT_CLOSING){ if(pptviewobj[id].state==PPT_CLOSING||pptviewobj[id].slideCount<=0){
ClosePPT(id); ClosePPT(id);
id=-1; id=-1;
} }

View File

@ -38,7 +38,7 @@ class PresentationPlugin(Plugin):
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
log.debug(u'Initialised') log.debug(u'Initialised')
self.controllers = {} self.controllers = {}
Plugin.__init__(self, u'Presentations', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'Presentations', u'1.9.2', plugin_helpers)
self.weight = -8 self.weight = -8
self.icon = build_icon(u':/media/media_presentation.png') self.icon = build_icon(u':/media/media_presentation.png')
self.status = PluginStatus.Active self.status = PluginStatus.Active
@ -114,4 +114,3 @@ class PresentationPlugin(Plugin):
'programs. The choice of available presentation programs is ' 'programs. The choice of available presentation programs is '
'available to the user in a drop down box.') 'available to the user in a drop down box.')
return about_text return about_text

View File

@ -37,7 +37,7 @@ class RemotesPlugin(Plugin):
""" """
remotes constructor remotes constructor
""" """
Plugin.__init__(self, u'Remotes', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'Remotes', u'1.9.2', plugin_helpers)
self.weight = -1 self.weight = -1
self.server = None self.server = None

View File

@ -50,6 +50,7 @@ class Ui_EditSongDialog(object):
self.TitleLabel.setObjectName(u'TitleLabel') self.TitleLabel.setObjectName(u'TitleLabel')
self.LyricsTabLayout.addWidget(self.TitleLabel, 0, 0, 1, 1) self.LyricsTabLayout.addWidget(self.TitleLabel, 0, 0, 1, 1)
self.TitleEditItem = QtGui.QLineEdit(self.LyricsTab) self.TitleEditItem = QtGui.QLineEdit(self.LyricsTab)
self.TitleLabel.setBuddy(self.TitleEditItem)
sizePolicy = QtGui.QSizePolicy( sizePolicy = QtGui.QSizePolicy(
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
@ -63,6 +64,7 @@ class Ui_EditSongDialog(object):
self.AlternativeTitleLabel.setObjectName(u'AlternativeTitleLabel') self.AlternativeTitleLabel.setObjectName(u'AlternativeTitleLabel')
self.LyricsTabLayout.addWidget(self.AlternativeTitleLabel, 1, 0, 1, 1) self.LyricsTabLayout.addWidget(self.AlternativeTitleLabel, 1, 0, 1, 1)
self.AlternativeEdit = QtGui.QLineEdit(self.LyricsTab) self.AlternativeEdit = QtGui.QLineEdit(self.LyricsTab)
self.AlternativeTitleLabel.setBuddy(self.AlternativeEdit)
self.AlternativeEdit.setObjectName(u'AlternativeEdit') self.AlternativeEdit.setObjectName(u'AlternativeEdit')
self.LyricsTabLayout.addWidget(self.AlternativeEdit, 1, 1, 1, 2) self.LyricsTabLayout.addWidget(self.AlternativeEdit, 1, 1, 1, 2)
self.LyricsLabel = QtGui.QLabel(self.LyricsTab) self.LyricsLabel = QtGui.QLabel(self.LyricsTab)
@ -71,6 +73,7 @@ class Ui_EditSongDialog(object):
self.LyricsLabel.setObjectName(u'LyricsLabel') self.LyricsLabel.setObjectName(u'LyricsLabel')
self.LyricsTabLayout.addWidget(self.LyricsLabel, 2, 0, 1, 1) self.LyricsTabLayout.addWidget(self.LyricsLabel, 2, 0, 1, 1)
self.VerseListWidget = QtGui.QTableWidget(self.LyricsTab) self.VerseListWidget = QtGui.QTableWidget(self.LyricsTab)
self.LyricsLabel.setBuddy(self.VerseListWidget)
self.VerseListWidget.setColumnCount(1) self.VerseListWidget.setColumnCount(1)
self.VerseListWidget.horizontalHeader().setVisible(False) self.VerseListWidget.horizontalHeader().setVisible(False)
self.VerseListWidget.setSelectionBehavior(1) self.VerseListWidget.setSelectionBehavior(1)
@ -83,6 +86,7 @@ class Ui_EditSongDialog(object):
self.VerseOrderLabel.setObjectName(u'VerseOrderLabel') self.VerseOrderLabel.setObjectName(u'VerseOrderLabel')
self.LyricsTabLayout.addWidget(self.VerseOrderLabel, 4, 0, 1, 1) self.LyricsTabLayout.addWidget(self.VerseOrderLabel, 4, 0, 1, 1)
self.VerseOrderEdit = QtGui.QLineEdit(self.LyricsTab) self.VerseOrderEdit = QtGui.QLineEdit(self.LyricsTab)
self.VerseOrderLabel.setBuddy(self.VerseOrderEdit)
self.VerseOrderEdit.setObjectName(u'VerseOrderEdit') self.VerseOrderEdit.setObjectName(u'VerseOrderEdit')
self.LyricsTabLayout.addWidget(self.VerseOrderEdit, 4, 1, 1, 2) self.LyricsTabLayout.addWidget(self.VerseOrderEdit, 4, 1, 1, 2)
self.VerseButtonWidget = QtGui.QWidget(self.LyricsTab) self.VerseButtonWidget = QtGui.QWidget(self.LyricsTab)
@ -482,7 +486,7 @@ class Ui_EditSongDialog(object):
self.CopyrightGroupBox.setTitle( self.CopyrightGroupBox.setTitle(
translate('SongsPlugin.EditSongForm', 'Copyright Information')) translate('SongsPlugin.EditSongForm', 'Copyright Information'))
self.CopyrightInsertButton.setText( self.CopyrightInsertButton.setText(
translate('SongsPlugin.EditSongForm', u'\u00a9'.encode('utf8'))) translate('SongsPlugin.EditSongForm', '\xa9'))
self.CCLILabel.setText( self.CCLILabel.setText(
translate('SongsPlugin.EditSongForm', 'CCLI Number:')) translate('SongsPlugin.EditSongForm', 'CCLI Number:'))
self.CommentsGroupBox.setTitle( self.CommentsGroupBox.setTitle(

View File

@ -589,7 +589,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
def onCopyrightInsertButtonTriggered(self): def onCopyrightInsertButtonTriggered(self):
text = self.CopyrightEditItem.text() text = self.CopyrightEditItem.text()
pos = self.CopyrightEditItem.cursorPosition() pos = self.CopyrightEditItem.cursorPosition()
text = text[:pos] + u'\u00a9'.encode('utf8') + text[pos:] text = text[:pos] + '\xa9' + text[pos:]
self.CopyrightEditItem.setText(text) self.CopyrightEditItem.setText(text)
self.CopyrightEditItem.setFocus() self.CopyrightEditItem.setFocus()
self.CopyrightEditItem.setCursorPosition(pos + 1) self.CopyrightEditItem.setCursorPosition(pos + 1)

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, SongXMLParser, \ from openlp.core.lib import MediaManagerItem, SongXMLParser, \
BaseListWithDnD, Receiver, ItemCapabilities, translate BaseListWithDnD, Receiver, ItemCapabilities, translate, check_item_selected
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
ImportWizardForm ImportWizardForm
@ -279,7 +279,7 @@ class SongMediaItem(MediaManagerItem):
""" """
Edit a song Edit a song
""" """
if self.checkItemSelected(translate('SongsPlugin.MediaItem', if check_item_selected(self.ListView, translate('SongsPlugin.MediaItem',
'You must select an item to edit.')): 'You must select an item to edit.')):
item = self.ListView.currentItem() item = self.ListView.currentItem()
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
@ -290,7 +290,7 @@ class SongMediaItem(MediaManagerItem):
""" """
Remove a song from the list and database Remove a song from the list and database
""" """
if self.checkItemSelected(translate('SongsPlugin.MediaItem', if check_item_selected(self.ListView, translate('SongsPlugin.MediaItem',
'You must select an item to delete.')): 'You must select an item to delete.')):
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
if len(items) == 1: if len(items) == 1:

View File

@ -66,7 +66,7 @@ class SongImport(object):
self.copyright_string = unicode(translate( self.copyright_string = unicode(translate(
'SongsPlugin.SongImport', 'copyright')) 'SongsPlugin.SongImport', 'copyright'))
self.copyright_symbol = unicode(translate( self.copyright_symbol = unicode(translate(
'SongsPlugin.SongImport', u'\u00a9'.encode('utf8'))) 'SongsPlugin.SongImport', '\xa9'))
@staticmethod @staticmethod
def process_songs_text(manager, text): def process_songs_text(manager, text):

View File

@ -49,7 +49,7 @@ class SongsPlugin(Plugin):
""" """
Create and set up the Songs plugin. Create and set up the Songs plugin.
""" """
Plugin.__init__(self, u'Songs', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'Songs', u'1.9.2', plugin_helpers)
self.weight = -10 self.weight = -10
self.manager = SongManager() self.manager = SongManager()
self.icon = build_icon(u':/media/media_song.png') self.icon = build_icon(u':/media/media_song.png')
@ -194,4 +194,3 @@ class SongsPlugin(Plugin):
if len(self.manager.get_songs_for_theme(theme)) == 0: if len(self.manager.get_songs_for_theme(theme)) == 0:
return True return True
return False return False

View File

@ -40,7 +40,7 @@ class SongUsagePlugin(Plugin):
log.info(u'SongUsage Plugin loaded') log.info(u'SongUsage Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
Plugin.__init__(self, u'SongUsage', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'SongUsage', u'1.9.2', plugin_helpers)
self.weight = -4 self.weight = -4
self.icon = build_icon(u':/media/media_image.png') self.icon = build_icon(u':/media/media_image.png')
self.songusagemanager = None self.songusagemanager = None

4254
resources/i18n/openlp_af.ts Normal file

File diff suppressed because one or more lines are too long

4259
resources/i18n/openlp_de.ts Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

4253
resources/i18n/openlp_es.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -262,6 +262,11 @@ This General Public License does not permit incorporating your program into prop
<source>Show an alert message</source> <source>Show an alert message</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/alerts/alertsplugin.py" line="97"/>
<source>&lt;b&gt;Alerts Plugin&lt;/b&gt;&lt;br&gt;This plugin controls the displaying of alerts on the presentations screen</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>AlertsPlugin.AlertForm</name> <name>AlertsPlugin.AlertForm</name>
@ -321,6 +326,14 @@ This General Public License does not permit incorporating your program into prop
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>AlertsPlugin.AlertsManager</name>
<message>
<location filename="openlp/plugins/alerts/lib/alertsmanager.py" line="95"/>
<source>Alert message created and delayed</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>AlertsPlugin.AlertsTab</name> <name>AlertsPlugin.AlertsTab</name>
<message> <message>
@ -723,10 +736,15 @@ This General Public License does not permit incorporating your program into prop
<context> <context>
<name>BiblePlugin</name> <name>BiblePlugin</name>
<message> <message>
<location filename="openlp/plugins/bibles/bibleplugin.py" line="73"/> <location filename="openlp/plugins/bibles/bibleplugin.py" line="84"/>
<source>&amp;Bible</source> <source>&amp;Bible</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/bibles/bibleplugin.py" line="93"/>
<source>&lt;strong&gt;Bible Plugin&lt;/strong&gt;&lt;br /&gt;This plugin allows bible verses from different sources to be displayed on the screen during the service.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>BiblesPlugin,BiblesTab</name> <name>BiblesPlugin,BiblesTab</name>
@ -795,6 +813,20 @@ This General Public License does not permit incorporating your program into prop
<source>Display Dual Bible Verses</source> <source>Display Dual Bible Verses</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/bibles/lib/biblestab.py" line="154"/>
<source>Only show new chapter numbers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BiblesPlugin.BiblesTab</name>
<message>
<location filename="openlp/plugins/bibles/lib/biblestab.py" line="177"/>
<source>Note:
Changes don&apos;t affect verses already in the service</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>BiblesPlugin.ImportWizardForm</name> <name>BiblesPlugin.ImportWizardForm</name>
@ -938,6 +970,126 @@ This General Public License does not permit incorporating your program into prop
<source>Starting import...</source> <source>Starting import...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/bibles/forms/bibleimportwizard.py" line="313"/>
<source>Welcome to the Bible Import Wizard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/bibleimportwizard.py" line="317"/>
<source>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.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/bibleimportwizard.py" line="322"/>
<source>Select Import Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/bibleimportwizard.py" line="324"/>
<source>Select the import format, and where to import from.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/bibleimportwizard.py" line="362"/>
<source>Proxy Server (Optional)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/bibleimportwizard.py" line="368"/>
<source>Set up the Bible&apos;s license details.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/bibleimportwizard.py" line="379"/>
<source>Please wait while your Bible is imported.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="125"/>
<source>Invalid Bible Location</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="125"/>
<source>You need to specify a file to import your Bible from.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="136"/>
<source>Invalid Books File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="136"/>
<source>You need to specify a file with books of the Bible to use in the import.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="146"/>
<source>Invalid Verse File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="146"/>
<source>You need to specify a file of Bible verses to import.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="158"/>
<source>Invalid OpenSong Bible</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="158"/>
<source>You need to specify an OpenSong Bible file to import.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="174"/>
<source>Empty Version Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="174"/>
<source>You need to specify a version name for your Bible.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="184"/>
<source>Empty Copyright</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="184"/>
<source>You need to set a copyright for your Bible! Bibles in the Public Domain need to be marked as such.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="195"/>
<source>Bible Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="195"/>
<source>This Bible already exists! Please import a different Bible or first delete the existing one.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="242"/>
<source>Open Verses CSV File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="447"/>
<source>Finished import.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/bibles/forms/importwizardform.py" line="451"/>
<source>Your Bible import failed.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>BiblesPlugin.MediaItem</name> <name>BiblesPlugin.MediaItem</name>
@ -1046,6 +1198,11 @@ This General Public License does not permit incorporating your program into prop
<source>Bible not fully loaded</source> <source>Bible not fully loaded</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/bibles/lib/mediaitem.py" line="387"/>
<source>No matching book could be found in this Bible.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>BiblesPlugin.Opensong</name> <name>BiblesPlugin.Opensong</name>
@ -1055,6 +1212,14 @@ This General Public License does not permit incorporating your program into prop
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>CustomPlugin</name>
<message>
<location filename="openlp/plugins/custom/customplugin.py" line="70"/>
<source>&lt;b&gt;Custom Plugin&lt;/b&gt;&lt;br&gt;This plugin allows slides to be displayed on the screen in the same way songs are. This plugin provides greater freedom over the songs plugin.&lt;br&gt;</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>CustomPlugin.CustomTab</name> <name>CustomPlugin.CustomTab</name>
<message> <message>
@ -1067,6 +1232,11 @@ This General Public License does not permit incorporating your program into prop
<source>Display Footer</source> <source>Display Footer</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/custom/lib/customtab.py" line="58"/>
<source>Custom Display</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>CustomPlugin.EditCustomForm</name> <name>CustomPlugin.EditCustomForm</name>
@ -1171,22 +1341,22 @@ This General Public License does not permit incorporating your program into prop
<translation type="unfinished">Autorid:</translation> <translation type="unfinished">Autorid:</translation>
</message> </message>
<message> <message>
<location filename="openlp/plugins/custom/forms/editcustomform.py" line="89"/> <location filename="openlp/plugins/custom/forms/editcustomform.py" line="88"/>
<source>Save &amp;&amp; Preview</source> <source>Save &amp;&amp; Preview</source>
<translation type="unfinished">Salvesta &amp;&amp; eelvaatle</translation> <translation type="unfinished">Salvesta &amp;&amp; eelvaatle</translation>
</message> </message>
<message> <message>
<location filename="openlp/plugins/custom/forms/editcustomform.py" line="152"/> <location filename="openlp/plugins/custom/forms/editcustomform.py" line="151"/>
<source>Error</source> <source>Error</source>
<translation type="unfinished">Viga</translation> <translation type="unfinished">Viga</translation>
</message> </message>
<message> <message>
<location filename="openlp/plugins/custom/forms/editcustomform.py" line="272"/> <location filename="openlp/plugins/custom/forms/editcustomform.py" line="271"/>
<source>You need to enter a title</source> <source>You need to enter a title</source>
<translation type="unfinished">Pead sisestama pealkirja</translation> <translation type="unfinished">Pead sisestama pealkirja</translation>
</message> </message>
<message> <message>
<location filename="openlp/plugins/custom/forms/editcustomform.py" line="277"/> <location filename="openlp/plugins/custom/forms/editcustomform.py" line="276"/>
<source>You need to enter a slide</source> <source>You need to enter a slide</source>
<translation type="unfinished">Pead sisenema slaidile</translation> <translation type="unfinished">Pead sisenema slaidile</translation>
</message> </message>
@ -1198,11 +1368,21 @@ This General Public License does not permit incorporating your program into prop
<source>Custom</source> <source>Custom</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/custom/lib/mediaitem.py" line="121"/>
<source>You must select an item to edit.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/custom/lib/mediaitem.py" line="133"/>
<source>You must select an item to delete.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>CustomPlugin.editCustomForm</name> <name>CustomPlugin.editCustomForm</name>
<message> <message>
<location filename="openlp/plugins/custom/forms/editcustomform.py" line="281"/> <location filename="openlp/plugins/custom/forms/editcustomform.py" line="280"/>
<source>You have unsaved data, please save or clear</source> <source>You have unsaved data, please save or clear</source>
<translation type="unfinished">Sul on salvestamata andmeid, palun salvesta või tühjenda</translation> <translation type="unfinished">Sul on salvestamata andmeid, palun salvesta või tühjenda</translation>
</message> </message>
@ -1962,6 +2142,11 @@ You can download the latest version from http://openlp.org</source>
<source>You must select one or more items to send live.</source> <source>You must select one or more items to send live.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/core/lib/mediamanageritem.py" line="492"/>
<source>You must select a %s service item.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaPlugin</name> <name>MediaPlugin</name>
@ -1992,7 +2177,7 @@ You can download the latest version from http://openlp.org</source>
<context> <context>
<name>OpenLP</name> <name>OpenLP</name>
<message> <message>
<location filename="openlp/core/utils/__init__.py" line="194"/> <location filename="openlp/core/utils/__init__.py" line="208"/>
<source>Image Files</source> <source>Image Files</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -2055,6 +2240,14 @@ You can download the latest version from http://openlp.org</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>PresentationPlugin</name>
<message>
<location filename="openlp/plugins/presentations/presentationplugin.py" line="111"/>
<source>&lt;b&gt;Presentation Plugin&lt;/b&gt; &lt;br&gt; Delivers the ability to show presentations using a number of different programs. The choice of available presentation programs is available to the user in a drop down box.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>PresentationPlugin.MediaItem</name> <name>PresentationPlugin.MediaItem</name>
<message> <message>
@ -2062,6 +2255,36 @@ You can download the latest version from http://openlp.org</source>
<source>Present using:</source> <source>Present using:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/presentations/lib/mediaitem.py" line="64"/>
<source>Presentation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/presentations/lib/mediaitem.py" line="68"/>
<source>Select Presentation(s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/presentations/lib/mediaitem.py" line="70"/>
<source>Automatic</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/presentations/lib/mediaitem.py" line="141"/>
<source>File exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/presentations/lib/mediaitem.py" line="141"/>
<source>A presentation with that filename already exists.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/presentations/lib/mediaitem.py" line="180"/>
<source>You must select an item to delete.</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>PresentationPlugin.PresentationTab</name> <name>PresentationPlugin.PresentationTab</name>
@ -2070,6 +2293,24 @@ You can download the latest version from http://openlp.org</source>
<source>available</source> <source>available</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/presentations/lib/presentationtab.py" line="40"/>
<source>Presentations</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/presentations/lib/presentationtab.py" line="92"/>
<source>Available Controllers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RemotePlugin</name>
<message>
<location filename="openlp/plugins/remotes/remoteplugin.py" line="72"/>
<source>&lt;b&gt;Remote Plugin&lt;/b&gt;&lt;br&gt;This plugin provides the ability to send messages to a running version of openlp on a different computer via a web browser or other app&lt;br&gt;The Primary use for this would be to send alerts from a creche</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>RemotePlugin.RemoteTab</name> <name>RemotePlugin.RemoteTab</name>
@ -2390,6 +2631,108 @@ The content encoding is not UTF-8.</source>
<translation>Muuda ja kuva laulu eelvaade uuesti</translation> <translation>Muuda ja kuva laulu eelvaade uuesti</translation>
</message> </message>
</context> </context>
<context>
<name>SongUsagePlugin</name>
<message>
<location filename="openlp/plugins/songusage/songusageplugin.py" line="62"/>
<source>&amp;Song Usage</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songusage/songusageplugin.py" line="66"/>
<source>&amp;Delete recorded data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songusage/songusageplugin.py" line="68"/>
<source>Delete song usage to specified date</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songusage/songusageplugin.py" line="73"/>
<source>&amp;Extract recorded data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songusage/songusageplugin.py" line="75"/>
<source>Generate report on Song Usage</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songusage/songusageplugin.py" line="84"/>
<source>Song Usage Status</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songusage/songusageplugin.py" line="86"/>
<source>Start/Stop live song usage recording</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songusage/songusageplugin.py" line="161"/>
<source>&lt;b&gt;SongUsage Plugin&lt;/b&gt;&lt;br&gt;This plugin records the use of songs and when they have been used during a live service</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SongsPlugin</name>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="93"/>
<source>&amp;Song</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="95"/>
<source>Import songs using the import wizard.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="102"/>
<source>Songs of Fellowship (temp menu item)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="109"/>
<source>Import songs from the VOLS1_2.RTF, sof3words.rtf and sof4words.rtf supplied with the music books</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="118"/>
<source>Generic Document/Presentation Import (temp menu item)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="126"/>
<source>Import songs from Word/Writer/Powerpoint/Impress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="156"/>
<source>Open Songs of Fellowship file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="166"/>
<source>Import Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="166"/>
<source>Error importing Songs of Fellowship file.
OpenOffice.org must be installed and you must be using an unedited copy of the RTF included with the Songs of Fellowship Music Editions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="179"/>
<source>Open documents or presentations</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/songsplugin.py" line="188"/>
<source>&lt;strong&gt;Song Plugin&lt;/strong&gt;&lt;br /&gt;This plugin allows songs to be managed and displayed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>SongsPlugin.AuditDeleteDialog</name> <name>SongsPlugin.AuditDeleteDialog</name>
<message> <message>
@ -2415,6 +2758,11 @@ The content encoding is not UTF-8.</source>
<source>Report Location</source> <source>Report Location</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/songusage/forms/songusagedetaildialog.py" line="89"/>
<source>Song Usage Extraction</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SongsPlugin.AuthorsForm</name> <name>SongsPlugin.AuthorsForm</name>
@ -2900,6 +3248,31 @@ The content encoding is not UTF-8.</source>
<source>CCLI Licence: </source> <source>CCLI Licence: </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/songs/lib/mediaitem.py" line="71"/>
<source>Maintain the lists of authors, topics and books</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/lib/mediaitem.py" line="282"/>
<source>You must select an item to edit.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/lib/mediaitem.py" line="293"/>
<source>You must select an item to delete.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/lib/mediaitem.py" line="297"/>
<source>Delete song?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/lib/mediaitem.py" line="300"/>
<source>Delete %d songs?</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SongsPlugin.SongBookForm</name> <name>SongsPlugin.SongBookForm</name>
@ -2986,6 +3359,102 @@ The content encoding is not UTF-8.</source>
<source>No book selected!</source> <source>No book selected!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="229"/>
<source>Error</source>
<translation type="unfinished">Viga</translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="139"/>
<source>Couldn&apos;t add your author.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="151"/>
<source>Couldn&apos;t add your topic.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="165"/>
<source>Couldn&apos;t add your book.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="195"/>
<source>Couldn&apos;t save your author.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="211"/>
<source>Couldn&apos;t save your topic.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="229"/>
<source>Couldn&apos;t save your book.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="239"/>
<source>Are you sure you want to delete the selected author?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="239"/>
<source>This author can&apos;t be deleted, they are currently assigned to at least one song.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="239"/>
<source>No author selected!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="255"/>
<source>Are you sure you want to delete the selected topic?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="255"/>
<source>This topic can&apos;t be deleted, it is currently assigned to at least one song.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="255"/>
<source>No topic selected!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="271"/>
<source>Are you sure you want to delete the selected book?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="271"/>
<source>This book can&apos;t be deleted, it is currently assigned to at least one song.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SongsPlugin.SongUsageDeleteForm</name>
<message>
<location filename="openlp/plugins/songusage/forms/songusagedeleteform.py" line="44"/>
<source>Delete Selected Song Usage Events?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songusage/forms/songusagedeleteform.py" line="44"/>
<source>Are you sure you want to delete selected Song Usage data?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SongsPlugin.SongUsageDetailForm</name>
<message>
<location filename="openlp/plugins/songusage/forms/songusagedetailform.py" line="63"/>
<source>Output File Location</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SongsPlugin.SongsTab</name> <name>SongsPlugin.SongsTab</name>
@ -3004,6 +3473,11 @@ The content encoding is not UTF-8.</source>
<source>Enable search as you type</source> <source>Enable search as you type</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="openlp/plugins/songs/lib/songstab.py" line="68"/>
<source>Display Verses on Live Tool bar</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SongsPlugin.TopicsForm</name> <name>SongsPlugin.TopicsForm</name>
@ -3022,6 +3496,11 @@ The content encoding is not UTF-8.</source>
<source>Error</source> <source>Error</source>
<translation type="unfinished">Viga</translation> <translation type="unfinished">Viga</translation>
</message> </message>
<message>
<location filename="openlp/plugins/songs/forms/topicsform.py" line="51"/>
<source>You need to type in a topic name!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Splashscreen</name> <name>Splashscreen</name>

3904
resources/i18n/openlp_hu.ts Normal file

File diff suppressed because it is too large Load Diff

4960
resources/i18n/openlp_ko.ts Normal file

File diff suppressed because it is too large Load Diff

4491
resources/i18n/openlp_nb.ts Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4262
resources/i18n/openlp_sv.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -25,143 +25,210 @@
############################################################################### ###############################################################################
# Short description # Short description
# Steps for creating languages: # Steps for creating languages:
# 1. make shure that the openlp_en.ts file exist # 1. make sure that the openlp_en.ts file exist
# 2. go to scripts folder and start: # 2. go to scripts folder and start:
# python translation_utils.py -a # python translation_utils.py -a
############################################################################### ###############################################################################
import os import os
import urllib import urllib
import re
from optparse import OptionParser from optparse import OptionParser
from PyQt4 import QtCore from PyQt4 import QtCore
from BeautifulSoup import BeautifulSoup
ignore_pathes = [u"./scripts", u"./openlp/core/test"] class TranslationUtils(object):
ignore_files = [u"setup.py"] def __init__(self):
translation_path = u"http://pootle.projecthq.biz/export/openlp/" self.ignore_paths = [u'./scripts']
translations = [ u"en" self.ignore_files = [u'setup.py']
, u"af" self.server_url = u'http://pootle.projecthq.biz/export/openlp/'
, u"en_ZA" self.cmd_stack = []
, u"en_GB" self.stack_count = 0
, u"de" self.verbose = False
, u"hu"
, u"ko"
, u"nb"
, u"pt_BR"
, u"es"
, u"sv"]
def write_file(filename, stringlist):
content = u''
for line in stringlist:
content = u'%s%s\n' % (content, line)
file = open(filename, u'w')
file.write(content.encode('utf8'))
file.close()
def main(): def process_stack(self):
# Set up command line options. if len(self.cmd_stack) > 0:
usage = u'Usage: %prog [options]' if len(self.cmd_stack) == self.stack_count:
parser = OptionParser(usage=usage) print u'Process %d commands' % self.stack_count
parser.add_option("-d", "--download-ts", action="store_true", print u'%d. ' % (self.stack_count-len(self.cmd_stack)+1),
dest="download", help="Load languages from Pootle Server") command = self.cmd_stack.pop(0)
parser.add_option("-p", "--prepare", action="store_true", dest="prepare", if len(command) > 1:
help="preparation (generate pro file)") command[0](command[1])
parser.add_option("-u", "--update", action="store_true", dest="update", else:
help="update translation files") command[0]()
parser.add_option("-g", "--generate", action="store_true", dest="generate", else:
help="generate qm files") print "Finished all commands"
parser.add_option("-a", "--all", action="store_true", dest="all",
help="proceed all options")
(options, args) = parser.parse_args()
if options.download:
downloadTranslations()
elif options.prepare:
preparation()
elif options.update:
update()
elif options.generate:
generate()
elif options.all:
all()
else:
pass
def downloadTranslations(): def downloadTranslations(self):
print "download()" print 'Download Translation files from HQ-Server'
for language in translations: page = urllib.urlopen(u'%s' % (self.server_url))
filename = os.path.join(u'..', u'resources', u'i18n', soup = BeautifulSoup(page)
u"openlp_%s.ts" % language) languages = soup.findAll(text=re.compile(".*\.ts"))
print filename for language in languages:
page = urllib.urlopen(u"%s%s.ts" % (translation_path, language)) filename = os.path.join(u'..', u'resources', u'i18n',
content = page.read().decode("utf8") u'openlp_%s' % language)
self.printVerbose(u'Get Translation File: %s' % filename)
self.get_and_write_file(language, filename)
print u' done'
self.process_stack()
def get_and_write_file(self, language, filename):
page = urllib.urlopen(u'%s%s' % (self.server_url, language))
content = page.read().decode('utf8')
page.close() page.close()
file = open(filename, u'w') file = open(filename, u'w')
file.write(content.encode('utf8')) file.write(content.encode('utf8'))
file.close() file.close()
def preparation(): def creation(self, language):
stringlist = [] print "Create new Translation File"
start_dir = os.path.join(u'..') """
for root, dirs, files in os.walk(start_dir): Use this option to create a new translation file
for file in files: this function:
path = u"%s" % root * create the new *.ts file
path = path.replace("\\","/") """
path = path.replace("..",".") filename = os.path.join(u'..', u'resources', u'i18n',
u'openlp_%s.ts' % language)
self.get_and_write_file(u'en.ts', filename)
self.printVerbose("""
Please remind: For permanent providing this language:
this language name have to append to the global list
variable "translations" in this file
and this file have to be uploaded to the Pootle Server
Please contact the developers!
""")
print u' done'
self.process_stack()
if file.startswith(u'hook-') or file.startswith(u'test_'):
continue
cond = False def preparation(self):
for search in ignore_pathes: print u'Generating the openlp.pro file'
if path.startswith(search): stringlist = []
cond = True start_dir = os.path.join(u'..')
if cond: for root, dirs, files in os.walk(start_dir):
continue for file in files:
cond = False path = u'%s' % root
for search in ignore_files: path = path.replace('\\','/')
if search == file: path = path.replace('..','.')
cond = True
if cond:
continue
if file.endswith(u'.py'): if file.startswith(u'hook-') or file.startswith(u'test_'):
line = u"%s/%s" % (path, file) continue
print u'Parsing "%s"' % line
stringlist.append(u"SOURCES += %s" % line)
elif file.endswith(u'.pyw'):
line = u"%s/%s" % (path, file)
print u'Parsing "%s"' % line
stringlist.append(u"SOURCES += %s" % line)
elif file.endswith(u'.ts'):
line = u"%s/%s" % (path, file)
print u'Parsing "%s"' % line
stringlist.append(u"TRANSLATIONS += %s" % line)
print u'Generating PRO file...', cond = False
stringlist.sort() for search in self.ignore_paths:
write_file(os.path.join(start_dir, u'openlp.pro'), stringlist) if path.startswith(search):
print u'done.' cond = True
if cond:
continue
cond = False
for search in self.ignore_files:
if search == file:
cond = True
if cond:
continue
def update(): if file.endswith(u'.py'):
print "update()" line = u'%s/%s' % (path, file)
updateProcess = QtCore.QProcess() self.printVerbose(u'Parsing "%s"' % line)
updateProcess.start(u"pylupdate4 -noobsolete ../openlp.pro") stringlist.append(u'SOURCES += %s' % line)
updateProcess.waitForFinished(60000) elif file.endswith(u'.pyw'):
line = u'%s/%s' % (path, file)
self.printVerbose(u'Parsing "%s"' % line)
stringlist.append(u'SOURCES += %s' % line)
elif file.endswith(u'.ts'):
line = u'%s/%s' % (path, file)
self.printVerbose(u'Parsing "%s"' % line)
stringlist.append(u'TRANSLATIONS += %s' % line)
def generate(): stringlist.sort()
print "generate()" self.write_file(os.path.join(start_dir, u'openlp.pro'), stringlist)
generateProcess = QtCore.QProcess() print u' done'
generateProcess.start(u"lrelease ../openlp.pro") self.process_stack()
generateProcess.waitForFinished(60000)
def update(self):
print u'Update the translation files'
cmd = u'pylupdate4 -verbose -noobsolete ../openlp.pro'
self.start_cmd(cmd)
def generate(self):
print u'Generate the related *.qm files'
cmd = u'lrelease ../openlp.pro'
self.start_cmd(cmd)
def write_file(self, filename, stringlist):
content = u''
for line in stringlist:
content = u'%s%s\n' % (content, line)
file = open(filename, u'w')
file.write(content.encode('utf8'))
file.close()
def printVerbose(self, data):
if self.verbose:
print u' %s' % data
def start_cmd(self, command):
self.printVerbose(command)
self.process = QtCore.QProcess()
self.process.start(command)
while (self.process.waitForReadyRead()):
self.printVerbose(u'ReadyRead: %s' % QtCore.QString(self.process.readAll()))
self.printVerbose(self.process.readAllStandardError())
self.printVerbose(self.process.readAllStandardOutput())
print u' done'
self.process_stack()
def main():
# start Main Class
Util = TranslationUtils()
# Set up command line options.
usage = u'''
This script handle the translation files for OpenLP.
Usage: %prog [options]
If no option will be used, options "-d -p -u -g" will be set automatically
'''
parser = OptionParser(usage=usage)
parser.add_option('-d', '--download-ts', action='store_true',
dest='download', help='Load languages from Pootle Server')
parser.add_option('-c', '--create', metavar='lang',
help='creation of new translation file, Parameter: language (e.g. "en_GB"')
parser.add_option('-p', '--prepare', action='store_true', dest='prepare',
help='preparation (generate pro file)')
parser.add_option('-u', '--update', action='store_true', dest='update',
help='update translation files')
parser.add_option('-g', '--generate', action='store_true', dest='generate',
help='generate qm files')
parser.add_option('-v', '--verbose', action='store_true', dest='verbose',
help='Give more informations while processing')
(options, args) = parser.parse_args()
if options.download:
Util.cmd_stack.append([Util.downloadTranslations])
if options.create:
Util.cmd_stack.append([Util.creation, u'%s' % options.create])
if options.prepare:
Util.cmd_stack.append([Util.preparation])
if options.update:
Util.cmd_stack.append([Util.update])
if options.generate:
Util.cmd_stack.append([Util.generate])
if options.verbose:
Util.verbose = True
if len(Util.cmd_stack) == 0:
Util.cmd_stack.append([Util.downloadTranslations])
Util.cmd_stack.append([Util.preparation])
Util.cmd_stack.append([Util.update])
Util.cmd_stack.append([Util.generate])
Util.stack_count = len(Util.cmd_stack)
Util.process_stack()
def all():
print "all()"
downloadTranslations()
preparation()
update()
generate()
if __name__ == u'__main__': if __name__ == u'__main__':