Merge lp:~thelinuxguy/openlp/fix-stylesheet into lp:openlp

Proposed by Simon Hanna
Status: Merged
Approved by: Tim Bentley
Approved revision: 2602
Merged at revision: 2605
Proposed branch: lp:~thelinuxguy/openlp/fix-stylesheet
Merge into: lp:openlp
Diff against target: 88 lines (+11/-21)
4 files modified
openlp/core/lib/plugin.py (+1/-1)
openlp/core/ui/mainwindow.py (+1/-2)
openlp/core/ui/mediadockmanager.py (+5/-16)
tests/functional/openlp_plugins/images/test_imagetab.py (+4/-2)
To merge this branch: bzr merge lp:~thelinuxguy/openlp/fix-stylesheet
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Tim Bentley Approve
Review via email: mp+282126@code.launchpad.net

Description of the change

Reenable the stylesheet
remove the icons from mediamanager so that display in plasma works

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) :
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/plugin.py'
2--- openlp/core/lib/plugin.py 2015-12-31 22:46:06 +0000
3+++ openlp/core/lib/plugin.py 2016-01-10 20:08:31 +0000
4@@ -275,7 +275,7 @@
5 """
6 if self.media_item:
7 self.media_item.initialise()
8- self.main_window.media_dock_manager.insert_dock(self.media_item, self.icon, self.weight)
9+ self.main_window.media_dock_manager.add_item_to_dock(self.media_item)
10
11 def finalise(self):
12 """
13
14=== modified file 'openlp/core/ui/mainwindow.py'
15--- openlp/core/ui/mainwindow.py 2016-01-09 19:10:56 +0000
16+++ openlp/core/ui/mainwindow.py 2016-01-10 20:08:31 +0000
17@@ -153,8 +153,7 @@
18 # Create the MediaManager
19 self.media_manager_dock = OpenLPDockWidget(main_window, 'media_manager_dock',
20 ':/system/system_mediamanager.png')
21- # TODO: Figure out how to fix the stylesheet and add it back in
22- # self.media_manager_dock.setStyleSheet(MEDIA_MANAGER_STYLE)
23+ self.media_manager_dock.setStyleSheet(MEDIA_MANAGER_STYLE)
24 # Create the media toolbox
25 self.media_tool_box = QtWidgets.QToolBox(self.media_manager_dock)
26 self.media_tool_box.setObjectName('media_tool_box')
27
28=== modified file 'openlp/core/ui/mediadockmanager.py'
29--- openlp/core/ui/mediadockmanager.py 2015-12-31 22:46:06 +0000
30+++ openlp/core/ui/mediadockmanager.py 2016-01-10 20:08:31 +0000
31@@ -39,23 +39,12 @@
32 """
33 self.media_dock = media_dock
34
35- def add_dock(self, media_item, icon, weight):
36+ def add_item_to_dock(self, media_item):
37 """
38 Add a MediaManagerItem to the dock
39-
40- :param media_item: The item to add to the dock
41- :param icon: An icon for this dock item
42- :param weight:
43- """
44- visible_title = media_item.plugin.get_string(StringContent.VisibleName)
45- log.info('Adding %s dock' % visible_title)
46- self.media_dock.addItem(media_item, icon, visible_title['title'])
47-
48- def insert_dock(self, media_item, icon, weight):
49- """
50- This should insert a dock item at a given location
51- This does not work as it gives a Segmentation error.
52- For now add at end of stack if not present
53+ If the item has been added before, it's silently skipped
54+
55+ :param media_item: The item to add to the dock
56 """
57 visible_title = media_item.plugin.get_string(StringContent.VisibleName)
58 log.debug('Inserting %s dock' % visible_title['title'])
59@@ -65,7 +54,7 @@
60 match = True
61 break
62 if not match:
63- self.media_dock.addItem(media_item, icon, visible_title['title'])
64+ self.media_dock.addItem(media_item, visible_title['title'])
65
66 def remove_dock(self, media_item):
67 """
68
69=== modified file 'tests/functional/openlp_plugins/images/test_imagetab.py'
70--- tests/functional/openlp_plugins/images/test_imagetab.py 2015-12-31 22:46:06 +0000
71+++ tests/functional/openlp_plugins/images/test_imagetab.py 2016-01-10 20:08:31 +0000
72@@ -80,12 +80,14 @@
73
74 def save_tab_change_test_test(self):
75 """
76- Test a change triggers post processing.
77+ Test a color change is applied and triggers post processing.
78 """
79 # GIVEN: Apply a change to the form.
80- self.form.background_color = '#999999'
81+ self.form.on_background_color_changed('#999999')
82 # WHEN: the save is invoked
83 self.form.save()
84 # THEN: the post process should be requested
85 self.assertEqual(1, self.form.settings_form.register_post_process.call_count,
86 'Image Post processing should have been requested')
87+ # THEN: The color should be set
88+ self.assertEqual(self.form.background_color, '#999999', 'The updated color should have been saved')