Head r883

This commit is contained in:
Jon Tibble 2010-06-25 19:16:39 +01:00
commit f5a8a846b7
4 changed files with 59 additions and 48 deletions

View File

@ -589,7 +589,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
def onCopyrightInsertButtonTriggered(self): def onCopyrightInsertButtonTriggered(self):
text = self.CopyrightEditItem.text() text = self.CopyrightEditItem.text()
pos = self.CopyrightEditItem.cursorPosition() pos = self.CopyrightEditItem.cursorPosition()
text = text[:pos] + u'\xa9' + text[pos:] text = text[:pos] + '\xa9' + text[pos:]
self.CopyrightEditItem.setText(text) self.CopyrightEditItem.setText(text)
self.CopyrightEditItem.setFocus() self.CopyrightEditItem.setFocus()
self.CopyrightEditItem.setCursorPosition(pos + 1) self.CopyrightEditItem.setCursorPosition(pos + 1)

View File

@ -94,6 +94,10 @@ class VerseType(object):
from manager import SongManager from manager import SongManager
from songstab import SongsTab from songstab import SongsTab
from mediaitem import SongMediaItem from mediaitem import SongMediaItem
from sofimport import SofImport
from oooimport import OooImport
from songimport import SongImport from songimport import SongImport
try:
from sofimport import SofImport
from oooimport import OooImport
except ImportError:
pass

View File

@ -27,7 +27,7 @@ import re
from PyQt4 import QtGui from PyQt4 import QtGui
from openlp.core.lib import SongXMLBuilder from openlp.core.lib import SongXMLBuilder, translate
from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib import VerseType
from openlp.plugins.songs.lib.models import Song, Author, Topic, Book from openlp.plugins.songs.lib.models import Song, Author, Topic, Book
@ -63,10 +63,10 @@ class SongImport(object):
self.verses = [] self.verses = []
self.versecount = 0 self.versecount = 0
self.choruscount = 0 self.choruscount = 0
self.copyright_string = unicode(QtGui.QApplication.translate( self.copyright_string = unicode(translate(
u'SongsPlugin.SongImport', u'copyright')) 'SongsPlugin.SongImport', 'copyright'))
self.copyright_symbol = unicode(QtGui.QApplication.translate( self.copyright_symbol = unicode(translate(
u'SongsPlugin.SongImport', u'\xa9')) 'SongsPlugin.SongImport', '\xa9'))
@staticmethod @staticmethod
def process_songs_text(manager, text): def process_songs_text(manager, text):

View File

@ -29,8 +29,13 @@ 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, \
translate translate
from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \ from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab
SofImport, OooImport
try:
from openlp.plugins.songs.lib import SofImport, OooImport
OOo_available = True
except ImportError:
OOo_available = False
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -95,6 +100,10 @@ class SongsPlugin(Plugin):
self.SongImportItem.setToolTip(translate('SongsPlugin', self.SongImportItem.setToolTip(translate('SongsPlugin',
'Import songs using the import wizard.')) 'Import songs using the import wizard.'))
import_menu.addAction(self.SongImportItem) 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 # Songs of Fellowship import menu item - will be removed and the
# functionality will be contained within the import wizard # functionality will be contained within the import wizard
self.ImportSofItem = QtGui.QAction(import_menu) self.ImportSofItem = QtGui.QAction(import_menu)
@ -129,8 +138,6 @@ class SongsPlugin(Plugin):
'Word/Writer/Powerpoint/Impress')) '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.SIGNAL(u'triggered()'), self.onSongImportItemClicked)
QtCore.QObject.connect(self.ImportSofItem, QtCore.QObject.connect(self.ImportSofItem,
QtCore.SIGNAL(u'triggered()'), self.onImportSofItemClick) QtCore.SIGNAL(u'triggered()'), self.onImportSofItemClick)
QtCore.QObject.connect(self.ImportOooItem, QtCore.QObject.connect(self.ImportOooItem,