Merge lp:~sam92/openlp/bag_1225763 into lp:openlp

Proposed by Samuel Mehrbrodt
Status: Merged
Approved by: Raoul Snyman
Approved revision: 2307
Merged at revision: 2360
Proposed branch: lp:~sam92/openlp/bag_1225763
Merge into: lp:openlp
Diff against target: 90 lines (+37/-3)
4 files modified
.bzrignore (+1/-0)
openlp/core/lib/ui.py (+1/-1)
openlp/core/ui/media/mediacontroller.py (+3/-2)
tests/functional/openlp_core_lib/test_ui.py (+32/-0)
To merge this branch: bzr merge lp:~sam92/openlp/bag_1225763
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Tim Bentley Pending
Andreas Preikschat Pending
Review via email: mp+215955@code.launchpad.net

This proposal supersedes a proposal from 2014-04-14.

Description of the change

Got the branch from https://code.launchpad.net/~marmyshev/openlp/bag_1225763/
Merged current trunk and added a test.

To post a comment you must log in.
Revision history for this message
Samuel Mehrbrodt (sam92) wrote : Posted in a previous version of this proposal
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

 No newline at end of file - Hummmmmmm

Rest looks fine.

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

Conflict with trunk

review: Needs Fixing
Revision history for this message
Tim Bentley (trb143) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Raoul Snyman (raoul-snyman) : Posted in a previous version of this proposal
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 '.bzrignore'
2--- .bzrignore 2013-11-07 20:35:02 +0000
3+++ .bzrignore 2014-04-15 20:57:10 +0000
4@@ -2,6 +2,7 @@
5 *.*~
6 \#*\#
7 *.eric4project
8+*.eric5project
9 *.ropeproject
10 *.e4*
11 .eric4project
12
13=== modified file 'openlp/core/lib/ui.py'
14--- openlp/core/lib/ui.py 2014-03-26 12:06:48 +0000
15+++ openlp/core/lib/ui.py 2014-04-15 20:57:10 +0000
16@@ -173,7 +173,7 @@
17 kwargs.setdefault('tooltip', translate('OpenLP.Ui', 'Move selection down one position.'))
18 else:
19 log.warn('The role "%s" is not defined in create_push_button().', role)
20- if kwargs.pop('class', '') == 'toolbutton':
21+ if kwargs.pop('btn_class', '') == 'toolbutton':
22 button = QtGui.QToolButton(parent)
23 else:
24 button = QtGui.QPushButton(parent)
25
26=== modified file 'openlp/core/ui/media/mediacontroller.py'
27--- openlp/core/ui/media/mediacontroller.py 2014-04-12 20:19:22 +0000
28+++ openlp/core/ui/media/mediacontroller.py 2014-04-15 20:57:10 +0000
29@@ -506,7 +506,8 @@
30 else:
31 self.media_volume(controller, controller.media_info.volume)
32 if status:
33- display.frame.evaluateJavaScript('show_blank("desktop");')
34+ if not controller.media_info.is_background:
35+ display.frame.evaluateJavaScript('show_blank("desktop");')
36 self.current_media_players[controller.controller_type].set_visible(display, True)
37 # Flash needs to be played and will not AutoPlay
38 if controller.media_info.is_flash:
39@@ -517,7 +518,7 @@
40 controller.mediabar.actions['playbackPause'].setVisible(True)
41 controller.mediabar.actions['playbackStop'].setVisible(True)
42 if controller.is_live:
43- if controller.hide_menu.defaultAction().isChecked():
44+ if controller.hide_menu.defaultAction().isChecked() and not controller.media_info.is_background:
45 controller.hide_menu.defaultAction().trigger()
46 # Start Timer for ui updates
47 if not self.timer.isActive():
48
49=== modified file 'tests/functional/openlp_core_lib/test_ui.py'
50--- tests/functional/openlp_core_lib/test_ui.py 2014-04-15 08:15:07 +0000
51+++ tests/functional/openlp_core_lib/test_ui.py 2014-04-15 20:57:10 +0000
52@@ -82,6 +82,38 @@
53 self.assertEqual(1, len(btnbox.buttons()))
54 self.assertEqual(QtGui.QDialogButtonBox.HelpRole, btnbox.buttonRole(btnbox.buttons()[0]))
55
56+ def test_create_button(self):
57+ """
58+ Test creating a button
59+ """
60+ # GIVEN: A dialog
61+ dialog = QtGui.QDialog()
62+
63+ # WHEN: We create the button
64+ btn = create_button(dialog, 'my_btn')
65+
66+ # THEN: We should get a button with a name
67+ self.assertIsInstance(btn, QtGui.QPushButton)
68+ self.assertEqual('my_btn', btn.objectName())
69+ self.assertTrue(btn.isEnabled())
70+
71+ # WHEN: We create a button with some attributes
72+ btn = create_button(dialog, 'my_btn', text='Hello', tooltip='How are you?', enabled=False)
73+
74+ # THEN: We should get a button with those attributes
75+ self.assertIsInstance(btn, QtGui.QPushButton)
76+ self.assertEqual('Hello', btn.text())
77+ self.assertEqual('How are you?', btn.toolTip())
78+ self.assertFalse(btn.isEnabled())
79+
80+ # WHEN: We create a toolbutton
81+ btn = create_button(dialog, 'my_btn', btn_class='toolbutton')
82+
83+ # THEN: We should get a toolbutton
84+ self.assertIsInstance(btn, QtGui.QToolButton)
85+ self.assertEqual('my_btn', btn.objectName())
86+ self.assertTrue(btn.isEnabled())
87+
88 def test_create_valign_selection_widgets(self):
89 """
90 Test creating a combo box for valign selection