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)
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):
"""

View File

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

View File

@ -343,19 +343,6 @@ class MediaManagerItem(QtGui.QWidget):
"""
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):
files = QtGui.QFileDialog.getOpenFileNames(
self, self.OnNewPrompt,

View File

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

View File

@ -50,6 +50,7 @@ class Ui_AmendThemeDialog(object):
self.ThemeNameLayout.addWidget(self.ThemeNameLabel)
self.ThemeNameEdit = QtGui.QLineEdit(self.ThemeNameWidget)
self.ThemeNameEdit.setObjectName(u'ThemeNameEdit')
self.ThemeNameLabel.setBuddy(self.ThemeNameEdit)
self.ThemeNameLayout.addWidget(self.ThemeNameEdit)
self.AmendThemeLayout.addWidget(self.ThemeNameWidget)
self.ContentWidget = QtGui.QWidget(AmendThemeDialog)
@ -72,6 +73,7 @@ class Ui_AmendThemeDialog(object):
self.BackgroundLabel)
self.BackgroundComboBox = QtGui.QComboBox(self.BackgroundTab)
self.BackgroundComboBox.setObjectName(u'BackgroundComboBox')
self.BackgroundLabel.setBuddy(self.BackgroundComboBox)
self.BackgroundComboBox.addItem(QtCore.QString())
self.BackgroundComboBox.addItem(QtCore.QString())
self.BackgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole,
@ -752,9 +754,9 @@ class Ui_AmendThemeDialog(object):
AmendThemeDialog.setWindowTitle(
translate('AmendThemeForm', 'Theme Maintenance'))
self.ThemeNameLabel.setText(
translate('AmendThemeForm', 'Theme Name:'))
translate('AmendThemeForm', 'Theme &Name:'))
self.BackgroundLabel.setText(
translate('AmendThemeForm', 'Visibility:'))
translate('AmendThemeForm', '&Visibility:'))
self.BackgroundComboBox.setItemText(0,
translate('AmendThemeForm', 'Opaque'))
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
"""
log.debug(u'mainDisplaySetBackground')
if not self.mainDisplay.primary:
self.blankButton.setChecked(True)
@ -672,12 +673,12 @@ class SlideController(QtGui.QWidget):
def onBlankDisplay(self, checked):
"""
Handle the blank screen button
Handle the blank screen button actions
"""
log.debug(u'onBlankDisplay %d' % checked)
self.hideButton.setChecked(False)
self.themeButton.setChecked(False)
self.canDisplay = not checked
self.canDisplay = not checked
QtCore.QSettings().setValue(
self.parent.generalSettingsSection + u'/screen blank',
QtCore.QVariant(checked))
@ -722,6 +723,7 @@ class SlideController(QtGui.QWidget):
"""
Blank the display screen within a plugin if required.
"""
log.debug(u'blankPlugin %d ', blank)
if self.serviceItem is not None:
if 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.lib import OpenLPToolbar, context_menu_action, \
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
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
theme editing form so the user can make their changes.
"""
item = self.ThemeListWidget.currentItem()
if item:
if check_item_selected(self.ThemeListWidget, translate('ThemeManager',
'You must select a theme to edit.')):
item = self.ThemeListWidget.currentItem()
theme = self.getThemeData(
unicode(item.data(QtCore.Qt.UserRole).toString()))
self.amendThemeForm.loadTheme(theme)
@ -198,8 +199,9 @@ class ThemeManager(QtGui.QWidget):
self.global_theme = unicode(QtCore.QSettings().value(
self.settingsSection + u'/global theme',
QtCore.QVariant(u'')).toString())
item = self.ThemeListWidget.currentItem()
if item:
if check_item_selected(self.ThemeListWidget, translate('ThemeManager',
'You must select a theme to delete.')):
item = self.ThemeListWidget.currentItem()
theme = unicode(item.text())
# should be the same unless default
if theme != unicode(item.data(QtCore.Qt.UserRole).toString()):

