forked from openlp/openlp
Head r717
This commit is contained in:
commit
5947f58cf6
@ -144,6 +144,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.PreviewListWidget.setEditTriggers(
|
self.PreviewListWidget.setEditTriggers(
|
||||||
QtGui.QAbstractItemView.NoEditTriggers)
|
QtGui.QAbstractItemView.NoEditTriggers)
|
||||||
self.PreviewListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
self.PreviewListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||||
|
self.PreviewListWidget.setAlternatingRowColors(True)
|
||||||
self.ControllerLayout.addWidget(self.PreviewListWidget)
|
self.ControllerLayout.addWidget(self.PreviewListWidget)
|
||||||
# Build the full toolbar
|
# Build the full toolbar
|
||||||
self.Toolbar = OpenLPToolbar(self)
|
self.Toolbar = OpenLPToolbar(self)
|
||||||
|
@ -166,8 +166,6 @@ class BibleCommon(object):
|
|||||||
"""
|
"""
|
||||||
A common ancestor for bible download sites.
|
A common ancestor for bible download sites.
|
||||||
"""
|
"""
|
||||||
global log
|
|
||||||
log = logging.getLogger(u'BibleCommon')
|
|
||||||
log.info(u'BibleCommon')
|
log.info(u'BibleCommon')
|
||||||
|
|
||||||
def _get_web_text(self, urlstring, proxyurl):
|
def _get_web_text(self, urlstring, proxyurl):
|
||||||
|
@ -59,7 +59,7 @@ class BibleDB(QtCore.QObject):
|
|||||||
``config``
|
``config``
|
||||||
The configuration object, passed in from the plugin.
|
The configuration object, passed in from the plugin.
|
||||||
"""
|
"""
|
||||||
log.info(u'BibleDBimpl loaded')
|
log.info(u'BibleDB loaded')
|
||||||
QtCore.QObject.__init__(self)
|
QtCore.QObject.__init__(self)
|
||||||
if u'path' not in kwargs:
|
if u'path' not in kwargs:
|
||||||
raise KeyError(u'Missing keyword argument "path".')
|
raise KeyError(u'Missing keyword argument "path".')
|
||||||
|
@ -35,6 +35,8 @@ from common import BibleCommon, SearchResults
|
|||||||
from db import BibleDB
|
from db import BibleDB
|
||||||
from openlp.plugins.bibles.lib.models import Book
|
from openlp.plugins.bibles.lib.models import Book
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class HTTPBooks(object):
|
class HTTPBooks(object):
|
||||||
cursor = None
|
cursor = None
|
||||||
|
|
||||||
@ -119,9 +121,7 @@ class HTTPBooks(object):
|
|||||||
|
|
||||||
|
|
||||||
class BGExtract(BibleCommon):
|
class BGExtract(BibleCommon):
|
||||||
global log
|
log.info(u'%s BGExtract loaded', __name__)
|
||||||
log = logging.getLogger(u'BibleHTTPMgr(BG_extract)')
|
|
||||||
log.info(u'BG_extract loaded')
|
|
||||||
|
|
||||||
def __init__(self, proxyurl=None):
|
def __init__(self, proxyurl=None):
|
||||||
log.debug(u'init %s', proxyurl)
|
log.debug(u'init %s', proxyurl)
|
||||||
@ -184,7 +184,7 @@ class BGExtract(BibleCommon):
|
|||||||
return SearchResults(bookname, chapter, bible)
|
return SearchResults(bookname, chapter, bible)
|
||||||
|
|
||||||
class CWExtract(BibleCommon):
|
class CWExtract(BibleCommon):
|
||||||
log.info(u'%s loaded', __name__)
|
log.info(u'%s CWExtract loaded', __name__)
|
||||||
|
|
||||||
def __init__(self, proxyurl=None):
|
def __init__(self, proxyurl=None):
|
||||||
log.debug(u'init %s', proxyurl)
|
log.debug(u'init %s', proxyurl)
|
||||||
@ -229,7 +229,7 @@ class CWExtract(BibleCommon):
|
|||||||
|
|
||||||
|
|
||||||
class HTTPBible(BibleDB):
|
class HTTPBible(BibleDB):
|
||||||
log.info(u'%s loaded', __name__)
|
log.info(u'%s HTTPBible loaded' , __name__)
|
||||||
|
|
||||||
def __init__(self, parent, **kwargs):
|
def __init__(self, parent, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
@ -43,7 +43,6 @@ class BibleListView(BaseListWithDnD):
|
|||||||
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):
|
||||||
"""
|
"""
|
||||||
This is the custom media manager item for Bibles.
|
This is the custom media manager item for Bibles.
|
||||||
@ -435,7 +434,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
raw_slides = []
|
raw_slides = []
|
||||||
raw_footer = []
|
raw_footer = []
|
||||||
bible_text = u''
|
bible_text = u''
|
||||||
self.service_item.autoPreviewAllowed = True
|
service_item.autoPreviewAllowed = True
|
||||||
#If we want to use a 2nd translation / version
|
#If we want to use a 2nd translation / version
|
||||||
bible2 = u''
|
bible2 = u''
|
||||||
if self.SearchTabWidget.currentIndex() == 0:
|
if self.SearchTabWidget.currentIndex() == 0:
|
||||||
@ -471,12 +470,12 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
verse_text = self.formatVerse(old_chapter, chapter, verse, u'', u'')
|
verse_text = self.formatVerse(old_chapter, chapter, verse, u'', u'')
|
||||||
old_chapter = chapter
|
old_chapter = chapter
|
||||||
footer = u'%s (%s %s)' % (book, version, copyright)
|
footer = u'%s (%s %s)' % (book, version, copyright)
|
||||||
#If not found throws and error so add.s
|
#If not found add to footer
|
||||||
if footer not in raw_footer:
|
if footer not in raw_footer:
|
||||||
raw_footer.append(footer)
|
raw_footer.append(footer)
|
||||||
if bible2:
|
if bible2:
|
||||||
footer = u'%s (%s %s)' % (book, version, copyright)
|
footer = u'%s (%s %s)' % (book, version, copyright)
|
||||||
#If not found throws and error so add.s
|
#If not found add to footer
|
||||||
if footer not in raw_footer:
|
if footer not in raw_footer:
|
||||||
raw_footer.append(footer)
|
raw_footer.append(footer)
|
||||||
bible_text = u'%s %s \n\n %s %s' % \
|
bible_text = u'%s %s \n\n %s %s' % \
|
||||||
|
@ -144,7 +144,7 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||||
else:
|
else:
|
||||||
item_id = self.remoteCustom
|
item_id = self.remoteCustom
|
||||||
self.service_item.autoPreviewAllowed = True
|
service_item.autoPreviewAllowed = True
|
||||||
customSlide = self.parent.custommanager.get_custom(item_id)
|
customSlide = self.parent.custommanager.get_custom(item_id)
|
||||||
title = customSlide.title
|
title = customSlide.title
|
||||||
credit = customSlide.credits
|
credit = customSlide.credits
|
||||||
|
@ -144,7 +144,7 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
items = self.ListView.selectedIndexes()
|
items = self.ListView.selectedIndexes()
|
||||||
if items:
|
if items:
|
||||||
service_item.title = self.trUtf8('Image(s)')
|
service_item.title = self.trUtf8('Image(s)')
|
||||||
self.service_item.autoPreviewAllowed = True
|
service_item.autoPreviewAllowed = True
|
||||||
for item in items:
|
for item in items:
|
||||||
bitem = self.ListView.item(item.row())
|
bitem = self.ListView.item(item.row())
|
||||||
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
||||||
|
@ -30,6 +30,8 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon
|
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class MediaListView(BaseListWithDnD):
|
class MediaListView(BaseListWithDnD):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
self.PluginName = u'Media'
|
self.PluginName = u'Media'
|
||||||
@ -39,9 +41,7 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
"""
|
"""
|
||||||
This is the custom media manager item for Media Slides.
|
This is the custom media manager item for Media Slides.
|
||||||
"""
|
"""
|
||||||
global log
|
log.info(u'%s MediaMediaItem loaded', __name__)
|
||||||
log = logging.getLogger(u'MediaMediaItem')
|
|
||||||
log.info(u'Media Media Item loaded')
|
|
||||||
|
|
||||||
def __init__(self, parent, icon, title):
|
def __init__(self, parent, icon, title):
|
||||||
self.PluginNameShort = u'Media'
|
self.PluginNameShort = u'Media'
|
||||||
|
@ -27,11 +27,12 @@ import logging
|
|||||||
|
|
||||||
from openlp.core.lib import Plugin, build_icon, PluginStatus
|
from openlp.core.lib import Plugin, build_icon, PluginStatus
|
||||||
from openlp.plugins.media.lib import MediaMediaItem
|
from openlp.plugins.media.lib import MediaMediaItem
|
||||||
|
from PyQt4.phonon import Phonon
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class MediaPlugin(Plugin):
|
class MediaPlugin(Plugin):
|
||||||
global log
|
log.info(u'%s MediaPlugin loaded', __name__)
|
||||||
log = logging.getLogger(u'MediaPlugin')
|
|
||||||
log.info(u'Media Plugin loaded')
|
|
||||||
|
|
||||||
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.1', plugin_helpers)
|
||||||
@ -40,6 +41,9 @@ class MediaPlugin(Plugin):
|
|||||||
# passed with drag and drop messages
|
# passed with drag and drop messages
|
||||||
self.dnd_id = u'Media'
|
self.dnd_id = u'Media'
|
||||||
self.status = PluginStatus.Active
|
self.status = PluginStatus.Active
|
||||||
|
# print Phonon.BackendCapabilities.availableMimeTypes()
|
||||||
|
# for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
|
||||||
|
# print mimetype
|
||||||
|
|
||||||
def initialise(self):
|
def initialise(self):
|
||||||
log.info(u'Plugin Initialising')
|
log.info(u'Plugin Initialising')
|
||||||
|
@ -33,13 +33,13 @@ from openlp.plugins.songs.forms import EditVerseForm
|
|||||||
from openlp.plugins.songs.lib.models import Song
|
from openlp.plugins.songs.lib.models import Song
|
||||||
from editsongdialog import Ui_EditSongDialog
|
from editsongdialog import Ui_EditSongDialog
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||||
"""
|
"""
|
||||||
Class to manage the editing of a song
|
Class to manage the editing of a song
|
||||||
"""
|
"""
|
||||||
global log
|
log.info(u'%s EditSongForm loaded', __name__)
|
||||||
log = logging.getLogger(u'EditSongForm')
|
|
||||||
log.info(u'Song Editor loaded')
|
|
||||||
|
|
||||||
def __init__(self, songmanager, parent=None):
|
def __init__(self, songmanager, parent=None):
|
||||||
"""
|
"""
|
||||||
|
@ -77,6 +77,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
|||||||
def setVerse(self, text, verseCount=0, single=False, tag=u'Verse:1'):
|
def setVerse(self, text, verseCount=0, single=False, tag=u'Verse:1'):
|
||||||
posVerse = 0
|
posVerse = 0
|
||||||
posSub = 0
|
posSub = 0
|
||||||
|
if len(text) == 0:
|
||||||
|
text = u'---[Verse:1]---\n'
|
||||||
if single:
|
if single:
|
||||||
id = tag.split(u':')
|
id = tag.split(u':')
|
||||||
posVerse = self.VerseListComboBox.findText(id[0], QtCore.Qt.MatchExactly)
|
posVerse = self.VerseListComboBox.findText(id[0], QtCore.Qt.MatchExactly)
|
||||||
@ -112,6 +114,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
|||||||
self.VerseTextEdit.setPlainText(text)
|
self.VerseTextEdit.setPlainText(text)
|
||||||
self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason)
|
self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason)
|
||||||
self.onVerseComboChanged(0)
|
self.onVerseComboChanged(0)
|
||||||
|
self.VerseTextEdit.moveCursor(QtGui.QTextCursor.Down)
|
||||||
|
|
||||||
def getVerse(self):
|
def getVerse(self):
|
||||||
return self.VerseTextEdit.toPlainText(), \
|
return self.VerseTextEdit.toPlainText(), \
|
||||||
@ -119,7 +122,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
|||||||
unicode(self.SubVerseListComboBox.currentText())
|
unicode(self.SubVerseListComboBox.currentText())
|
||||||
|
|
||||||
def getVerseAll(self):
|
def getVerseAll(self):
|
||||||
return self.VerseTextEdit.toPlainText()
|
text = self.VerseTextEdit.toPlainText()
|
||||||
|
if not text.startsWith(u'---['):
|
||||||
|
text = u'---[Verse:1]---\n%s' % text
|
||||||
|
return text
|
||||||
|
|
||||||
def onVerseComboChanged(self, id):
|
def onVerseComboChanged(self, id):
|
||||||
if unicode(self.VerseListComboBox.currentText()) == u'Verse':
|
if unicode(self.VerseListComboBox.currentText()) == u'Verse':
|
||||||
|
Loading…
Reference in New Issue
Block a user