forked from openlp/openlp
Some other minor touchups.
This commit is contained in:
parent
304aed1c1e
commit
28a403bd07
@ -30,10 +30,10 @@ from PyQt4 import QtCore, QtGui
|
|||||||
from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver
|
from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver
|
||||||
from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \
|
from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \
|
||||||
SofImport, OooImport
|
SofImport, OooImport
|
||||||
from openlp.plugins.songs.forms import ImportWizardForm
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SongsPlugin(Plugin):
|
class SongsPlugin(Plugin):
|
||||||
"""
|
"""
|
||||||
This is the number 1 plugin, if importance were placed on any
|
This is the number 1 plugin, if importance were placed on any
|
||||||
@ -115,11 +115,14 @@ class SongsPlugin(Plugin):
|
|||||||
self.ImportOooItem = QtGui.QAction(import_menu)
|
self.ImportOooItem = QtGui.QAction(import_menu)
|
||||||
self.ImportOooItem.setObjectName(u'ImportOooItem')
|
self.ImportOooItem.setObjectName(u'ImportOooItem')
|
||||||
self.ImportOooItem.setText(
|
self.ImportOooItem.setText(
|
||||||
import_menu.trUtf8('Generic Document/Presentation Import (temp menu item)'))
|
import_menu.trUtf8('Generic Document/Presentation Import '
|
||||||
|
'(temp menu item)'))
|
||||||
self.ImportOooItem.setToolTip(
|
self.ImportOooItem.setToolTip(
|
||||||
import_menu.trUtf8('Import songs from Word/Writer/Powerpoint/Impress'))
|
import_menu.trUtf8('Import songs from '
|
||||||
|
'Word/Writer/Powerpoint/Impress'))
|
||||||
self.ImportOooItem.setStatusTip(
|
self.ImportOooItem.setStatusTip(
|
||||||
import_menu.trUtf8('Import songs from Word/Writer/Powerpoint/Impress'))
|
import_menu.trUtf8('Import songs from '
|
||||||
|
'Word/Writer/Powerpoint/Impress'))
|
||||||
import_menu.addAction(self.ImportOooItem)
|
import_menu.addAction(self.ImportOooItem)
|
||||||
# Signals and slots
|
# Signals and slots
|
||||||
QtCore.QObject.connect(self.SongImportItem,
|
QtCore.QObject.connect(self.SongImportItem,
|
||||||
@ -151,16 +154,16 @@ class SongsPlugin(Plugin):
|
|||||||
u'', u'Songs of Fellowship file (*.rtf *.RTF)')
|
u'', u'Songs of Fellowship file (*.rtf *.RTF)')
|
||||||
try:
|
try:
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
sofimport = SofImport(self.songmanager)
|
sofimport = SofImport(self.manager)
|
||||||
sofimport.import_sof(unicode(filename))
|
sofimport.import_sof(unicode(filename))
|
||||||
except:
|
except:
|
||||||
log.exception('Could not import SoF file')
|
log.exception('Could not import SoF file')
|
||||||
QtGui.QMessageBox.critical(None,
|
QtGui.QMessageBox.critical(None,
|
||||||
self.ImportSongMenu.trUtf8('Import Error'),
|
self.ImportSongMenu.trUtf8('Import Error'),
|
||||||
self.ImportSongMenu.trUtf8('Error importing Songs of '
|
self.ImportSongMenu.trUtf8('Error importing Songs of '
|
||||||
+ 'Fellowship file.\nOpenOffice.org must be installed'
|
'Fellowship file.\nOpenOffice.org must be installed'
|
||||||
+ ' and you must be using an unedited copy of the RTF'
|
' and you must be using an unedited copy of the RTF'
|
||||||
+ ' included with the Songs of Fellowship Music Editions'),
|
' included with the Songs of Fellowship Music Editions'),
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
|
||||||
QtGui.QMessageBox.Ok)
|
QtGui.QMessageBox.Ok)
|
||||||
Receiver.send_message(u'songs_load_list')
|
Receiver.send_message(u'songs_load_list')
|
||||||
@ -169,13 +172,13 @@ class SongsPlugin(Plugin):
|
|||||||
filenames = QtGui.QFileDialog.getOpenFileNames(
|
filenames = QtGui.QFileDialog.getOpenFileNames(
|
||||||
None, self.trUtf8('Open documents or presentations'),
|
None, self.trUtf8('Open documents or presentations'),
|
||||||
u'', u'All Files(*.*)')
|
u'', u'All Files(*.*)')
|
||||||
oooimport = OooImport(self.songmanager)
|
oooimport = OooImport(self.manager)
|
||||||
oooimport.import_docs(filenames)
|
oooimport.import_docs(filenames)
|
||||||
Receiver.send_message(u'songs_load_list')
|
Receiver.send_message(u'songs_load_list')
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
about_text = self.trUtf8('<strong>Song Plugin</strong><br />This plugin allows '
|
about_text = self.trUtf8('<strong>Song Plugin</strong><br />'
|
||||||
'Songs to be managed and displayed.')
|
'This plugin allows songs to be managed and displayed.')
|
||||||
return about_text
|
return about_text
|
||||||
|
|
||||||
def can_delete_theme(self, theme):
|
def can_delete_theme(self, theme):
|
||||||
@ -183,4 +186,3 @@ class SongsPlugin(Plugin):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user