View File

@ -37,7 +37,7 @@ class alertsPlugin(Plugin):
log.info(u'Alerts Plugin loaded')
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.icon = build_icon(u':/media/media_image.png')
self.alertsmanager = AlertsManager(self)
@ -97,4 +97,4 @@ class alertsPlugin(Plugin):
about_text = translate('AlertsPlugin',
'<b>Alerts Plugin</b><br>This plugin '
'controls the displaying of alerts on the presentations screen')
return about_text
return about_text

View File

@ -36,7 +36,7 @@ class BiblePlugin(Plugin):
log.info(u'Bible Plugin loaded')
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.icon = build_icon(u':/media/media_bible.png')
#Register the bible Manager
@ -99,4 +99,4 @@ class BiblePlugin(Plugin):
def can_delete_theme(self, theme):
if self.settings_tab.bible_theme == theme:
return False
return True
return True

View File

@ -43,7 +43,8 @@ class BibleListView(BaseListWithDnD):
BaseListWithDnD.__init__(self, parent)
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):

View File

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

@ -43,7 +43,7 @@ class CustomPlugin(Plugin):
log.info(u'Custom Plugin loaded')
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.custommanager = CustomManager()
self.edit_custom_form = EditCustomForm(self.custommanager)
@ -77,4 +77,4 @@ class CustomPlugin(Plugin):
def can_delete_theme(self, theme):
if len(self.custommanager.get_customs_for_theme(theme)) == 0:
return True
return False
return False

View File

@ -43,6 +43,7 @@ class Ui_customEditDialog(object):
self.TitleLabel.setObjectName(u'TitleLabel')
self.horizontalLayout.addWidget(self.TitleLabel)
self.TitleEdit = QtGui.QLineEdit(customEditDialog)
self.TitleLabel.setBuddy(self.TitleEdit)
self.TitleEdit.setObjectName(u'TitleEdit')
self.horizontalLayout.addWidget(self.TitleEdit)
self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
@ -118,6 +119,7 @@ class Ui_customEditDialog(object):
self.ThemeLabel.setObjectName(u'ThemeLabel')
self.horizontalLayout_3.addWidget(self.ThemeLabel)
self.ThemeComboBox = QtGui.QComboBox(customEditDialog)
self.ThemeLabel.setBuddy(self.ThemeComboBox)
self.ThemeComboBox.setObjectName(u'ThemeComboBox')
self.horizontalLayout_3.addWidget(self.ThemeComboBox)
self.gridLayout.addLayout(self.horizontalLayout_3, 3, 0, 1, 1)
@ -127,6 +129,7 @@ class Ui_customEditDialog(object):
self.CreditLabel.setObjectName(u'CreditLabel')
self.horizontalLayout_2.addWidget(self.CreditLabel)
self.CreditEdit = QtGui.QLineEdit(customEditDialog)
self.CreditLabel.setBuddy(self.CreditEdit)
self.CreditEdit.setObjectName(u'CreditEdit')
self.horizontalLayout_2.addWidget(self.CreditEdit)
self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1)
@ -162,7 +165,7 @@ class Ui_customEditDialog(object):
self.DownButton.setToolTip(
translate('CustomPlugin.EditCustomForm', 'Move slide down 1'))
self.TitleLabel.setText(
translate('CustomPlugin.EditCustomForm', 'Title:'))
translate('CustomPlugin.EditCustomForm', '&Title:'))
self.AddButton.setText(
translate('CustomPlugin.EditCustomForm', 'Add New'))
self.AddButton.setToolTip(
@ -192,7 +195,7 @@ class Ui_customEditDialog(object):
self.SplitButton.setToolTip(
translate('CustomPlugin.EditCustomForm', 'Add slide split'))
self.ThemeLabel.setText(
translate('CustomPlugin.EditCustomForm', 'Theme:'))
translate('CustomPlugin.EditCustomForm', 'The&me:'))
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 openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD, \
Receiver, ItemCapabilities, translate
Receiver, ItemCapabilities, translate, check_item_selected
log = logging.getLogger(__name__)
@ -118,7 +118,8 @@ class CustomMediaItem(MediaManagerItem):
"""
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.')):
item = self.ListView.currentItem()
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
"""
if self.checkItemSelected(translate('CustomPlugin.MediaItem',
if check_item_selected(self.ListView,
translate('CustomPlugin.MediaItem',
'You must select an item to delete.')):
item = self.ListView.currentItem()
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]

View File

@ -34,7 +34,7 @@ class ImagePlugin(Plugin):
log.info(u'Image Plugin loaded')
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.icon = build_icon(u':/media/media_image.png')
self.status = PluginStatus.Active
@ -64,4 +64,4 @@ class ImagePlugin(Plugin):
'an image is selected any songs which are rendered will use the '
'selected image from the background instead of the one provied by '
'the theme.<br>')
return about_text
return about_text

