Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~trb143/openlp/audit |
Merge into: | lp:openlp |
Diff against target: |
547 lines 15 files modified
openlp/core/lib/plugin.py (+8/-20) openlp/core/lib/pluginmanager.py (+7/-7) openlp/core/ui/__init__.py (+2/-1) openlp/core/ui/mainwindow.py (+7/-4) openlp/core/ui/mediadockmanager.py (+51/-0) openlp/core/ui/settingsform.py (+27/-14) openlp/plugins/bibles/bibleplugin.py (+24/-2) openlp/plugins/bibles/lib/mediaitem.py (+2/-1) openlp/plugins/images/lib/imagetab.py (+1/-1) openlp/plugins/media/lib/mediaitem.py (+3/-2) openlp/plugins/media/mediaplugin.py (+17/-0) openlp/plugins/presentations/presentationplugin.py (+13/-0) openlp/plugins/remotes/remoteplugin.py (+3/-0) openlp/plugins/songs/lib/mediaitem.py (+1/-1) openlp/plugins/songs/songsplugin.py (+23/-5) |
To merge this branch: | bzr merge lp:~trb143/openlp/audit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Approve | ||
Review via email:
|
This proposal supersedes a proposal from 2009-10-07.
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Raoul Snyman (raoul-snyman) wrote : | # |
Looks fine. Works nicely.
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 2009-10-03 19:02:40 +0000 | |||
3 | +++ openlp/core/lib/plugin.py 2009-10-08 17:35:19 +0000 | |||
4 | @@ -119,9 +119,6 @@ | |||
5 | 119 | self.icon = None | 119 | self.icon = None |
6 | 120 | self.config = PluginConfig(self.name) | 120 | self.config = PluginConfig(self.name) |
7 | 121 | self.weight = 0 | 121 | self.weight = 0 |
8 | 122 | self.media_id = -1 | ||
9 | 123 | self.settings_id = -1 | ||
10 | 124 | self.media_active = False | ||
11 | 125 | self.status = PluginStatus.Inactive | 122 | self.status = PluginStatus.Inactive |
12 | 126 | # Set up logging | 123 | # Set up logging |
13 | 127 | self.log = logging.getLogger(self.name) | 124 | self.log = logging.getLogger(self.name) |
14 | @@ -130,7 +127,7 @@ | |||
15 | 130 | self.render_manager = plugin_helpers[u'render'] | 127 | self.render_manager = plugin_helpers[u'render'] |
16 | 131 | self.service_manager = plugin_helpers[u'service'] | 128 | self.service_manager = plugin_helpers[u'service'] |
17 | 132 | self.settings = plugin_helpers[u'settings'] | 129 | self.settings = plugin_helpers[u'settings'] |
19 | 133 | self.mediatoolbox = plugin_helpers[u'toolbox'] | 130 | self.mediadock = plugin_helpers[u'toolbox'] |
20 | 134 | QtCore.QObject.connect(Receiver.get_receiver(), | 131 | QtCore.QObject.connect(Receiver.get_receiver(), |
21 | 135 | QtCore.SIGNAL(u'%s_add_service_item'% self.name), self.process_add_service_event) | 132 | QtCore.SIGNAL(u'%s_add_service_item'% self.name), self.process_add_service_event) |
22 | 136 | 133 | ||
23 | @@ -155,8 +152,8 @@ | |||
24 | 155 | """ | 152 | """ |
25 | 156 | Sets the status of the plugin | 153 | Sets the status of the plugin |
26 | 157 | """ | 154 | """ |
29 | 158 | self.status = self.config.get_config(\ | 155 | self.status = int(self.config.get_config(\ |
30 | 159 | u'%s_status' % self.name, PluginStatus.Inactive) | 156 | u'%s_status' % self.name, PluginStatus.Inactive)) |
31 | 160 | 157 | ||
32 | 161 | def toggle_status(self, new_status): | 158 | def toggle_status(self, new_status): |
33 | 162 | """ | 159 | """ |
34 | @@ -171,7 +168,7 @@ | |||
35 | 171 | 168 | ||
36 | 172 | Returns True or False. | 169 | Returns True or False. |
37 | 173 | """ | 170 | """ |
39 | 174 | return int(self.status ) == int(PluginStatus.Active) | 171 | return self.status == PluginStatus.Active |
40 | 175 | 172 | ||
41 | 176 | def get_media_manager_item(self): | 173 | def get_media_manager_item(self): |
42 | 177 | """ | 174 | """ |
43 | @@ -253,21 +250,12 @@ | |||
44 | 253 | """ | 250 | """ |
45 | 254 | Called by the plugin to remove toolbar | 251 | Called by the plugin to remove toolbar |
46 | 255 | """ | 252 | """ |
52 | 256 | if self.media_id is not -1: | 253 | self.mediadock.removeDock(self.name) |
53 | 257 | self.mediatoolbox.removeItem(self.media_id) | 254 | self.settings.removeTab(self.name) |
49 | 258 | if self.settings_id is not -1: | ||
50 | 259 | self.settings.removeTab(self.settings_id) | ||
51 | 260 | self.media_active = False | ||
54 | 261 | 255 | ||
55 | 262 | def insert_toolbox_item(self): | 256 | def insert_toolbox_item(self): |
56 | 263 | """ | 257 | """ |
57 | 264 | Called by plugin to replace toolbar | 258 | Called by plugin to replace toolbar |
58 | 265 | """ | 259 | """ |
67 | 266 | if not self.media_active: | 260 | self.mediadock.insertDock(self.name) |
68 | 267 | if self.media_id is not -1: | 261 | self.settings.insertTab(self.name) |
61 | 268 | self.mediatoolbox.insertItem( | ||
62 | 269 | self.media_id, self.media_item, self.icon, self.media_item.title) | ||
63 | 270 | if self.settings_id is not -1: | ||
64 | 271 | self.settings.insertTab( | ||
65 | 272 | self.settings_id, self.settings_tab) | ||
66 | 273 | self.media_active = True | ||
69 | 274 | 262 | ||
70 | === modified file 'openlp/core/lib/pluginmanager.py' | |||
71 | --- openlp/core/lib/pluginmanager.py 2009-10-03 19:02:40 +0000 | |||
72 | +++ openlp/core/lib/pluginmanager.py 2009-10-08 17:35:19 +0000 | |||
73 | @@ -125,7 +125,7 @@ | |||
74 | 125 | """ | 125 | """ |
75 | 126 | return cmp(x.weight, y.weight) | 126 | return cmp(x.weight, y.weight) |
76 | 127 | 127 | ||
78 | 128 | def hook_media_manager(self, mediatoolbox): | 128 | def hook_media_manager(self, mediadock): |
79 | 129 | """ | 129 | """ |
80 | 130 | Loop through all the plugins. If a plugin has a valid media manager | 130 | Loop through all the plugins. If a plugin has a valid media manager |
81 | 131 | item, add it to the media manager. | 131 | item, add it to the media manager. |
82 | @@ -139,9 +139,8 @@ | |||
83 | 139 | if plugin.media_item is not None: | 139 | if plugin.media_item is not None: |
84 | 140 | log.debug(u'Inserting media manager item from %s' % \ | 140 | log.debug(u'Inserting media manager item from %s' % \ |
85 | 141 | plugin.name) | 141 | plugin.name) |
89 | 142 | plugin.media_id = mediatoolbox.addItem( | 142 | mediadock.addDock(plugin.name, |
90 | 143 | plugin.media_item, plugin.icon, plugin.media_item.title) | 143 | plugin.media_item, plugin.icon) |
88 | 144 | plugin.media_active = True | ||
91 | 145 | 144 | ||
92 | 146 | def hook_settings_tabs(self, settingsform=None): | 145 | def hook_settings_tabs(self, settingsform=None): |
93 | 147 | """ | 146 | """ |
94 | @@ -157,7 +156,7 @@ | |||
95 | 157 | plugin.settings_tab = plugin.get_settings_tab() | 156 | plugin.settings_tab = plugin.get_settings_tab() |
96 | 158 | if plugin.settings_tab is not None: | 157 | if plugin.settings_tab is not None: |
97 | 159 | log.debug(u'Inserting settings tab item from %s' % plugin.name) | 158 | log.debug(u'Inserting settings tab item from %s' % plugin.name) |
99 | 160 | plugin.settings_id = settingsform.addTab(plugin.settings_tab) | 159 | settingsform.addTab(plugin.name, plugin.settings_tab) |
100 | 161 | else: | 160 | else: |
101 | 162 | log.debug(u'No tab settings in %s' % plugin.name) | 161 | log.debug(u'No tab settings in %s' % plugin.name) |
102 | 163 | 162 | ||
103 | @@ -202,11 +201,12 @@ | |||
104 | 202 | Loop through all the plugins and give them an opportunity to | 201 | Loop through all the plugins and give them an opportunity to |
105 | 203 | initialise themselves. | 202 | initialise themselves. |
106 | 204 | """ | 203 | """ |
107 | 205 | log.info(u'initialising plugins') | ||
108 | 206 | for plugin in self.plugins: | 204 | for plugin in self.plugins: |
109 | 205 | log.info(u'initialising plugins %s in a %s state' | ||
110 | 206 | % (plugin.name, plugin.is_active())) | ||
111 | 207 | if plugin.is_active(): | 207 | if plugin.is_active(): |
112 | 208 | plugin.initialise() | 208 | plugin.initialise() |
114 | 209 | if plugin.media_item is not None and not plugin.is_active(): | 209 | if not plugin.is_active(): |
115 | 210 | plugin.remove_toolbox_item() | 210 | plugin.remove_toolbox_item() |
116 | 211 | 211 | ||
117 | 212 | def finalise_plugins(self): | 212 | def finalise_plugins(self): |
118 | 213 | 213 | ||
119 | === modified file 'openlp/core/ui/__init__.py' | |||
120 | --- openlp/core/ui/__init__.py 2009-09-25 00:43:42 +0000 | |||
121 | +++ openlp/core/ui/__init__.py 2009-10-08 17:35:19 +0000 | |||
122 | @@ -34,10 +34,11 @@ | |||
123 | 34 | from alertform import AlertForm | 34 | from alertform import AlertForm |
124 | 35 | from plugindialoglistform import PluginForm | 35 | from plugindialoglistform import PluginForm |
125 | 36 | from settingsform import SettingsForm | 36 | from settingsform import SettingsForm |
126 | 37 | from mediadockmanager import MediaDockManager | ||
127 | 37 | from servicemanager import ServiceManager | 38 | from servicemanager import ServiceManager |
128 | 38 | from thememanager import ThemeManager | 39 | from thememanager import ThemeManager |
129 | 39 | from mainwindow import MainWindow | 40 | from mainwindow import MainWindow |
130 | 40 | 41 | ||
131 | 41 | __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainWindow', | 42 | __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainWindow', |
132 | 42 | 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', | 43 | 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', |
134 | 43 | 'AmendThemeForm'] | 44 | 'AmendThemeForm', 'MediaDockManager'] |
135 | 44 | 45 | ||
136 | === modified file 'openlp/core/ui/mainwindow.py' | |||
137 | --- openlp/core/ui/mainwindow.py 2009-10-03 18:39:44 +0000 | |||
138 | +++ openlp/core/ui/mainwindow.py 2009-10-08 17:35:19 +0000 | |||
139 | @@ -29,9 +29,10 @@ | |||
140 | 29 | 29 | ||
141 | 30 | from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \ | 30 | from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \ |
142 | 31 | ServiceManager, ThemeManager, MainDisplay, SlideController, \ | 31 | ServiceManager, ThemeManager, MainDisplay, SlideController, \ |
144 | 32 | PluginForm | 32 | PluginForm, MediaDockManager |
145 | 33 | from openlp.core.lib import translate, RenderManager, PluginConfig, \ | 33 | from openlp.core.lib import translate, RenderManager, PluginConfig, \ |
147 | 34 | OpenLPDockWidget, SettingsManager, PluginManager, Receiver, buildIcon | 34 | OpenLPDockWidget, SettingsManager, PluginManager, Receiver, \ |
148 | 35 | buildIcon | ||
149 | 35 | 36 | ||
150 | 36 | 37 | ||
151 | 37 | class Ui_MainWindow(object): | 38 | class Ui_MainWindow(object): |
152 | @@ -489,6 +490,8 @@ | |||
153 | 489 | #ThemeManager needs to call RenderManager | 490 | #ThemeManager needs to call RenderManager |
154 | 490 | self.RenderManager = RenderManager(self.ThemeManagerContents, | 491 | self.RenderManager = RenderManager(self.ThemeManagerContents, |
155 | 491 | self.screenList, self.getMonitorNumber()) | 492 | self.screenList, self.getMonitorNumber()) |
156 | 493 | #Define the media Dock Manager | ||
157 | 494 | self.mediaDockManager = MediaDockManager(self.MediaToolBox) | ||
158 | 492 | log.info(u'Load Plugins') | 495 | log.info(u'Load Plugins') |
159 | 493 | #make the controllers available to the plugins | 496 | #make the controllers available to the plugins |
160 | 494 | self.plugin_helpers[u'preview'] = self.PreviewController | 497 | self.plugin_helpers[u'preview'] = self.PreviewController |
161 | @@ -496,7 +499,7 @@ | |||
162 | 496 | self.plugin_helpers[u'render'] = self.RenderManager | 499 | self.plugin_helpers[u'render'] = self.RenderManager |
163 | 497 | self.plugin_helpers[u'service'] = self.ServiceManagerContents | 500 | self.plugin_helpers[u'service'] = self.ServiceManagerContents |
164 | 498 | self.plugin_helpers[u'settings'] = self.settingsForm | 501 | self.plugin_helpers[u'settings'] = self.settingsForm |
166 | 499 | self.plugin_helpers[u'toolbox'] = self.MediaToolBox | 502 | self.plugin_helpers[u'toolbox'] = self.mediaDockManager |
167 | 500 | self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers) | 503 | self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers) |
168 | 501 | # hook methods have to happen after find_plugins. Find plugins needs | 504 | # hook methods have to happen after find_plugins. Find plugins needs |
169 | 502 | # the controllers hence the hooks have moved from setupUI() to here | 505 | # the controllers hence the hooks have moved from setupUI() to here |
170 | @@ -505,7 +508,7 @@ | |||
171 | 505 | self.plugin_manager.hook_settings_tabs(self.settingsForm) | 508 | self.plugin_manager.hook_settings_tabs(self.settingsForm) |
172 | 506 | # Find and insert media manager items | 509 | # Find and insert media manager items |
173 | 507 | log.info(u'hook media') | 510 | log.info(u'hook media') |
175 | 508 | self.plugin_manager.hook_media_manager(self.MediaToolBox) | 511 | self.plugin_manager.hook_media_manager(self.mediaDockManager) |
176 | 509 | # Call the hook method to pull in import menus. | 512 | # Call the hook method to pull in import menus. |
177 | 510 | log.info(u'hook menus') | 513 | log.info(u'hook menus') |
178 | 511 | self.plugin_manager.hook_import_menu(self.FileImportMenu) | 514 | self.plugin_manager.hook_import_menu(self.FileImportMenu) |
179 | 512 | 515 | ||
180 | === added file 'openlp/core/ui/mediadockmanager.py' | |||
181 | --- openlp/core/ui/mediadockmanager.py 1970-01-01 00:00:00 +0000 | |||
182 | +++ openlp/core/ui/mediadockmanager.py 2009-10-08 17:35:19 +0000 | |||
183 | @@ -0,0 +1,51 @@ | |||
184 | 1 | # -*- coding: utf-8 -*- | ||
185 | 2 | # vim: autoindent shiftwidth=4 expanddock textwidth=80 dockstop=4 softdockstop=4 | ||
186 | 3 | |||
187 | 4 | ############################################################################### | ||
188 | 5 | # OpenLP - Open Source Lyrics Projection # | ||
189 | 6 | # --------------------------------------------------------------------------- # | ||
190 | 7 | # Copyright (c) 2008-2009 Raoul Snyman # | ||
191 | 8 | # Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # | ||
192 | 9 | # Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # | ||
193 | 10 | # --------------------------------------------------------------------------- # | ||
194 | 11 | # This program is free software; you can redistribute it and/or modify it # | ||
195 | 12 | # under the terms of the GNU General Public License as published by the Free # | ||
196 | 13 | # Software Foundation; version 2 of the License. # | ||
197 | 14 | # # | ||
198 | 15 | # This program is distributed in the hope that it will be useful, but WITHOUT # | ||
199 | 16 | # ANY WARRANTY; without even the implied warranty of MERCHANdockILITY or # | ||
200 | 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # | ||
201 | 18 | # more details. # | ||
202 | 19 | # # | ||
203 | 20 | # You should have received a copy of the GNU General Public License along # | ||
204 | 21 | # with this program; if not, write to the Free Software Foundation, Inc., 59 # | ||
205 | 22 | # Temple Place, Suite 330, Boston, MA 02111-1307 USA # | ||
206 | 23 | ############################################################################### | ||
207 | 24 | |||
208 | 25 | import logging | ||
209 | 26 | |||
210 | 27 | log = logging.getLogger(u'MediaDockManager') | ||
211 | 28 | |||
212 | 29 | class MediaDockManager(object): | ||
213 | 30 | |||
214 | 31 | def __init__(self, mediaDock): | ||
215 | 32 | self.mediaDock = mediaDock | ||
216 | 33 | |||
217 | 34 | def addDock(self, name, media_item, icon): | ||
218 | 35 | log.info(u'Adding %s dock' % name) | ||
219 | 36 | id = self.mediaDock.addItem( | ||
220 | 37 | media_item, icon, media_item.title) | ||
221 | 38 | |||
222 | 39 | def insertDock(self, name): | ||
223 | 40 | log.debug(u'Inserting %s dock' % name) | ||
224 | 41 | for tab_index in range(0, self.mediaDock.count()): | ||
225 | 42 | #print self.mediaDock.widget(tab_index).ConfigSection, name | ||
226 | 43 | if self.mediaDock.widget(tab_index).ConfigSection == name.lower(): | ||
227 | 44 | self.mediaDock.setItemEnabled(tab_index, True) | ||
228 | 45 | |||
229 | 46 | def removeDock(self, name): | ||
230 | 47 | log.debug(u'remove %s dock' % name) | ||
231 | 48 | for tab_index in range(0, self.mediaDock.count()): | ||
232 | 49 | #print "rd", self.mediaDock.widget(tab_index).ConfigSection, name | ||
233 | 50 | if self.mediaDock.widget(tab_index).ConfigSection == name.lower(): | ||
234 | 51 | self.mediaDock.setItemEnabled(tab_index, False) | ||
235 | 0 | 52 | ||
236 | === modified file 'openlp/core/ui/settingsform.py' | |||
237 | --- openlp/core/ui/settingsform.py 2009-10-03 19:02:40 +0000 | |||
238 | +++ openlp/core/ui/settingsform.py 2009-10-08 17:35:19 +0000 | |||
239 | @@ -38,26 +38,39 @@ | |||
240 | 38 | self.setupUi(self) | 38 | self.setupUi(self) |
241 | 39 | # General tab | 39 | # General tab |
242 | 40 | self.GeneralTab = GeneralTab(screen_list) | 40 | self.GeneralTab = GeneralTab(screen_list) |
244 | 41 | self.addTab(self.GeneralTab) | 41 | self.addTab(u'General', self.GeneralTab) |
245 | 42 | # Themes tab | 42 | # Themes tab |
246 | 43 | self.ThemesTab = ThemesTab(mainWindow) | 43 | self.ThemesTab = ThemesTab(mainWindow) |
248 | 44 | self.addTab(self.ThemesTab) | 44 | self.addTab(u'Themes', self.ThemesTab) |
249 | 45 | # Alert tab | 45 | # Alert tab |
250 | 46 | self.AlertsTab = AlertsTab() | 46 | self.AlertsTab = AlertsTab() |
252 | 47 | self.addTab(self.AlertsTab) | 47 | self.addTab(u'Alerts', self.AlertsTab) |
253 | 48 | 48 | ||
255 | 49 | def addTab(self, tab): | 49 | def addTab(self, name, tab): |
256 | 50 | log.info(u'Adding %s tab' % tab.title()) | 50 | log.info(u'Adding %s tab' % tab.title()) |
267 | 51 | return self.SettingsTabWidget.addTab(tab, tab.title()) | 51 | id = self.SettingsTabWidget.addTab(tab, tab.title()) |
268 | 52 | 52 | ||
269 | 53 | def insertTab(self, id, tab): | 53 | def insertTab(self, name): |
270 | 54 | log.debug(u'Inserting %s tab' % tab.title()) | 54 | log.debug(u'Inserting %s tab' % name) |
271 | 55 | self.SettingsTabWidget.insertTab(id, tab, tab.title()) | 55 | for tab_index in range(0, self.SettingsTabWidget.count()): |
272 | 56 | 56 | #print self.SettingsTabWidget.widget(tab_index).title() | |
273 | 57 | def removeTab(self, id): | 57 | if self.SettingsTabWidget.widget(tab_index).title() == name: |
274 | 58 | log.debug(u'remove %s no tab' % unicode(id)) | 58 | #print "Insert match" |
275 | 59 | self.SettingsTabWidget.removeTab(id) | 59 | #print self.SettingsTabWidget.widget(tab_index).isVisible() |
276 | 60 | 60 | self.SettingsTabWidget.setTabEnabled(tab_index, True) | |
277 | 61 | #print self.SettingsTabWidget.widget(tab_index).isVisible() | ||
278 | 62 | |||
279 | 63 | |||
280 | 64 | def removeTab(self, name): | ||
281 | 65 | log.debug(u'remove %s tab' % name) | ||
282 | 66 | #print ">>>>>>>>>>> remove settings" | ||
283 | 67 | for tab_index in range(0, self.SettingsTabWidget.count()): | ||
284 | 68 | #print "rt", self.SettingsTabWidget.widget(tab_index).title(), name | ||
285 | 69 | if self.SettingsTabWidget.widget(tab_index).title() == name: | ||
286 | 70 | #print "remove match" | ||
287 | 71 | #print self.SettingsTabWidget.widget(tab_index).isVisible() | ||
288 | 72 | self.SettingsTabWidget.setTabEnabled(tab_index, False) | ||
289 | 73 | #print self.SettingsTabWidget.widget(tab_index).isVisible() | ||
290 | 61 | 74 | ||
291 | 62 | def accept(self): | 75 | def accept(self): |
292 | 63 | for tab_index in range(0, self.SettingsTabWidget.count()): | 76 | for tab_index in range(0, self.SettingsTabWidget.count()): |
293 | 64 | 77 | ||
294 | === modified file 'openlp/plugins/bibles/bibleplugin.py' | |||
295 | --- openlp/plugins/bibles/bibleplugin.py 2009-10-03 19:02:40 +0000 | |||
296 | +++ openlp/plugins/bibles/bibleplugin.py 2009-10-08 17:35:19 +0000 | |||
297 | @@ -41,7 +41,26 @@ | |||
298 | 41 | # Create the plugin icon | 41 | # Create the plugin icon |
299 | 42 | self.icon = buildIcon(u':/media/media_bible.png') | 42 | self.icon = buildIcon(u':/media/media_bible.png') |
300 | 43 | #Register the bible Manager | 43 | #Register the bible Manager |
302 | 44 | self.biblemanager = BibleManager(self.config) | 44 | self.biblemanager = None |
303 | 45 | |||
304 | 46 | def can_be_disabled(self): | ||
305 | 47 | return True | ||
306 | 48 | |||
307 | 49 | def initialise(self): | ||
308 | 50 | log.info(u'bibles Initialising') | ||
309 | 51 | if self.biblemanager is None: | ||
310 | 52 | self.biblemanager = BibleManager(self.config) | ||
311 | 53 | Plugin.initialise(self) | ||
312 | 54 | self.insert_toolbox_item() | ||
313 | 55 | self.ImportBibleItem.setVisible(True) | ||
314 | 56 | self.ExportBibleItem.setVisible(True) | ||
315 | 57 | |||
316 | 58 | def finalise(self): | ||
317 | 59 | log.info(u'Plugin Finalise') | ||
318 | 60 | Plugin.finalise(self) | ||
319 | 61 | self.remove_toolbox_item() | ||
320 | 62 | self.ImportBibleItem.setVisible(False) | ||
321 | 63 | self.ExportBibleItem.setVisible(False) | ||
322 | 45 | 64 | ||
323 | 46 | def get_settings_tab(self): | 65 | def get_settings_tab(self): |
324 | 47 | return BiblesTab() | 66 | return BiblesTab() |
325 | @@ -58,15 +77,18 @@ | |||
326 | 58 | # Signals and slots | 77 | # Signals and slots |
327 | 59 | QtCore.QObject.connect(self.ImportBibleItem, | 78 | QtCore.QObject.connect(self.ImportBibleItem, |
328 | 60 | QtCore.SIGNAL(u'triggered()'), self.onBibleNewClick) | 79 | QtCore.SIGNAL(u'triggered()'), self.onBibleNewClick) |
329 | 80 | self.ImportBibleItem.setVisible(False) | ||
330 | 61 | 81 | ||
331 | 62 | def add_export_menu_item(self, export_menu): | 82 | def add_export_menu_item(self, export_menu): |
332 | 63 | self.ExportBibleItem = QtGui.QAction(export_menu) | 83 | self.ExportBibleItem = QtGui.QAction(export_menu) |
333 | 64 | self.ExportBibleItem.setObjectName(u'ExportBibleItem') | 84 | self.ExportBibleItem.setObjectName(u'ExportBibleItem') |
334 | 65 | export_menu.addAction(self.ExportBibleItem) | 85 | export_menu.addAction(self.ExportBibleItem) |
335 | 66 | self.ExportBibleItem.setText(translate(u'BiblePlugin', u'&Bible')) | 86 | self.ExportBibleItem.setText(translate(u'BiblePlugin', u'&Bible')) |
336 | 87 | self.ExportBibleItem.setVisible(False) | ||
337 | 67 | 88 | ||
338 | 68 | def onBibleNewClick(self): | 89 | def onBibleNewClick(self): |
340 | 69 | self.media_item.onBibleNewClick() | 90 | if self.media_item is not None: |
341 | 91 | self.media_item.onNewClick() | ||
342 | 70 | 92 | ||
343 | 71 | def about(self): | 93 | def about(self): |
344 | 72 | return u'<b>Bible Plugin</b> <br>This plugin allows bible verse from different sources to be displayed on the screen during the service.<br><br>This is a core plugin and cannot be made inactive</b>' | 94 | return u'<b>Bible Plugin</b> <br>This plugin allows bible verse from different sources to be displayed on the screen during the service.<br><br>This is a core plugin and cannot be made inactive</b>' |
345 | 73 | 95 | ||
346 | === modified file 'openlp/plugins/bibles/lib/mediaitem.py' | |||
347 | --- openlp/plugins/bibles/lib/mediaitem.py 2009-09-29 17:05:34 +0000 | |||
348 | +++ openlp/plugins/bibles/lib/mediaitem.py 2009-10-08 17:35:19 +0000 | |||
349 | @@ -226,9 +226,10 @@ | |||
350 | 226 | translate(u'BibleMediaItem', u'Keep')) | 226 | translate(u'BibleMediaItem', u'Keep')) |
351 | 227 | 227 | ||
352 | 228 | def initialise(self): | 228 | def initialise(self): |
354 | 229 | log.debug(u'initialise') | 229 | log.debug(u'bible manager initialise') |
355 | 230 | self.loadBibles() | 230 | self.loadBibles() |
356 | 231 | self.parent.biblemanager.set_media_manager(self) | 231 | self.parent.biblemanager.set_media_manager(self) |
357 | 232 | log.debug(u'bible manager initialise complete') | ||
358 | 232 | 233 | ||
359 | 233 | def setQuickMessage(self, text): | 234 | def setQuickMessage(self, text): |
360 | 234 | self.QuickMessage.setText(translate(u'BibleMediaItem', unicode(text))) | 235 | self.QuickMessage.setText(translate(u'BibleMediaItem', unicode(text))) |
361 | 235 | 236 | ||
362 | === modified file 'openlp/plugins/images/lib/imagetab.py' | |||
363 | --- openlp/plugins/images/lib/imagetab.py 2009-09-25 00:43:42 +0000 | |||
364 | +++ openlp/plugins/images/lib/imagetab.py 2009-10-08 17:35:19 +0000 | |||
365 | @@ -31,7 +31,7 @@ | |||
366 | 31 | ImageTab is the Image settings tab in the settings dialog. | 31 | ImageTab is the Image settings tab in the settings dialog. |
367 | 32 | """ | 32 | """ |
368 | 33 | def __init__(self): | 33 | def __init__(self): |
370 | 34 | SettingsTab.__init__(self, translate(u'ImageTab', u'Image'), u'Image') | 34 | SettingsTab.__init__(self, translate(u'ImageTab', u'Images'), u'Image') |
371 | 35 | 35 | ||
372 | 36 | def setupUi(self): | 36 | def setupUi(self): |
373 | 37 | self.setObjectName(u'ImageTab') | 37 | self.setObjectName(u'ImageTab') |
374 | 38 | 38 | ||
375 | === modified file 'openlp/plugins/media/lib/mediaitem.py' | |||
376 | --- openlp/plugins/media/lib/mediaitem.py 2009-09-26 09:11:39 +0000 | |||
377 | +++ openlp/plugins/media/lib/mediaitem.py 2009-10-08 17:35:19 +0000 | |||
378 | @@ -46,9 +46,10 @@ | |||
379 | 46 | self.TranslationContext = u'MediaPlugin' | 46 | self.TranslationContext = u'MediaPlugin' |
380 | 47 | self.IconPath = u'images/image' | 47 | self.IconPath = u'images/image' |
381 | 48 | self.PluginTextShort = u'Media' | 48 | self.PluginTextShort = u'Media' |
383 | 49 | self.ConfigSection = u'images' | 49 | self.ConfigSection = u'media' |
384 | 50 | self.OnNewPrompt = u'Select Media(s)' | 50 | self.OnNewPrompt = u'Select Media(s)' |
386 | 51 | self.OnNewFileMasks = u'Videos (*.avi *.mpeg *.mpg *.mp4);;Audio (*.ogg *.mp3 *.wma);;All files (*)' | 51 | self.OnNewFileMasks = \ |
387 | 52 | u'Videos (*.avi *.mpeg *.mpg *.mp4);;Audio (*.ogg *.mp3 *.wma);;All files (*)' | ||
388 | 52 | # this next is a class, not an instance of a class - it will | 53 | # this next is a class, not an instance of a class - it will |
389 | 53 | # be instanced by the base MediaManagerItem | 54 | # be instanced by the base MediaManagerItem |
390 | 54 | self.ListViewWithDnD_class = MediaListView | 55 | self.ListViewWithDnD_class = MediaListView |
391 | 55 | 56 | ||
392 | === modified file 'openlp/plugins/media/mediaplugin.py' | |||
393 | --- openlp/plugins/media/mediaplugin.py 2009-10-03 19:02:40 +0000 | |||
394 | +++ openlp/plugins/media/mediaplugin.py 2009-10-08 17:35:19 +0000 | |||
395 | @@ -22,10 +22,15 @@ | |||
396 | 22 | # Temple Place, Suite 330, Boston, MA 02111-1307 USA # | 22 | # Temple Place, Suite 330, Boston, MA 02111-1307 USA # |
397 | 23 | ############################################################################### | 23 | ############################################################################### |
398 | 24 | 24 | ||
399 | 25 | import logging | ||
400 | 26 | |||
401 | 25 | from openlp.core.lib import Plugin, buildIcon | 27 | from openlp.core.lib import Plugin, buildIcon |
402 | 26 | from openlp.plugins.media.lib import MediaTab, MediaMediaItem | 28 | from openlp.plugins.media.lib import MediaTab, MediaMediaItem |
403 | 27 | 29 | ||
404 | 28 | class MediaPlugin(Plugin): | 30 | class MediaPlugin(Plugin): |
405 | 31 | global log | ||
406 | 32 | log = logging.getLogger(u'MediaPlugin') | ||
407 | 33 | log.info(u'Media Plugin loaded') | ||
408 | 29 | 34 | ||
409 | 30 | def __init__(self, plugin_helpers): | 35 | def __init__(self, plugin_helpers): |
410 | 31 | # Call the parent constructor | 36 | # Call the parent constructor |
411 | @@ -39,6 +44,18 @@ | |||
412 | 39 | def get_settings_tab(self): | 44 | def get_settings_tab(self): |
413 | 40 | return MediaTab() | 45 | return MediaTab() |
414 | 41 | 46 | ||
415 | 47 | def can_be_disabled(self): | ||
416 | 48 | return True | ||
417 | 49 | |||
418 | 50 | def initialise(self): | ||
419 | 51 | log.info(u'Plugin Initialising') | ||
420 | 52 | Plugin.initialise(self) | ||
421 | 53 | self.insert_toolbox_item() | ||
422 | 54 | |||
423 | 55 | def finalise(self): | ||
424 | 56 | log.info(u'Plugin Finalise') | ||
425 | 57 | self.remove_toolbox_item() | ||
426 | 58 | |||
427 | 42 | def get_media_manager_item(self): | 59 | def get_media_manager_item(self): |
428 | 43 | # Create the MediaManagerItem object | 60 | # Create the MediaManagerItem object |
429 | 44 | return MediaMediaItem(self, self.icon, u'Media') | 61 | return MediaMediaItem(self, self.icon, u'Media') |
430 | 45 | 62 | ||
431 | === modified file 'openlp/plugins/presentations/presentationplugin.py' | |||
432 | --- openlp/plugins/presentations/presentationplugin.py 2009-10-03 19:02:40 +0000 | |||
433 | +++ openlp/plugins/presentations/presentationplugin.py 2009-10-08 17:35:19 +0000 | |||
434 | @@ -51,6 +51,19 @@ | |||
435 | 51 | Create the settings Tab | 51 | Create the settings Tab |
436 | 52 | """ | 52 | """ |
437 | 53 | return PresentationTab(self.controllers) | 53 | return PresentationTab(self.controllers) |
438 | 54 | # | ||
439 | 55 | # def can_be_disabled(self): | ||
440 | 56 | # return True | ||
441 | 57 | # | ||
442 | 58 | # def initialise(self): | ||
443 | 59 | # log.info(u'Presentations Initialising') | ||
444 | 60 | # Plugin.initialise(self) | ||
445 | 61 | # self.insert_toolbox_item() | ||
446 | 62 | # | ||
447 | 63 | # def finalise(self): | ||
448 | 64 | # log.info(u'Plugin Finalise') | ||
449 | 65 | # Plugin.finalise(self) | ||
450 | 66 | # self.remove_toolbox_item() | ||
451 | 54 | 67 | ||
452 | 55 | def get_media_manager_item(self): | 68 | def get_media_manager_item(self): |
453 | 56 | """ | 69 | """ |
454 | 57 | 70 | ||
455 | === modified file 'openlp/plugins/remotes/remoteplugin.py' | |||
456 | --- openlp/plugins/remotes/remoteplugin.py 2009-10-03 07:25:41 +0000 | |||
457 | +++ openlp/plugins/remotes/remoteplugin.py 2009-10-08 17:35:19 +0000 | |||
458 | @@ -41,6 +41,8 @@ | |||
459 | 41 | 41 | ||
460 | 42 | def initialise(self): | 42 | def initialise(self): |
461 | 43 | log.debug(u'initialise') | 43 | log.debug(u'initialise') |
462 | 44 | Plugin.initialise(self) | ||
463 | 45 | self.insert_toolbox_item() | ||
464 | 44 | self.server = QtNetwork.QUdpSocket() | 46 | self.server = QtNetwork.QUdpSocket() |
465 | 45 | self.server.bind(int(self.config.get_config(u'remote port', 4316))) | 47 | self.server.bind(int(self.config.get_config(u'remote port', 4316))) |
466 | 46 | QtCore.QObject.connect(self.server, | 48 | QtCore.QObject.connect(self.server, |
467 | @@ -48,6 +50,7 @@ | |||
468 | 48 | 50 | ||
469 | 49 | def finalise(self): | 51 | def finalise(self): |
470 | 50 | log.debug(u'finalise') | 52 | log.debug(u'finalise') |
471 | 53 | self.remove_toolbox_item() | ||
472 | 51 | if self.server is not None: | 54 | if self.server is not None: |
473 | 52 | self.server.close() | 55 | self.server.close() |
474 | 53 | 56 | ||
475 | 54 | 57 | ||
476 | === modified file 'openlp/plugins/songs/lib/mediaitem.py' | |||
477 | --- openlp/plugins/songs/lib/mediaitem.py 2009-09-29 02:54:32 +0000 | |||
478 | +++ openlp/plugins/songs/lib/mediaitem.py 2009-10-08 17:35:19 +0000 | |||
479 | @@ -46,7 +46,7 @@ | |||
480 | 46 | def __init__(self, parent, icon, title): | 46 | def __init__(self, parent, icon, title): |
481 | 47 | self.TranslationContext = u'SongPlugin' | 47 | self.TranslationContext = u'SongPlugin' |
482 | 48 | self.PluginTextShort = u'Song' | 48 | self.PluginTextShort = u'Song' |
484 | 49 | self.ConfigSection = u'song' | 49 | self.ConfigSection = u'songs' |
485 | 50 | self.IconPath = u'songs/song' | 50 | self.IconPath = u'songs/song' |
486 | 51 | self.ListViewWithDnD_class = SongListView | 51 | self.ListViewWithDnD_class = SongListView |
487 | 52 | self.ServiceItemIconName = u':/media/song_image.png' | 52 | self.ServiceItemIconName = u':/media/song_image.png' |
488 | 53 | 53 | ||
489 | === modified file 'openlp/plugins/songs/songsplugin.py' | |||
490 | --- openlp/plugins/songs/songsplugin.py 2009-10-03 18:39:44 +0000 | |||
491 | +++ openlp/plugins/songs/songsplugin.py 2009-10-08 17:35:19 +0000 | |||
492 | @@ -51,7 +51,7 @@ | |||
493 | 51 | # Call the parent constructor | 51 | # Call the parent constructor |
494 | 52 | Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers) | 52 | Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers) |
495 | 53 | self.weight = -10 | 53 | self.weight = -10 |
497 | 54 | self.songmanager = SongManager(self.config) | 54 | self.songmanager = None |
498 | 55 | self.openlp_import_form = OpenLPImportForm() | 55 | self.openlp_import_form = OpenLPImportForm() |
499 | 56 | self.opensong_import_form = OpenSongImportForm() | 56 | self.opensong_import_form = OpenSongImportForm() |
500 | 57 | self.openlp_export_form = OpenLPExportForm() | 57 | self.openlp_export_form = OpenLPExportForm() |
501 | @@ -59,6 +59,26 @@ | |||
502 | 59 | # Create the plugin icon | 59 | # Create the plugin icon |
503 | 60 | self.icon = buildIcon(u':/media/media_song.png') | 60 | self.icon = buildIcon(u':/media/media_song.png') |
504 | 61 | 61 | ||
505 | 62 | def can_be_disabled(self): | ||
506 | 63 | return True | ||
507 | 64 | |||
508 | 65 | def initialise(self): | ||
509 | 66 | log.info(u'Songs Initialising') | ||
510 | 67 | if self.songmanager is None: | ||
511 | 68 | self.songmanager = SongManager(self.config) | ||
512 | 69 | Plugin.initialise(self) | ||
513 | 70 | self.insert_toolbox_item() | ||
514 | 71 | self.ImportSongMenu.menuAction().setVisible(True) | ||
515 | 72 | self.ExportSongMenu.menuAction().setVisible(True) | ||
516 | 73 | self.media_item.displayResultsSong(self.songmanager.get_songs()) | ||
517 | 74 | |||
518 | 75 | def finalise(self): | ||
519 | 76 | log.info(u'Plugin Finalise') | ||
520 | 77 | Plugin.finalise(self) | ||
521 | 78 | self.remove_toolbox_item() | ||
522 | 79 | self.ImportSongMenu.menuAction().setVisible(False) | ||
523 | 80 | self.ExportSongMenu.menuAction().setVisible(False) | ||
524 | 81 | |||
525 | 62 | def get_media_manager_item(self): | 82 | def get_media_manager_item(self): |
526 | 63 | """ | 83 | """ |
527 | 64 | Create the MediaManagerItem object, which is displaed in the | 84 | Create the MediaManagerItem object, which is displaed in the |
528 | @@ -109,6 +129,7 @@ | |||
529 | 109 | QtCore.SIGNAL(u'triggered()'), self.onImportOpenlp1ItemClick) | 129 | QtCore.SIGNAL(u'triggered()'), self.onImportOpenlp1ItemClick) |
530 | 110 | QtCore.QObject.connect(self.ImportOpenSongItem, | 130 | QtCore.QObject.connect(self.ImportOpenSongItem, |
531 | 111 | QtCore.SIGNAL(u'triggered()'), self.onImportOpenSongItemClick) | 131 | QtCore.SIGNAL(u'triggered()'), self.onImportOpenSongItemClick) |
532 | 132 | self.ImportSongMenu.menuAction().setVisible(False) | ||
533 | 112 | 133 | ||
534 | 113 | def add_export_menu_item(self, export_menu): | 134 | def add_export_menu_item(self, export_menu): |
535 | 114 | """ | 135 | """ |
536 | @@ -143,10 +164,7 @@ | |||
537 | 143 | QtCore.SIGNAL(u'triggered()'), self.onExportOpenlp1ItemClicked) | 164 | QtCore.SIGNAL(u'triggered()'), self.onExportOpenlp1ItemClicked) |
538 | 144 | QtCore.QObject.connect(self.ExportOpenSongItem, | 165 | QtCore.QObject.connect(self.ExportOpenSongItem, |
539 | 145 | QtCore.SIGNAL(u'triggered()'), self.onExportOpenSongItemClicked) | 166 | QtCore.SIGNAL(u'triggered()'), self.onExportOpenSongItemClicked) |
544 | 146 | 167 | self.ExportSongMenu.menuAction().setVisible(False) | |
541 | 147 | def initialise(self): | ||
542 | 148 | Plugin.initialise(self) | ||
543 | 149 | self.media_item.displayResultsSong(self.songmanager.get_songs()) | ||
545 | 150 | 168 | ||
546 | 151 | def onImportOpenlp1ItemClick(self): | 169 | def onImportOpenlp1ItemClick(self): |
547 | 152 | self.openlp_import_form.show() | 170 | self.openlp_import_form.show() |
Following the last merge made some cleanups and simplifications to the process.
The hiding has been stopped for now and I just disable the Media Dock.