forked from openlp/openlp
send messages in openlp.plugins.bibles.lib.manager via "openlp_information_message" signal
This commit is contained in:
parent
4fd5d7546e
commit
e000b8a89b
@ -44,6 +44,10 @@ class ThemesTab(SettingsTab):
|
||||
self.GlobalGroupBoxLayout = QtGui.QVBoxLayout(self.GlobalGroupBox)
|
||||
self.GlobalGroupBoxLayout.setObjectName(u'GlobalGroupBoxLayout')
|
||||
self.DefaultComboBox = QtGui.QComboBox(self.GlobalGroupBox)
|
||||
self.DefaultComboBox.setSizeAdjustPolicy(
|
||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
||||
self.DefaultComboBox.setSizePolicy(QtGui.QSizePolicy.Expanding,
|
||||
QtGui.QSizePolicy.Fixed)
|
||||
self.DefaultComboBox.setObjectName(u'DefaultComboBox')
|
||||
self.GlobalGroupBoxLayout.addWidget(self.DefaultComboBox)
|
||||
self.DefaultListView = QtGui.QLabel(self.GlobalGroupBox)
|
||||
|
@ -74,6 +74,10 @@ class BiblesTab(SettingsTab):
|
||||
self.BibleThemeLabel = QtGui.QLabel(self.VerseDisplayGroupBox)
|
||||
self.BibleThemeLabel.setObjectName(u'BibleThemeLabel')
|
||||
self.BibleThemeComboBox = QtGui.QComboBox(self.VerseDisplayGroupBox)
|
||||
self.BibleThemeComboBox.setSizeAdjustPolicy(
|
||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
||||
self.BibleThemeComboBox.setSizePolicy(QtGui.QSizePolicy.Expanding,
|
||||
QtGui.QSizePolicy.Fixed)
|
||||
self.BibleThemeComboBox.addItem(u'')
|
||||
self.BibleThemeComboBox.setObjectName(u'BibleThemeComboBox')
|
||||
self.VerseDisplayLayout.addRow(self.BibleThemeLabel,
|
||||
@ -84,6 +88,8 @@ class BiblesTab(SettingsTab):
|
||||
self.VerseDisplayLayout.addRow(self.ChangeNoteLabel)
|
||||
self.leftLayout.addWidget(self.VerseDisplayGroupBox)
|
||||
self.leftLayout.addStretch()
|
||||
self.rightColumn.setSizePolicy(QtGui.QSizePolicy.Expanding,
|
||||
QtGui.QSizePolicy.Preferred)
|
||||
self.rightLayout.addStretch()
|
||||
# Signals and slots
|
||||
QtCore.QObject.connect(
|
||||
|
@ -28,7 +28,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import SettingsManager, translate
|
||||
from openlp.core.lib import Receiver, SettingsManager, translate
|
||||
from openlp.core.utils import AppLocation
|
||||
from openlp.plugins.bibles.lib import parse_reference
|
||||
from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta
|
||||
@ -258,21 +258,22 @@ class BibleManager(object):
|
||||
"""
|
||||
log.debug(u'BibleManager.get_verses("%s", "%s")', bible, versetext)
|
||||
if not bible:
|
||||
QtGui.QMessageBox.information(self.parent.mediaItem,
|
||||
translate('BiblesPlugin.BibleManager',
|
||||
Receiver.send_message(u'openlp_information_message', {
|
||||
u'title': translate('BiblesPlugin.BibleManager',
|
||||
'No Bibles available'),
|
||||
translate('BiblesPlugin.BibleManager',
|
||||
u'message': translate('BiblesPlugin.BibleManager',
|
||||
'There are no Bibles currently installed. Please use the '
|
||||
'Import Wizard to install one or more Bibles.'))
|
||||
'Import Wizard to install one or more Bibles.')
|
||||
})
|
||||
return None
|
||||
reflist = parse_reference(versetext)
|
||||
if reflist:
|
||||
return self.db_cache[bible].get_verses(reflist)
|
||||
else:
|
||||
QtGui.QMessageBox.information(self.parent.mediaItem,
|
||||
translate('BiblesPlugin.BibleManager',
|
||||
Receiver.send_message(u'openlp_information_message', {
|
||||
u'title': translate('BiblesPlugin.BibleManager',
|
||||
'Scripture Reference Error'),
|
||||
translate('BiblesPlugin.BibleManager', 'Your scripture '
|
||||
u'message': translate('BiblesPlugin.BibleManager', 'Your scripture '
|
||||
'reference is either not supported by OpenLP or is invalid. '
|
||||
'Please make sure your reference conforms to one of the '
|
||||
'following patterns:\n\n'
|
||||
@ -281,7 +282,8 @@ class BibleManager(object):
|
||||
'Book Chapter:Verse-Verse\n'
|
||||
'Book Chapter:Verse-Verse,Verse-Verse\n'
|
||||
'Book Chapter:Verse-Verse,Chapter:Verse-Verse\n'
|
||||
'Book Chapter:Verse-Chapter:Verse'))
|
||||
'Book Chapter:Verse-Chapter:Verse')
|
||||
})
|
||||
return None
|
||||
|
||||
def verse_search(self, bible, second_bible, text):
|
||||
@ -306,22 +308,25 @@ class BibleManager(object):
|
||||
second_webbible = self.db_cache[second_bible].get_object(BibleMeta,
|
||||
u'download source')
|
||||
if webbible or second_webbible:
|
||||
QtGui.QMessageBox.information(self.parent.mediaItem,
|
||||
translate('BiblesPlugin.BibleManager',
|
||||
Receiver.send_message(u'openlp_information_message', {
|
||||
u'title': translate('BiblesPlugin.BibleManager',
|
||||
'Web Bible cannot be used'),
|
||||
translate('BiblesPlugin.BibleManager', 'Text Search is not '
|
||||
'available with Web Bibles.'))
|
||||
u'message': translate('BiblesPlugin.BibleManager',
|
||||
'Text Search is not available with Web Bibles.')
|
||||
})
|
||||
return None
|
||||
if text:
|
||||
return self.db_cache[bible].verse_search(text)
|
||||
else:
|
||||
QtGui.QMessageBox.information(self.parent.mediaItem,
|
||||
translate('BiblesPlugin.BibleManager',
|
||||
Receiver.send_message(u'openlp_information_message', {
|
||||
u'title': translate('BiblesPlugin.BibleManager',
|
||||
'Scripture Reference Error'),
|
||||
translate('BiblesPlugin.BibleManager', 'You did not enter a '
|
||||
'search keyword.\nYou can separate different keywords by a '
|
||||
'space to search for all of your keywords and you can separate '
|
||||
'them by a comma to search for one of them.'))
|
||||
u'message': translate('BiblesPlugin.BibleManager',
|
||||
'You did not enter a search keyword.\n'
|
||||
'You can separate different keywords by a space to search for '
|
||||
'all of your keywords and you can separate them by a comma to '
|
||||
'search for one of them.')
|
||||
})
|
||||
return None
|
||||
|
||||
def save_meta_data(self, bible, version, copyright, permissions):
|
||||
|
@ -214,7 +214,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
'Live Background Error'),
|
||||
u'message': unicode(translate('ImagePlugin.MediaItem',
|
||||
'There was a problem replacing your background, '
|
||||
'the image file %s no longer exists.')) % filename})
|
||||
'the image file "%s" no longer exists.')) % filename})
|
||||
|
||||
def onPreviewClick(self):
|
||||
MediaManagerItem.onPreviewClick(self)
|
||||
|
@ -111,7 +111,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
'Live Background Error'),
|
||||
u'message': unicode(translate('MediaPlugin.MediaItem',
|
||||
'There was a problem replacing your background, '
|
||||
'the media file %s no longer exists.')) % filename})
|
||||
'the media file "%s" no longer exists.')) % filename})
|
||||
|
||||
def generateSlideData(self, service_item, item=None, xmlVersion=False):
|
||||
if item is None:
|
||||
|
Loading…
Reference in New Issue
Block a user