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

Proposed by Tim Bentley
Status: Superseded
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
Reviewer Review Type Date Requested Status
OpenLP Core Pending
Review via email: mp+13005@code.launchpad.net

This proposal has been superseded by a proposal from 2009-10-08.

Commit message

Fixed up all plugins except Presentations cos it's complex.
Sorted out issues with current trunk.

Enjoy

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :

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.

lp:~trb143/openlp/audit updated
617. By Tim Bentley

More cleanups, Bibles and media done

618. By Tim Bentley

Songs now play hide and seek

619. By Tim Bentley

Presentations add code but leave for now - Angels fear to tread

620. By Tim Bentley

Fix Bible plugin rendering

621. By Tim Bentley

Bible New features and Clean up

622. By Tim Bentley

More dock hiding work

623. By Tim Bentley

Head

624. By Tim Bentley

More hiding changes

625. By Tim Bentley

Head

626. By Tim Bentley

Plugins now hide and reappear correctly

627. By Tim Bentley

Remove all print statements

628. By Tim Bentley

Theme improvements

629. By Tim Bentley

Latest Version checking added

630. By Tim Bentley

Correct Theme name for Export if default

631. By Tim Bentley

Quick code cleanup and fix test for version checking

632. By Tim Bentley

Servie Manager DnD part 1

633. By Tim Bentley

Servie Manager DnD part 2

634. By Tim Bentley

Audit Cleanup - part 1

635. By Tim Bentley

Small fix ups and corrections. Plugin list obeys can_be_diabled

636. By Tim Bentley

