Merge lp:~trb143/openlp/fbeta3 into lp:openlp

Proposed by Tim Bentley
Status: Merged
Merged at revision: 1681
Proposed branch: lp:~trb143/openlp/fbeta3
Merge into: lp:openlp
Diff against target: 148 lines (+41/-15)
4 files modified
openlp/core/lib/serviceitem.py (+20/-4)
openlp/core/lib/ui.py (+4/-3)
openlp/core/ui/servicemanager.py (+14/-7)
openlp/core/ui/slidecontroller.py (+3/-1)
To merge this branch: bzr merge lp:~trb143/openlp/fbeta3
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Andreas Preikschat (community) Approve
Review via email: mp+67454@code.launchpad.net

This proposal supersedes a proposal from 2011-07-10.

Description of the change

Improve ServiceManager tool tips to include theme.
Fix change of theme in servicemanager to allow live to be updated.

To post a comment you must log in.
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote : Posted in a previous version of this proposal

Line 39: hm... what's with <strong>?
Line 42/43: Indent missing

review: Needs Fixing
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote : Posted in a previous version of this proposal

Sorry, for not saying/noticing this in the last review.
Lines 40/44: There should not be a space between the string and the colon.
A few lines later (not in the diff) we have some code to display the playing time. This should be moved on modified to work in the same way as the changes already in the diff. (Unless it will be possible to have move audio/video files in one item soon. ;-) )

Rest looks good. I am particular happy that you fixed the theme update thing (I guess many people were confused when they were testing things).

