openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #02268
[Merge] lp:~meths/openlp/trivialfixes into lp:openlp
Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Cleanup plugins (Bug #600996)
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/29076
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py 2010-06-19 17:31:42 +0000
+++ openlp/core/lib/plugin.py 2010-07-02 12:15:40 +0000
@@ -242,19 +242,22 @@
"""
if self.media_item:
self.media_item.initialise()
+ self.insert_toolbox_item()
def finalise(self):
"""
Called by the plugin Manager to cleanup things.
"""
- pass
+ self.remove_toolbox_item()
def remove_toolbox_item(self):
"""
Called by the plugin to remove toolbar
"""
- self.mediadock.remove_dock(self.name)
- self.settings_form.removeTab(self.name)
+ if self.media_item:
+ self.mediadock.remove_dock(self.name)
+ if self.settings_tab:
+ self.settings_form.removeTab(self.name)
def insert_toolbox_item(self):
"""
=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py 2010-06-29 21:23:56 +0000
+++ openlp/plugins/alerts/alertsplugin.py 2010-07-02 12:15:40 +0000
@@ -85,8 +85,8 @@
def finalise(self):
log.info(u'Plugin Finalise')
+ Plugin.finalise(self)
self.toolsAlertItem.setVisible(False)
- #stop any events being processed
def togglealertsState(self):
self.alertsActive = not self.alertsActive
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2010-06-30 18:16:07 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2010-07-02 12:15:40 +0000
@@ -48,14 +48,12 @@
if self.manager is None:
self.manager = BibleManager(self)
Plugin.initialise(self)
- self.insert_toolbox_item()
self.ImportBibleItem.setVisible(True)
self.ExportBibleItem.setVisible(True)
def finalise(self):
log.info(u'Plugin Finalise')
Plugin.finalise(self)
- self.remove_toolbox_item()
self.ImportBibleItem.setVisible(False)
self.ExportBibleItem.setVisible(False)
=== modified file 'openlp/plugins/custom/customplugin.py'
--- openlp/plugins/custom/customplugin.py 2010-06-30 22:05:51 +0000
+++ openlp/plugins/custom/customplugin.py 2010-07-02 12:15:40 +0000
@@ -60,15 +60,6 @@
# Create the CustomManagerItem object
return CustomMediaItem(self, self.icon, self.name)
- def initialise(self):
- log.info(u'Plugin Initialising')
- Plugin.initialise(self)
- self.insert_toolbox_item()
-
- def finalise(self):
- log.info(u'Plugin Finalise')
- self.remove_toolbox_item()
-
def about(self):
about_text = translate('CustomPlugin',
'<b>Custom Plugin</b><br>This plugin '
=== modified file 'openlp/plugins/images/imageplugin.py'
--- openlp/plugins/images/imageplugin.py 2010-06-30 18:16:07 +0000
+++ openlp/plugins/images/imageplugin.py 2010-07-02 12:15:40 +0000
@@ -39,15 +39,6 @@
self.icon = build_icon(u':/plugins/plugin_images.png')
self.status = PluginStatus.Active
- def initialise(self):
- log.info(u'Plugin Initialising')
- Plugin.initialise(self)
- self.insert_toolbox_item()
-
- def finalise(self):
- log.info(u'Plugin Finalise')
- self.remove_toolbox_item()
-
def get_settings_tab(self):
return ImageTab(self.name)
=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py 2010-06-30 18:16:07 +0000
+++ openlp/plugins/media/mediaplugin.py 2010-07-02 12:15:40 +0000
@@ -67,15 +67,6 @@
type = u''
return list, type
- def initialise(self):
- log.info(u'Plugin Initialising')
- Plugin.initialise(self)
- self.insert_toolbox_item()
-
- def finalise(self):
- log.info(u'Plugin Finalise')
- self.remove_toolbox_item()
-
def get_media_manager_item(self):
# Create the MediaManagerItem object
return MediaMediaItem(self, self.icon, self.name)
=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py 2010-06-30 18:16:07 +0000
+++ openlp/plugins/presentations/presentationplugin.py 2010-07-02 12:15:40 +0000
@@ -64,7 +64,7 @@
controller = self.controllers[key]
if controller.enabled:
controller.kill()
- self.remove_toolbox_item()
+ Plugin.finalise(self)
def get_media_manager_item(self):
"""
=== modified file 'openlp/plugins/remotes/remoteplugin.py'
--- openlp/plugins/remotes/remoteplugin.py 2010-06-29 21:23:56 +0000
+++ openlp/plugins/remotes/remoteplugin.py 2010-07-02 12:15:40 +0000
@@ -56,7 +56,7 @@
Tidy up and close down the http server
"""
log.debug(u'finalise')
- self.remove_toolbox_item()
+ Plugin.finalise(self)
if self.server:
self.server.close()
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2010-07-02 10:29:36 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2010-07-02 12:15:40 +0000
@@ -166,13 +166,13 @@
if search_type == 0:
log.debug(u'Titles Search')
search_results = self.parent.manager.get_all_objects_filtered(Song,
- Song.search_title.like(u'%' + keywords + u'%'),
+ Song.search_title.like(u'%' + search_keywords + u'%'),
Song.search_title.asc())
self.displayResultsSong(search_results)
elif search_type == 1:
log.debug(u'Lyrics Search')
search_results = self.parent.manager.get_all_objects_filtered(Song,
- Song.search_lyrics.like(u'%' + keywords + u'%'),
+ Song.search_lyrics.like(u'%' + search_keywords + u'%'),
Song.search_lyrics.asc())
self.displayResultsSong(search_results)
elif search_type == 2:
=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py 2010-07-01 10:31:37 +0000
+++ openlp/plugins/songs/songsplugin.py 2010-07-02 12:15:40 +0000
@@ -67,15 +67,9 @@
def initialise(self):
log.info(u'Songs Initialising')
Plugin.initialise(self)
- self.insert_toolbox_item()
self.media_item.displayResultsSong(
self.manager.get_all_objects(Song, Song.title))
- def finalise(self):
- log.info(u'Plugin Finalise')
- Plugin.finalise(self)
- self.remove_toolbox_item()
-
def get_media_manager_item(self):
"""
Create the MediaManagerItem object, which is displaed in the
Follow ups