View File

@ -29,7 +29,8 @@ import os
from PyQt4 import QtCore, QtGui
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
log = logging.getLogger(__name__)
@ -116,7 +117,7 @@ class ImageMediaItem(MediaManagerItem):
"""
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.')):
items = self.ListView.selectedIndexes()
for item in items:

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
ItemCapabilities, SettingsManager, translate
ItemCapabilities, SettingsManager, translate, check_item_selected
log = logging.getLogger(__name__)
@ -141,7 +141,7 @@ class MediaMediaItem(MediaManagerItem):
"""
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.')):
item = self.ListView.currentItem()
row = self.ListView.row(item)

View File

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

View File

@ -331,7 +331,10 @@ class ImpressDocument(PresentationDocument):
def stop_presentation(self):
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):
log.debug(u'start presentation OpenOffice')

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
SettingsManager, translate
SettingsManager, translate, check_item_selected
from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import MessageListener
@ -177,7 +177,8 @@ class PresentationMediaItem(MediaManagerItem):
"""
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.')):
item = self.ListView.currentItem()
row = self.ListView.row(item)

View File

@ -41,31 +41,31 @@ class Controller(object):
log.info(u'Controller loaded')
def __init__(self, live):
self.isLive = live
self.is_live = live
self.doc = None
log.info(u'%s controller loaded' % live)
def addHandler(self, controller, file, isBlank):
log.debug(u'Live = %s, addHandler %s' % (self.isLive, file))
def add_handler(self, controller, file, is_blank):
log.debug(u'Live = %s, add_handler %s' % (self.is_live, file))
self.controller = controller
if self.doc is not None:
self.shutdown()
self.doc = self.controller.add_doc(file)
self.doc.load_presentation()
if self.isLive:
if self.is_live:
self.doc.start_presentation()
if isBlank:
if is_blank:
self.blank()
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
self.doc.slidenumber = 0
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():
return
if not self.doc.is_loaded():
self.doc.load_presentation()
if self.isLive:
if self.is_live:
self.doc.start_presentation()
if self.doc.slidenumber > 1:
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
"""
log.debug(u'Live = %s, first' % self.isLive)
if not self.isLive:
log.debug(u'Live = %s, first' % self.is_live)
if not self.is_live:
return
if self.doc.is_blank():
self.doc.slidenumber = 1
return
self.activate()
self.doc.start_presentation()
self.doc.poll_slidenumber(self.isLive)
self.doc.poll_slidenumber(self.is_live)
def last(self):
"""
Based on the handler passed at startup triggers the first slide
"""
log.debug(u'Live = %s, last' % self.isLive)
if not self.isLive:
log.debug(u'Live = %s, last' % self.is_live)
if not self.is_live:
return
if self.doc.is_blank():
self.doc.slidenumber = self.doc.get_slide_count()
return
self.activate()
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):
"""
Based on the handler passed at startup triggers the next slide event
"""
log.debug(u'Live = %s, next' % self.isLive)
if not self.isLive:
log.debug(u'Live = %s, next' % self.is_live)
if not self.is_live:
return
if self.doc.is_blank():
if self.doc.slidenumber < self.doc.get_slide_count():
@ -122,14 +122,14 @@ class Controller(object):
return
self.activate()
self.doc.next_step()
self.doc.poll_slidenumber(self.isLive)
self.doc.poll_slidenumber(self.is_live)
def previous(self):
"""
Based on the handler passed at startup triggers the previous slide event
"""
log.debug(u'Live = %s, previous' % self.isLive)
if not self.isLive:
log.debug(u'Live = %s, previous' % self.is_live)
if not self.is_live:
return
if self.doc.is_blank():
if self.doc.slidenumber > 1:
@ -137,14 +137,14 @@ class Controller(object):
return
self.activate()
self.doc.previous_step()
self.doc.poll_slidenumber(self.isLive)
self.doc.poll_slidenumber(self.is_live)
def shutdown(self):
"""
Based on the handler passed at startup triggers slide show to shut down
"""
log.debug(u'Live = %s, shutdown' % self.isLive)
if self.isLive:
log.debug(u'Live = %s, shutdown' % self.is_live)
if self.is_live:
Receiver.send_message(u'maindisplay_show')
self.doc.close_presentation()
self.doc = None
@ -152,8 +152,8 @@ class Controller(object):
#self.timer.stop()
def blank(self):
log.debug(u'Live = %s, blank' % self.isLive)
if not self.isLive:
log.debug(u'Live = %s, blank' % self.is_live)
if not self.is_live:
return
if not self.doc.is_loaded():
return
@ -162,8 +162,8 @@ class Controller(object):
self.doc.blank_screen()
def stop(self):
log.debug(u'Live = %s, stop' % self.isLive)
if not self.isLive:
log.debug(u'Live = %s, stop' % self.is_live)
if not self.is_live:
return
if not self.doc.is_loaded():
return
@ -172,8 +172,8 @@ class Controller(object):
self.doc.stop_presentation()
def unblank(self):
log.debug(u'Live = %s, unblank' % self.isLive)
if not self.isLive:
log.debug(u'Live = %s, unblank' % self.is_live)
if not self.is_live:
return
self.activate()
if self.doc.slidenumber and \
@ -183,7 +183,7 @@ class Controller(object):
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
def poll(self):
self.doc.poll_slidenumber(self.isLive)
self.doc.poll_slidenumber(self.is_live)
class MessageListener(object):
"""
@ -195,8 +195,8 @@ class MessageListener(object):
def __init__(self, mediaitem):
self.controllers = mediaitem.controllers
self.mediaitem = mediaitem
self.previewHandler = Controller(False)
self.liveHandler = Controller(True)
self.preview_handler = Controller(False)
self.live_handler = Controller(True)
# messages are sent from core.ui.slidecontroller
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_start'), self.startup)
@ -228,9 +228,10 @@ class MessageListener(object):
Start of new presentation
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)
isBlank = message[2]
is_blank = message[2]
file = os.path.join(item.get_frame_path(),
item.get_frame_title())
self.handler = item.title
@ -238,75 +239,71 @@ class MessageListener(object):
self.handler = self.mediaitem.findControllerByType(file)
if not self.handler:
return
if isLive:
controller = self.liveHandler
if is_live:
controller = self.live_handler
else:
controller = self.previewHandler
controller.addHandler(self.controllers[self.handler], file, isBlank)
def decode_message(self, message):
if len(message) == 3:
return message[1], message[0], message[2]
else:
return message[1], message[0]
controller = self.preview_handler
controller.add_handler(self.controllers[self.handler], file, is_blank)
def slide(self, message):
isLive, item, slide = self.decode_message(message)
if isLive:
self.liveHandler.slide(slide, isLive)
is_live = message[1]
slide = message[2]
item = message[0]
if is_live:
self.live_handler.slide(slide, item)
else:
self.previewHandler.slide(slide, isLive)
self.preview_handler.slide(slide, item)
def first(self, message):
isLive = self.decode_message(message)[0]
if isLive:
self.liveHandler.first()
is_live = message[1]
if is_live:
self.live_handler.first()
else:
self.previewHandler.first()
self.preview_handler.first()
def last(self, message):
isLive = self.decode_message(message)[0]
if isLive:
self.liveHandler.last()
is_live = message[1]
if is_live:
self.live_handler.last()
else:
self.previewHandler.last()
self.preview_handler.last()
def next(self, message):
isLive = self.decode_message(message)[0]
if isLive:
self.liveHandler.next()
is_live = message[1]
if is_live:
self.live_handler.next()
else:
self.previewHandler.next()
self.preview_handler.next()
def previous(self, message):
isLive = self.decode_message(message)[0]
if isLive:
self.liveHandler.previous()
is_live = message[1]
if is_live:
self.live_handler.previous()
else:
self.previewHandler.previous()
self.preview_handler.previous()
def shutdown(self, message):
isLive = self.decode_message(message)[0]
if isLive:
is_live = message[1]
if is_live:
Receiver.send_message(u'maindisplay_show')
self.liveHandler.shutdown()
self.live_handler.shutdown()
else:
self.previewHandler.shutdown()
self.preview_handler.shutdown()
def hide(self, message):
isLive = self.decode_message(message)[0]
if isLive:
self.liveHandler.stop()
is_live = message[1]
if is_live:
self.live_handler.stop()
def blank(self, message):
isLive = self.decode_message(message)[0]
if isLive:
self.liveHandler.blank()
is_live = message[1]
if is_live:
self.live_handler.blank()
def unblank(self, message):
isLive = self.decode_message(message)[0]
if isLive:
self.liveHandler.unblank()
is_live = message[1]
if is_live:
self.live_handler.unblank()
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
import _winreg
import win32ui
import pywintypes
from presentationcontroller import PresentationController, PresentationDocument
@ -65,7 +66,7 @@ class PowerpointController(PresentationController):
_winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,
u'PowerPoint.Application').Close()
return True
except:
except WindowsError:
pass
return False
@ -91,7 +92,7 @@ class PowerpointController(PresentationController):
return
try:
self.process.Quit()
except:
except pywintypes.com_error:
pass
self.process = None
@ -121,11 +122,8 @@ class PowerpointDocument(PresentationDocument):
log.debug(u'LoadPresentation')
if not self.controller.process.Visible:
self.controller.start_process()
#try:
self.controller.process.Presentations.Open(self.filepath, False, False,
True)
#except:
# return
self.presentation = self.controller.process.Presentations(
self.controller.process.Presentations.Count)
self.create_thumbnails()
@ -154,7 +152,7 @@ class PowerpointDocument(PresentationDocument):
if self.presentation:
try:
self.presentation.Close()
except:
except pywintypes.com_error:
pass
self.presentation = None
self.controller.remove_doc(self)
@ -170,7 +168,7 @@ class PowerpointDocument(PresentationDocument):
return False
if self.controller.process.Presentations.Count == 0:
return False
except:
except (AttributeError, pywintypes.com_error):
return False
return True
@ -186,7 +184,7 @@ class PowerpointDocument(PresentationDocument):
return False
if self.presentation.SlideShowWindow.View is None:
return False
except:
except (AttributeError, pywintypes.com_error):
return False
return True
@ -208,7 +206,10 @@ class PowerpointDocument(PresentationDocument):
"""
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):
"""
@ -224,11 +225,11 @@ class PowerpointDocument(PresentationDocument):
#SlideShowWindow measures its size/position by points, not pixels
try:
dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88)
except:
except win32ui.error:
try:
dpi = \
win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88)
except:
except win32ui.error:
dpi = 96
self.presentation.SlideShowSettings.Run()
self.presentation.SlideShowWindow.View.GotoSlide(1)

View File

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

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 project can be built with the free Microsoft Visual C++ 2008 Express Edition.
USAGE
-----
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.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, "\"");
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);
SavePPTInfo(id);
if(pptviewobj[id].state==PPT_CLOSING){
if(pptviewobj[id].state==PPT_CLOSING||pptviewobj[id].slideCount<=0){
ClosePPT(id);
id=-1;
}

View File

@ -38,7 +38,7 @@ class PresentationPlugin(Plugin):
def __init__(self, plugin_helpers):
log.debug(u'Initialised')
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.icon = build_icon(u':/media/media_presentation.png')
self.status = PluginStatus.Active
@ -114,4 +114,3 @@ class PresentationPlugin(Plugin):
'programs. The choice of available presentation programs is '
'available to the user in a drop down box.')
return about_text

View File

@ -37,7 +37,7 @@ class RemotesPlugin(Plugin):
"""
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.server = None
@ -74,4 +74,4 @@ class RemotesPlugin(Plugin):
'provides the ability to send messages to a running version of '
'openlp on a different computer via a web browser or other app<br>'
'The Primary use for this would be to send alerts from a creche')
return about_text
return about_text

