forked from openlp/openlp
Fix song editing where text is lost
This commit is contained in:
parent
4a83e572e9
commit
1979f24502
@ -30,6 +30,8 @@ from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class MediaListView(BaseListWithDnD):
|
||||
def __init__(self, parent=None):
|
||||
self.PluginName = u'Media'
|
||||
@ -39,9 +41,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
"""
|
||||
This is the custom media manager item for Media Slides.
|
||||
"""
|
||||
global log
|
||||
log = logging.getLogger(u'MediaMediaItem')
|
||||
log.info(u'Media Media Item loaded')
|
||||
log.info(u'%s MediaMediaItem loaded', __name__)
|
||||
|
||||
def __init__(self, parent, icon, title):
|
||||
self.PluginNameShort = u'Media'
|
||||
|
@ -29,10 +29,10 @@ from openlp.core.lib import Plugin, build_icon, PluginStatus
|
||||
from openlp.plugins.media.lib import MediaMediaItem
|
||||
from PyQt4.phonon import Phonon
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class MediaPlugin(Plugin):
|
||||
global log
|
||||
log = logging.getLogger(u'MediaPlugin')
|
||||
log.info(u'Media Plugin loaded')
|
||||
log.info(u'%s MediaPlugin loaded', __name__)
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
Plugin.__init__(self, u'Media', u'1.9.1', plugin_helpers)
|
||||
@ -41,6 +41,9 @@ class MediaPlugin(Plugin):
|
||||
# passed with drag and drop messages
|
||||
self.dnd_id = u'Media'
|
||||
self.status = PluginStatus.Active
|
||||
# print Phonon.BackendCapabilities.availableMimeTypes()
|
||||
# for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
|
||||
# print mimetype
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'Plugin Initialising')
|
||||
|
@ -33,13 +33,13 @@ from openlp.plugins.songs.forms import EditVerseForm
|
||||
from openlp.plugins.songs.lib.models import Song
|
||||
from editsongdialog import Ui_EditSongDialog
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
"""
|
||||
Class to manage the editing of a song
|
||||
"""
|
||||
global log
|
||||
log = logging.getLogger(u'EditSongForm')
|
||||
log.info(u'Song Editor loaded')
|
||||
log.info(u'%s EditSongForm loaded', __name__)
|
||||
|
||||
def __init__(self, songmanager, parent=None):
|
||||
"""
|
||||
|
@ -77,6 +77,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
||||
def setVerse(self, text, verseCount=0, single=False, tag=u'Verse:1'):
|
||||
posVerse = 0
|
||||
posSub = 0
|
||||
if len(text) == 0:
|
||||
text = u'---[Verse:1]---'
|
||||
if single:
|
||||
id = tag.split(u':')
|
||||
posVerse = self.VerseListComboBox.findText(id[0], QtCore.Qt.MatchExactly)
|
||||
@ -119,7 +121,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
||||
unicode(self.SubVerseListComboBox.currentText())
|
||||
|
||||
def getVerseAll(self):
|
||||
return self.VerseTextEdit.toPlainText()
|
||||
text = self.VerseTextEdit.toPlainText()
|
||||
if not text.startsWith(u'---['):
|
||||
text = u'---[Verse:1]---\n%s' % text
|
||||
return text
|
||||
|
||||
def onVerseComboChanged(self, id):
|
||||
if unicode(self.VerseListComboBox.currentText()) == u'Verse':
|
||||
|
Loading…
Reference in New Issue
Block a user