UiStrings

This commit is contained in:
Jon Tibble 2011-02-13 14:21:12 +00:00
parent 321269b11b
commit 816b17c245
3 changed files with 5 additions and 9 deletions

View File

@ -87,6 +87,7 @@ class UiStrings(object):
SaveType = unicode(translate('OpenLP.Ui', 'Save %s'))
Search = translate('OpenLP.Ui', 'Search')
SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.')
SelectEdit = translate('OpenLP.Ui', 'You must select an item to edit.')
SendSelectLive = unicode(translate('OpenLP.Ui',
'Send the selected %s live.'))
Service = translate('OpenLP.Ui', 'Service')

View File

@ -30,6 +30,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \
translate, check_item_selected
from openlp.core.lib.ui import UiStrings
from openlp.plugins.custom.lib import CustomXMLParser
from openlp.plugins.custom.lib.db import CustomSlide
@ -108,9 +109,7 @@ class CustomMediaItem(MediaManagerItem):
"""
Edit a custom item
"""
if check_item_selected(self.listView,
translate('CustomPlugin.MediaItem',
'You haven\'t selected an item to edit.')):
if check_item_selected(self.listView, UiStrings.SelectEdit):
item = self.listView.currentItem()
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
self.parent.edit_custom_form.loadCustom(item_id, False)
@ -121,9 +120,7 @@ class CustomMediaItem(MediaManagerItem):
"""
Remove a custom item from the list and database
"""
if check_item_selected(self.listView,
translate('CustomPlugin.MediaItem',
'You haven\'t selected an item to delete.')):
if check_item_selected(self.listView, UiStrings.SelectDelete):
row_list = [item.row() for item in self.listView.selectedIndexes()]
row_list.sort(reverse=True)
id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0]

View File

@ -306,9 +306,7 @@ class SongMediaItem(MediaManagerItem):
Edit a song
"""
log.debug(u'onEditClick')
if check_item_selected(self.listView,
translate('SongsPlugin.MediaItem',
'You must select an item to edit.')):
if check_item_selected(self.listView, UiStrings.SelectEdit):
self.editItem = self.listView.currentItem()
item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0]
self.edit_song_form.loadSong(item_id, False)