Fixes to last merge request

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py 2009-10-03 19:02:40 +0000
+++ openlp/core/lib/plugin.py 2009-10-08 17:33:11 +0000
@@ -119,9 +119,6 @@
119 self.icon = None119 self.icon = None
120 self.config = PluginConfig(self.name)120 self.config = PluginConfig(self.name)
121 self.weight = 0121 self.weight = 0
122 self.media_id = -1
123 self.settings_id = -1
124 self.media_active = False
125 self.status = PluginStatus.Inactive122 self.status = PluginStatus.Inactive
126 # Set up logging123 # Set up logging
127 self.log = logging.getLogger(self.name)124 self.log = logging.getLogger(self.name)
@@ -130,7 +127,7 @@
130 self.render_manager = plugin_helpers[u'render']127 self.render_manager = plugin_helpers[u'render']
131 self.service_manager = plugin_helpers[u'service']128 self.service_manager = plugin_helpers[u'service']
132 self.settings = plugin_helpers[u'settings']129 self.settings = plugin_helpers[u'settings']
133 self.mediatoolbox = plugin_helpers[u'toolbox']130 self.mediadock = plugin_helpers[u'toolbox']
134 QtCore.QObject.connect(Receiver.get_receiver(),131 QtCore.QObject.connect(Receiver.get_receiver(),
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)
136133
@@ -155,8 +152,8 @@
155 """152 """
156 Sets the status of the plugin153 Sets the status of the plugin
157 """154 """
158 self.status = self.config.get_config(\155 self.status = int(self.config.get_config(\
159 u'%s_status' % self.name, PluginStatus.Inactive)156 u'%s_status' % self.name, PluginStatus.Inactive))
160157
161 def toggle_status(self, new_status):158 def toggle_status(self, new_status):
162 """159 """
@@ -171,7 +168,7 @@
171168
172 Returns True or False.169 Returns True or False.
173 """170 """
174 return int(self.status ) == int(PluginStatus.Active)171 return self.status == PluginStatus.Active
175172
176 def get_media_manager_item(self):173 def get_media_manager_item(self):
177 """174 """
@@ -253,21 +250,12 @@
253 """250 """
254 Called by the plugin to remove toolbar251 Called by the plugin to remove toolbar
255 """252 """
256 if self.media_id is not -1:253 self.mediadock.removeDock(self.name)
257 self.mediatoolbox.removeItem(self.media_id)254 self.settings.removeTab(self.name)
258 if self.settings_id is not -1:
259 self.settings.removeTab(self.settings_id)
260 self.media_active = False
261255
262 def insert_toolbox_item(self):256 def insert_toolbox_item(self):
263 """257 """
264 Called by plugin to replace toolbar258 Called by plugin to replace toolbar
265 """259 """
266 if not self.media_active:260 self.mediadock.insertDock(self.name)
267 if self.media_id is not -1:261 self.settings.insertTab(self.name)
268 self.mediatoolbox.insertItem(
269 self.media_id, self.media_item, self.icon, self.media_item.title)
270 if self.settings_id is not -1:
271 self.settings.insertTab(
272 self.settings_id, self.settings_tab)
273 self.media_active = True
274262
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py 2009-10-03 19:02:40 +0000
+++ openlp/core/lib/pluginmanager.py 2009-10-08 17:33:11 +0000
@@ -125,7 +125,7 @@
125 """125 """
126 return cmp(x.weight, y.weight)126 return cmp(x.weight, y.weight)
127127
128 def hook_media_manager(self, mediatoolbox):128 def hook_media_manager(self, mediadock):
129 """129 """
130 Loop through all the plugins. If a plugin has a valid media manager130 Loop through all the plugins. If a plugin has a valid media manager
131 item, add it to the media manager.131 item, add it to the media manager.
@@ -139,9 +139,8 @@
139 if plugin.media_item is not None:139 if plugin.media_item is not None:
140 log.debug(u'Inserting media manager item from %s' % \140 log.debug(u'Inserting media manager item from %s' % \
141 plugin.name)141 plugin.name)
142 plugin.media_id = mediatoolbox.addItem(142 mediadock.addDock(plugin.name,
143 plugin.media_item, plugin.icon, plugin.media_item.title)143 plugin.media_item, plugin.icon)
144 plugin.media_active = True
145144
146 def hook_settings_tabs(self, settingsform=None):145 def hook_settings_tabs(self, settingsform=None):
147 """146 """
@@ -157,7 +156,7 @@
157 plugin.settings_tab = plugin.get_settings_tab()156 plugin.settings_tab = plugin.get_settings_tab()
158 if plugin.settings_tab is not None:157 if plugin.settings_tab is not None:
159 log.debug(u'Inserting settings tab item from %s' % plugin.name)158 log.debug(u'Inserting settings tab item from %s' % plugin.name)
160 plugin.settings_id = settingsform.addTab(plugin.settings_tab)159 settingsform.addTab(plugin.name, plugin.settings_tab)
161 else:160 else:
162 log.debug(u'No tab settings in %s' % plugin.name)161 log.debug(u'No tab settings in %s' % plugin.name)
163162
@@ -202,11 +201,12 @@
202 Loop through all the plugins and give them an opportunity to201 Loop through all the plugins and give them an opportunity to
203 initialise themselves.202 initialise themselves.
204 """203 """
205 log.info(u'initialising plugins')
206 for plugin in self.plugins:204 for plugin in self.plugins:
205 log.info(u'initialising plugins %s in a %s state'
206 % (plugin.name, plugin.is_active()))
207 if plugin.is_active():207 if plugin.is_active():
208 plugin.initialise()208 plugin.initialise()
209 if plugin.media_item is not None and not plugin.is_active():209 if not plugin.is_active():
210 plugin.remove_toolbox_item()210 plugin.remove_toolbox_item()
211211
212 def finalise_plugins(self):212 def finalise_plugins(self):
213213
=== modified file 'openlp/core/ui/__init__.py'
--- openlp/core/ui/__init__.py 2009-09-25 00:43:42 +0000
+++ openlp/core/ui/__init__.py 2009-10-08 17:33:11 +0000
@@ -34,10 +34,11 @@
34from alertform import AlertForm34from alertform import AlertForm
35from plugindialoglistform import PluginForm35from plugindialoglistform import PluginForm
36from settingsform import SettingsForm36from settingsform import SettingsForm
37from mediadockmanager import MediaDockManager
37from servicemanager import ServiceManager38from servicemanager import ServiceManager
38from thememanager import ThemeManager39from thememanager import ThemeManager
39from mainwindow import MainWindow40from mainwindow import MainWindow
4041
41__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainWindow',42__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainWindow',
42 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager',43 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager',
43 'AmendThemeForm']44 'AmendThemeForm', 'MediaDockManager']
4445
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-10-03 18:39:44 +0000
+++ openlp/core/ui/mainwindow.py 2009-10-08 17:33:11 +0000
@@ -29,9 +29,10 @@
2929
30from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \30from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \
31 ServiceManager, ThemeManager, MainDisplay, SlideController, \31 ServiceManager, ThemeManager, MainDisplay, SlideController, \
32 PluginForm32 PluginForm, MediaDockManager
33from openlp.core.lib import translate, RenderManager, PluginConfig, \33from openlp.core.lib import translate, RenderManager, PluginConfig, \
34 OpenLPDockWidget, SettingsManager, PluginManager, Receiver, buildIcon34 OpenLPDockWidget, SettingsManager, PluginManager, Receiver, \
35 buildIcon
3536
3637
37class Ui_MainWindow(object):38class Ui_MainWindow(object):
@@ -489,6 +490,8 @@
489 #ThemeManager needs to call RenderManager490 #ThemeManager needs to call RenderManager
490 self.RenderManager = RenderManager(self.ThemeManagerContents,491 self.RenderManager = RenderManager(self.ThemeManagerContents,
491 self.screenList, self.getMonitorNumber())492 self.screenList, self.getMonitorNumber())
493 #Define the media Dock Manager
494 self.mediaDockManager = MediaDockManager(self.MediaToolBox)
492 log.info(u'Load Plugins')495 log.info(u'Load Plugins')
493 #make the controllers available to the plugins496 #make the controllers available to the plugins
494 self.plugin_helpers[u'preview'] = self.PreviewController497 self.plugin_helpers[u'preview'] = self.PreviewController
@@ -496,7 +499,7 @@
496 self.plugin_helpers[u'render'] = self.RenderManager499 self.plugin_helpers[u'render'] = self.RenderManager
497 self.plugin_helpers[u'service'] = self.ServiceManagerContents500 self.plugin_helpers[u'service'] = self.ServiceManagerContents
498 self.plugin_helpers[u'settings'] = self.settingsForm501 self.plugin_helpers[u'settings'] = self.settingsForm
499 self.plugin_helpers[u'toolbox'] = self.MediaToolBox502 self.plugin_helpers[u'toolbox'] = self.mediaDockManager
500 self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers)503 self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers)
501 # hook methods have to happen after find_plugins. Find plugins needs504 # hook methods have to happen after find_plugins. Find plugins needs
502 # the controllers hence the hooks have moved from setupUI() to here505 # the controllers hence the hooks have moved from setupUI() to here
@@ -505,7 +508,7 @@
505 self.plugin_manager.hook_settings_tabs(self.settingsForm)508 self.plugin_manager.hook_settings_tabs(self.settingsForm)
506 # Find and insert media manager items509 # Find and insert media manager items
507 log.info(u'hook media')510 log.info(u'hook media')
508 self.plugin_manager.hook_media_manager(self.MediaToolBox)511 self.plugin_manager.hook_media_manager(self.mediaDockManager)
509 # Call the hook method to pull in import menus.512 # Call the hook method to pull in import menus.
510 log.info(u'hook menus')513 log.info(u'hook menus')
511 self.plugin_manager.hook_import_menu(self.FileImportMenu)514 self.plugin_manager.hook_import_menu(self.FileImportMenu)
512515
=== added file 'openlp/core/ui/mediadockmanager.py'
--- openlp/core/ui/mediadockmanager.py 1970-01-01 00:00:00 +0000
+++ openlp/core/ui/mediadockmanager.py 2009-10-08 17:33:11 +0000
@@ -0,0 +1,51 @@
1# -*- coding: utf-8 -*-
2# vim: autoindent shiftwidth=4 expanddock textwidth=80 dockstop=4 softdockstop=4
3
4###############################################################################
5# OpenLP - Open Source Lyrics Projection #
6# --------------------------------------------------------------------------- #
7# Copyright (c) 2008-2009 Raoul Snyman #
8# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
9# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
10# --------------------------------------------------------------------------- #
11# This program is free software; you can redistribute it and/or modify it #
12# under the terms of the GNU General Public License as published by the Free #
13# Software Foundation; version 2 of the License. #
14# #
15# This program is distributed in the hope that it will be useful, but WITHOUT #
16# ANY WARRANTY; without even the implied warranty of MERCHANdockILITY or #
17# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
18# more details. #
19# #
20# You should have received a copy of the GNU General Public License along #
21# with this program; if not, write to the Free Software Foundation, Inc., 59 #
22# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
23###############################################################################
24
25import logging
26
27log = logging.getLogger(u'MediaDockManager')
28
29class MediaDockManager(object):
30
31 def __init__(self, mediaDock):
32 self.mediaDock = mediaDock
33
34 def addDock(self, name, media_item, icon):
35 log.info(u'Adding %s dock' % name)
36 id = self.mediaDock.addItem(
37 media_item, icon, media_item.title)
38
39 def insertDock(self, name):
40 log.debug(u'Inserting %s dock' % name)
41 for tab_index in range(0, self.mediaDock.count()):
42 #print self.mediaDock.widget(tab_index).ConfigSection, name
43 if self.mediaDock.widget(tab_index).ConfigSection == name.lower():
44 self.mediaDock.setItemEnabled(tab_index, True)
45
46 def removeDock(self, name):
47 log.debug(u'remove %s dock' % name)
48 for tab_index in range(0, self.mediaDock.count()):
49 #print "rd", self.mediaDock.widget(tab_index).ConfigSection, name
50 if self.mediaDock.widget(tab_index).ConfigSection == name.lower():
51 self.mediaDock.setItemEnabled(tab_index, False)
052
=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py 2009-10-03 19:02:40 +0000
+++ openlp/core/ui/settingsform.py 2009-10-08 17:33:11 +0000
@@ -38,26 +38,39 @@
38 self.setupUi(self)38 self.setupUi(self)
39 # General tab39 # General tab
40 self.GeneralTab = GeneralTab(screen_list)40 self.GeneralTab = GeneralTab(screen_list)
41 self.addTab(self.GeneralTab)41 self.addTab(u'General', self.GeneralTab)
42 # Themes tab42 # Themes tab
43 self.ThemesTab = ThemesTab(mainWindow)43 self.ThemesTab = ThemesTab(mainWindow)
44 self.addTab(self.ThemesTab)44 self.addTab(u'Themes', self.ThemesTab)
45 # Alert tab45 # Alert tab
46 self.AlertsTab = AlertsTab()46 self.AlertsTab = AlertsTab()
47 self.addTab(self.AlertsTab)47 self.addTab(u'Alerts', self.AlertsTab)
4848
49 def addTab(self, tab):49 def addTab(self, name, tab):
50 log.info(u'Adding %s tab' % tab.title())50 log.info(u'Adding %s tab' % tab.title())
51 return self.SettingsTabWidget.addTab(tab, tab.title())51 id = self.SettingsTabWidget.addTab(tab, tab.title())
5252
53 def insertTab(self, id, tab):53 def insertTab(self, name):
54 log.debug(u'Inserting %s tab' % tab.title())54 log.debug(u'Inserting %s tab' % name)
55 self.SettingsTabWidget.insertTab(id, tab, tab.title())55 for tab_index in range(0, self.SettingsTabWidget.count()):
5656 #print self.SettingsTabWidget.widget(tab_index).title()
57 def removeTab(self, id):57 if self.SettingsTabWidget.widget(tab_index).title() == name:
58 log.debug(u'remove %s no tab' % unicode(id))58 #print "Insert match"
59 self.SettingsTabWidget.removeTab(id)59 #print self.SettingsTabWidget.widget(tab_index).isVisible()
6060 self.SettingsTabWidget.setTabEnabled(tab_index, True)
61 #print self.SettingsTabWidget.widget(tab_index).isVisible()
62
63
64 def removeTab(self, name):
65 log.debug(u'remove %s tab' % name)
66 #print ">>>>>>>>>>> remove settings"
67 for tab_index in range(0, self.SettingsTabWidget.count()):
68 #print "rt", self.SettingsTabWidget.widget(tab_index).title(), name
69 if self.SettingsTabWidget.widget(tab_index).title() == name:
70 #print "remove match"
71 #print self.SettingsTabWidget.widget(tab_index).isVisible()
72 self.SettingsTabWidget.setTabEnabled(tab_index, False)
73 #print self.SettingsTabWidget.widget(tab_index).isVisible()
6174
62 def accept(self):75 def accept(self):
63 for tab_index in range(0, self.SettingsTabWidget.count()):76 for tab_index in range(0, self.SettingsTabWidget.count()):
6477
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2009-10-03 19:02:40 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2009-10-08 17:33:11 +0000
@@ -41,7 +41,26 @@
41 # Create the plugin icon41 # Create the plugin icon
42 self.icon = buildIcon(u':/media/media_bible.png')42 self.icon = buildIcon(u':/media/media_bible.png')
43 #Register the bible Manager43 #Register the bible Manager
44 self.biblemanager = BibleManager(self.config)44 self.biblemanager = None
45
46 def can_be_disabled(self):
47 return True
48
49 def initialise(self):
50 log.info(u'bibles Initialising')
51 if self.biblemanager is None:
52 self.biblemanager = BibleManager(self.config)
53 Plugin.initialise(self)
54 self.insert_toolbox_item()
55 self.ImportBibleItem.setVisible(True)
56 self.ExportBibleItem.setVisible(True)
57
58 def finalise(self):
59 log.info(u'Plugin Finalise')
60 Plugin.finalise(self)
61 self.remove_toolbox_item()
62 self.ImportBibleItem.setVisible(False)
63 self.ExportBibleItem.setVisible(False)
4564
46 def get_settings_tab(self):65 def get_settings_tab(self):
47 return BiblesTab()66 return BiblesTab()
@@ -58,15 +77,18 @@
58 # Signals and slots77 # Signals and slots
59 QtCore.QObject.connect(self.ImportBibleItem,78 QtCore.QObject.connect(self.ImportBibleItem,
60 QtCore.SIGNAL(u'triggered()'), self.onBibleNewClick)79 QtCore.SIGNAL(u'triggered()'), self.onBibleNewClick)
80 self.ImportBibleItem.setVisible(False)
6181
62 def add_export_menu_item(self, export_menu):82 def add_export_menu_item(self, export_menu):
63 self.ExportBibleItem = QtGui.QAction(export_menu)83 self.ExportBibleItem = QtGui.QAction(export_menu)
64 self.ExportBibleItem.setObjectName(u'ExportBibleItem')84 self.ExportBibleItem.setObjectName(u'ExportBibleItem')
65 export_menu.addAction(self.ExportBibleItem)85 export_menu.addAction(self.ExportBibleItem)
66 self.ExportBibleItem.setText(translate(u'BiblePlugin', u'&Bible'))86 self.ExportBibleItem.setText(translate(u'BiblePlugin', u'&Bible'))
87 self.ExportBibleItem.setVisible(False)
6788
68 def onBibleNewClick(self):89 def onBibleNewClick(self):
69 self.media_item.onBibleNewClick()90 if self.media_item is not None:
91 self.media_item.onNewClick()
7092
71 def about(self):93 def about(self):
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>'
7395
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2009-09-29 17:05:34 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2009-10-08 17:33:11 +0000
@@ -226,9 +226,10 @@
226 translate(u'BibleMediaItem', u'Keep'))226 translate(u'BibleMediaItem', u'Keep'))
227227
228 def initialise(self):228 def initialise(self):
229 log.debug(u'initialise')229 log.debug(u'bible manager initialise')
230 self.loadBibles()230 self.loadBibles()
231 self.parent.biblemanager.set_media_manager(self)231 self.parent.biblemanager.set_media_manager(self)
232 log.debug(u'bible manager initialise complete')
232233
233 def setQuickMessage(self, text):234 def setQuickMessage(self, text):
234 self.QuickMessage.setText(translate(u'BibleMediaItem', unicode(text)))235 self.QuickMessage.setText(translate(u'BibleMediaItem', unicode(text)))
235236
=== modified file 'openlp/plugins/images/lib/imagetab.py'
--- openlp/plugins/images/lib/imagetab.py 2009-09-25 00:43:42 +0000
+++ openlp/plugins/images/lib/imagetab.py 2009-10-08 17:33:11 +0000
@@ -31,7 +31,7 @@
31 ImageTab is the Image settings tab in the settings dialog.31 ImageTab is the Image settings tab in the settings dialog.
32 """32 """
33 def __init__(self):33 def __init__(self):
34 SettingsTab.__init__(self, translate(u'ImageTab', u'Image'), u'Image')34 SettingsTab.__init__(self, translate(u'ImageTab', u'Images'), u'Image')
3535
36 def setupUi(self):36 def setupUi(self):
37 self.setObjectName(u'ImageTab')37 self.setObjectName(u'ImageTab')
3838
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2009-09-26 09:11:39 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2009-10-08 17:33:11 +0000
@@ -46,9 +46,10 @@
46 self.TranslationContext = u'MediaPlugin'46 self.TranslationContext = u'MediaPlugin'
47 self.IconPath = u'images/image'47 self.IconPath = u'images/image'
48 self.PluginTextShort = u'Media'48 self.PluginTextShort = u'Media'
49 self.ConfigSection = u'images'49 self.ConfigSection = u'media'
50 self.OnNewPrompt = u'Select Media(s)'50 self.OnNewPrompt = u'Select Media(s)'
51 self.OnNewFileMasks = u'Videos (*.avi *.mpeg *.mpg *.mp4);;Audio (*.ogg *.mp3 *.wma);;All files (*)'51 self.OnNewFileMasks = \
52 u'Videos (*.avi *.mpeg *.mpg *.mp4);;Audio (*.ogg *.mp3 *.wma);;All files (*)'
52 # this next is a class, not an instance of a class - it will53 # this next is a class, not an instance of a class - it will
53 # be instanced by the base MediaManagerItem54 # be instanced by the base MediaManagerItem
54 self.ListViewWithDnD_class = MediaListView55 self.ListViewWithDnD_class = MediaListView
5556
=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py 2009-10-03 19:02:40 +0000
+++ openlp/plugins/media/mediaplugin.py 2009-10-08 17:33:11 +0000
@@ -22,10 +22,15 @@
22# Temple Place, Suite 330, Boston, MA 02111-1307 USA #22# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
23###############################################################################23###############################################################################
2424
25import logging
26
25from openlp.core.lib import Plugin, buildIcon27from openlp.core.lib import Plugin, buildIcon
26from openlp.plugins.media.lib import MediaTab, MediaMediaItem28from openlp.plugins.media.lib import MediaTab, MediaMediaItem
2729
28class MediaPlugin(Plugin):30class MediaPlugin(Plugin):
31 global log
32 log = logging.getLogger(u'MediaPlugin')
33 log.info(u'Media Plugin loaded')
2934
30 def __init__(self, plugin_helpers):35 def __init__(self, plugin_helpers):
31 # Call the parent constructor36 # Call the parent constructor
@@ -39,6 +44,18 @@
39 def get_settings_tab(self):44 def get_settings_tab(self):
40 return MediaTab()45 return MediaTab()
4146
47 def can_be_disabled(self):
48 return True
49
50 def initialise(self):
51 log.info(u'Plugin Initialising')
52 Plugin.initialise(self)
53 self.insert_toolbox_item()
54
55 def finalise(self):
56 log.info(u'Plugin Finalise')
57 self.remove_toolbox_item()
58
42 def get_media_manager_item(self):59 def get_media_manager_item(self):
43 # Create the MediaManagerItem object60 # Create the MediaManagerItem object
44 return MediaMediaItem(self, self.icon, u'Media')61 return MediaMediaItem(self, self.icon, u'Media')
4562
=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py 2009-10-03 19:02:40 +0000
+++ openlp/plugins/presentations/presentationplugin.py 2009-10-08 17:33:11 +0000
@@ -51,6 +51,19 @@
51 Create the settings Tab51 Create the settings Tab
52 """52 """
53 return PresentationTab(self.controllers)53 return PresentationTab(self.controllers)
54#
55# def can_be_disabled(self):
56# return True
57#
58# def initialise(self):
59# log.info(u'Presentations Initialising')
60# Plugin.initialise(self)
61# self.insert_toolbox_item()
62#
63# def finalise(self):
64# log.info(u'Plugin Finalise')
65# Plugin.finalise(self)
66# self.remove_toolbox_item()
5467
55 def get_media_manager_item(self):68 def get_media_manager_item(self):
56 """69 """
5770
=== modified file 'openlp/plugins/remotes/remoteplugin.py'
--- openlp/plugins/remotes/remoteplugin.py 2009-10-03 07:25:41 +0000
+++ openlp/plugins/remotes/remoteplugin.py 2009-10-08 17:33:11 +0000
@@ -41,6 +41,8 @@
4141
42 def initialise(self):42 def initialise(self):
43 log.debug(u'initialise')43 log.debug(u'initialise')
44 Plugin.initialise(self)
45 self.insert_toolbox_item()
44 self.server = QtNetwork.QUdpSocket()46 self.server = QtNetwork.QUdpSocket()
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)))
46 QtCore.QObject.connect(self.server,48 QtCore.QObject.connect(self.server,
@@ -48,6 +50,7 @@
4850
49 def finalise(self):51 def finalise(self):
50 log.debug(u'finalise')52 log.debug(u'finalise')
53 self.remove_toolbox_item()
51 if self.server is not None:54 if self.server is not None:
52 self.server.close()55 self.server.close()
5356
5457
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2009-09-29 02:54:32 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2009-10-08 17:33:11 +0000
@@ -46,7 +46,7 @@
46 def __init__(self, parent, icon, title):46 def __init__(self, parent, icon, title):
47 self.TranslationContext = u'SongPlugin'47 self.TranslationContext = u'SongPlugin'
48 self.PluginTextShort = u'Song'48 self.PluginTextShort = u'Song'
49 self.ConfigSection = u'song'49 self.ConfigSection = u'songs'
50 self.IconPath = u'songs/song'50 self.IconPath = u'songs/song'
51 self.ListViewWithDnD_class = SongListView51 self.ListViewWithDnD_class = SongListView
52 self.ServiceItemIconName = u':/media/song_image.png'52 self.ServiceItemIconName = u':/media/song_image.png'
5353
=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py 2009-10-03 18:39:44 +0000
+++ openlp/plugins/songs/songsplugin.py 2009-10-08 17:33:11 +0000
@@ -51,7 +51,7 @@
51 # Call the parent constructor51 # Call the parent constructor
52 Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers)52 Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers)
53 self.weight = -1053 self.weight = -10
54 self.songmanager = SongManager(self.config)54 self.songmanager = None
55 self.openlp_import_form = OpenLPImportForm()55 self.openlp_import_form = OpenLPImportForm()
56 self.opensong_import_form = OpenSongImportForm()56 self.opensong_import_form = OpenSongImportForm()
57 self.openlp_export_form = OpenLPExportForm()57 self.openlp_export_form = OpenLPExportForm()
@@ -59,6 +59,26 @@
59 # Create the plugin icon59 # Create the plugin icon
60 self.icon = buildIcon(u':/media/media_song.png')60 self.icon = buildIcon(u':/media/media_song.png')
6161
62 def can_be_disabled(self):
63 return True
64
65 def initialise(self):
66 log.info(u'Songs Initialising')
67 if self.songmanager is None:
68 self.songmanager = SongManager(self.config)
69 Plugin.initialise(self)
70 self.insert_toolbox_item()
71 self.ImportSongMenu.menuAction().setVisible(True)
72 self.ExportSongMenu.menuAction().setVisible(True)
73 self.media_item.displayResultsSong(self.songmanager.get_songs())
74
75 def finalise(self):
76 log.info(u'Plugin Finalise')
77 Plugin.finalise(self)
78 self.remove_toolbox_item()
79 self.ImportSongMenu.menuAction().setVisible(False)
80 self.ExportSongMenu.menuAction().setVisible(False)
81
62 def get_media_manager_item(self):82 def get_media_manager_item(self):
63 """83 """
64 Create the MediaManagerItem object, which is displaed in the84 Create the MediaManagerItem object, which is displaed in the
@@ -109,6 +129,7 @@
109 QtCore.SIGNAL(u'triggered()'), self.onImportOpenlp1ItemClick)129 QtCore.SIGNAL(u'triggered()'), self.onImportOpenlp1ItemClick)
110 QtCore.QObject.connect(self.ImportOpenSongItem,130 QtCore.QObject.connect(self.ImportOpenSongItem,
111 QtCore.SIGNAL(u'triggered()'), self.onImportOpenSongItemClick)131 QtCore.SIGNAL(u'triggered()'), self.onImportOpenSongItemClick)
132 self.ImportSongMenu.menuAction().setVisible(False)
112133
113 def add_export_menu_item(self, export_menu):134 def add_export_menu_item(self, export_menu):
114 """135 """
@@ -143,10 +164,7 @@
143 QtCore.SIGNAL(u'triggered()'), self.onExportOpenlp1ItemClicked)164 QtCore.SIGNAL(u'triggered()'), self.onExportOpenlp1ItemClicked)
144 QtCore.QObject.connect(self.ExportOpenSongItem,165 QtCore.QObject.connect(self.ExportOpenSongItem,
145 QtCore.SIGNAL(u'triggered()'), self.onExportOpenSongItemClicked)166 QtCore.SIGNAL(u'triggered()'), self.onExportOpenSongItemClicked)
146167 self.ExportSongMenu.menuAction().setVisible(False)
147 def initialise(self):
148 Plugin.initialise(self)
149 self.media_item.displayResultsSong(self.songmanager.get_songs())
150168
151 def onImportOpenlp1ItemClick(self):169 def onImportOpenlp1ItemClick(self):
152 self.openlp_import_form.show()170 self.openlp_import_form.show()