forked from openlp/openlp
Remote Song Editing Finished - minor other changes
bzr-revno: 641
This commit is contained in:
commit
686f34b7f9
@ -41,6 +41,10 @@ class SongXMLBuilder(object):
|
||||
</lyrics>
|
||||
</song>
|
||||
"""
|
||||
global log
|
||||
log = logging.getLogger(u'SongXMLBuilder')
|
||||
log.info(u'SongXMLBuilder Loaded')
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Set up the song builder.
|
||||
@ -81,6 +85,7 @@ class SongXMLBuilder(object):
|
||||
``content``
|
||||
The actual text of the verse to be stored.
|
||||
"""
|
||||
#log.debug(u'add_verse_to_lyrics %s, %s\n%s' % (type, number, content))
|
||||
verse = self.song_xml.createElement(u'verse')
|
||||
verse.setAttribute(u'type', type)
|
||||
verse.setAttribute(u'label', number)
|
||||
|
@ -525,7 +525,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
self.settingsForm.postSetUp()
|
||||
|
||||
def versionCheck(self):
|
||||
applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-595')
|
||||
applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-640')
|
||||
version = check_latest_version(self.generalConfig, applicationVersion)
|
||||
if applicationVersion != version:
|
||||
version_text = unicode(self.trUtf8(u'OpenLP version %s has been updated '
|
||||
|
@ -27,6 +27,7 @@ import string
|
||||
import logging
|
||||
import cPickle
|
||||
import zipfile
|
||||
import uuid
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \
|
||||
@ -556,17 +557,22 @@ class ServiceManager(QtGui.QWidget):
|
||||
sitem, count = self.findServiceItem()
|
||||
item.render()
|
||||
if self.remoteEditTriggered:
|
||||
item.uuid = self.serviceItems[sitem][u'data'].uuid
|
||||
self.serviceItems[sitem][u'data'] = item
|
||||
self.remoteEditTriggered = False
|
||||
self.repaintServiceList(sitem + 1, 0)
|
||||
self.parent.LiveController.replaceServiceManagerItem(item)
|
||||
else:
|
||||
item.uuid = unicode(uuid.uuid1())
|
||||
if sitem == -1:
|
||||
self.serviceItems.append({u'data': item,
|
||||
u'order': len(self.serviceItems) + 1, u'expanded':True})
|
||||
u'order': len(self.serviceItems) + 1,
|
||||
u'expanded':True})
|
||||
self.repaintServiceList(len(self.serviceItems) + 1, 0)
|
||||
else:
|
||||
self.serviceItems.insert(sitem + 1, {u'data': item,
|
||||
u'order': len(self.serviceItems)+1, u'expanded':True})
|
||||
u'order': len(self.serviceItems)+1,
|
||||
u'expanded':True})
|
||||
self.repaintServiceList(sitem + 1, 0)
|
||||
self.parent.serviceChanged(False, self.serviceName)
|
||||
|
||||
|
@ -176,16 +176,16 @@ class SlideController(QtGui.QWidget):
|
||||
if isLive:
|
||||
self.Songbar = OpenLPToolbar(self)
|
||||
self.Songbar.addToolbarButton(
|
||||
u'Bridge', u':/media/media_time.png',
|
||||
u'Bridge', u':/slides/slide_close.png',
|
||||
self.trUtf8(u'Bridge'),
|
||||
self.onSongBarHandler)
|
||||
self.Songbar.addToolbarButton(
|
||||
u'Chorus', u':/media/media_time.png',
|
||||
u'Chorus', u':/slides/slide_close.png',
|
||||
self.trUtf8(u'Chorus'),
|
||||
self.onSongBarHandler)
|
||||
for verse in range(1, 9):
|
||||
for verse in range(1, 20):
|
||||
self.Songbar.addToolbarButton(
|
||||
unicode(verse), u':/media/media_time.png',
|
||||
unicode(verse), u':/slides/slide_close.png',
|
||||
unicode(self.trUtf8(u'Verse %s'))%verse,
|
||||
self.onSongBarHandler)
|
||||
self.ControllerLayout.addWidget(self.Songbar)
|
||||
@ -282,6 +282,15 @@ class SlideController(QtGui.QWidget):
|
||||
self.Toolbar.makeWidgetsInvisible(self.image_list)
|
||||
if item.name == u'Songs' and \
|
||||
str_to_bool(self.songsconfig.get_config(u'display songbar', True)):
|
||||
for action in self.Songbar.actions:
|
||||
self.Songbar.actions[action].setVisible(False)
|
||||
verses = item.verse_order.split(u' ')
|
||||
for verse in verses:
|
||||
try:
|
||||
self.Songbar.actions[verse].setVisible(True)
|
||||
except:
|
||||
#More than 20 verses hard luck
|
||||
pass
|
||||
self.Songbar.setVisible(True)
|
||||
elif item.service_item_type == ServiceType.Image:
|
||||
#Not sensible to allow loops with 1 frame
|
||||
@ -323,6 +332,13 @@ class SlideController(QtGui.QWidget):
|
||||
self.songEdit = False
|
||||
self.displayServiceManagerItems(item, slideno)
|
||||
|
||||
def replaceServiceManagerItem(self, item):
|
||||
"""
|
||||
Replacement item following a remote edit
|
||||
"""
|
||||
if self.commandItem is not None and \
|
||||
item.uuid == self.commandItem.uuid:
|
||||
self.addServiceManagerItem(item, self.PreviewListWidget.currentRow())
|
||||
|
||||
def addServiceManagerItem(self, item, slideno):
|
||||
"""
|
||||
|
@ -115,7 +115,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.VerseDeleteButton.setEnabled(False)
|
||||
self.AuthorRemoveButton.setEnabled(False)
|
||||
self.TopicRemoveButton.setEnabled(False)
|
||||
self.title_change = False
|
||||
|
||||
def loadAuthors(self):
|
||||
authors = self.songmanager.get_authors()
|
||||
@ -162,7 +161,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.VerseListWidget.clear()
|
||||
self.AuthorsListView.clear()
|
||||
self.TopicsListView.clear()
|
||||
self.title_change = False
|
||||
self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
|
||||
self.loadAuthors()
|
||||
self.loadTopics()
|
||||
@ -235,7 +233,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
topic_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(topic.id))
|
||||
self.TopicsListView.addItem(topic_name)
|
||||
self._validate_song()
|
||||
self.title_change = False
|
||||
self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
|
||||
#if not preview hide the preview button
|
||||
self.previewButton.setVisible(False)
|
||||
@ -378,7 +375,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
|
||||
def onTitleEditItemLostFocus(self):
|
||||
self.song.title = self.TitleEditItem.text()
|
||||
self.title_change = True
|
||||
|
||||
def onVerseOrderEditLostFocus(self):
|
||||
self.song.verse_order = self.VerseOrderEdit.text()
|
||||
@ -431,6 +427,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.song.search_title = unicode(self.TitleEditItem.displayText()) + \
|
||||
u'@'+ unicode(self.AlternativeEdit.displayText())
|
||||
self.song.comments = unicode(self.CommentsEdit.toPlainText())
|
||||
self.song.verse_order = unicode(self.VerseOrderEdit.text())
|
||||
self.song.ccli_number = unicode(self.CCLNumberEdit.displayText())
|
||||
self.processLyrics()
|
||||
self.processTitle()
|
||||
|
@ -106,8 +106,8 @@ class SongManager():
|
||||
self.session.commit()
|
||||
return True
|
||||
except:
|
||||
self.session.rollback()
|
||||
log.exception(u'Could not save song to song database')
|
||||
self.session.rollback()
|
||||
return False
|
||||
|
||||
def delete_song(self, songid):
|
||||
|
Loading…
Reference in New Issue
Block a user