This commit is contained in:
Tim Bentley 2011-07-10 12:59:23 +01:00
parent dd302537ec
commit 4651ec35b6
3 changed files with 11 additions and 13 deletions

View File

@ -35,7 +35,7 @@ import logging
import os
import uuid
from openlp.core.lib import build_icon, clean_tags, expand_tags
from openlp.core.lib import build_icon, clean_tags, expand_tags, translate
from openlp.core.lib.ui import UiStrings
log = logging.getLogger(__name__)
@ -450,10 +450,12 @@ class ServiceItem(object):
start = None
end = None
if self.start_time != 0:
start = UiStrings().StartTimeCode % \
start = unicode(translate('OpenLP.ServiceItem',
'<strong>Start</strong>: %s')) % \
unicode(datetime.timedelta(seconds=self.start_time))
if self.media_length != 0:
end = UiStrings().LengthTime % \
end = unicode(translate('OpenLP.ServiceItem',
'<strong>Length</strong>: %s')) % \
unicode(datetime.timedelta(seconds=self.media_length))
if not start and not end:
return None
@ -462,7 +464,7 @@ class ServiceItem(object):
elif not start and end:
return end
else:
return u'%s : %s' % (start, end)
return u'%s <br />%s' % (start, end)
def update_theme(self, theme):
"""

View File

@ -83,7 +83,6 @@ class UiStrings(object):
self.Image = translate('OpenLP.Ui', 'Image')
self.Import = translate('OpenLP.Ui', 'Import')
self.LayoutStyle = translate('OpenLP.Ui', 'Layout style:')
self.LengthTime = unicode(translate('OpenLP.Ui', 'Length %s'))
self.Live = translate('OpenLP.Ui', 'Live')
self.LiveBGError = translate('OpenLP.Ui', 'Live Background Error')
self.LiveToolbar = translate('OpenLP.Ui', 'Live Toolbar')
@ -123,7 +122,6 @@ class UiStrings(object):
self.Split = translate('OpenLP.Ui', '&Split')
self.SplitToolTip = translate('OpenLP.Ui', 'Split a slide into two '
'only if it does not fit on the screen as one slide.')
self.StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s'))
self.Theme = translate('OpenLP.Ui', 'Theme', 'Singular')
self.Themes = translate('OpenLP.Ui', 'Themes', 'Plural')
self.Tools = translate('OpenLP.Ui', 'Tools')

View File

@ -958,13 +958,16 @@ class ServiceManager(QtGui.QWidget):
treewidgetitem.setText(0, serviceitem.get_display_title())
tips = []
if serviceitem.theme and serviceitem.theme != -1:
tips.append(u'<strong>%s :</strong> <em>%s</em>' %
tips.append(u'<strong>%s:</strong> <em>%s</em>' %
(unicode(translate('OpenLP.ServiceManager', 'Slide theme')),
serviceitem.theme))
if serviceitem.notes:
tips.append(u'<strong>%s :</strong> %s' %
tips.append(u'<strong>%s </strong> %s' %
(unicode(translate('OpenLP.ServiceManager', 'Notes')),
unicode(serviceitem.notes)))
if item[u'service_item'] \
.is_capable(ItemCapabilities.AllowsVariableStartTime):
tips.append(item[u'service_item'].get_media_time())
treewidgetitem.setToolTip(0, u'<br />'.join(tips))
treewidgetitem.setData(0, QtCore.Qt.UserRole,
QtCore.QVariant(item[u'order']))
@ -975,11 +978,6 @@ class ServiceManager(QtGui.QWidget):
text = frame[u'title'].replace(u'\n', u' ')
child.setText(0, text[:40])
child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count))
if item[u'service_item'] \
.is_capable(ItemCapabilities.AllowsVariableStartTime):
tip = item[u'service_item'].get_media_time()
if tip:
child.setToolTip(0, tip)
if serviceItem == itemcount:
if item[u'expanded'] and serviceItemChild == count:
self.serviceManagerList.setCurrentItem(child)