diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 0c0e5c196..253225411 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -184,7 +184,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): Load the media files into a combobox. """ self.audioAddFromMediaButton.setVisible(False) - for plugin in self.parent().pluginManager.plugins: + for plugin in self.plugin_manager.plugins: if plugin.name == u'media' and plugin.status == PluginStatus.Active: self.audioAddFromMediaButton.setVisible(True) self.mediaForm.populateFiles(plugin.mediaItem.getList(MediaType.Audio)) @@ -907,6 +907,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): except: log.exception(u'Problem processing song Lyrics \n%s', sxml.dump_xml()) + def _get_plugin_manager(self): + """ + Adds the plugin manager to the class dynamically + """ + if not hasattr(self, u'_plugin_manager'): + self._plugin_manager = Registry().get(u'plugin_manager') + return self._plugin_manager + + plugin_manager = property(_get_plugin_manager) + def _get_theme_manager(self): """ Adds the theme manager to the class dynamically @@ -915,4 +925,5 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self._theme_manager = Registry().get(u'theme_manager') return self._theme_manager - theme_manager = property(_get_theme_manager) \ No newline at end of file + theme_manager = property(_get_theme_manager) +