forked from openlp/openlp
- Fixed re-playing of previous audio file.
- Fixed left-over files from previous song. - Renamed a few more enumerations. - Fixed some exception handling.
This commit is contained in:
parent
0d16b05779
commit
4d66954d62
@ -25,7 +25,12 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
__all__ = ('OpenLP', 'main')
|
||||
"""
|
||||
The :mod:`core` module provides all core application functions
|
||||
|
||||
All the core functions of the OpenLP application including the GUI, settings,
|
||||
logging and a plugin framework are contained within the openlp.core module.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
@ -46,16 +51,11 @@ from openlp.core.ui import SplashScreen, ScreenList
|
||||
from openlp.core.utils import AppLocation, LanguageManager, VersionThread, \
|
||||
get_application_version, DelayStartThread
|
||||
|
||||
|
||||
__all__ = [u'OpenLP', u'main']
|
||||
|
||||
|
||||
log = logging.getLogger()
|
||||
|
||||
|
||||
"""
|
||||
The :mod:`core` module provides all core application functions
|
||||
|
||||
All the core functions of the OpenLP application including the GUI, settings,
|
||||
logging and a plugin framework are contained within the openlp.core module.
|
||||
"""
|
||||
|
||||
application_stylesheet = u"""
|
||||
QMainWindow::separator
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ def upgrade_db(url, upgrade):
|
||||
load_changes = True
|
||||
try:
|
||||
tables = upgrade.upgrade_setup(metadata)
|
||||
except SQLAlchemyError, DBAPIError:
|
||||
except (SQLAlchemyError, DBAPIError):
|
||||
load_changes = False
|
||||
metadata_table = Table(u'metadata', metadata,
|
||||
Column(u'key', types.Unicode(64), primary_key=True),
|
||||
@ -106,7 +106,7 @@ def upgrade_db(url, upgrade):
|
||||
getattr(upgrade, u'upgrade_%d' % version) \
|
||||
(session, metadata, tables)
|
||||
version_meta.value = unicode(version)
|
||||
except SQLAlchemyError, DBAPIError:
|
||||
except (SQLAlchemyError, DBAPIError):
|
||||
log.exception(u'Could not run database upgrade script '
|
||||
'"upgrade_%s", upgrade process has been halted.', version)
|
||||
break
|
||||
@ -213,7 +213,7 @@ class Manager(object):
|
||||
return
|
||||
try:
|
||||
self.session = init_schema(self.db_url)
|
||||
except SQLAlchemyError, DBAPIError:
|
||||
except (SQLAlchemyError, DBAPIError):
|
||||
log.exception(u'Error loading database: %s', self.db_url)
|
||||
critical_error_message_box(
|
||||
translate('OpenLP.Manager', 'Database Error'),
|
||||
|
@ -222,14 +222,14 @@ class Renderer(object):
|
||||
if item.is_capable(ItemCapabilities.NoLineBreaks):
|
||||
line_end = u' '
|
||||
# Bibles
|
||||
if item.is_capable(ItemCapabilities.HasWordSplit):
|
||||
if item.is_capable(ItemCapabilities.CanWordSplit):
|
||||
pages = self._paginate_slide_words(text.split(u'\n'), line_end)
|
||||
else:
|
||||
# Clean up line endings.
|
||||
lines = self._lines_split(text)
|
||||
pages = self._paginate_slide(lines, line_end)
|
||||
# Songs and Custom
|
||||
if item.is_capable(ItemCapabilities.HasVirtualSplit) and \
|
||||
if item.is_capable(ItemCapabilities.CanSoftBreak) and \
|
||||
len(pages) > 1 and u'[---]' in text:
|
||||
pages = []
|
||||
while True:
|
||||
|
@ -57,15 +57,15 @@ class ItemCapabilities(object):
|
||||
CanMaintain = 3
|
||||
RequiresMedia = 4
|
||||
CanLoop = 5
|
||||
HasAdditions = 6
|
||||
CanAppend = 6
|
||||
NoLineBreaks = 7
|
||||
OnLoadUpdate = 8
|
||||
AddIfNewItem = 9
|
||||
ProvidesOwnDisplay = 10
|
||||
HasDetailedTitleDisplay = 11
|
||||
HasVariableStartTime = 12
|
||||
HasVirtualSplit = 13
|
||||
HasWordSplit = 14
|
||||
CanSoftBreak = 13
|
||||
CanWordSplit = 14
|
||||
HasBackgroundAudio = 15
|
||||
|
||||
|
||||
|
@ -627,7 +627,7 @@ class AudioPlayer(QtCore.QObject):
|
||||
self.currentIndex = -1
|
||||
self.playlist = []
|
||||
self.stop()
|
||||
self.clearQueue()
|
||||
self.mediaObject.clear()
|
||||
|
||||
def play(self):
|
||||
"""
|
||||
@ -664,9 +664,3 @@ class AudioPlayer(QtCore.QObject):
|
||||
for filename in filenames:
|
||||
self.playlist.append(Phonon.MediaSource(filename))
|
||||
|
||||
def clearQueue(self):
|
||||
"""
|
||||
Clean up the Object queue
|
||||
"""
|
||||
log.debug(u'AudioPlayer.clearQueue() called')
|
||||
self.mediaObject.clearQueue()
|
||||
|
@ -1314,7 +1314,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
serviceItem = self.serviceItems[pos]
|
||||
if (plugin == serviceItem[u'service_item'].name and
|
||||
serviceItem[u'service_item'].is_capable(
|
||||
ItemCapabilities.HasAdditions)):
|
||||
ItemCapabilities.CanAppend)):
|
||||
action = self.dndMenu.exec_(QtGui.QCursor.pos())
|
||||
# New action required
|
||||
if action == self.newAction:
|
||||
|
@ -865,7 +865,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||
service_item.add_capability(ItemCapabilities.NoLineBreaks)
|
||||
service_item.add_capability(ItemCapabilities.CanPreview)
|
||||
service_item.add_capability(ItemCapabilities.CanLoop)
|
||||
service_item.add_capability(ItemCapabilities.HasWordSplit)
|
||||
service_item.add_capability(ItemCapabilities.CanWordSplit)
|
||||
# Service Item: Title
|
||||
service_item.title = u', '.join(raw_title)
|
||||
# Service Item: Theme
|
||||
|
@ -230,7 +230,7 @@ class CustomMediaItem(MediaManagerItem):
|
||||
service_item.add_capability(ItemCapabilities.CanEdit)
|
||||
service_item.add_capability(ItemCapabilities.CanPreview)
|
||||
service_item.add_capability(ItemCapabilities.CanLoop)
|
||||
service_item.add_capability(ItemCapabilities.HasVirtualSplit)
|
||||
service_item.add_capability(ItemCapabilities.CanSoftBreak)
|
||||
customSlide = self.plugin.manager.get_object(CustomSlide, item_id)
|
||||
title = customSlide.title
|
||||
credit = customSlide.credits
|
||||
|
@ -152,7 +152,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
service_item.add_capability(ItemCapabilities.CanMaintain)
|
||||
service_item.add_capability(ItemCapabilities.CanPreview)
|
||||
service_item.add_capability(ItemCapabilities.CanLoop)
|
||||
service_item.add_capability(ItemCapabilities.HasAdditions)
|
||||
service_item.add_capability(ItemCapabilities.CanAppend)
|
||||
# force a nonexistent theme
|
||||
service_item.theme = -1
|
||||
missing_items = []
|
||||
|
@ -198,6 +198,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.verseListWidget.setRowCount(0)
|
||||
self.authorsListView.clear()
|
||||
self.topicsListView.clear()
|
||||
self.audioListWidget.clear()
|
||||
self.titleEdit.setFocus(QtCore.Qt.OtherFocusReason)
|
||||
self.songBookNumberEdit.setText(u'')
|
||||
self.loadAuthors()
|
||||
|
@ -419,7 +419,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
service_item.add_capability(ItemCapabilities.CanLoop)
|
||||
service_item.add_capability(ItemCapabilities.OnLoadUpdate)
|
||||
service_item.add_capability(ItemCapabilities.AddIfNewItem)
|
||||
service_item.add_capability(ItemCapabilities.HasVirtualSplit)
|
||||
service_item.add_capability(ItemCapabilities.CanSoftBreak)
|
||||
song = self.plugin.manager.get_object(Song, item_id)
|
||||
service_item.theme = song.theme_name
|
||||
service_item.edit_id = item_id
|
||||
|
Loading…
Reference in New Issue
Block a user