forked from openlp/openlp
HEAD r1415
This commit is contained in:
commit
a9b1fa2f5d
@ -4,6 +4,7 @@ recursive-include openlp *.csv
|
||||
recursive-include openlp *.html
|
||||
recursive-include openlp *.js
|
||||
recursive-include openlp *.css
|
||||
recursive-include openlp *.png
|
||||
recursive-include documentation *
|
||||
recursive-include resources *
|
||||
recursive-include scripts *
|
||||
|
@ -173,7 +173,9 @@ class OpenLP(QtGui.QApplication):
|
||||
has_run_wizard = QtCore.QSettings().value(
|
||||
u'general/has run wizard', QtCore.QVariant(False)).toBool()
|
||||
if not has_run_wizard:
|
||||
FirstTimeForm(screens).exec_()
|
||||
if FirstTimeForm(screens).exec_() == QtGui.QDialog.Accepted:
|
||||
QtCore.QSettings().setValue(u'general/has run wizard',
|
||||
QtCore.QVariant(True))
|
||||
if os.name == u'nt':
|
||||
self.setStyleSheet(application_stylesheet)
|
||||
show_splash = QtCore.QSettings().value(
|
||||
|
@ -183,8 +183,9 @@ class ServiceItem(object):
|
||||
else:
|
||||
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
||||
self.title = clean_tags(self.title)
|
||||
# The footer should never be None, but to be compatible with older
|
||||
# release of OpenLP, we have to correct this to avoid tracebacks.
|
||||
# The footer should never be None, but to be compatible with a few
|
||||
# nightly builds between 1.9.4 and 1.9.5, we have to correct this to
|
||||
# avoid tracebacks.
|
||||
if self.raw_footer is None:
|
||||
self.raw_footer = []
|
||||
self.foot_text = \
|
||||
@ -448,3 +449,4 @@ class ServiceItem(object):
|
||||
return end
|
||||
else:
|
||||
return u'%s : %s' % (start, end)
|
||||
|
||||
|
@ -33,7 +33,8 @@ from ConfigParser import SafeConfigParser
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import translate, PluginStatus, Receiver, build_icon
|
||||
from openlp.core.lib import translate, PluginStatus, Receiver, build_icon, \
|
||||
check_directory_exists
|
||||
from openlp.core.utils import get_web_page, AppLocation
|
||||
from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
|
||||
|
||||
@ -49,6 +50,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
def __init__(self, screens, parent=None):
|
||||
QtGui.QWizard.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
self.screens = screens
|
||||
# check to see if we have web access
|
||||
self.web = u'http://openlp.org/files/frw/'
|
||||
self.config = SafeConfigParser()
|
||||
@ -56,12 +58,13 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
if self.webAccess:
|
||||
files = self.webAccess.read()
|
||||
self.config.readfp(io.BytesIO(files))
|
||||
self.displayComboBox.addItems(screens.get_screen_list())
|
||||
self.updateScreenListCombo()
|
||||
self.downloading = unicode(translate('OpenLP.FirstTimeWizard',
|
||||
'Downloading %s...'))
|
||||
QtCore.QObject.connect(self,
|
||||
QtCore.SIGNAL(u'currentIdChanged(int)'),
|
||||
self.onCurrentIdChanged)
|
||||
QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'config_screen_changed'), self.updateScreenListCombo)
|
||||
|
||||
def exec_(self, edit=False):
|
||||
"""
|
||||
@ -75,6 +78,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
Set up display at start of theme edit.
|
||||
"""
|
||||
self.restart()
|
||||
check_directory_exists(os.path.join(gettempdir(), u'openlp'))
|
||||
# Sort out internet access for downloads
|
||||
if self.webAccess:
|
||||
songs = self.config.get(u'songs', u'languages')
|
||||
@ -111,8 +115,6 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
self.biblesTreeWidget.expandAll()
|
||||
themes = self.config.get(u'themes', u'files')
|
||||
themes = themes.split(u',')
|
||||
if not os.path.exists(os.path.join(gettempdir(), u'openlp')):
|
||||
os.makedirs(os.path.join(gettempdir(), u'openlp'))
|
||||
for theme in themes:
|
||||
title = self.config.get(u'theme_%s' % theme, u'title')
|
||||
filename = self.config.get(u'theme_%s' % theme, u'filename')
|
||||
@ -160,6 +162,15 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
self._performWizard()
|
||||
self._postWizard()
|
||||
|
||||
def updateScreenListCombo(self):
|
||||
"""
|
||||
The user changed screen resolution or enabled/disabled more screens, so
|
||||
we need to update the combo box.
|
||||
"""
|
||||
self.displayComboBox.clear()
|
||||
self.displayComboBox.addItems(self.screens.get_screen_list())
|
||||
self.displayComboBox.setCurrentIndex(self.displayComboBox.count() - 1)
|
||||
|
||||
def _getFileSize(self, url):
|
||||
site = urllib.urlopen(url)
|
||||
meta = site.info()
|
||||
@ -294,8 +305,6 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
if self.themeComboBox.currentIndex() != -1:
|
||||
QtCore.QSettings().setValue(u'themes/global theme',
|
||||
QtCore.QVariant(self.themeComboBox.currentText()))
|
||||
QtCore.QSettings().setValue(u'general/has run wizard',
|
||||
QtCore.QVariant(True))
|
||||
|
||||
def _setPluginStatus(self, field, tag):
|
||||
status = PluginStatus.Active if field.checkState() \
|
||||
|
@ -158,8 +158,6 @@ class Ui_FirstTimeWizard(object):
|
||||
self.displayComboBox = QtGui.QComboBox(self.defaultsPage)
|
||||
self.displayComboBox.setEditable(False)
|
||||
self.displayComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
|
||||
self.displayComboBox.setSizeAdjustPolicy(
|
||||
QtGui.QComboBox.AdjustToContents)
|
||||
self.displayComboBox.setObjectName(u'displayComboBox')
|
||||
self.defaultsLayout.addRow(self.displayLabel, self.displayComboBox)
|
||||
self.themeLabel = QtGui.QLabel(self.defaultsPage)
|
||||
|
@ -110,7 +110,7 @@ class MainDisplay(DisplayWidget):
|
||||
Phonon.createPath(self.mediaObject, self.audio)
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
|
||||
self.videoStart)
|
||||
self.videoState)
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'finished()'),
|
||||
self.videoFinished)
|
||||
@ -378,11 +378,13 @@ class MainDisplay(DisplayWidget):
|
||||
Receiver.send_message(u'maindisplay_active')
|
||||
return self.preview()
|
||||
|
||||
def videoStart(self, newState, oldState):
|
||||
def videoState(self, newState, oldState):
|
||||
"""
|
||||
Start the video at a predetermined point.
|
||||
"""
|
||||
if newState == Phonon.PlayingState:
|
||||
if newState == Phonon.PlayingState \
|
||||
and oldState != Phonon.PausedState \
|
||||
and self.serviceItem.start_time > 0:
|
||||
# set start time in milliseconds
|
||||
self.mediaObject.seek(self.serviceItem.start_time * 1000)
|
||||
|
||||
|
@ -46,7 +46,6 @@ class SlideList(QtGui.QTableWidget):
|
||||
QtGui.QTableWidget.__init__(self, parent.controller)
|
||||
self.parent = parent
|
||||
|
||||
|
||||
class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
SlideController is the slide controller widget. This widget is what the
|
||||
@ -117,7 +116,8 @@ class SlideController(QtGui.QWidget):
|
||||
self.previewListWidget.setColumnWidth(0, self.controller.width())
|
||||
self.previewListWidget.isLive = self.isLive
|
||||
self.previewListWidget.setObjectName(u'PreviewListWidget')
|
||||
self.previewListWidget.setSelectionBehavior(1)
|
||||
self.previewListWidget.setSelectionBehavior(
|
||||
QtGui.QAbstractItemView.SelectRows)
|
||||
self.previewListWidget.setSelectionMode(
|
||||
QtGui.QAbstractItemView.SingleSelection)
|
||||
self.previewListWidget.setEditTriggers(
|
||||
@ -857,6 +857,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.serviceItem.bg_image_bytes = None
|
||||
self.slidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
self.selectedRow = row
|
||||
self.__checkUpdateSelectedSlide(row)
|
||||
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
||||
row)
|
||||
|
||||
|
@ -424,11 +424,11 @@ class ThemeManager(QtGui.QWidget):
|
||||
unicode(translate('OpenLP.ThemeManager',
|
||||
'OpenLP Themes (*.theme *.otz)')))
|
||||
log.info(u'New Themes %s', unicode(files))
|
||||
if not files:
|
||||
return
|
||||
Receiver.send_message(u'cursor_busy')
|
||||
if files:
|
||||
for file in files:
|
||||
SettingsManager.set_last_dir(
|
||||
self.settingsSection, unicode(file))
|
||||
SettingsManager.set_last_dir(self.settingsSection, unicode(file))
|
||||
self.unzipTheme(file, self.path)
|
||||
self.loadThemes()
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
@ -502,16 +502,16 @@ class ThemeManager(QtGui.QWidget):
|
||||
def unzipTheme(self, filename, dir):
|
||||
"""
|
||||
Unzip the theme, remove the preview file if stored
|
||||
Generate a new preview fileCheck the XML theme version and upgrade if
|
||||
Generate a new preview file. Check the XML theme version and upgrade if
|
||||
necessary.
|
||||
"""
|
||||
log.debug(u'Unzipping theme %s', filename)
|
||||
filename = unicode(filename)
|
||||
zip = None
|
||||
outfile = None
|
||||
filexml = None
|
||||
try:
|
||||
zip = zipfile.ZipFile(filename)
|
||||
filexml = None
|
||||
themename = None
|
||||
for file in zip.namelist():
|
||||
ucsfile = file_is_unicode(file)
|
||||
@ -547,7 +547,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
else:
|
||||
outfile = open(fullpath, u'wb')
|
||||
outfile.write(zip.read(file))
|
||||
except (IOError, NameError):
|
||||
except (IOError, NameError, zipfile.BadZipfile):
|
||||
critical_error_message_box(
|
||||
translate('OpenLP.ThemeManager', 'Validation Error'),
|
||||
translate('OpenLP.ThemeManager', 'File is not a valid theme.'))
|
||||
@ -562,7 +562,9 @@ class ThemeManager(QtGui.QWidget):
|
||||
if filexml:
|
||||
theme = self._createThemeFromXml(filexml, self.path)
|
||||
self.generateAndSaveImage(dir, themename, theme)
|
||||
else:
|
||||
# Only show the error message, when IOError was not raised (in this
|
||||
# case the error message has already been shown).
|
||||
elif zip is not None:
|
||||
critical_error_message_box(
|
||||
translate('OpenLP.ThemeManager', 'Validation Error'),
|
||||
translate('OpenLP.ThemeManager',
|
||||
|
@ -268,6 +268,7 @@ class SearchResults(object):
|
||||
return len(self.verselist) > 0
|
||||
|
||||
|
||||
from versereferencelist import VerseReferenceList
|
||||
from manager import BibleManager
|
||||
from biblestab import BiblesTab
|
||||
from mediaitem import BibleMediaItem
|
||||
|
@ -35,7 +35,7 @@ from openlp.core.lib.ui import UiStrings, add_widget_completer, \
|
||||
media_item_combo_box, critical_error_message_box
|
||||
from openlp.plugins.bibles.forms import BibleImportForm
|
||||
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \
|
||||
get_reference_match
|
||||
VerseReferenceList, get_reference_match
|
||||
from openlp.plugins.bibles.forms import BibleImportRequest
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -643,6 +643,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||
old_chapter = -1
|
||||
raw_slides = []
|
||||
raw_title = []
|
||||
verses = VerseReferenceList()
|
||||
for item in items:
|
||||
bitem = self.listView.item(item.row())
|
||||
book = self._decodeQtObject(bitem, 'book')
|
||||
@ -659,15 +660,9 @@ class BibleMediaItem(MediaManagerItem):
|
||||
second_permissions = \
|
||||
self._decodeQtObject(bitem, 'second_permissions')
|
||||
second_text = self._decodeQtObject(bitem, 'second_text')
|
||||
verses.add(book, chapter, verse, version, copyright, permissions)
|
||||
verse_text = self.formatVerse(old_chapter, chapter, verse)
|
||||
footer = u'%s (%s %s %s)' % (book, version, copyright, permissions)
|
||||
if footer not in service_item.raw_footer:
|
||||
service_item.raw_footer.append(footer)
|
||||
if second_bible:
|
||||
footer = u'%s (%s %s %s)' % (book, second_version,
|
||||
second_copyright, second_permissions)
|
||||
if footer not in service_item.raw_footer:
|
||||
service_item.raw_footer.append(footer)
|
||||
bible_text = u'%s %s\n\n%s %s' % (verse_text, text,
|
||||
verse_text, second_text)
|
||||
raw_slides.append(bible_text.rstrip())
|
||||
@ -690,6 +685,12 @@ class BibleMediaItem(MediaManagerItem):
|
||||
start_item = item
|
||||
old_item = item
|
||||
old_chapter = chapter
|
||||
# Add footer
|
||||
service_item.raw_footer.append(verses.format_verses())
|
||||
if second_bible:
|
||||
verses.add_version(second_version, second_copyright,
|
||||
second_permissions)
|
||||
service_item.raw_footer.append(verses.format_versions())
|
||||
raw_title.append(self.formatTitle(start_item, item))
|
||||
# If there are no more items we check whether we have to add bible_text.
|
||||
if bible_text:
|
||||
|
99
openlp/plugins/bibles/lib/versereferencelist.py
Normal file
99
openlp/plugins/bibles/lib/versereferencelist.py
Normal file
@ -0,0 +1,99 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
# Software Foundation; version 2 of the License. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||
# more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License along #
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
class VerseReferenceList(object):
|
||||
"""
|
||||
The VerseReferenceList class encapsulates a list of verse references, but
|
||||
maintains the order in which they were added.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.verse_list = []
|
||||
self.version_list = []
|
||||
self.current_index = -1
|
||||
|
||||
def add(self, book, chapter, verse, version, copyright, permission):
|
||||
self.add_version(version, copyright, permission)
|
||||
if not self.verse_list or \
|
||||
self.verse_list[self.current_index][u'book'] != book:
|
||||
self.verse_list.append({u'version': version, u'book': book,
|
||||
u'chapter': chapter, u'start': verse, u'end': verse})
|
||||
self.current_index += 1
|
||||
elif self.verse_list[self.current_index][u'chapter'] != chapter:
|
||||
self.verse_list.append({u'version': version, u'book': book,
|
||||
u'chapter': chapter, u'start': verse, u'end': verse})
|
||||
self.current_index += 1
|
||||
elif (self.verse_list[self.current_index][u'end'] + 1) == verse:
|
||||
self.verse_list[self.current_index][u'end'] = verse
|
||||
else:
|
||||
self.verse_list.append({u'version': version, u'book': book,
|
||||
u'chapter': chapter, u'start': verse, u'end': verse})
|
||||
self.current_index += 1
|
||||
|
||||
def add_version(self, version, copyright, permission):
|
||||
for bible_version in self.version_list:
|
||||
if bible_version[u'version'] == version:
|
||||
return
|
||||
self.version_list.append({u'version': version, u'copyright': copyright,
|
||||
u'permission': permission})
|
||||
|
||||
def format_verses(self):
|
||||
result = u''
|
||||
for index, verse in enumerate(self.verse_list):
|
||||
if index == 0:
|
||||
result = u'%s %s:%s' % (verse[u'book'], verse[u'chapter'],
|
||||
verse[u'start'])
|
||||
if verse[u'start'] != verse[u'end']:
|
||||
result = u'%s-%s' % (result, verse[u'end'])
|
||||
continue
|
||||
prev = index - 1
|
||||
if self.verse_list[prev][u'version'] != verse[u'version']:
|
||||
result = u'%s (%s)' % (result, self.verse_list[prev][u'version'])
|
||||
result = result + u', '
|
||||
if self.verse_list[prev][u'book'] != verse[u'book']:
|
||||
result = u'%s%s %s:' % (result, verse[u'book'],
|
||||
verse[u'chapter'])
|
||||
elif self.verse_list[prev][u'chapter'] != verse[u'chapter']:
|
||||
result = u'%s%s:' % (result, verse[u'chapter'])
|
||||
result = result + str(verse[u'start'])
|
||||
if verse[u'start'] != verse[u'end']:
|
||||
result = u'%s-%s' % (result, verse[u'end'])
|
||||
if len(self.version_list) > 1:
|
||||
result = u'%s (%s)' % (result, verse[u'version'])
|
||||
return result
|
||||
|
||||
def format_versions(self):
|
||||
result = u''
|
||||
for index, version in enumerate(self.version_list):
|
||||
if index > 0:
|
||||
if result[-1] not in [u';', u',', u'.']:
|
||||
result = result + u';'
|
||||
result = result + u' '
|
||||
result = u'%s%s, %s' % (result, version[u'version'],
|
||||
version[u'copyright'])
|
||||
if version[u'permission'].strip():
|
||||
result = result + u', ' + version[u'permission']
|
||||
return result
|
@ -220,10 +220,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
|
||||
Removes the current row from the list.
|
||||
"""
|
||||
self.slideListView.takeItem(self.slideListView.currentRow())
|
||||
if self.slideListView.currentRow() == 0:
|
||||
self.upButton.setEnabled(False)
|
||||
if self.slideListView.currentRow() == self.slideListView.count():
|
||||
self.downButton.setEnabled(False)
|
||||
self.onCurrentRowChanged(self.slideListView.currentRow())
|
||||
|
||||
def onCurrentRowChanged(self, row):
|
||||
"""
|
||||
|
@ -24,6 +24,7 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
from datetime import datetime
|
||||
import logging
|
||||
import os
|
||||
|
||||
@ -53,9 +54,6 @@ class MediaMediaItem(MediaManagerItem):
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'video_background_replaced'),
|
||||
self.videobackgroundReplaced)
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
|
||||
self.videoStart)
|
||||
|
||||
def retranslateUi(self):
|
||||
self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
|
||||
@ -124,35 +122,66 @@ class MediaMediaItem(MediaManagerItem):
|
||||
if item is None:
|
||||
return False
|
||||
filename = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||
if os.path.exists(filename):
|
||||
self.mediaState = None
|
||||
self.mediaObject.stop()
|
||||
self.mediaObject.clearQueue()
|
||||
self.mediaObject.setCurrentSource(Phonon.MediaSource(filename))
|
||||
self.mediaObject.play()
|
||||
service_item.title = unicode(self.plugin.nameStrings[u'singular'])
|
||||
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
||||
# force a nonexistent theme
|
||||
service_item.theme = -1
|
||||
frame = u':/media/image_clapperboard.png'
|
||||
(path, name) = os.path.split(filename)
|
||||
file_size = os.path.getsize(filename)
|
||||
# File too big for processing
|
||||
if file_size <= 52428800: # 50MiB
|
||||
while not self.mediaState:
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
service_item.media_length = self.mediaLength
|
||||
service_item.add_capability(
|
||||
ItemCapabilities.AllowsVariableStartTime)
|
||||
service_item.add_from_command(path, name, frame)
|
||||
return True
|
||||
else:
|
||||
if not os.path.exists(filename):
|
||||
# File is no longer present
|
||||
critical_error_message_box(
|
||||
translate('MediaPlugin.MediaItem', 'Missing Media File'),
|
||||
unicode(translate('MediaPlugin.MediaItem',
|
||||
'The file %s no longer exists.')) % filename)
|
||||
return False
|
||||
self.mediaObject.stop()
|
||||
self.mediaObject.clearQueue()
|
||||
self.mediaObject.setCurrentSource(Phonon.MediaSource(filename))
|
||||
if not self.mediaStateWait(Phonon.StoppedState):
|
||||
# Due to string freeze, borrow a message from presentations
|
||||
# This will be corrected in 1.9.6
|
||||
critical_error_message_box(
|
||||
translate('PresentationPlugin.MediaItem', 'Unsupported File'),
|
||||
unicode(translate('PresentationPlugin.MediaItem',
|
||||
'Unsupported File')))
|
||||
return False
|
||||
# File too big for processing
|
||||
if os.path.getsize(filename) <= 52428800: # 50MiB
|
||||
self.mediaObject.play()
|
||||
if not self.mediaStateWait(Phonon.PlayingState) \
|
||||
or self.mediaObject.currentSource().type() \
|
||||
== Phonon.MediaSource.Invalid:
|
||||
# Due to string freeze, borrow a message from presentations
|
||||
# This will be corrected in 1.9.6
|
||||
self.mediaObject.stop()
|
||||
critical_error_message_box(
|
||||
translate('PresentationPlugin.MediaItem',
|
||||
'Unsupported File'),
|
||||
unicode(translate('PresentationPlugin.MediaItem',
|
||||
'Unsupported File')))
|
||||
return False
|
||||
self.mediaLength = self.mediaObject.totalTime() / 1000
|
||||
self.mediaObject.stop()
|
||||
service_item.media_length = self.mediaLength
|
||||
service_item.add_capability(
|
||||
ItemCapabilities.AllowsVariableStartTime)
|
||||
service_item.title = unicode(self.plugin.nameStrings[u'singular'])
|
||||
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
||||
# force a non-existent theme
|
||||
service_item.theme = -1
|
||||
frame = u':/media/image_clapperboard.png'
|
||||
(path, name) = os.path.split(filename)
|
||||
service_item.add_from_command(path, name, frame)
|
||||
return True
|
||||
|
||||
def mediaStateWait(self, mediaState):
|
||||
"""
|
||||
Wait for the video to change its state
|
||||
Wait no longer than 5 seconds.
|
||||
"""
|
||||
start = datetime.now()
|
||||
while self.mediaObject.state() != mediaState:
|
||||
if self.mediaObject.state() == Phonon.ErrorState:
|
||||
return False
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
if (datetime.now() - start).seconds > 5:
|
||||
return False
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
self.listView.clear()
|
||||
@ -181,12 +210,3 @@ class MediaMediaItem(MediaManagerItem):
|
||||
item_name.setIcon(build_icon(img))
|
||||
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file))
|
||||
self.listView.addItem(item_name)
|
||||
|
||||
def videoStart(self, newState, oldState):
|
||||
"""
|
||||
Start the video at a predetermined point.
|
||||
"""
|
||||
if newState == Phonon.PlayingState:
|
||||
self.mediaState = newState
|
||||
self.mediaLength = self.mediaObject.totalTime()/1000
|
||||
self.mediaObject.stop()
|
@ -71,6 +71,8 @@ class Ui_EditSongDialog(object):
|
||||
self.verseListWidget.setColumnCount(1)
|
||||
self.verseListWidget.setSelectionBehavior(
|
||||
QtGui.QAbstractItemView.SelectRows)
|
||||
self.verseListWidget.setSelectionMode(
|
||||
QtGui.QAbstractItemView.SingleSelection)
|
||||
self.verseListWidget.setEditTriggers(
|
||||
QtGui.QAbstractItemView.NoEditTriggers)
|
||||
self.verseListWidget.setObjectName(u'verseListWidget')
|
||||
|
@ -543,6 +543,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
|
||||
def onVerseDeleteButtonClicked(self):
|
||||
self.verseListWidget.removeRow(self.verseListWidget.currentRow())
|
||||
if not self.verseListWidget.selectedItems():
|
||||
self.verseEditButton.setEnabled(False)
|
||||
self.verseDeleteButton.setEnabled(False)
|
||||
|
||||
|
@ -271,6 +271,37 @@ def clean_song(manager, song):
|
||||
verses = SongXML().get_verses(song.lyrics)
|
||||
lyrics = u' '.join([whitespace.sub(u' ', verse[1]) for verse in verses])
|
||||
song.search_lyrics = lyrics.lower()
|
||||
# We need a new and clean SongXML instance.
|
||||
sxml = SongXML()
|
||||
# Rebuild the song's verses, to remove any wrong verse names (for example
|
||||
# translated ones), which might have been added prior to 1.9.5.
|
||||
# List for later comparison.
|
||||
compare_order = []
|
||||
for verse in verses:
|
||||
type = VerseType.Tags[VerseType.from_loose_input(verse[0][u'type'])]
|
||||
sxml.add_verse_to_lyrics(
|
||||
type,
|
||||
verse[0][u'label'],
|
||||
verse[1],
|
||||
verse[0][u'lang'] if verse[0].has_key(u'lang') else None
|
||||
)
|
||||
compare_order.append((u'%s%s' % (type, verse[0][u'label'])).upper())
|
||||
song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
||||
# Rebuild the verse order, to convert translated verse tags, which might
|
||||
# have been added prior to 1.9.5.
|
||||
order = song.verse_order.strip().split()
|
||||
new_order = []
|
||||
for verse_def in order:
|
||||
new_order.append((u'%s%s' % (
|
||||
VerseType.Tags[VerseType.from_loose_input(verse_def[0])],
|
||||
verse_def[1:])).upper()
|
||||
)
|
||||
song.verse_order = u' '.join(new_order)
|
||||
# Check if the verse order contains tags for verses which do not exist.
|
||||
for order in new_order:
|
||||
if order not in compare_order:
|
||||
song.verse_order = u''
|
||||
break
|
||||
# The song does not have any author, add one.
|
||||
if not song.authors:
|
||||
name = SongStrings.AuthorUnknown
|
||||
|
@ -34,30 +34,31 @@ import os
|
||||
import re
|
||||
|
||||
from openlp.core.ui.wizard import WizardStrings
|
||||
from openlp.plugins.songs.lib import VerseType
|
||||
from openlp.plugins.songs.lib.songimport import SongImport
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class SongBeamerTypes(object):
|
||||
MarkTypes = {
|
||||
u'Refrain': u'C',
|
||||
u'Chorus': u'C',
|
||||
u'Vers': u'V',
|
||||
u'Verse': u'V',
|
||||
u'Strophe': u'V',
|
||||
u'Intro': u'I',
|
||||
u'Coda': u'E',
|
||||
u'Ending': u'E',
|
||||
u'Bridge': u'B',
|
||||
u'Interlude': u'B',
|
||||
u'Zwischenspiel': u'B',
|
||||
u'Pre-Chorus': u'P',
|
||||
u'Pre-Refrain': u'P',
|
||||
u'Pre-Bridge': u'O',
|
||||
u'Pre-Coda': u'O',
|
||||
u'Unbekannt': u'O',
|
||||
u'Unknown': u'O',
|
||||
u'Unbenannt': u'O'
|
||||
u'Refrain': VerseType.Tags[VerseType.Chorus],
|
||||
u'Chorus': VerseType.Tags[VerseType.Chorus],
|
||||
u'Vers': VerseType.Tags[VerseType.Verse],
|
||||
u'Verse': VerseType.Tags[VerseType.Verse],
|
||||
u'Strophe': VerseType.Tags[VerseType.Verse],
|
||||
u'Intro': VerseType.Tags[VerseType.Intro],
|
||||
u'Coda': VerseType.Tags[VerseType.Ending],
|
||||
u'Ending': VerseType.Tags[VerseType.Ending],
|
||||
u'Bridge': VerseType.Tags[VerseType.Bridge],
|
||||
u'Interlude': VerseType.Tags[VerseType.Bridge],
|
||||
u'Zwischenspiel': VerseType.Tags[VerseType.Bridge],
|
||||
u'Pre-Chorus': VerseType.Tags[VerseType.PreChorus],
|
||||
u'Pre-Refrain': VerseType.Tags[VerseType.PreChorus],
|
||||
u'Pre-Bridge': VerseType.Tags[VerseType.Other],
|
||||
u'Pre-Coda': VerseType.Tags[VerseType.Other],
|
||||
u'Unbekannt': VerseType.Tags[VerseType.Other],
|
||||
u'Unknown': VerseType.Tags[VerseType.Other],
|
||||
u'Unbenannt': VerseType.Tags[VerseType.Other]
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +85,7 @@ class SongBeamerImport(SongImport):
|
||||
# TODO: check that it is a valid SongBeamer file
|
||||
self.set_defaults()
|
||||
self.current_verse = u''
|
||||
self.current_verse_type = u'V'
|
||||
self.current_verse_type = VerseType.Tags[VerseType.Verse]
|
||||
read_verses = False
|
||||
file_name = os.path.split(file)[1]
|
||||
self.import_wizard.incrementProgressBar(
|
||||
@ -111,7 +112,7 @@ class SongBeamerImport(SongImport):
|
||||
self.add_verse(self.current_verse,
|
||||
self.current_verse_type)
|
||||
self.current_verse = u''
|
||||
self.current_verse_type = u'V'
|
||||
self.current_verse_type = VerseType.Tags[VerseType.Verse]
|
||||
read_verses = True
|
||||
verse_start = True
|
||||
elif read_verses:
|
||||
|
@ -31,7 +31,7 @@ The basic XML for storing the lyrics in the song database looks like this::
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<song version="1.0">
|
||||
<lyrics>
|
||||
<verse type="Chorus" label="1" lang="en">
|
||||
<verse type="c" label="1" lang="en">
|
||||
<![CDATA[ ... ]]>
|
||||
</verse>
|
||||
</lyrics>
|
||||
|
File diff suppressed because it is too large
Load Diff
1185
resources/i18n/de.ts
1185
resources/i18n/de.ts
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
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
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1001
resources/i18n/nl.ts
1001
resources/i18n/nl.ts
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
@ -31,9 +31,9 @@ OutputDir=..\..\dist
|
||||
OutputBaseFilename=OpenLP-{#RealVersion}-setup
|
||||
Compression=lzma
|
||||
SolidCompression=true
|
||||
SetupIconFile=C:\Program Files\Inno Setup 5\Examples\Setup.ico
|
||||
WizardImageFile=C:\Program Files\Inno Setup 5\WizModernImage-IS.bmp
|
||||
WizardSmallImageFile=C:\Program Files\Inno Setup 5\WizModernSmallImage-IS.bmp
|
||||
SetupIconFile=OpenLP.ico
|
||||
WizardImageFile=WizImageBig.bmp
|
||||
WizardSmallImageFile=WizImageSmall.bmp
|
||||
|
||||
[Languages]
|
||||
Name: english; MessagesFile: compiler:Default.isl
|
||||
@ -78,15 +78,6 @@ Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filenam
|
||||
Filename: {app}\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent
|
||||
|
||||
[Registry]
|
||||
Root: HKCU; SubKey: Software\OpenLP\OpenLP\alerts; ValueType: dword; ValueName: status; ValueData: $00000001
|
||||
Root: HKCU; SubKey: Software\OpenLP\OpenLP\bibles; ValueType: dword; ValueName: status; ValueData: $00000001
|
||||
Root: HKCU; SubKey: Software\OpenLP\OpenLP\custom; ValueType: dword; ValueName: status; ValueData: $00000001
|
||||
Root: HKCU; SubKey: Software\OpenLP\OpenLP\images; ValueType: dword; ValueName: status; ValueData: $00000001
|
||||
Root: HKCU; SubKey: Software\OpenLP\OpenLP\media; ValueType: dword; ValueName: status; ValueData: $00000001
|
||||
Root: HKCU; SubKey: Software\OpenLP\OpenLP\presentations; ValueType: dword; ValueName: status; ValueData: $00000001
|
||||
Root: HKCU; SubKey: Software\OpenLP\OpenLP\remotes; ValueType: dword; ValueName: status; ValueData: $00000000
|
||||
Root: HKCU; SubKey: Software\OpenLP\OpenLP\songs; ValueType: dword; ValueName: status; ValueData: $00000001
|
||||
Root: HKCU; SubKey: Software\OpenLP\OpenLP\songusage; ValueType: dword; ValueName: status; ValueData: $00000001
|
||||
|
||||
[Code]
|
||||
function GetUninstallString(): String;
|
||||
|
BIN
resources/windows/WizImageBig.bmp
Normal file
BIN
resources/windows/WizImageBig.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 151 KiB |
BIN
resources/windows/WizImageSmall.bmp
Normal file
BIN
resources/windows/WizImageSmall.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
@ -116,8 +116,15 @@ dist_path = os.path.join(branch_path, u'dist', u'OpenLP')
|
||||
enchant_path = os.path.join(site_packages, u'enchant')
|
||||
|
||||
def update_code():
|
||||
print u'Updating the code...'
|
||||
os.chdir(branch_path)
|
||||
print u'Reverting any changes to the code...'
|
||||
bzr = Popen((u'bzr', u'revert'), stdout=PIPE)
|
||||
output, error = bzr.communicate()
|
||||
code = bzr.wait()
|
||||
if code != 0:
|
||||
print output
|
||||
raise Exception(u'Error reverting the code')
|
||||
print u'Updating the code...'
|
||||
bzr = Popen((u'bzr', u'update'), stdout=PIPE)
|
||||
output, error = bzr.communicate()
|
||||
code = bzr.wait()
|
||||
|
36
setup.py
36
setup.py
@ -62,7 +62,41 @@ setup(
|
||||
description="Open source Church presentation and lyrics projection application.",
|
||||
long_description="""\
|
||||
OpenLP (previously openlp.org) is free church presentation software, or lyrics projection software, used to display slides of songs, Bible verses, videos, images, and even presentations (if PowerPoint is installed) for church worship using a computer and a data projector.""",
|
||||
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Environment :: MacOS X',
|
||||
'Environment :: Win32 (MS Windows)',
|
||||
'Environment :: X11 Applications',
|
||||
'Environment :: X11 Applications :: Qt',
|
||||
'Intended Audience :: End Users/Desktop',
|
||||
'Intended Audience :: Religion',
|
||||
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||
'Natural Language :: Afrikaans',
|
||||
'Natural Language :: Dutch',
|
||||
'Natural Language :: English',
|
||||
'Natural Language :: French',
|
||||
'Natural Language :: German',
|
||||
'Natural Language :: Hungarian',
|
||||
'Natural Language :: Indonesian',
|
||||
'Natural Language :: Japanese',
|
||||
'Natural Language :: Norwegian',
|
||||
'Natural Language :: Portuguese (Brazilian)',
|
||||
'Natural Language :: Russian',
|
||||
'Natural Language :: Swedish',
|
||||
'Operating System :: MacOS :: MacOS X',
|
||||
'Operating System :: Microsoft :: Windows',
|
||||
'Operating System :: POSIX :: BSD :: FreeBSD',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2',
|
||||
'Topic :: Desktop Environment :: Gnome',
|
||||
'Topic :: Desktop Environment :: K Desktop Environment (KDE)',
|
||||
'Topic :: Multimedia',
|
||||
'Topic :: Multimedia :: Graphics :: Presentation',
|
||||
'Topic :: Multimedia :: Sound/Audio',
|
||||
'Topic :: Multimedia :: Video',
|
||||
'Topic :: Religion'
|
||||
], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
keywords='open source church presentation lyrics projection song bible display project',
|
||||
author='Raoul Snyman',
|
||||
author_email='raoulsnyman@openlp.org',
|
||||
|
Loading…
Reference in New Issue
Block a user