View File

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

View File

@ -589,7 +589,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
def onCopyrightInsertButtonTriggered(self):
text = self.CopyrightEditItem.text()
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.setFocus()
self.CopyrightEditItem.setCursorPosition(pos + 1)

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui
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, \
ImportWizardForm
@ -279,7 +279,7 @@ class SongMediaItem(MediaManagerItem):
"""
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.')):
item = self.ListView.currentItem()
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
@ -290,7 +290,7 @@ class SongMediaItem(MediaManagerItem):
"""
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.')):
items = self.ListView.selectedIndexes()
if len(items) == 1:

View File

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

View File

@ -49,7 +49,7 @@ class SongsPlugin(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.manager = SongManager()
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:
return True
return False

View File

@ -40,7 +40,7 @@ class SongUsagePlugin(Plugin):
log.info(u'SongUsage Plugin loaded')
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.icon = build_icon(u':/media/media_image.png')
self.songusagemanager = None
@ -162,4 +162,4 @@ class SongUsagePlugin(Plugin):
'<b>SongUsage Plugin</b><br>This plugin '
'records the use of songs and when they have been used during '
'a live service')
return about_text
return about_text

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>
<translation type="unfinished"></translation>
</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>
<name>AlertsPlugin.AlertForm</name>
@ -321,6 +326,14 @@ This General Public License does not permit incorporating your program into prop
<translation type="unfinished"></translation>
</message>
</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>
<name>AlertsPlugin.AlertsTab</name>
<message>
@ -723,10 +736,15 @@ This General Public License does not permit incorporating your program into prop
<context>
<name>BiblePlugin</name>
<message>
<location filename="openlp/plugins/bibles/bibleplugin.py" line="73"/>
<location filename="openlp/plugins/bibles/bibleplugin.py" line="84"/>
<source>&amp;Bible</source>
<translation type="unfinished"></translation>
</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>
<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>
<translation type="unfinished"></translation>
</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>
<name>BiblesPlugin.ImportWizardForm</name>
@ -938,6 +970,126 @@ This General Public License does not permit incorporating your program into prop
<source>Starting import...</source>
<translation type="unfinished"></translation>
</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>
<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>
<translation type="unfinished"></translation>
</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>
<name>BiblesPlugin.Opensong</name>
@ -1055,6 +1212,14 @@ This General Public License does not permit incorporating your program into prop
<translation type="unfinished"></translation>
</message>
</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>
<name>CustomPlugin.CustomTab</name>
<message>
@ -1067,6 +1232,11 @@ This General Public License does not permit incorporating your program into prop
<source>Display Footer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/custom/lib/customtab.py" line="58"/>
<source>Custom Display</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<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>
</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>
<translation type="unfinished">Salvesta &amp;&amp; eelvaatle</translation>
</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>
<translation type="unfinished">Viga</translation>
</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>
<translation type="unfinished">Pead sisestama pealkirja</translation>
</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>
<translation type="unfinished">Pead sisenema slaidile</translation>
</message>
@ -1198,11 +1368,21 @@ This General Public License does not permit incorporating your program into prop
<source>Custom</source>
<translation type="unfinished"></translation>
</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>
<name>CustomPlugin.editCustomForm</name>
<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>
<translation type="unfinished">Sul on salvestamata andmeid, palun salvesta või tühjenda</translation>
</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>
<translation type="unfinished"></translation>
</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>
<name>MediaPlugin</name>
@ -1992,7 +2177,7 @@ You can download the latest version from http://openlp.org</source>
<context>
<name>OpenLP</name>
<message>
<location filename="openlp/core/utils/__init__.py" line="194"/>
<location filename="openlp/core/utils/__init__.py" line="208"/>
<source>Image Files</source>
<translation type="unfinished"></translation>
</message>
@ -2055,6 +2240,14 @@ You can download the latest version from http://openlp.org</source>
<translation type="unfinished"></translation>
</message>
</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>
<name>PresentationPlugin.MediaItem</name>
<message>
@ -2062,6 +2255,36 @@ You can download the latest version from http://openlp.org</source>
<source>Present using:</source>
<translation type="unfinished"></translation>
</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>
<name>PresentationPlugin.PresentationTab</name>
@ -2070,6 +2293,24 @@ You can download the latest version from http://openlp.org</source>
<source>available</source>
<translation type="unfinished"></translation>
</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>
<name>RemotePlugin.RemoteTab</name>
@ -2390,6 +2631,108 @@ The content encoding is not UTF-8.</source>
<translation>Muuda ja kuva laulu eelvaade uuesti</translation>
</message>
</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>
<name>SongsPlugin.AuditDeleteDialog</name>
<message>
@ -2415,6 +2758,11 @@ The content encoding is not UTF-8.</source>
<source>Report Location</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="openlp/plugins/songusage/forms/songusagedetaildialog.py" line="89"/>
<source>Song Usage Extraction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SongsPlugin.AuthorsForm</name>
@ -2900,6 +3248,31 @@ The content encoding is not UTF-8.</source>
<source>CCLI Licence: </source>
<translation type="unfinished"></translation>
</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>
<name>SongsPlugin.SongBookForm</name>
@ -2986,6 +3359,102 @@ The content encoding is not UTF-8.</source>
<source>No book selected!</source>
<translation type="unfinished"></translation>
</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>
<name>SongsPlugin.SongsTab</name>
@ -3004,6 +3473,11 @@ The content encoding is not UTF-8.</source>
<source>Enable search as you type</source>
<translation type="unfinished"></translation>
</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>
<name>SongsPlugin.TopicsForm</name>
@ -3022,6 +3496,11 @@ The content encoding is not UTF-8.</source>
<source>Error</source>
<translation type="unfinished">Viga</translation>
</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>
<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
# 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:
# python translation_utils.py -a
###############################################################################
import os
import urllib
import re
from optparse import OptionParser
from PyQt4 import QtCore
from BeautifulSoup import BeautifulSoup
ignore_pathes = [u"./scripts", u"./openlp/core/test"]
ignore_files = [u"setup.py"]
translation_path = u"http://pootle.projecthq.biz/export/openlp/"
translations = [ u"en"
, u"af"
, u"en_ZA"
, u"en_GB"
, u"de"
, u"hu"
, u"ko"
, u"nb"
, u"pt_BR"
, u"es"
, u"sv"]
class TranslationUtils(object):
def __init__(self):
self.ignore_paths = [u'./scripts']
self.ignore_files = [u'setup.py']
self.server_url = u'http://pootle.projecthq.biz/export/openlp/'
self.cmd_stack = []
self.stack_count = 0
self.verbose = False
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 process_stack(self):
if len(self.cmd_stack) > 0:
if len(self.cmd_stack) == self.stack_count:
print u'Process %d commands' % self.stack_count
print u'%d. ' % (self.stack_count-len(self.cmd_stack)+1),
command = self.cmd_stack.pop(0)
if len(command) > 1:
command[0](command[1])
else:
command[0]()
else:
print "Finished all commands"
def main():
# Set up command line options.
usage = u'Usage: %prog [options]'
parser = OptionParser(usage=usage)
parser.add_option("-d", "--download-ts", action="store_true",
dest="download", help="Load languages from Pootle Server")
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("-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(self):
print 'Download Translation files from HQ-Server'
page = urllib.urlopen(u'%s' % (self.server_url))
soup = BeautifulSoup(page)
languages = soup.findAll(text=re.compile(".*\.ts"))
for language in languages:
filename = os.path.join(u'..', u'resources', u'i18n',
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 downloadTranslations():
print "download()"
for language in translations:
filename = os.path.join(u'..', u'resources', u'i18n',
u"openlp_%s.ts" % language)
print filename
page = urllib.urlopen(u"%s%s.ts" % (translation_path, language))
content = page.read().decode("utf8")
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()
file = open(filename, u'w')
file.write(content.encode('utf8'))
file.close()
def preparation():
stringlist = []
start_dir = os.path.join(u'..')
for root, dirs, files in os.walk(start_dir):
for file in files:
path = u"%s" % root
path = path.replace("\\","/")
path = path.replace("..",".")
if file.startswith(u'hook-') or file.startswith(u'test_'):
continue
def creation(self, language):
print "Create new Translation File"
"""
Use this option to create a new translation file
this function:
* create the new *.ts file
"""
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()
def preparation(self):
print u'Generating the openlp.pro file'
stringlist = []
start_dir = os.path.join(u'..')
for root, dirs, files in os.walk(start_dir):
for file in files:
path = u'%s' % root
path = path.replace('\\','/')
path = path.replace('..','.')
if file.startswith(u'hook-') or file.startswith(u'test_'):
continue
cond = False
for search in ignore_pathes:
if path.startswith(search):
cond = True
if cond:
continue
cond = False
for search in ignore_files:
if search == file:
cond = True
if cond:
continue
if file.endswith(u'.py'):
line = u"%s/%s" % (path, file)
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...',
stringlist.sort()
write_file(os.path.join(start_dir, u'openlp.pro'), stringlist)
print u'done.'
cond = False
for search in self.ignore_paths:
if path.startswith(search):
cond = True
if cond:
continue
cond = False
for search in self.ignore_files:
if search == file:
cond = True
if cond:
continue
if file.endswith(u'.py'):
line = u'%s/%s' % (path, file)
self.printVerbose(u'Parsing "%s"' % line)
stringlist.append(u'SOURCES += %s' % line)
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)
stringlist.sort()
self.write_file(os.path.join(start_dir, u'openlp.pro'), stringlist)
print u' done'
self.process_stack()
def update():
print "update()"
updateProcess = QtCore.QProcess()
updateProcess.start(u"pylupdate4 -noobsolete ../openlp.pro")
updateProcess.waitForFinished(60000)
def update(self):
print u'Update the translation files'
cmd = u'pylupdate4 -verbose -noobsolete ../openlp.pro'
self.start_cmd(cmd)
def generate():
print "generate()"
generateProcess = QtCore.QProcess()
generateProcess.start(u"lrelease ../openlp.pro")
generateProcess.waitForFinished(60000)
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 all():
print "all()"
downloadTranslations()
preparation()
update()
generate()
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()
if __name__ == u'__main__':