forked from openlp/openlp
r1972
This commit is contained in:
commit
e28f654b0f
@ -26,12 +26,6 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# Import uuid now, to avoid the rare bug described in the support system:
|
|
||||||
# http://support.openlp.org/issues/102
|
|
||||||
# If https://bugs.gentoo.org/show_bug.cgi?id=317557 is fixed, the import can be
|
|
||||||
# removed.
|
|
||||||
import uuid
|
|
||||||
|
|
||||||
from openlp.core import main
|
from openlp.core import main
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,6 +64,9 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
|||||||
elif event.key() == QtCore.Qt.Key_Down:
|
elif event.key() == QtCore.Qt.Key_Down:
|
||||||
self.serviceManager.onMoveSelectionDown()
|
self.serviceManager.onMoveSelectionDown()
|
||||||
event.accept()
|
event.accept()
|
||||||
|
elif event.key() == QtCore.Qt.Key_Delete:
|
||||||
|
self.serviceManager.onDeleteFromService()
|
||||||
|
event.accept()
|
||||||
event.ignore()
|
event.ignore()
|
||||||
else:
|
else:
|
||||||
event.ignore()
|
event.ignore()
|
||||||
@ -218,6 +221,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
icon=u':/general/general_delete.png',
|
icon=u':/general/general_delete.png',
|
||||||
tooltip=translate('OpenLP.ServiceManager',
|
tooltip=translate('OpenLP.ServiceManager',
|
||||||
'Delete the selected item from the service.'),
|
'Delete the selected item from the service.'),
|
||||||
|
shortcuts=[QtCore.Qt.Key_Delete],
|
||||||
triggers=self.onDeleteFromService)
|
triggers=self.onDeleteFromService)
|
||||||
self.orderToolbar.addSeparator()
|
self.orderToolbar.addSeparator()
|
||||||
self.serviceManagerList.expand = self.orderToolbar.addToolbarAction(
|
self.serviceManagerList.expand = self.orderToolbar.addToolbarAction(
|
||||||
@ -298,17 +302,14 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.timeAction = create_widget_action(self.menu,
|
self.timeAction = create_widget_action(self.menu,
|
||||||
text=translate('OpenLP.ServiceManager', '&Start Time'),
|
text=translate('OpenLP.ServiceManager', '&Start Time'),
|
||||||
icon=u':/media/media_time.png', triggers=self.onStartTimeForm)
|
icon=u':/media/media_time.png', triggers=self.onStartTimeForm)
|
||||||
self.deleteAction = create_widget_action(self.menu,
|
# Add already existing delete action to the menu.
|
||||||
text=translate('OpenLP.ServiceManager', '&Delete From Service'),
|
self.menu.addAction(self.serviceManagerList.delete)
|
||||||
icon=u':/general/general_delete.png',
|
|
||||||
triggers=self.onDeleteFromService)
|
|
||||||
self.menu.addSeparator()
|
self.menu.addSeparator()
|
||||||
self.previewAction = create_widget_action(self.menu,
|
self.previewAction = create_widget_action(self.menu,
|
||||||
text=translate('OpenLP.ServiceManager', 'Show &Preview'),
|
text=translate('OpenLP.ServiceManager', 'Show &Preview'),
|
||||||
icon=u':/general/general_preview.png', triggers=self.makePreview)
|
icon=u':/general/general_preview.png', triggers=self.makePreview)
|
||||||
self.liveAction = create_widget_action(self.menu,
|
# Add already existing make live action to the menu.
|
||||||
text=translate('OpenLP.ServiceManager', 'Show &Live'),
|
self.menu.addAction(self.serviceManagerList.makeLive)
|
||||||
icon=u':/general/general_live.png', triggers=self.makeLive)
|
|
||||||
self.menu.addSeparator()
|
self.menu.addSeparator()
|
||||||
self.themeMenu = QtGui.QMenu(
|
self.themeMenu = QtGui.QMenu(
|
||||||
translate('OpenLP.ServiceManager', '&Change Item Theme'))
|
translate('OpenLP.ServiceManager', '&Change Item Theme'))
|
||||||
@ -560,14 +561,12 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
zip.write(audio_from, audio_to.encode(u'utf-8'))
|
zip.write(audio_from, audio_to.encode(u'utf-8'))
|
||||||
except IOError:
|
except IOError:
|
||||||
log.exception(u'Failed to save service to disk: %s', temp_file_name)
|
log.exception(u'Failed to save service to disk: %s', temp_file_name)
|
||||||
# Add this line in after the release to notify the user that saving
|
Receiver.send_message(u'openlp_error_message', {
|
||||||
# their file failed. Commented out due to string freeze.
|
u'title': translate(u'OpenLP.ServiceManager',
|
||||||
#Receiver.send_message(u'openlp_error_message', {
|
u'Error Saving File'),
|
||||||
# u'title': translate(u'OpenLP.ServiceManager',
|
u'message': translate(u'OpenLP.ServiceManager',
|
||||||
# u'Error Saving File'),
|
u'There was an error saving your file.')
|
||||||
# u'message': translate(u'OpenLP.ServiceManager',
|
})
|
||||||
# u'There was an error saving your file.')
|
|
||||||
#})
|
|
||||||
success = False
|
success = False
|
||||||
finally:
|
finally:
|
||||||
if zip:
|
if zip:
|
||||||
@ -1317,15 +1316,15 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
|
|
||||||
def findServiceItem(self):
|
def findServiceItem(self):
|
||||||
"""
|
"""
|
||||||
Finds the selected ServiceItem in the list and returns the position of
|
Finds the first selected ServiceItem in the list and returns the
|
||||||
the serviceitem and its selected child item. For example, if the third
|
position of the serviceitem and its selected child item. For example,
|
||||||
child item (in the Slidecontroller known as slide) in the second service
|
if the third child item (in the Slidecontroller known as slide) in the
|
||||||
item is selected this will return::
|
second service item is selected this will return::
|
||||||
|
|
||||||
(1, 2)
|
(1, 2)
|
||||||
"""
|
"""
|
||||||
items = self.serviceManagerList.selectedItems()
|
items = self.serviceManagerList.selectedItems()
|
||||||
serviceItem = 0
|
serviceItem = -1
|
||||||
serviceItemChild = -1
|
serviceItemChild = -1
|
||||||
for item in items:
|
for item in items:
|
||||||
parentitem = item.parent()
|
parentitem = item.parent()
|
||||||
@ -1334,8 +1333,10 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
serviceItem = parentitem.data(0, QtCore.Qt.UserRole).toInt()[0]
|
serviceItem = parentitem.data(0, QtCore.Qt.UserRole).toInt()[0]
|
||||||
serviceItemChild = item.data(0, QtCore.Qt.UserRole).toInt()[0]
|
serviceItemChild = item.data(0, QtCore.Qt.UserRole).toInt()[0]
|
||||||
# Adjust for zero based arrays.
|
# Adjust for zero based arrays.
|
||||||
serviceItem -= 1
|
serviceItem -= 1
|
||||||
|
# Only process the first item on the list for this method.
|
||||||
|
break
|
||||||
return serviceItem, serviceItemChild
|
return serviceItem, serviceItemChild
|
||||||
|
|
||||||
def dragEnterEvent(self, event):
|
def dragEnterEvent(self, event):
|
||||||
|
@ -330,13 +330,7 @@ class BibleManager(object):
|
|||||||
'Import Wizard to install one or more Bibles.')
|
'Import Wizard to install one or more Bibles.')
|
||||||
})
|
})
|
||||||
return None
|
return None
|
||||||
language_selection = self.get_meta_data(bible, u'book_name_language')
|
language_selection = self.get_language_selection(bible)
|
||||||
if language_selection:
|
|
||||||
language_selection = int(language_selection.value)
|
|
||||||
if language_selection is None or language_selection == -1:
|
|
||||||
language_selection = QtCore.QSettings().value(
|
|
||||||
self.settingsSection + u'/bookname language',
|
|
||||||
QtCore.QVariant(0)).toInt()[0]
|
|
||||||
reflist = parse_reference(versetext, self.db_cache[bible],
|
reflist = parse_reference(versetext, self.db_cache[bible],
|
||||||
language_selection, book_ref_id)
|
language_selection, book_ref_id)
|
||||||
if reflist:
|
if reflist:
|
||||||
@ -378,12 +372,16 @@ class BibleManager(object):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'BibleManager.get_language_selection("%s")', bible)
|
log.debug(u'BibleManager.get_language_selection("%s")', bible)
|
||||||
language_selection = self.get_meta_data(bible, u'book_name_language')
|
language_selection = self.get_meta_data(bible, u'book_name_language')
|
||||||
if language_selection and language_selection.value != u'None':
|
if language_selection:
|
||||||
return int(language_selection.value)
|
try:
|
||||||
if language_selection is None or language_selection.value == u'None':
|
language_selection = int(language_selection.value)
|
||||||
return QtCore.QSettings().value(
|
except (ValueError, TypeError):
|
||||||
|
language_selection = LanguageSelection.Application
|
||||||
|
if language_selection is None or language_selection == -1:
|
||||||
|
language_selection = QtCore.QSettings().value(
|
||||||
self.settingsSection + u'/bookname language',
|
self.settingsSection + u'/bookname language',
|
||||||
QtCore.QVariant(0)).toInt()[0]
|
QtCore.QVariant(0)).toInt()[0]
|
||||||
|
return language_selection
|
||||||
|
|
||||||
def verse_search(self, bible, second_bible, text):
|
def verse_search(self, bible, second_bible, text):
|
||||||
"""
|
"""
|
||||||
|
@ -843,10 +843,11 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
items = []
|
items = []
|
||||||
language_selection = self.plugin.manager.get_language_selection(bible)
|
language_selection = self.plugin.manager.get_language_selection(bible)
|
||||||
for count, verse in enumerate(search_results):
|
for count, verse in enumerate(search_results):
|
||||||
|
book = None
|
||||||
if language_selection == LanguageSelection.Bible:
|
if language_selection == LanguageSelection.Bible:
|
||||||
book = verse.book.name
|
book = verse.book.name
|
||||||
elif language_selection == LanguageSelection.Application:
|
elif language_selection == LanguageSelection.Application:
|
||||||
book_names = BibleStrings().Booknames
|
book_names = BibleStrings().BookNames
|
||||||
data = BiblesResourcesDB.get_book_by_id(
|
data = BiblesResourcesDB.get_book_by_id(
|
||||||
verse.book.book_reference_id)
|
verse.book.book_reference_id)
|
||||||
book = unicode(book_names[data[u'abbreviation']])
|
book = unicode(book_names[data[u'abbreviation']])
|
||||||
|
Loading…
Reference in New Issue
Block a user