forked from openlp/openlp
Merged with current trunk and used '\xa9' as (c) symbol
This commit is contained in:
commit
5c5427d963
|
@ -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):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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'
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,7 +673,7 @@ 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)
|
||||||
|
@ -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'
|
||||||
|
|
|
@ -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.
|
||||||
"""
|
"""
|
||||||
|
if check_item_selected(self.ThemeListWidget, translate('ThemeManager',
|
||||||
|
'You must select a theme to edit.')):
|
||||||
item = self.ThemeListWidget.currentItem()
|
item = self.ThemeListWidget.currentItem()
|
||||||
if item:
|
|
||||||
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())
|
||||||
|
if check_item_selected(self.ThemeListWidget, translate('ThemeManager',
|
||||||
|
'You must select a theme to delete.')):
|
||||||
item = self.ThemeListWidget.currentItem()
|
item = self.ThemeListWidget.currentItem()
|
||||||
if item:
|
|
||||||
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()):
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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'')\
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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:'))
|
||||||
|
|
||||||
|
|
|
@ -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]
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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')
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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
|
||||||
"""
|
"""
|
||||||
|
if self.is_active():
|
||||||
return self.presentation.SlideShowWindow.View.State == 3
|
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)
|
||||||
|
|
|
@ -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,12 +180,17 @@ 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
|
||||||
"""
|
"""
|
||||||
|
if self.hidden:
|
||||||
|
self.hidden = False
|
||||||
|
self.controller.process.Resume(self.pptid)
|
||||||
|
else:
|
||||||
self.controller.process.RestartShow(self.pptid)
|
self.controller.process.RestartShow(self.pptid)
|
||||||
|
|
||||||
def get_slide_number(self):
|
def get_slide_number(self):
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
File diff suppressed because one or more lines are too long
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
File diff suppressed because it is too large
Load Diff
|
@ -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><b>Alerts Plugin</b><br>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>&Bible</source>
|
<source>&Bible</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="openlp/plugins/bibles/bibleplugin.py" line="93"/>
|
||||||
|
<source><strong>Bible Plugin</strong><br />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'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'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><b>Custom Plugin</b><br>This plugin allows slides to be displayed on the screen in the same way songs are. This plugin provides greater freedom over the songs plugin.<br></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 && Preview</source>
|
<source>Save && Preview</source>
|
||||||
<translation type="unfinished">Salvesta && eelvaatle</translation>
|
<translation type="unfinished">Salvesta && 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><b>Presentation Plugin</b> <br> Delivers the ability to show presentations using a number of different programs. The choice of available presentation programs is available to the user in a drop down box.</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><b>Remote Plugin</b><br>This plugin provides the ability to send messages to a running version of openlp on a different computer via a web browser or other app<br>The Primary use for this would be to send alerts from a creche</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>&Song Usage</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="openlp/plugins/songusage/songusageplugin.py" line="66"/>
|
||||||
|
<source>&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>&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><b>SongUsage Plugin</b><br>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>&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><strong>Song Plugin</strong><br />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't add your author.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="151"/>
|
||||||
|
<source>Couldn't add your topic.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="165"/>
|
||||||
|
<source>Couldn't add your book.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="195"/>
|
||||||
|
<source>Couldn't save your author.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="211"/>
|
||||||
|
<source>Couldn't save your topic.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="openlp/plugins/songs/forms/songmaintenanceform.py" line="229"/>
|
||||||
|
<source>Couldn'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'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'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'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>
|
||||||
|
|
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 it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -25,33 +25,140 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# 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):
|
|
||||||
|
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 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 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 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 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(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''
|
content = u''
|
||||||
for line in stringlist:
|
for line in stringlist:
|
||||||
content = u'%s%s\n' % (content, line)
|
content = u'%s%s\n' % (content, line)
|
||||||
|
@ -59,109 +166,69 @@ def write_file(filename, stringlist):
|
||||||
file.write(content.encode('utf8'))
|
file.write(content.encode('utf8'))
|
||||||
file.close()
|
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():
|
def main():
|
||||||
|
# start Main Class
|
||||||
|
Util = TranslationUtils()
|
||||||
|
|
||||||
# Set up command line options.
|
# Set up command line options.
|
||||||
usage = u'Usage: %prog [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 = OptionParser(usage=usage)
|
||||||
parser.add_option("-d", "--download-ts", action="store_true",
|
parser.add_option('-d', '--download-ts', action='store_true',
|
||||||
dest="download", help="Load languages from Pootle Server")
|
dest='download', help='Load languages from Pootle Server')
|
||||||
parser.add_option("-p", "--prepare", action="store_true", dest="prepare",
|
parser.add_option('-c', '--create', metavar='lang',
|
||||||
help="preparation (generate pro file)")
|
help='creation of new translation file, Parameter: language (e.g. "en_GB"')
|
||||||
parser.add_option("-u", "--update", action="store_true", dest="update",
|
parser.add_option('-p', '--prepare', action='store_true', dest='prepare',
|
||||||
help="update translation files")
|
help='preparation (generate pro file)')
|
||||||
parser.add_option("-g", "--generate", action="store_true", dest="generate",
|
parser.add_option('-u', '--update', action='store_true', dest='update',
|
||||||
help="generate qm files")
|
help='update translation files')
|
||||||
parser.add_option("-a", "--all", action="store_true", dest="all",
|
parser.add_option('-g', '--generate', action='store_true', dest='generate',
|
||||||
help="proceed all options")
|
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()
|
(options, args) = parser.parse_args()
|
||||||
if options.download:
|
if options.download:
|
||||||
downloadTranslations()
|
Util.cmd_stack.append([Util.downloadTranslations])
|
||||||
elif options.prepare:
|
if options.create:
|
||||||
preparation()
|
Util.cmd_stack.append([Util.creation, u'%s' % options.create])
|
||||||
elif options.update:
|
if options.prepare:
|
||||||
update()
|
Util.cmd_stack.append([Util.preparation])
|
||||||
elif options.generate:
|
if options.update:
|
||||||
generate()
|
Util.cmd_stack.append([Util.update])
|
||||||
elif options.all:
|
if options.generate:
|
||||||
all()
|
Util.cmd_stack.append([Util.generate])
|
||||||
else:
|
if options.verbose:
|
||||||
pass
|
Util.verbose = True
|
||||||
|
|
||||||
def downloadTranslations():
|
if len(Util.cmd_stack) == 0:
|
||||||
print "download()"
|
Util.cmd_stack.append([Util.downloadTranslations])
|
||||||
for language in translations:
|
Util.cmd_stack.append([Util.preparation])
|
||||||
filename = os.path.join(u'..', u'resources', u'i18n',
|
Util.cmd_stack.append([Util.update])
|
||||||
u"openlp_%s.ts" % language)
|
Util.cmd_stack.append([Util.generate])
|
||||||
print filename
|
|
||||||
page = urllib.urlopen(u"%s%s.ts" % (translation_path, language))
|
|
||||||
content = page.read().decode("utf8")
|
|
||||||
page.close()
|
|
||||||
file = open(filename, u'w')
|
|
||||||
file.write(content.encode('utf8'))
|
|
||||||
file.close()
|
|
||||||
|
|
||||||
def preparation():
|
Util.stack_count = len(Util.cmd_stack)
|
||||||
stringlist = []
|
Util.process_stack()
|
||||||
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.'
|
|
||||||
|
|
||||||
def update():
|
|
||||||
print "update()"
|
|
||||||
updateProcess = QtCore.QProcess()
|
|
||||||
updateProcess.start(u"pylupdate4 -noobsolete ../openlp.pro")
|
|
||||||
updateProcess.waitForFinished(60000)
|
|
||||||
|
|
||||||
def generate():
|
|
||||||
print "generate()"
|
|
||||||
generateProcess = QtCore.QProcess()
|
|
||||||
generateProcess.start(u"lrelease ../openlp.pro")
|
|
||||||
generateProcess.waitForFinished(60000)
|
|
||||||
|
|
||||||
def all():
|
|
||||||
print "all()"
|
|
||||||
downloadTranslations()
|
|
||||||
preparation()
|
|
||||||
update()
|
|
||||||
generate()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == u'__main__':
|
if __name__ == u'__main__':
|
||||||
|
|
Loading…
Reference in New Issue