forked from openlp/openlp
Song Edit Preview button only active from Preview, Reset Theme Editor image text Edit
This commit is contained in:
parent
81de929460
commit
0d959fbfb1
@ -408,6 +408,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
self.theme.background_endColor = u'#ff0000'
|
self.theme.background_endColor = u'#ff0000'
|
||||||
else:
|
else:
|
||||||
self.theme.background_type = u'image'
|
self.theme.background_type = u'image'
|
||||||
|
a=c
|
||||||
self.stateChanging(self.theme)
|
self.stateChanging(self.theme)
|
||||||
self.previewTheme(self.theme)
|
self.previewTheme(self.theme)
|
||||||
|
|
||||||
@ -431,7 +432,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
QtGui.QColor(self.theme.background_endColor), self).name()
|
QtGui.QColor(self.theme.background_endColor), self).name()
|
||||||
self.Color2PushButton.setStyleSheet(
|
self.Color2PushButton.setStyleSheet(
|
||||||
u'background-color: %s' % unicode(self.theme.background_endColor))
|
u'background-color: %s' % unicode(self.theme.background_endColor))
|
||||||
|
|
||||||
self.previewTheme(self.theme)
|
self.previewTheme(self.theme)
|
||||||
#
|
#
|
||||||
#Other Tab
|
#Other Tab
|
||||||
@ -486,12 +486,14 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
else:
|
else:
|
||||||
self.BackgroundComboBox.setCurrentIndex(1)
|
self.BackgroundComboBox.setCurrentIndex(1)
|
||||||
|
|
||||||
|
self.ImageLineEdit.setText(u'')
|
||||||
if theme.background_type == u'solid':
|
if theme.background_type == u'solid':
|
||||||
self.BackgroundTypeComboBox.setCurrentIndex(0)
|
self.BackgroundTypeComboBox.setCurrentIndex(0)
|
||||||
elif theme.background_type == u'gradient':
|
elif theme.background_type == u'gradient':
|
||||||
self.BackgroundTypeComboBox.setCurrentIndex(1)
|
self.BackgroundTypeComboBox.setCurrentIndex(1)
|
||||||
else:
|
else:
|
||||||
self.BackgroundTypeComboBox.setCurrentIndex(2)
|
self.BackgroundTypeComboBox.setCurrentIndex(2)
|
||||||
|
self.ImageLineEdit.setText(self.theme.background_filename)
|
||||||
|
|
||||||
if self.theme.background_direction == u'horizontal':
|
if self.theme.background_direction == u'horizontal':
|
||||||
self.GradientComboBox.setCurrentIndex(0)
|
self.GradientComboBox.setCurrentIndex(0)
|
||||||
|
@ -129,6 +129,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.serviceItems = []
|
self.serviceItems = []
|
||||||
self.serviceName = u''
|
self.serviceName = u''
|
||||||
self.isNew = True
|
self.isNew = True
|
||||||
|
#Indicates if remoteTriggering is active. If it is the next addServiceItem call
|
||||||
|
#will replace the currently selected one.
|
||||||
self.remoteEditTriggered = False
|
self.remoteEditTriggered = False
|
||||||
self.Layout = QtGui.QVBoxLayout(self)
|
self.Layout = QtGui.QVBoxLayout(self)
|
||||||
self.Layout.setSpacing(0)
|
self.Layout.setSpacing(0)
|
||||||
|
@ -95,9 +95,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
QtCore.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus)
|
QtCore.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus)
|
||||||
QtCore.QObject.connect(self.VerseOrderEdit,
|
QtCore.QObject.connect(self.VerseOrderEdit,
|
||||||
QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus)
|
QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus)
|
||||||
previewButton = QtGui.QPushButton()
|
self.previewButton = QtGui.QPushButton()
|
||||||
previewButton.setText(self.trUtf8(u'Save && Preview'))
|
self.previewButton.setText(self.trUtf8(u'Save && Preview'))
|
||||||
self.ButtonBox.addButton(previewButton, QtGui.QDialogButtonBox.ActionRole)
|
self.ButtonBox.addButton(
|
||||||
|
self.previewButton, QtGui.QDialogButtonBox.ActionRole)
|
||||||
QtCore.QObject.connect(self.ButtonBox,
|
QtCore.QObject.connect(self.ButtonBox,
|
||||||
QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview)
|
QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview)
|
||||||
# Create other objects and forms
|
# Create other objects and forms
|
||||||
@ -167,7 +168,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
self.loadTopics()
|
self.loadTopics()
|
||||||
self.loadBooks()
|
self.loadBooks()
|
||||||
|
|
||||||
def loadSong(self, id):
|
def loadSong(self, id, preview):
|
||||||
log.debug(u'Load Song')
|
log.debug(u'Load Song')
|
||||||
self.SongTabWidget.setCurrentIndex(0)
|
self.SongTabWidget.setCurrentIndex(0)
|
||||||
self.loadAuthors()
|
self.loadAuthors()
|
||||||
@ -236,6 +237,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
self._validate_song()
|
self._validate_song()
|
||||||
self.title_change = False
|
self.title_change = False
|
||||||
self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
|
self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
|
||||||
|
#if not preview hide the preview button
|
||||||
|
self.previewButton.setVisible(False)
|
||||||
|
if preview:
|
||||||
|
self.previewButton.setVisible(True)
|
||||||
|
|
||||||
def onAuthorAddButtonClicked(self):
|
def onAuthorAddButtonClicked(self):
|
||||||
item = int(self.AuthorsSelectionComboItem.currentIndex())
|
item = int(self.AuthorsSelectionComboItem.currentIndex())
|
||||||
@ -434,31 +439,34 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
|
|
||||||
def processLyrics(self):
|
def processLyrics(self):
|
||||||
log.debug(u'processLyrics')
|
log.debug(u'processLyrics')
|
||||||
sxml = SongXMLBuilder()
|
try:
|
||||||
sxml.new_document()
|
sxml = SongXMLBuilder()
|
||||||
sxml.add_lyrics_to_song()
|
sxml.new_document()
|
||||||
count = 1
|
sxml.add_lyrics_to_song()
|
||||||
text = u' '
|
count = 1
|
||||||
verse_order = u''
|
text = u' '
|
||||||
for i in range (0, self.VerseListWidget.count()):
|
verse_order = u''
|
||||||
sxml.add_verse_to_lyrics(u'Verse', unicode(count),
|
for i in range (0, self.VerseListWidget.count()):
|
||||||
unicode(self.VerseListWidget.item(i).text()))
|
sxml.add_verse_to_lyrics(u'Verse', unicode(count),
|
||||||
text = text + unicode(self.VerseListWidget.item(i).text()) + u' '
|
unicode(self.VerseListWidget.item(i).text()))
|
||||||
verse_order = verse_order + unicode(count) + u' '
|
text = text + unicode(self.VerseListWidget.item(i).text()) + u' '
|
||||||
count += 1
|
verse_order = verse_order + unicode(count) + u' '
|
||||||
if self.song.verse_order is None:
|
count += 1
|
||||||
self.song.verse_order = verse_order
|
if self.song.verse_order is None:
|
||||||
text = text.replace(u'\'', u'')
|
self.song.verse_order = verse_order
|
||||||
text = text.replace(u',', u'')
|
text = text.replace(u'\'', u'')
|
||||||
text = text.replace(u';', u'')
|
text = text.replace(u',', u'')
|
||||||
text = text.replace(u':', u'')
|
text = text.replace(u';', u'')
|
||||||
text = text.replace(u'(', u'')
|
text = text.replace(u':', u'')
|
||||||
text = text.replace(u')', u'')
|
text = text.replace(u'(', u'')
|
||||||
text = text.replace(u'{', u'')
|
text = text.replace(u')', u'')
|
||||||
text = text.replace(u'}', u'')
|
text = text.replace(u'{', u'')
|
||||||
text = text.replace(u'?', u'')
|
text = text.replace(u'}', u'')
|
||||||
self.song.search_lyrics = unicode(text)
|
text = text.replace(u'?', u'')
|
||||||
self.song.lyrics = unicode(sxml.extract_xml())
|
self.song.search_lyrics = unicode(text)
|
||||||
|
self.song.lyrics = unicode(sxml.extract_xml())
|
||||||
|
except:
|
||||||
|
log.exception(u'Problem processing song Lyrics')
|
||||||
|
|
||||||
def processTitle(self):
|
def processTitle(self):
|
||||||
log.debug(u'processTitle')
|
log.debug(u'processTitle')
|
||||||
|
@ -55,7 +55,11 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
self.edit_song_form = EditSongForm(self.parent.songmanager, self)
|
self.edit_song_form = EditSongForm(self.parent.songmanager, self)
|
||||||
self.song_maintenance_form = SongMaintenanceForm(
|
self.song_maintenance_form = SongMaintenanceForm(
|
||||||
self.parent.songmanager, self)
|
self.parent.songmanager, self)
|
||||||
|
#fromPreview holds the id of the item if the song editor needs to trigger a preview
|
||||||
|
#without closing. It is set to -1 if this function is inactive
|
||||||
self.fromPreview = -1
|
self.fromPreview = -1
|
||||||
|
#fromServiceManager holds the id of the item if the song editor needs to trigger posting
|
||||||
|
#to the servicemanager without closing. It is set to -1 if this function is inactive
|
||||||
self.fromServiceManager = -1
|
self.fromServiceManager = -1
|
||||||
|
|
||||||
def initPluginNameVisible(self):
|
def initPluginNameVisible(self):
|
||||||
@ -244,7 +248,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
valid = self.parent.songmanager.get_song(songid)
|
valid = self.parent.songmanager.get_song(songid)
|
||||||
if valid is not None:
|
if valid is not None:
|
||||||
self.fromServiceManager = songid
|
self.fromServiceManager = songid
|
||||||
self.edit_song_form.loadSong(songid)
|
self.edit_song_form.loadSong(songid, False)
|
||||||
self.edit_song_form.exec_()
|
self.edit_song_form.exec_()
|
||||||
|
|
||||||
def onEditClick(self, preview=False):
|
def onEditClick(self, preview=False):
|
||||||
@ -254,7 +258,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
self.fromPreview = -1
|
self.fromPreview = -1
|
||||||
if preview:
|
if preview:
|
||||||
self.fromPreview = item_id
|
self.fromPreview = item_id
|
||||||
self.edit_song_form.loadSong(item_id)
|
self.edit_song_form.loadSong(item_id, preview)
|
||||||
self.edit_song_form.exec_()
|
self.edit_song_form.exec_()
|
||||||
|
|
||||||
def onEventEditSong (self):
|
def onEventEditSong (self):
|
||||||
|
Loading…
Reference in New Issue
Block a user