forked from openlp/openlp
Songs now play hide and seek
This commit is contained in:
parent
5d32ce5e66
commit
afff83113f
@ -46,7 +46,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
def __init__(self, parent, icon, title):
|
||||
self.TranslationContext = u'SongPlugin'
|
||||
self.PluginTextShort = u'Song'
|
||||
self.ConfigSection = u'song'
|
||||
self.ConfigSection = u'songs'
|
||||
self.IconPath = u'songs/song'
|
||||
self.ListViewWithDnD_class = SongListView
|
||||
self.ServiceItemIconName = u':/media/song_image.png'
|
||||
|
@ -51,7 +51,7 @@ class SongsPlugin(Plugin):
|
||||
# Call the parent constructor
|
||||
Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers)
|
||||
self.weight = -10
|
||||
self.songmanager = SongManager(self.config)
|
||||
self.songmanager = None
|
||||
self.openlp_import_form = OpenLPImportForm()
|
||||
self.opensong_import_form = OpenSongImportForm()
|
||||
self.openlp_export_form = OpenLPExportForm()
|
||||
@ -59,6 +59,26 @@ class SongsPlugin(Plugin):
|
||||
# Create the plugin icon
|
||||
self.icon = buildIcon(u':/media/media_song.png')
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'Songs Initialising')
|
||||
if self.songmanager is None:
|
||||
self.songmanager = SongManager(self.config)
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
self.ImportSongMenu.menuAction().setVisible(True)
|
||||
self.ExportSongMenu.menuAction().setVisible(True)
|
||||
self.media_item.displayResultsSong(self.songmanager.get_songs())
|
||||
|
||||
def finalise(self):
|
||||
log.info(u'Plugin Finalise')
|
||||
Plugin.finalise(self)
|
||||
self.remove_toolbox_item()
|
||||
self.ImportSongMenu.menuAction().setVisible(False)
|
||||
self.ExportSongMenu.menuAction().setVisible(False)
|
||||
|
||||
def get_media_manager_item(self):
|
||||
"""
|
||||
Create the MediaManagerItem object, which is displaed in the
|
||||
@ -109,6 +129,7 @@ class SongsPlugin(Plugin):
|
||||
QtCore.SIGNAL(u'triggered()'), self.onImportOpenlp1ItemClick)
|
||||
QtCore.QObject.connect(self.ImportOpenSongItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onImportOpenSongItemClick)
|
||||
self.ImportSongMenu.menuAction().setVisible(False)
|
||||
|
||||
def add_export_menu_item(self, export_menu):
|
||||
"""
|
||||
@ -143,10 +164,7 @@ class SongsPlugin(Plugin):
|
||||
QtCore.SIGNAL(u'triggered()'), self.onExportOpenlp1ItemClicked)
|
||||
QtCore.QObject.connect(self.ExportOpenSongItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onExportOpenSongItemClicked)
|
||||
|
||||
def initialise(self):
|
||||
Plugin.initialise(self)
|
||||
self.media_item.displayResultsSong(self.songmanager.get_songs())
|
||||
self.ExportSongMenu.menuAction().setVisible(False)
|
||||
|
||||
def onImportOpenlp1ItemClick(self):
|
||||
self.openlp_import_form.show()
|
||||
|
Loading…
Reference in New Issue
Block a user