review: Needs Fixing
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) :
review: Approve
Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/lib/serviceitem.py'
2--- openlp/core/lib/serviceitem.py 2011-06-18 13:36:29 +0000
3+++ openlp/core/lib/serviceitem.py 2011-07-10 12:11:16 +0000
4@@ -35,7 +35,7 @@
5 import os
6 import uuid
7
8-from openlp.core.lib import build_icon, clean_tags, expand_tags
9+from openlp.core.lib import build_icon, clean_tags, expand_tags, translate
10 from openlp.core.lib.ui import UiStrings
11
12 log = logging.getLogger(__name__)
13@@ -352,6 +352,9 @@
14 Updates the _uuid with the value from the original one
15 The _uuid is unique for a given service item but this allows one to
16 replace an original version.
17+
18+ ``other``
19+ The service item to be merged with
20 """
21 self._uuid = other._uuid
22 self.notes = other.notes
23@@ -447,10 +450,12 @@
24 start = None
25 end = None
26 if self.start_time != 0:
27- start = UiStrings().StartTimeCode % \
28+ start = unicode(translate('OpenLP.ServiceItem',
29+ '<strong>Start</strong>: %s')) % \
30 unicode(datetime.timedelta(seconds=self.start_time))
31 if self.media_length != 0:
32- end = UiStrings().LengthTime % \
33+ end = unicode(translate('OpenLP.ServiceItem',
34+ '<strong>Length</strong>: %s')) % \
35 unicode(datetime.timedelta(seconds=self.media_length))
36 if not start and not end:
37 return None
38@@ -459,5 +464,16 @@
39 elif not start and end:
40 return end
41 else:
42- return u'%s : %s' % (start, end)
43+ return u'%s <br />%s' % (start, end)
44+
45+ def update_theme(self, theme):
46+ """
47+ updates the theme in the service item
48+
49+ ``theme``
50+ The new theme to be replaced in the service item
51+ """
52+ self.theme = theme
53+ self._new_item()
54+ self.render()
55
56
57=== modified file 'openlp/core/lib/ui.py'
58--- openlp/core/lib/ui.py 2011-07-07 15:23:55 +0000
59+++ openlp/core/lib/ui.py 2011-07-10 12:11:16 +0000
60@@ -83,7 +83,6 @@
61 self.Image = translate('OpenLP.Ui', 'Image')
62 self.Import = translate('OpenLP.Ui', 'Import')
63 self.LayoutStyle = translate('OpenLP.Ui', 'Layout style:')
64- self.LengthTime = unicode(translate('OpenLP.Ui', 'Length %s'))
65 self.Live = translate('OpenLP.Ui', 'Live')
66 self.LiveBGError = translate('OpenLP.Ui', 'Live Background Error')
67 self.LiveToolbar = translate('OpenLP.Ui', 'Live Toolbar')
68@@ -126,8 +125,10 @@
69 self.SplitToolTip = translate('OpenLP.Ui', 'Split a slide into two '
70 'only if it does not fit on the screen as one slide.')
71 self.StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s'))
72- self.StopPlaySlidesInLoop = translate('OpenLP.Ui','Stop Play Slides in Loop')
73- self.StopPlaySlidesToEnd = translate('OpenLP.Ui','Stop Play Slides to End')
74+ self.StopPlaySlidesInLoop = translate('OpenLP.Ui',
75+ 'Stop Play Slides in Loop')
76+ self.StopPlaySlidesToEnd = translate('OpenLP.Ui',
77+ 'Stop Play Slides to End')
78 self.Theme = translate('OpenLP.Ui', 'Theme', 'Singular')
79 self.Themes = translate('OpenLP.Ui', 'Themes', 'Plural')
80 self.Tools = translate('OpenLP.Ui', 'Tools')
81
82=== modified file 'openlp/core/ui/servicemanager.py'
83--- openlp/core/ui/servicemanager.py 2011-07-07 20:14:12 +0000
84+++ openlp/core/ui/servicemanager.py 2011-07-10 12:11:16 +0000
85@@ -956,7 +956,19 @@
86 treewidgetitem.setIcon(0,
87 build_icon(u':/general/general_delete.png'))
88 treewidgetitem.setText(0, serviceitem.get_display_title())
89- treewidgetitem.setToolTip(0, serviceitem.notes)
90+ tips = []
91+ if serviceitem.theme and serviceitem.theme != -1:
92+ tips.append(u'<strong>%s:</strong> <em>%s</em>' %
93+ (unicode(translate('OpenLP.ServiceManager', 'Slide theme')),
94+ serviceitem.theme))
95+ if serviceitem.notes:
96+ tips.append(u'<strong>%s: </strong> %s' %
97+ (unicode(translate('OpenLP.ServiceManager', 'Notes')),
98+ unicode(serviceitem.notes)))
99+ if item[u'service_item'] \
100+ .is_capable(ItemCapabilities.AllowsVariableStartTime):
101+ tips.append(item[u'service_item'].get_media_time())
102+ treewidgetitem.setToolTip(0, u'<br />'.join(tips))
103 treewidgetitem.setData(0, QtCore.Qt.UserRole,
104 QtCore.QVariant(item[u'order']))
105 treewidgetitem.setSelected(item[u'selected'])
106@@ -966,11 +978,6 @@
107 text = frame[u'title'].replace(u'\n', u' ')
108 child.setText(0, text[:40])
109 child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count))
110- if item[u'service_item'] \
111- .is_capable(ItemCapabilities.AllowsVariableStartTime):
112- tip = item[u'service_item'].get_media_time()
113- if tip:
114- child.setToolTip(0, tip)
115 if serviceItem == itemcount:
116 if item[u'expanded'] and serviceItemChild == count:
117 self.serviceManagerList.setCurrentItem(child)
118@@ -1338,7 +1345,7 @@
119 if not theme:
120 theme = None
121 item = self.findServiceItem()[0]
122- self.serviceItems[item][u'service_item'].theme = theme
123+ self.serviceItems[item][u'service_item'].update_theme(theme)
124 self.regenerateServiceItems()
125
126 def _getParentItemData(self, item):
127
128=== modified file 'openlp/core/ui/slidecontroller.py'
129--- openlp/core/ui/slidecontroller.py 2011-07-08 06:41:30 +0000
130+++ openlp/core/ui/slidecontroller.py 2011-07-10 12:11:16 +0000
131@@ -28,6 +28,7 @@
132 import logging
133 import os
134 import time
135+import copy
136
137 from PyQt4 import QtCore, QtGui
138 from PyQt4.phonon import Phonon
139@@ -598,7 +599,8 @@
140 log.debug(u'processManagerItem live = %s' % self.isLive)
141 self.onStopLoop()
142 old_item = self.serviceItem
143- self.serviceItem = serviceItem
144+ # take a copy not a link to the servicemeanager copy.
145+ self.serviceItem = copy.copy(serviceItem)
146 if old_item and self.isLive and old_item.is_capable(
147 ItemCapabilities.ProvidesOwnDisplay):
148 self._resetBlank()