forked from openlp/openlp
Fix the song plugin's dependence on OpenOffice.org by conditionally importing the SOF and Generic importers.
bzr-revno: 882
This commit is contained in:
commit
b93979338d
@ -94,6 +94,10 @@ class VerseType(object):
|
||||
from manager import SongManager
|
||||
from songstab import SongsTab
|
||||
from mediaitem import SongMediaItem
|
||||
from songimport import SongImport
|
||||
try:
|
||||
from sofimport import SofImport
|
||||
from oooimport import OooImport
|
||||
from songimport import SongImport
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
@ -29,8 +29,13 @@ from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, \
|
||||
translate
|
||||
from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \
|
||||
SofImport, OooImport
|
||||
from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab
|
||||
|
||||
try:
|
||||
from openlp.plugins.songs.lib import SofImport, OooImport
|
||||
OOo_available = True
|
||||
except ImportError:
|
||||
OOo_available = False
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -95,6 +100,10 @@ class SongsPlugin(Plugin):
|
||||
self.SongImportItem.setToolTip(translate('SongsPlugin',
|
||||
'Import songs using the import wizard.'))
|
||||
import_menu.addAction(self.SongImportItem)
|
||||
# Signals and slots
|
||||
QtCore.QObject.connect(self.SongImportItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onSongImportItemClicked)
|
||||
if OOo_available:
|
||||
# Songs of Fellowship import menu item - will be removed and the
|
||||
# functionality will be contained within the import wizard
|
||||
self.ImportSofItem = QtGui.QAction(import_menu)
|
||||
@ -129,8 +138,6 @@ class SongsPlugin(Plugin):
|
||||
'Word/Writer/Powerpoint/Impress'))
|
||||
import_menu.addAction(self.ImportOooItem)
|
||||
# Signals and slots
|
||||
QtCore.QObject.connect(self.SongImportItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onSongImportItemClicked)
|
||||
QtCore.QObject.connect(self.ImportSofItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onImportSofItemClick)
|
||||
QtCore.QObject.connect(self.ImportOooItem,
|
||||
|
Loading…
Reference in New Issue
Block a user