added bible actions

This commit is contained in:
Andreas Preikschat 2011-03-30 20:27:33 +02:00
parent 369a539970
commit fb78350a44
2 changed files with 11 additions and 11 deletions

View File

@ -29,6 +29,8 @@ import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import base_action
from openlp.core.utils.actions import actionList
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
log = logging.getLogger(__name__)
@ -50,6 +52,9 @@ class BiblePlugin(Plugin):
self.manager = BibleManager(self)
Plugin.initialise(self)
self.importBibleItem.setVisible(True)
actionList.add_action(self.importBibleItem, u'Import')
# Do not add the action to the list yet.
#actionList.add_action(self.exportBibleItem, u'Export')
# Set to invisible until we can export bibles
self.exportBibleItem.setVisible(False)
@ -64,21 +69,18 @@ class BiblePlugin(Plugin):
self.exportBibleItem.setVisible(False)
def addImportMenuItem(self, import_menu):
self.importBibleItem = QtGui.QAction(import_menu)
self.importBibleItem.setObjectName(u'importBibleItem')
self.importBibleItem = base_action(import_menu, u'importBibleItem')
self.importBibleItem.setText(translate('BiblesPlugin', '&Bible'))
import_menu.addAction(self.importBibleItem)
self.importBibleItem.setText(
translate('BiblesPlugin', '&Bible'))
# signals and slots
QtCore.QObject.connect(self.importBibleItem,
QtCore.SIGNAL(u'triggered()'), self.onBibleImportClick)
self.importBibleItem.setVisible(False)
def addExportMenuItem(self, export_menu):
self.exportBibleItem = QtGui.QAction(export_menu)
self.exportBibleItem.setObjectName(u'exportBibleItem')
export_menu.addAction(self.exportBibleItem)
self.exportBibleItem = base_action(export_menu, u'exportBibleItem')
self.exportBibleItem.setText(translate('BiblesPlugin', '&Bible'))
export_menu.addAction(self.exportBibleItem)
self.exportBibleItem.setVisible(False)
def onBibleImportClick(self):

View File

@ -83,8 +83,7 @@ class SongsPlugin(Plugin):
"""
# Main song import menu item - will eventually be the only one
self.SongImportItem = base_action(import_menu, u'SongImportItem')
self.SongImportItem.setText(translate(
'SongsPlugin', '&Song'))
self.SongImportItem.setText(translate('SongsPlugin', '&Song'))
self.SongImportItem.setToolTip(translate('SongsPlugin',
'Import songs using the import wizard.'))
import_menu.addAction(self.SongImportItem)
@ -103,8 +102,7 @@ class SongsPlugin(Plugin):
"""
# Main song import menu item - will eventually be the only one
self.SongExportItem = base_action(export_menu, u'SongExportItem')
self.SongExportItem.setText(translate(
'SongsPlugin', '&Song'))
self.SongExportItem.setText(translate('SongsPlugin', '&Song'))
self.SongExportItem.setToolTip(translate('SongsPlugin',
'Exports songs using the export wizard.'))
export_menu.addAction(self.SongExportItem)