Merge lp:~googol-deactivatedaccount/openlp/bug-1112587 into lp:openlp

Proposed by Andreas Preikschat
Status: Merged
Approved by: Raoul Snyman
Approved revision: 2181
Merged at revision: 2188
Proposed branch: lp:~googol-deactivatedaccount/openlp/bug-1112587
Merge into: lp:openlp
Diff against target: 85 lines (+17/-6)
2 files modified
openlp/core/ui/slidecontroller.py (+9/-4)
tests/functional/openlp_core_lib/test_formattingtags.py (+8/-2)
To merge this branch: bzr merge lp:~googol-deactivatedaccount/openlp/bug-1112587
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Review via email: mp+149211@code.launchpad.net

This proposal supersedes a proposal from 2013-02-10.

Description of the change

Hello,

- fixed bug #1112587 ('Display verses on live tool bar' ignored)
- improved hide menu behaviour when resizing

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
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Please add a test, it doesn't even need to be related to your merge proposal.

review: Needs Fixing
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/ui/slidecontroller.py'
2--- openlp/core/ui/slidecontroller.py 2013-02-07 11:33:47 +0000
3+++ openlp/core/ui/slidecontroller.py 2013-02-19 07:41:20 +0000
4@@ -90,7 +90,6 @@
5 u'delaySpinBox'
6 ]
7 self.audioList = [
8- u'songMenu',
9 u'audioPauseItem',
10 u'audioTimeLabel'
11 ]
12@@ -293,6 +292,7 @@
13 self.audioTimeLabel.setObjectName(u'audioTimeLabel')
14 self.toolbar.addToolbarWidget(self.audioTimeLabel)
15 self.toolbar.setWidgetVisible(self.audioList, False)
16+ self.toolbar.setWidgetVisible([u'songMenu'], False)
17 # Screen preview area
18 self.previewFrame = QtGui.QFrame(self.splitter)
19 self.previewFrame.setGeometry(QtCore.QRect(0, 0, 300, 300 * self.ratio))
20@@ -592,10 +592,14 @@
21 Change layout of display control buttons on controller size change
22 """
23 if self.isLive:
24- if width > 300 and self.hideMenu.isVisible():
25+ # Space used by the toolbar.
26+ used_space = self.toolbar.size().width() + self.hideMenu.size().width()
27+ # The + 40 is needed to prevent flickering. This can be considered a "buffer".
28+ if width > used_space + 40 and self.hideMenu.isVisible():
29 self.toolbar.setWidgetVisible(self.hideMenuList, False)
30 self.toolbar.setWidgetVisible(self.wideMenu)
31- elif width < 300 and not self.hideMenu.isVisible():
32+ # The - 40 is needed to prevent flickering. This can be considered a "buffer".
33+ elif width < used_space - 40 and not self.hideMenu.isVisible():
34 self.toolbar.setWidgetVisible(self.wideMenu, False)
35 self.toolbar.setWidgetVisible(self.hideMenuList)
36
37@@ -640,6 +644,7 @@
38 self.mediabar.hide()
39 self.songMenu.hide()
40 self.toolbar.setWidgetVisible(self.loopList, False)
41+ self.toolbar.setWidgetVisible([u'songMenu'], False)
42 # Reset the button
43 self.playSlidesOnce.setChecked(False)
44 self.playSlidesOnce.setIcon(build_icon(u':/media/media_time.png'))
45@@ -647,7 +652,7 @@
46 self.playSlidesLoop.setIcon(build_icon(u':/media/media_time.png'))
47 if item.is_text():
48 if Settings().value(self.parent().songsSettingsSection + u'/display songbar') and self.slideList:
49- self.songMenu.show()
50+ self.toolbar.setWidgetVisible([u'songMenu'], True)
51 if item.is_capable(ItemCapabilities.CanLoop) and len(item.get_frames()) > 1:
52 self.toolbar.setWidgetVisible(self.loopList)
53 if item.is_media():
54
55=== modified file 'tests/functional/openlp_core_lib/test_formattingtags.py'
56--- tests/functional/openlp_core_lib/test_formattingtags.py 2013-02-16 18:11:22 +0000
57+++ tests/functional/openlp_core_lib/test_formattingtags.py 2013-02-19 07:41:20 +0000
58@@ -50,7 +50,7 @@
59
60 def get_html_tags_with_user_tags_test(self):
61 """
62- Test the FormattingTags class' get_html_tags static method in combination with user tags.
63+ FormattingTags class - test the get_html_tags(), add_html_tags() and remove_html_tag() methods.
64 """
65 with patch(u'openlp.core.lib.translate') as mocked_translate, \
66 patch(u'openlp.core.lib.settings') as mocked_settings, \
67@@ -67,7 +67,7 @@
68 # WHEN: Add our tag and get the tags again.
69 FormattingTags.load_tags()
70 FormattingTags.add_html_tags([TAG])
71- new_tags_list = FormattingTags.get_html_tags()
72+ new_tags_list = copy.deepcopy(FormattingTags.get_html_tags())
73
74 # THEN: Lists should not be identically.
75 assert old_tags_list != new_tags_list, u'The lists should be different.'
76@@ -76,3 +76,9 @@
77 new_tag = new_tags_list.pop()
78 assert TAG == new_tag, u'Tags should be identically.'
79
80+ # WHEN: Remove the new tag.
81+ FormattingTags.remove_html_tag(len(new_tags_list))
82+
83+ # THEN: The lists should now be identically.
84+ assert old_tags_list == FormattingTags.get_html_tags(), u'The lists should be identically.'
85+