forked from openlp/openlp
Amended plugin to use correct stat values
Fixed bible media item to initialise in correct order Fixed servicemanager to use correct methods on service loading Sorted out lots of issues tagging the song verses
This commit is contained in:
parent
8dc0742e1e
commit
ab5b0ee0d5
@ -31,9 +31,9 @@ class PluginStatus(object):
|
|||||||
"""
|
"""
|
||||||
Defines the status of the plugin
|
Defines the status of the plugin
|
||||||
"""
|
"""
|
||||||
Active = 0
|
Active = 1
|
||||||
Inactive = 1
|
Inactive = 0
|
||||||
Disabled = 2
|
Disabled = -1
|
||||||
|
|
||||||
class Plugin(QtCore.QObject):
|
class Plugin(QtCore.QObject):
|
||||||
"""
|
"""
|
||||||
|
@ -26,7 +26,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
from PyQt4.phonon import Phonon
|
#from PyQt4.phonon import Phonon
|
||||||
|
|
||||||
from openlp.core.lib import Receiver
|
from openlp.core.lib import Receiver
|
||||||
|
|
||||||
@ -92,13 +92,13 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.layout.setSpacing(0)
|
self.layout.setSpacing(0)
|
||||||
self.layout.setMargin(0)
|
self.layout.setMargin(0)
|
||||||
self.layout.setObjectName(u'layout')
|
self.layout.setObjectName(u'layout')
|
||||||
self.mediaObject = Phonon.MediaObject(self)
|
#self.mediaObject = Phonon.MediaObject(self)
|
||||||
self.video = Phonon.VideoWidget()
|
#self.video = Phonon.VideoWidget()
|
||||||
self.video.setVisible(False)
|
#self.video.setVisible(False)
|
||||||
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
#self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||||
Phonon.createPath(self.mediaObject, self.video)
|
#Phonon.createPath(self.mediaObject, self.video)
|
||||||
Phonon.createPath(self.mediaObject, self.audio)
|
#Phonon.createPath(self.mediaObject, self.audio)
|
||||||
self.layout.insertWidget(0, self.video)
|
#self.layout.insertWidget(0, self.video)
|
||||||
self.display = QtGui.QLabel(self)
|
self.display = QtGui.QLabel(self)
|
||||||
self.display.setScaledContents(True)
|
self.display.setScaledContents(True)
|
||||||
self.layout.insertWidget(0, self.display)
|
self.layout.insertWidget(0, self.display)
|
||||||
@ -116,16 +116,16 @@ class MainDisplay(DisplayWidget):
|
|||||||
QtCore.SIGNAL(u'live_slide_hide'), self.hideDisplay)
|
QtCore.SIGNAL(u'live_slide_hide'), self.hideDisplay)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'live_slide_show'), self.showDisplay)
|
QtCore.SIGNAL(u'live_slide_show'), self.showDisplay)
|
||||||
QtCore.QObject.connect(self.mediaObject,
|
# QtCore.QObject.connect(self.mediaObject,
|
||||||
QtCore.SIGNAL(u'finished()'), self.onMediaFinish)
|
# QtCore.SIGNAL(u'finished()'), self.onMediaFinish)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
# QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'media_start'), self.onMediaQueue)
|
# QtCore.SIGNAL(u'media_start'), self.onMediaQueue)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
# QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'media_play'), self.onMediaPlay)
|
# QtCore.SIGNAL(u'media_play'), self.onMediaPlay)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
# QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'media_pause'), self.onMediaPaws)
|
# QtCore.SIGNAL(u'media_pause'), self.onMediaPaws)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
# QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'media_stop'), self.onMediaStop)
|
# QtCore.SIGNAL(u'media_stop'), self.onMediaStop)
|
||||||
|
|
||||||
def setup(self, screenNumber):
|
def setup(self, screenNumber):
|
||||||
"""
|
"""
|
||||||
|
@ -86,7 +86,10 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
self.VersionNumberLabel.setText(self.activePlugin.version)
|
self.VersionNumberLabel.setText(self.activePlugin.version)
|
||||||
self.AboutTextBrowser.setHtml(self.activePlugin.about())
|
self.AboutTextBrowser.setHtml(self.activePlugin.about())
|
||||||
self.programaticChange = True
|
self.programaticChange = True
|
||||||
self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status))
|
status = 1
|
||||||
|
if self.activePlugin.status == PluginStatus.Active:
|
||||||
|
status = 0
|
||||||
|
self.StatusComboBox.setCurrentIndex(status)
|
||||||
self.StatusComboBox.setEnabled(True)
|
self.StatusComboBox.setEnabled(True)
|
||||||
self.programaticChange = False
|
self.programaticChange = False
|
||||||
|
|
||||||
@ -108,10 +111,11 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
def onStatusComboBoxChanged(self, status):
|
def onStatusComboBoxChanged(self, status):
|
||||||
if self.programaticChange:
|
if self.programaticChange:
|
||||||
return
|
return
|
||||||
self.activePlugin.toggle_status(status)
|
if status == 0:
|
||||||
if status == PluginStatus.Active:
|
self.activePlugin.toggle_status(PluginStatus.Active)
|
||||||
self.activePlugin.initialise()
|
self.activePlugin.initialise()
|
||||||
else:
|
else:
|
||||||
|
self.activePlugin.toggle_status(PluginStatus.Inactive)
|
||||||
self.activePlugin.finalise()
|
self.activePlugin.finalise()
|
||||||
status_text = 'Inactive'
|
status_text = 'Inactive'
|
||||||
if self.activePlugin.status == PluginStatus.Active:
|
if self.activePlugin.status == PluginStatus.Active:
|
||||||
|
@ -26,7 +26,7 @@ import time
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
from PyQt4.phonon import Phonon
|
#from PyQt4.phonon import Phonon
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, Receiver, str_to_bool, PluginConfig
|
from openlp.core.lib import OpenLPToolbar, Receiver, str_to_bool, PluginConfig
|
||||||
|
|
||||||
@ -197,11 +197,11 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.Mediabar.addToolbarButton(
|
self.Mediabar.addToolbarButton(
|
||||||
u'Media Stop', u':/slides/media_playback_stop.png',
|
u'Media Stop', u':/slides/media_playback_stop.png',
|
||||||
self.trUtf8(u'Start playing media'), self.onMediaStop)
|
self.trUtf8(u'Start playing media'), self.onMediaStop)
|
||||||
self.volumeSlider = Phonon.VolumeSlider()
|
#self.volumeSlider = Phonon.VolumeSlider()
|
||||||
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
#self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||||
self.volumeSlider.setObjectName(u'volumeSlider')
|
#self.volumeSlider.setObjectName(u'volumeSlider')
|
||||||
self.Mediabar.addToolbarWidget(
|
#self.Mediabar.addToolbarWidget(
|
||||||
u'Audio Volume', self.volumeSlider)
|
# u'Audio Volume', self.volumeSlider)
|
||||||
self.ControllerLayout.addWidget(self.Mediabar)
|
self.ControllerLayout.addWidget(self.Mediabar)
|
||||||
# Build the Song Toolbar
|
# Build the Song Toolbar
|
||||||
if isLive:
|
if isLive:
|
||||||
@ -236,13 +236,13 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.SlideLayout.setSpacing(0)
|
self.SlideLayout.setSpacing(0)
|
||||||
self.SlideLayout.setMargin(0)
|
self.SlideLayout.setMargin(0)
|
||||||
self.SlideLayout.setObjectName(u'SlideLayout')
|
self.SlideLayout.setObjectName(u'SlideLayout')
|
||||||
self.mediaObject = Phonon.MediaObject(self)
|
# self.mediaObject = Phonon.MediaObject(self)
|
||||||
self.video = Phonon.VideoWidget()
|
#self.video = Phonon.VideoWidget()
|
||||||
self.video.setVisible(False)
|
#self.video.setVisible(False)
|
||||||
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
#self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||||
Phonon.createPath(self.mediaObject, self.video)
|
#Phonon.createPath(self.mediaObject, self.video)
|
||||||
Phonon.createPath(self.mediaObject, self.audio)
|
#Phonon.createPath(self.mediaObject, self.audio)
|
||||||
self.SlideLayout.insertWidget(0, self.video)
|
#self.SlideLayout.insertWidget(0, self.video)
|
||||||
# Actual preview screen
|
# Actual preview screen
|
||||||
self.SlidePreview = QtGui.QLabel(self)
|
self.SlidePreview = QtGui.QLabel(self)
|
||||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
|
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
|
||||||
|
@ -276,8 +276,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def initialise(self):
|
def initialise(self):
|
||||||
log.debug(u'bible manager initialise')
|
log.debug(u'bible manager initialise')
|
||||||
self.loadBibles()
|
|
||||||
self.parent.biblemanager.media = self
|
self.parent.biblemanager.media = self
|
||||||
|
self.loadBibles()
|
||||||
self.configUpdated()
|
self.configUpdated()
|
||||||
log.debug(u'bible manager initialise complete')
|
log.debug(u'bible manager initialise complete')
|
||||||
|
|
||||||
|
@ -218,10 +218,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
songXML = SongXMLParser(self.song.lyrics)
|
songXML = SongXMLParser(self.song.lyrics)
|
||||||
verseList = songXML.get_verses()
|
verseList = songXML.get_verses()
|
||||||
for verse in verseList:
|
for verse in verseList:
|
||||||
if verse[0][u'type'] == u'Verse':
|
variant = u'%s:%s' % (verse[0][u'type'], verse[0][u'label'])
|
||||||
variant = verse[0][u'label']
|
|
||||||
else:
|
|
||||||
variant = verse[0][u'type']
|
|
||||||
item = QtGui.QListWidgetItem(verse[1])
|
item = QtGui.QListWidgetItem(verse[1])
|
||||||
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant))
|
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant))
|
||||||
self.VerseListWidget.addItem(item)
|
self.VerseListWidget.addItem(item)
|
||||||
@ -328,7 +325,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
self.verse_form.setVerse(tempText, True, verseId)
|
self.verse_form.setVerse(tempText, True, verseId)
|
||||||
self.verse_form.exec_()
|
self.verse_form.exec_()
|
||||||
afterText, verse, subVerse = self.verse_form.getVerse()
|
afterText, verse, subVerse = self.verse_form.getVerse()
|
||||||
data = u'%s%s' %(verse , subVerse)
|
data = u'%s:%s' %(verse , subVerse)
|
||||||
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data))
|
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data))
|
||||||
item.setText(afterText)
|
item.setText(afterText)
|
||||||
#number of lines has change
|
#number of lines has change
|
||||||
@ -349,10 +346,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
for row in range(0, self.VerseListWidget.count()):
|
for row in range(0, self.VerseListWidget.count()):
|
||||||
item = self.VerseListWidget.item(row)
|
item = self.VerseListWidget.item(row)
|
||||||
field = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
field = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
||||||
if len(field) <= 2:
|
verse_list += u'---[%s]---\n' % field
|
||||||
verse_list += u'---[v%s]---\n' % field
|
|
||||||
else:
|
|
||||||
verse_list += u'---[%s]---\n' % field
|
|
||||||
verse_list += item.text()
|
verse_list += item.text()
|
||||||
verse_list += u'\n'
|
verse_list += u'\n'
|
||||||
self.verse_form.setVerse(verse_list)
|
self.verse_form.setVerse(verse_list)
|
||||||
@ -477,15 +471,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
text = u' '
|
text = u' '
|
||||||
verse_order = u''
|
verse_order = u''
|
||||||
for i in range (0, self.VerseListWidget.count()):
|
for i in range (0, self.VerseListWidget.count()):
|
||||||
verseId = unicode((item.data(QtCore.Qt.UserRole)).toString()[0])
|
item = self.VerseListWidget.item(i)
|
||||||
if len(verseId) <= 2:
|
verseId = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
||||||
type = u'Verse'
|
bits = verseId.split(u':')
|
||||||
value = verseId
|
sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text()))
|
||||||
else:
|
|
||||||
type = verseId
|
|
||||||
value = 0
|
|
||||||
sxml.add_verse_to_lyrics(type, verseId,
|
|
||||||
unicode(self.VerseListWidget.item(i).text()))
|
|
||||||
text = text + unicode(self.VerseListWidget.item(i).text()) + u' '
|
text = text + unicode(self.VerseListWidget.item(i).text()) + u' '
|
||||||
verse_order = verse_order + verseId + u' '
|
verse_order = verse_order + verseId + u' '
|
||||||
count += 1
|
count += 1
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'editversedialog.ui'
|
# Form implementation generated from reading ui file 'editversedialog.ui'
|
||||||
#
|
#
|
||||||
# Created: Sun Nov 22 13:33:41 2009
|
# Created: Fri Nov 27 18:35:12 2009
|
||||||
# by: PyQt4 UI code generator 4.5.4
|
# by: PyQt4 UI code generator 4.6.2
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ class Ui_EditVerseDialog(object):
|
|||||||
EditVerseDialog.resize(492, 494)
|
EditVerseDialog.resize(492, 494)
|
||||||
EditVerseDialog.setModal(True)
|
EditVerseDialog.setModal(True)
|
||||||
self.widget = QtGui.QWidget(EditVerseDialog)
|
self.widget = QtGui.QWidget(EditVerseDialog)
|
||||||
self.widget.setGeometry(QtCore.QRect(8, 11, 471, 461))
|
self.widget.setGeometry(QtCore.QRect(9, 12, 471, 471))
|
||||||
self.widget.setObjectName("widget")
|
self.widget.setObjectName("widget")
|
||||||
self.verticalLayout = QtGui.QVBoxLayout(self.widget)
|
self.verticalLayout = QtGui.QVBoxLayout(self.widget)
|
||||||
self.verticalLayout.setObjectName("verticalLayout")
|
self.verticalLayout.setObjectName("verticalLayout")
|
||||||
@ -23,35 +23,45 @@ class Ui_EditVerseDialog(object):
|
|||||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||||
self.VerseListComboBox = QtGui.QComboBox(self.widget)
|
self.VerseListComboBox = QtGui.QComboBox(self.widget)
|
||||||
self.VerseListComboBox.setObjectName("VerseListComboBox")
|
self.VerseListComboBox.setObjectName("VerseListComboBox")
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
self.VerseListComboBox.addItem("")
|
||||||
self.VerseListComboBox.setItemText(0, "")
|
self.VerseListComboBox.setItemText(0, "")
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
self.VerseListComboBox.addItem("")
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
self.VerseListComboBox.addItem("")
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
self.VerseListComboBox.addItem("")
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
|
||||||
self.VerseListComboBox.addItem(QtCore.QString())
|
|
||||||
self.horizontalLayout.addWidget(self.VerseListComboBox)
|
self.horizontalLayout.addWidget(self.VerseListComboBox)
|
||||||
self.SubVerseListComboBox = QtGui.QComboBox(self.widget)
|
self.SubVerseListComboBox = QtGui.QComboBox(self.widget)
|
||||||
self.SubVerseListComboBox.setObjectName("SubVerseListComboBox")
|
self.SubVerseListComboBox.setObjectName("SubVerseListComboBox")
|
||||||
self.SubVerseListComboBox.addItem(QtCore.QString())
|
self.SubVerseListComboBox.addItem("")
|
||||||
self.SubVerseListComboBox.setItemText(0, "")
|
self.SubVerseListComboBox.setItemText(0, "")
|
||||||
self.SubVerseListComboBox.addItem(QtCore.QString())
|
self.SubVerseListComboBox.addItem("")
|
||||||
self.SubVerseListComboBox.addItem(QtCore.QString())
|
self.SubVerseListComboBox.addItem("")
|
||||||
self.SubVerseListComboBox.addItem(QtCore.QString())
|
self.SubVerseListComboBox.addItem("")
|
||||||
self.SubVerseListComboBox.addItem(QtCore.QString())
|
self.SubVerseListComboBox.addItem("")
|
||||||
self.SubVerseListComboBox.addItem(QtCore.QString())
|
self.SubVerseListComboBox.addItem("")
|
||||||
|
self.SubVerseListComboBox.addItem("")
|
||||||
|
self.SubVerseListComboBox.addItem("")
|
||||||
|
self.SubVerseListComboBox.addItem("")
|
||||||
|
self.SubVerseListComboBox.addItem("")
|
||||||
|
self.SubVerseListComboBox.addItem("")
|
||||||
|
self.SubVerseListComboBox.addItem("")
|
||||||
self.horizontalLayout.addWidget(self.SubVerseListComboBox)
|
self.horizontalLayout.addWidget(self.SubVerseListComboBox)
|
||||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||||
self.VerseTextEdit = QtGui.QTextEdit(self.widget)
|
self.VerseTextEdit = QtGui.QTextEdit(self.widget)
|
||||||
self.VerseTextEdit.setAcceptRichText(False)
|
self.VerseTextEdit.setAcceptRichText(False)
|
||||||
self.VerseTextEdit.setObjectName("VerseTextEdit")
|
self.VerseTextEdit.setObjectName("VerseTextEdit")
|
||||||
self.verticalLayout.addWidget(self.VerseTextEdit)
|
self.verticalLayout.addWidget(self.VerseTextEdit)
|
||||||
|
self.horizontalLayout_2 = QtGui.QHBoxLayout()
|
||||||
|
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||||
|
self.addVerse = QtGui.QPushButton(self.widget)
|
||||||
|
self.addVerse.setObjectName("addVerse")
|
||||||
|
self.horizontalLayout_2.addWidget(self.addVerse)
|
||||||
|
self.addChorus = QtGui.QPushButton(self.widget)
|
||||||
|
self.addChorus.setObjectName("addChorus")
|
||||||
|
self.horizontalLayout_2.addWidget(self.addChorus)
|
||||||
|
self.addBridge = QtGui.QPushButton(self.widget)
|
||||||
|
self.addBridge.setObjectName("addBridge")
|
||||||
|
self.horizontalLayout_2.addWidget(self.addBridge)
|
||||||
|
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||||
self.ButtonBox = QtGui.QDialogButtonBox(self.widget)
|
self.ButtonBox = QtGui.QDialogButtonBox(self.widget)
|
||||||
self.ButtonBox.setOrientation(QtCore.Qt.Horizontal)
|
self.ButtonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||||
self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save)
|
self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save)
|
||||||
@ -65,20 +75,21 @@ class Ui_EditVerseDialog(object):
|
|||||||
|
|
||||||
def retranslateUi(self, EditVerseDialog):
|
def retranslateUi(self, EditVerseDialog):
|
||||||
EditVerseDialog.setWindowTitle(QtGui.QApplication.translate("EditVerseDialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
|
EditVerseDialog.setWindowTitle(QtGui.QApplication.translate("EditVerseDialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(1, QtGui.QApplication.translate("EditVerseDialog", "Chorus", None, QtGui.QApplication.UnicodeUTF8))
|
self.VerseListComboBox.setItemText(1, QtGui.QApplication.translate("EditVerseDialog", "Verse", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(2, QtGui.QApplication.translate("EditVerseDialog", "Bridge", None, QtGui.QApplication.UnicodeUTF8))
|
self.VerseListComboBox.setItemText(2, QtGui.QApplication.translate("EditVerseDialog", "Chorus", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(3, QtGui.QApplication.translate("EditVerseDialog", "1", None, QtGui.QApplication.UnicodeUTF8))
|
self.VerseListComboBox.setItemText(3, QtGui.QApplication.translate("EditVerseDialog", "Bridge", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(4, QtGui.QApplication.translate("EditVerseDialog", "2", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(1, QtGui.QApplication.translate("EditVerseDialog", "1", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(5, QtGui.QApplication.translate("EditVerseDialog", "3", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(2, QtGui.QApplication.translate("EditVerseDialog", "1a", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(6, QtGui.QApplication.translate("EditVerseDialog", "4", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(3, QtGui.QApplication.translate("EditVerseDialog", "1b", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(7, QtGui.QApplication.translate("EditVerseDialog", "5", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(4, QtGui.QApplication.translate("EditVerseDialog", "2", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(8, QtGui.QApplication.translate("EditVerseDialog", "6", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(5, QtGui.QApplication.translate("EditVerseDialog", "2a", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(9, QtGui.QApplication.translate("EditVerseDialog", "7", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(6, QtGui.QApplication.translate("EditVerseDialog", "2b", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(11, QtGui.QApplication.translate("EditVerseDialog", "9", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(7, QtGui.QApplication.translate("EditVerseDialog", "3", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.VerseListComboBox.setItemText(10, QtGui.QApplication.translate("EditVerseDialog", "8", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(8, QtGui.QApplication.translate("EditVerseDialog", "4", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.SubVerseListComboBox.setItemText(1, QtGui.QApplication.translate("EditVerseDialog", "a", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(9, QtGui.QApplication.translate("EditVerseDialog", "5", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.SubVerseListComboBox.setItemText(2, QtGui.QApplication.translate("EditVerseDialog", "b", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(10, QtGui.QApplication.translate("EditVerseDialog", "6", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.SubVerseListComboBox.setItemText(3, QtGui.QApplication.translate("EditVerseDialog", "c", None, QtGui.QApplication.UnicodeUTF8))
|
self.SubVerseListComboBox.setItemText(11, QtGui.QApplication.translate("EditVerseDialog", "7", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.SubVerseListComboBox.setItemText(4, QtGui.QApplication.translate("EditVerseDialog", "d", None, QtGui.QApplication.UnicodeUTF8))
|
self.addVerse.setText(QtGui.QApplication.translate("EditVerseDialog", "Verse", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
self.SubVerseListComboBox.setItemText(5, QtGui.QApplication.translate("EditVerseDialog", "e", None, QtGui.QApplication.UnicodeUTF8))
|
self.addChorus.setText(QtGui.QApplication.translate("EditVerseDialog", "Chorus", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.addBridge.setText(QtGui.QApplication.translate("EditVerseDialog", "Bridge", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from editversedialog import Ui_EditVerseDialog
|
from editversedialog import Ui_EditVerseDialog
|
||||||
|
|
||||||
class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
||||||
@ -36,39 +35,44 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
|||||||
"""
|
"""
|
||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
QtCore.QObject.connect(self.VerseListComboBox,
|
QtCore.QObject.connect(self.addVerse,
|
||||||
QtCore.SIGNAL(u'activated(int)'), self.onVerseListComboBoxChanged)
|
QtCore.SIGNAL(u'clicked()'), self.onAddVerse)
|
||||||
|
QtCore.QObject.connect(self.addChorus,
|
||||||
|
QtCore.SIGNAL(u'clicked()'), self.onAddChorus)
|
||||||
|
QtCore.QObject.connect(self.addBridge,
|
||||||
|
QtCore.SIGNAL(u'clicked()'), self.onAddBridge)
|
||||||
|
|
||||||
def onVerseListComboBoxChanged(self, value):
|
def onAddBridge(self):
|
||||||
if unicode(self.VerseListComboBox.currentText()).isdigit():
|
self.VerseTextEdit.insertPlainText(u'---[Bridge:1]---\n')
|
||||||
self.SubVerseListComboBox.setEnabled(True)
|
|
||||||
else:
|
|
||||||
self.SubVerseListComboBox.setCurrentIndex(0)
|
|
||||||
self.SubVerseListComboBox.setEnabled(False)
|
|
||||||
|
|
||||||
def setVerse(self, text, single=False, id=0):
|
def onAddChorus(self):
|
||||||
|
self.VerseTextEdit.insertPlainText(u'---[Chorus:1]---\n')
|
||||||
|
|
||||||
|
def onAddVerse(self):
|
||||||
|
self.VerseTextEdit.insertPlainText(u'---[Verse:1]---\n')
|
||||||
|
|
||||||
|
def setVerse(self, text, single=False, tag=0):
|
||||||
posVerse = 0
|
posVerse = 0
|
||||||
posSub = 0
|
posSub = 0
|
||||||
if single:
|
if single:
|
||||||
if len(id) <= 2:
|
id = tag.split(u':')
|
||||||
if len(id) == 0:
|
posVerse = self.VerseListComboBox.findText(id[0], QtCore.Qt.MatchExactly)
|
||||||
pass
|
posSub = self.SubVerseListComboBox.findText(id[1], QtCore.Qt.MatchExactly)
|
||||||
elif len(id) == 1:
|
|
||||||
posVerse = self.VerseListComboBox.findText(id, QtCore.Qt.MatchExactly)
|
|
||||||
else:
|
|
||||||
posVerse = self.VerseListComboBox.findText(id[0], QtCore.Qt.MatchExactly)
|
|
||||||
posSub = self.SubVerseListComboBox.findText(id[1], QtCore.Qt.MatchExactly)
|
|
||||||
else:
|
|
||||||
posVerse = self.VerseListComboBox.findText(id, QtCore.Qt.MatchExactly)
|
|
||||||
if posVerse == -1:
|
if posVerse == -1:
|
||||||
posVerse = 0
|
posVerse = 0
|
||||||
if posSub == -1:
|
if posSub == -1:
|
||||||
posSub = 0
|
posSub = 0
|
||||||
self.VerseListComboBox.setEnabled(True)
|
self.VerseListComboBox.setEnabled(True)
|
||||||
self.SubVerseListComboBox.setEnabled(True)
|
self.SubVerseListComboBox.setEnabled(True)
|
||||||
|
self.addBridge.setEnabled(False)
|
||||||
|
self.addChorus.setEnabled(False)
|
||||||
|
self.addVerse.setEnabled(False)
|
||||||
else:
|
else:
|
||||||
self.VerseListComboBox.setEnabled(False)
|
self.VerseListComboBox.setEnabled(False)
|
||||||
self.SubVerseListComboBox.setEnabled(False)
|
self.SubVerseListComboBox.setEnabled(False)
|
||||||
|
self.addBridge.setEnabled(True)
|
||||||
|
self.addChorus.setEnabled(True)
|
||||||
|
self.addVerse.setEnabled(True)
|
||||||
self.VerseListComboBox.setCurrentIndex(posVerse)
|
self.VerseListComboBox.setCurrentIndex(posVerse)
|
||||||
self.SubVerseListComboBox.setCurrentIndex(posSub)
|
self.SubVerseListComboBox.setCurrentIndex(posSub)
|
||||||
self.VerseTextEdit.setPlainText(text)
|
self.VerseTextEdit.setPlainText(text)
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>8</x>
|
<x>9</x>
|
||||||
<y>11</y>
|
<y>12</y>
|
||||||
<width>471</width>
|
<width>471</width>
|
||||||
<height>461</height>
|
<height>471</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
@ -50,16 +50,45 @@
|
|||||||
<string>Bridge</string>
|
<string>Bridge</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="SubVerseListComboBox">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>1a</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>1b</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>2</string>
|
<string>2</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>2a</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>2b</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>3</string>
|
<string>3</string>
|
||||||
@ -85,50 +114,6 @@
|
|||||||
<string>7</string>
|
<string>7</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>9</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>8</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="SubVerseListComboBox">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>a</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>b</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>c</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>d</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>e</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -140,6 +125,31 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="addVerse">
|
||||||
|
<property name="text">
|
||||||
|
<string>Verse</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="addChorus">
|
||||||
|
<property name="text">
|
||||||
|
<string>Chorus</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="addBridge">
|
||||||
|
<property name="text">
|
||||||
|
<string>Bridge</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="ButtonBox">
|
<widget class="QDialogButtonBox" name="ButtonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Loading…
Reference in New Issue
Block a user