From 6ebd1d9e607c8ccd23f93f9edfd45f1ca0f4ca02 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 1 Dec 2009 17:02:18 +0000 Subject: [PATCH 01/13] Cleanup from rendering changes --- openlp/core/lib/rendermanager.py | 2 +- openlp/core/lib/serviceitem.py | 2 +- openlp/core/ui/maindisplay.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index ddb8360da..a2beb1519 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -206,7 +206,7 @@ class RenderManager(object): footer.append(u'Public Domain') footer.append(u'CCLI 123456') formatted = self.renderer.format_slide(verse, False) - return self.renderer.generate_frame_from_lines(formatted[0], footer) + return self.renderer.generate_frame_from_lines(formatted[0], footer)[u'main'] def format_slide(self, words): """ diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 7cb3906ab..8f30499f5 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -293,7 +293,7 @@ class ServiceItem(object): if self.service_item_type == ServiceItemType.Text: return self.render_individual(row) else: - return self._raw_frames[row][u'image'] + return {u'main':self._raw_frames[row][u'image'], u'trans':None} def get_frame_title(self, row=0): """ diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index dac746967..0c8512b19 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -198,7 +198,7 @@ class MainDisplay(DisplayWidget): self.displayAlert() elif not self.displayBlank: if transition: - if self.hasTransition: + if self.hasTransition and self.frame[u'trans'] is not None: self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame[u'trans'])) self.repaint() self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'trans'])) From 156a70208ba2736ca9377f7ac67357296a11f52b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Dec 2009 08:35:02 +0000 Subject: [PATCH 02/13] Add new types to verse editing Clean up dialog so looks better Add controls around the editor in terms of validation --- openlp/core/ui/slidecontroller.py | 44 ++-- openlp/plugins/songs/forms/editsongform.py | 9 +- openlp/plugins/songs/forms/editversedialog.py | 149 +++++++------- openlp/plugins/songs/forms/editverseform.py | 49 ++++- resources/forms/editversedialog.ui | 189 ++++++++++-------- 5 files changed, 256 insertions(+), 184 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 6a0d53039..ac6a759a8 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -210,17 +210,17 @@ class SlideController(QtGui.QWidget): if isLive: self.Songbar = OpenLPToolbar(self) self.Songbar.addToolbarButton( - u'Bridge', u':/pages/page_bridge.png', + u'Bridge:1', u':/pages/page_bridge.png', self.trUtf8('Bridge'), self.onSongBarHandler) self.Songbar.addToolbarButton( - u'Chorus', u':/pages/page_chorus.png', + u'Chorus:1', u':/pages/page_chorus.png', self.trUtf8('Chorus'), self.onSongBarHandler) for verse in range(1, 12): self.Songbar.addToolbarButton( - unicode(verse), u':/pages/page_%s.png' % verse, - unicode(self.trUtf8('Verse %s'))%verse, + unicode(u'Verse:%s'% verse), u':/pages/page_%s.png' % verse, + unicode(self.trUtf8('Verse %s'))% verse, self.onSongBarHandler) self.ControllerLayout.addWidget(self.Songbar) self.Songbar.setVisible(False) @@ -312,14 +312,14 @@ class SlideController(QtGui.QWidget): pass def onSongBarHandler(self): - request = self.sender().text() + request = unicode(self.sender().text()) if request == u'Bridge': - pass + a=c elif request == u'Chorus': - pass + a=c else: #Remember list is 1 out! - slideno = int(request) - 1 + slideno = self.slideList[request] if slideno > self.PreviewListWidget.rowCount(): self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) else: @@ -355,14 +355,19 @@ class SlideController(QtGui.QWidget): self.Songbar.actions[action].setVisible(False) if item.verse_order: verses = item.verse_order.split(u' ') -# for verse in verses: -# if not verse or int(verse) > 12: -# break -# try: -# self.Songbar.actions[verse].setVisible(True) -# except: -# #More than 20 verses hard luck -# pass + for verse in verses: + if verse is not u' ': + pass + try: + if verse == u'C': + self.Songbar.actions[u'Chorus:1'].setVisible(True) + elif verse == u'B': + self.Songbar.actions[u'Bridge:1'].setVisible(True) + else: + vse = u'Verse:%s' % verse + self.Songbar.actions[vse].setVisible(True) + except: + pass self.Songbar.setVisible(True) elif item.is_image(): #Not sensible to allow loops with 1 frame @@ -451,7 +456,11 @@ class SlideController(QtGui.QWidget): slide_height = 0 #It is a based Text Render if self.serviceItem.is_text(): - self.slideList[frame[u'verseTag']] = framenumber + #only load the slot once + try: + test = self.slideList[frame[u'verseTag']] + except: + self.slideList[frame[u'verseTag']] = framenumber item.setText(frame[u'text']) else: label = QtGui.QLabel() @@ -479,6 +488,7 @@ class SlideController(QtGui.QWidget): if self.isLive: self.serviceItem.request_audit() log.debug(u'displayServiceManagerItems End') + print self.slideList #Screen event methods def onSlideSelectedFirst(self): diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index a68a02b08..dcda4ae52 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -315,7 +315,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.VerseDeleteButton.setEnabled(True) def onVerseAddButtonClicked(self): - self.verse_form.setVerse(u'') + self.verse_form.setVerse(u'', self.VerseListWidget.count() + 1, True) self.verse_form.exec_() afterText, verse, subVerse = self.verse_form.getVerse() data = u'%s:%s' %(verse, subVerse) @@ -329,7 +329,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if item: tempText = item.text() verseId = unicode((item.data(QtCore.Qt.UserRole)).toString()) - self.verse_form.setVerse(tempText, True, verseId) + self.verse_form.setVerse(tempText, \ + self.VerseListWidget.count(), True, verseId) self.verse_form.exec_() afterText, verse, subVerse = self.verse_form.getVerse() data = u'%s:%s' %(verse, subVerse) @@ -401,13 +402,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.SongTabWidget.setCurrentIndex(2) self.AuthorsListView.setFocus() for verse in unicode(self.VerseOrderEdit.text()): - if verse.isdigit() or u' BC'.find(verse) > -1: + if verse.isdigit() or u' BCITPEO'.find(verse.upper()) > -1: pass else: self.SongTabWidget.setCurrentIndex(0) self.VerseOrderEdit.setFocus() return False, \ - self.trUtf8('Invalid verse entry - values must be Numeric, B or C') + self.trUtf8('Invalid verse entry - values must be Numeric, I,B,C,T,P,E,O') return True, u'' def onTitleEditItemLostFocus(self): diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 6709dec21..8f532ac3f 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -1,88 +1,91 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -############################################################################### -# OpenLP - Open Source Lyrics Projection # -# --------------------------------------------------------------------------- # -# Copyright (c) 2008-2009 Raoul Snyman # -# Portions copyright (c) 2008-2009 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard # -# --------------------------------------------------------------------------- # -# This program is free software; you can redistribute it and/or modify it # -# under the terms of the GNU General Public License as published by the Free # -# Software Foundation; version 2 of the License. # -# # -# This program is distributed in the hope that it will be useful, but WITHOUT # -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # -# more details. # -# # -# You should have received a copy of the GNU General Public License along # -# with this program; if not, write to the Free Software Foundation, Inc., 59 # -# Temple Place, Suite 330, Boston, MA 02111-1307 USA # -############################################################################### +# Form implementation generated from reading ui file 'editversedialog.ui' +# +# Created: Wed Dec 2 08:14:47 2009 +# by: PyQt4 UI code generator 4.6.2 +# +# WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_EditVerseDialog(object): def setupUi(self, EditVerseDialog): EditVerseDialog.setObjectName("EditVerseDialog") - EditVerseDialog.resize(492, 494) + EditVerseDialog.resize(500, 521) EditVerseDialog.setModal(True) - self.widget = QtGui.QWidget(EditVerseDialog) - self.widget.setGeometry(QtCore.QRect(9, 12, 471, 471)) - self.widget.setObjectName("widget") - self.verticalLayout = QtGui.QVBoxLayout(self.widget) - self.verticalLayout.setObjectName("verticalLayout") + self.layoutWidget = QtGui.QWidget(EditVerseDialog) + self.layoutWidget.setGeometry(QtCore.QRect(11, 1, 471, 491)) + self.layoutWidget.setObjectName("layoutWidget") + self.verticalLayout_3 = QtGui.QVBoxLayout(self.layoutWidget) + self.verticalLayout_3.setObjectName("verticalLayout_3") self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") - self.VerseListComboBox = QtGui.QComboBox(self.widget) + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.VerseTypeLabel = QtGui.QLabel(self.layoutWidget) + self.VerseTypeLabel.setTextFormat(QtCore.Qt.PlainText) + self.VerseTypeLabel.setAlignment(QtCore.Qt.AlignCenter) + self.VerseTypeLabel.setObjectName("VerseTypeLabel") + self.verticalLayout.addWidget(self.VerseTypeLabel) + self.VerseListComboBox = QtGui.QComboBox(self.layoutWidget) self.VerseListComboBox.setObjectName("VerseListComboBox") self.VerseListComboBox.addItem("") - self.VerseListComboBox.setItemText(0, "") self.VerseListComboBox.addItem("") self.VerseListComboBox.addItem("") self.VerseListComboBox.addItem("") - self.horizontalLayout.addWidget(self.VerseListComboBox) - self.SubVerseListComboBox = QtGui.QComboBox(self.widget) + self.VerseListComboBox.addItem("") + self.VerseListComboBox.addItem("") + self.VerseListComboBox.addItem("") + self.verticalLayout.addWidget(self.VerseListComboBox) + self.horizontalLayout.addLayout(self.verticalLayout) + self.verticalLayout_2 = QtGui.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.VerseNumberLabel = QtGui.QLabel(self.layoutWidget) + self.VerseNumberLabel.setAlignment(QtCore.Qt.AlignCenter) + self.VerseNumberLabel.setObjectName("VerseNumberLabel") + self.verticalLayout_2.addWidget(self.VerseNumberLabel) + self.SubVerseListComboBox = QtGui.QComboBox(self.layoutWidget) self.SubVerseListComboBox.setObjectName("SubVerseListComboBox") - self.SubVerseListComboBox.addItem("") - self.SubVerseListComboBox.setItemText(0, "") - self.SubVerseListComboBox.addItem("") - self.SubVerseListComboBox.addItem("") - self.SubVerseListComboBox.addItem("") - self.SubVerseListComboBox.addItem("") - 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.verticalLayout.addLayout(self.horizontalLayout) - self.VerseTextEdit = QtGui.QTextEdit(self.widget) + self.verticalLayout_2.addWidget(self.SubVerseListComboBox) + self.horizontalLayout.addLayout(self.verticalLayout_2) + self.verticalLayout_3.addLayout(self.horizontalLayout) + self.VerseTextEdit = QtGui.QTextEdit(self.layoutWidget) self.VerseTextEdit.setAcceptRichText(False) self.VerseTextEdit.setObjectName("VerseTextEdit") - self.verticalLayout.addWidget(self.VerseTextEdit) + self.verticalLayout_3.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 = QtGui.QPushButton(self.layoutWidget) self.addBridge.setObjectName("addBridge") self.horizontalLayout_2.addWidget(self.addBridge) - self.verticalLayout.addLayout(self.horizontalLayout_2) - self.ButtonBox = QtGui.QDialogButtonBox(self.widget) + self.addVerse = QtGui.QPushButton(self.layoutWidget) + self.addVerse.setObjectName("addVerse") + self.horizontalLayout_2.addWidget(self.addVerse) + self.addChorus = QtGui.QPushButton(self.layoutWidget) + self.addChorus.setObjectName("addChorus") + self.horizontalLayout_2.addWidget(self.addChorus) + self.verticalLayout_3.addLayout(self.horizontalLayout_2) + self.horizontalLayout_3 = QtGui.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.addPreChorus = QtGui.QPushButton(self.layoutWidget) + self.addPreChorus.setObjectName("addPreChorus") + self.horizontalLayout_3.addWidget(self.addPreChorus) + self.addIntro = QtGui.QPushButton(self.layoutWidget) + self.addIntro.setObjectName("addIntro") + self.horizontalLayout_3.addWidget(self.addIntro) + self.addOther = QtGui.QPushButton(self.layoutWidget) + self.addOther.setObjectName("addOther") + self.horizontalLayout_3.addWidget(self.addOther) + self.addEnding = QtGui.QPushButton(self.layoutWidget) + self.addEnding.setObjectName("addEnding") + self.horizontalLayout_3.addWidget(self.addEnding) + self.verticalLayout_3.addLayout(self.horizontalLayout_3) + self.ButtonBox = QtGui.QDialogButtonBox(self.layoutWidget) self.ButtonBox.setOrientation(QtCore.Qt.Horizontal) self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) self.ButtonBox.setObjectName("ButtonBox") - self.verticalLayout.addWidget(self.ButtonBox) + self.verticalLayout_3.addWidget(self.ButtonBox) self.retranslateUi(EditVerseDialog) QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL("accepted()"), EditVerseDialog.accept) @@ -91,20 +94,20 @@ class Ui_EditVerseDialog(object): def retranslateUi(self, EditVerseDialog): EditVerseDialog.setWindowTitle(QtGui.QApplication.translate("EditVerseDialog", "Edit Verse", None, QtGui.QApplication.UnicodeUTF8)) + self.VerseTypeLabel.setText(QtGui.QApplication.translate("EditVerseDialog", "Verse Type", None, QtGui.QApplication.UnicodeUTF8)) + self.VerseListComboBox.setItemText(0, QtGui.QApplication.translate("EditVerseDialog", "Intro", 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", "Chorus", None, QtGui.QApplication.UnicodeUTF8)) - self.VerseListComboBox.setItemText(3, QtGui.QApplication.translate("EditVerseDialog", "Bridge", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(1, QtGui.QApplication.translate("EditVerseDialog", "1", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(2, QtGui.QApplication.translate("EditVerseDialog", "1a", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(3, QtGui.QApplication.translate("EditVerseDialog", "1b", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(4, QtGui.QApplication.translate("EditVerseDialog", "2", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(5, QtGui.QApplication.translate("EditVerseDialog", "2a", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(6, QtGui.QApplication.translate("EditVerseDialog", "2b", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(7, QtGui.QApplication.translate("EditVerseDialog", "3", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(8, QtGui.QApplication.translate("EditVerseDialog", "4", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(9, QtGui.QApplication.translate("EditVerseDialog", "5", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(10, QtGui.QApplication.translate("EditVerseDialog", "6", None, QtGui.QApplication.UnicodeUTF8)) - self.SubVerseListComboBox.setItemText(11, QtGui.QApplication.translate("EditVerseDialog", "7", None, QtGui.QApplication.UnicodeUTF8)) + self.VerseListComboBox.setItemText(2, QtGui.QApplication.translate("EditVerseDialog", "Pre-Chorus", None, QtGui.QApplication.UnicodeUTF8)) + self.VerseListComboBox.setItemText(3, QtGui.QApplication.translate("EditVerseDialog", "Chorus", None, QtGui.QApplication.UnicodeUTF8)) + self.VerseListComboBox.setItemText(4, QtGui.QApplication.translate("EditVerseDialog", "Bridge", None, QtGui.QApplication.UnicodeUTF8)) + self.VerseListComboBox.setItemText(5, QtGui.QApplication.translate("EditVerseDialog", "Ending", None, QtGui.QApplication.UnicodeUTF8)) + self.VerseListComboBox.setItemText(6, QtGui.QApplication.translate("EditVerseDialog", "Other", None, QtGui.QApplication.UnicodeUTF8)) + self.VerseNumberLabel.setText(QtGui.QApplication.translate("EditVerseDialog", "Number", None, QtGui.QApplication.UnicodeUTF8)) + self.addBridge.setText(QtGui.QApplication.translate("EditVerseDialog", "Bridge", None, QtGui.QApplication.UnicodeUTF8)) self.addVerse.setText(QtGui.QApplication.translate("EditVerseDialog", "Verse", 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)) + self.addPreChorus.setText(QtGui.QApplication.translate("EditVerseDialog", "Pre-Chorus", None, QtGui.QApplication.UnicodeUTF8)) + self.addIntro.setText(QtGui.QApplication.translate("EditVerseDialog", "Intro", None, QtGui.QApplication.UnicodeUTF8)) + self.addOther.setText(QtGui.QApplication.translate("EditVerseDialog", "Other", None, QtGui.QApplication.UnicodeUTF8)) + self.addEnding.setText(QtGui.QApplication.translate("EditVerseDialog", "Ending", None, QtGui.QApplication.UnicodeUTF8)) + diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index 5f46dd5ef..1f92fbbd8 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -42,17 +42,39 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.SIGNAL(u'clicked()'), self.onAddChorus) QtCore.QObject.connect(self.addBridge, QtCore.SIGNAL(u'clicked()'), self.onAddBridge) + QtCore.QObject.connect(self.addIntro, + QtCore.SIGNAL(u'clicked()'), self.onAddIntro) + QtCore.QObject.connect(self.addOther, + QtCore.SIGNAL(u'clicked()'), self.onAddOther) + QtCore.QObject.connect(self.addPreChorus, + QtCore.SIGNAL(u'clicked()'), self.onAddPreChorus) + QtCore.QObject.connect(self.addEnding, + QtCore.SIGNAL(u'clicked()'), self.onAddEnding) + QtCore.QObject.connect(self.VerseListComboBox, + QtCore.SIGNAL(u'activated(int)'), self.onVerseComboChanged) + + def onAddIntro(self): + self.VerseTextEdit.insertPlainText(u'---[Intro:1]---') + + def onAddEnding(self): + self.VerseTextEdit.insertPlainText(u'---[Ending:1]---') + + def onAddOther(self): + self.VerseTextEdit.insertPlainText(u'---[Other:1]---') + + def onAddPreChorus(self): + self.VerseTextEdit.insertPlainText(u'---[PreChorus:1]---') def onAddBridge(self): - self.VerseTextEdit.insertPlainText(u'---[Bridge:1]---\n') + self.VerseTextEdit.insertPlainText(u'---[Bridge:1]---') def onAddChorus(self): - self.VerseTextEdit.insertPlainText(u'---[Chorus:1]---\n') + self.VerseTextEdit.insertPlainText(u'---[Chorus:1]---') def onAddVerse(self): - self.VerseTextEdit.insertPlainText(u'---[Verse:1]---\n') + self.VerseTextEdit.insertPlainText(u'---[Verse:1]---') - def setVerse(self, text, single=False, tag=0): + def setVerse(self, text, verseCount=0, single=False, tag=u'Verse:1'): posVerse = 0 posSub = 0 if single: @@ -65,19 +87,31 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): posSub = 0 self.VerseListComboBox.setEnabled(True) self.SubVerseListComboBox.setEnabled(True) + self.SubVerseListComboBox.clear() + for i in range(1, verseCount + 1): + self.SubVerseListComboBox.addItem(u'%s'% i) self.addBridge.setEnabled(False) self.addChorus.setEnabled(False) self.addVerse.setEnabled(False) + self.addIntro.setEnabled(False) + self.addPreChorus.setEnabled(False) + self.addOther.setEnabled(False) + self.addEnding.setEnabled(False) else: self.VerseListComboBox.setEnabled(False) self.SubVerseListComboBox.setEnabled(False) self.addBridge.setEnabled(True) self.addChorus.setEnabled(True) self.addVerse.setEnabled(True) + self.addIntro.setEnabled(True) + self.addPreChorus.setEnabled(True) + self.addOther.setEnabled(True) + self.addEnding.setEnabled(True) self.VerseListComboBox.setCurrentIndex(posVerse) self.SubVerseListComboBox.setCurrentIndex(posSub) self.VerseTextEdit.setPlainText(text) self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason) + self.onVerseComboChanged(0) def getVerse(self): return self.VerseTextEdit.toPlainText(), \ @@ -86,3 +120,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): def getVerseAll(self): return self.VerseTextEdit.toPlainText() + + def onVerseComboChanged(self, id): + if unicode(self.VerseListComboBox.currentText()) == u'Verse': + self.SubVerseListComboBox.setEnabled(True) + else: + self.SubVerseListComboBox.setEnabled(False) + self.SubVerseListComboBox.setCurrentIndex(0) diff --git a/resources/forms/editversedialog.ui b/resources/forms/editversedialog.ui index e629eaa87..e0917f44d 100644 --- a/resources/forms/editversedialog.ui +++ b/resources/forms/editversedialog.ui @@ -6,115 +6,100 @@ 0 0 - 492 - 494 + 500 + 521 - Dialog + Edit Verse true - + - 9 - 12 + 11 + 1 471 - 471 + 491 - + - + - - - + + + Verse Type + + + Qt::PlainText + + + Qt::AlignCenter + + - - Verse - + + + + Intro + + + + + Verse + + + + + Pre-Chorus + + + + + Chorus + + + + + Bridge + + + + + Ending + + + + + Other + + + - - - Chorus - - - - - Bridge - - - + - + - - - + + + Number + + + Qt::AlignCenter + + - - 1 - + - - - 1a - - - - - 1b - - - - - 2 - - - - - 2a - - - - - 2b - - - - - 3 - - - - - 4 - - - - - 5 - - - - - 6 - - - - - 7 - - - + @@ -127,6 +112,13 @@ + + + + Bridge + + + @@ -141,10 +133,35 @@ + + + + - + - Bridge + Pre-Chorus + + + + + + + Intro + + + + + + + Other + + + + + + + Ending From 250fd4e41bdff9ec0ae5400adb7541b8c57be2d8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Dec 2009 08:55:15 +0000 Subject: [PATCH 03/13] Fix Icons on toolbar --- openlp/core/lib/toolbar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 5cc14f89b..d5d91ca6d 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -106,7 +106,8 @@ class OpenLPToolbar(QtGui.QToolBar): ``title`` The title of the icon to search for. """ - if self.icons.has_key(title): + title = QtCore.QString(title) + if self.icons[title]: return self.icons[title] else: self.log.error(u'getIconFromTitle - no icon for %s' % title) From ca7d032aa50ccb761e10956315d66c0e9542d2b8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Dec 2009 09:20:40 +0000 Subject: [PATCH 04/13] Correct Icon Path --- openlp/core/lib/__init__.py | 5 +++-- openlp/core/lib/mediamanageritem.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 22fe0b674..0a183e4b3 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -105,8 +105,9 @@ def build_icon(icon): ButtonIcon.addPixmap( QtGui.QPixmap(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) else: - ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), - QtGui.QIcon.Normal, QtGui.QIcon.Off) + if len(icon) < 5: + ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), + QtGui.QIcon.Normal, QtGui.QIcon.Off) elif type(icon) is QtGui.QImage: ButtonIcon = QtGui.QIcon() ButtonIcon.addPixmap( diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 5cb6df728..d9b078e9e 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -213,26 +213,26 @@ class MediaManagerItem(QtGui.QWidget): self.addToolbarButton( u'Load %s' % self.PluginNameShort, u'%s %s' % (self.trUtf8('Load a new'), self.PluginNameVisible), - u':%s_load.png' % self.IconPath, self.onFileClick) + u':/%s_load.png' % self.IconPath, self.onFileClick) ## New Button ## if self.hasNewIcon: self.addToolbarButton( u'New %s' % self.PluginNameShort, u'%s %s' % (self.trUtf8('Add a new'), self.PluginNameVisible), - u':%s_new.png' % self.IconPath, self.onNewClick) + u':/%s_new.png' % self.IconPath, self.onNewClick) ## Edit Button ## if self.hasEditIcon: self.addToolbarButton( u'Edit %s' % self.PluginNameShort, u'%s %s' % (self.trUtf8('Edit the selected'), self.PluginNameVisible), - u':%s_edit.png' % self.IconPath, self.onEditClick) + u':/%s_edit.png' % self.IconPath, self.onEditClick) ## Delete Button ## if self.hasDeleteIcon: self.addToolbarButton( u'Delete %s' % self.PluginNameShort, self.trUtf8('Delete the selected item'), - u':%s_delete.png' % self.IconPath, self.onDeleteClick) + u':/%s_delete.png' % self.IconPath, self.onDeleteClick) ## Separator Line ## self.addToolbarSeparator() ## Preview ## From a2ff6433bad9c37420997fe9d681a7ff8a3b00c9 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Dec 2009 10:59:54 +0000 Subject: [PATCH 05/13] Build Dynamic Icons for SlideController --- openlp/core/lib/__init__.py | 18 +++++++++++++++++- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/ui/slidecontroller.py | 9 ++++----- resources/images/openlp-2.qrc | 15 +-------------- resources/images/page_1.png | Bin 409 -> 0 bytes resources/images/page_10.png | Bin 357 -> 0 bytes resources/images/page_11.png | Bin 357 -> 0 bytes resources/images/page_12.png | Bin 357 -> 0 bytes resources/images/page_2.png | Bin 396 -> 0 bytes resources/images/page_3.png | Bin 388 -> 0 bytes resources/images/page_4.png | Bin 390 -> 0 bytes resources/images/page_5.png | Bin 400 -> 0 bytes resources/images/page_6.png | Bin 357 -> 0 bytes resources/images/page_7.png | Bin 357 -> 0 bytes resources/images/page_8.png | Bin 357 -> 0 bytes resources/images/page_9.png | Bin 357 -> 0 bytes resources/images/page_bridge.png | Bin 406 -> 0 bytes resources/images/page_chorus.png | Bin 402 -> 0 bytes 18 files changed, 23 insertions(+), 21 deletions(-) delete mode 100644 resources/images/page_1.png delete mode 100644 resources/images/page_10.png delete mode 100644 resources/images/page_11.png delete mode 100644 resources/images/page_12.png delete mode 100644 resources/images/page_2.png delete mode 100644 resources/images/page_3.png delete mode 100644 resources/images/page_4.png delete mode 100644 resources/images/page_5.png delete mode 100644 resources/images/page_6.png delete mode 100644 resources/images/page_7.png delete mode 100644 resources/images/page_8.png delete mode 100644 resources/images/page_9.png delete mode 100644 resources/images/page_bridge.png delete mode 100644 resources/images/page_chorus.png diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 0a183e4b3..d6e4b6911 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -105,9 +105,25 @@ def build_icon(icon): ButtonIcon.addPixmap( QtGui.QPixmap(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) else: - if len(icon) < 5: + if len(icon) > 2: ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), QtGui.QIcon.Normal, QtGui.QIcon.Off) + else: + #lets build a Icon from text + pmap = QtGui.QPixmap(u':/pages/slide.png') + painter = QtGui.QPainter(pmap) + painter.setPen(QtGui.QColor(QtGui.QColor.black)) + font = QtGui.QFont() + font.setFamily(u'Arial') + font.setBold(True) + font.setPointSize(12) + painter.setFont(font) + metrics = QtGui.QFontMetrics(font) + painter.drawText(5, 3 + metrics.ascent(), icon) + painter.end() + ButtonIcon.addPixmap( + pmap, QtGui.QIcon.Normal, QtGui.QIcon.Off) + elif type(icon) is QtGui.QImage: ButtonIcon = QtGui.QIcon() ButtonIcon.addPixmap( diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index d9b078e9e..b85eb30e7 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -269,7 +269,7 @@ class MediaManagerItem(QtGui.QWidget): if self.hasEditIcon: self.ListView.addAction( contextMenuAction( - self.ListView, u':%s_new.png' % self.IconPath, + self.ListView, u':/%s_new.png' % self.IconPath, u'%s %s' % (self.trUtf8('&Edit'), self.PluginNameVisible), self.onEditClick)) self.ListView.addAction(contextMenuSeparator(self.ListView)) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index ac6a759a8..04c923901 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -173,7 +173,7 @@ class SlideController(QtGui.QWidget): self.trUtf8('Move to live'), self.onGoLive) self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( - u'Edit Song', u':songs/song_edit.png', + u'Edit Song', u':/songs/song_edit.png', self.trUtf8('Edit and re-preview Song'), self.onEditSong) if isLive: self.Toolbar.addToolbarSeparator(u'Loop Separator') @@ -210,16 +210,16 @@ class SlideController(QtGui.QWidget): if isLive: self.Songbar = OpenLPToolbar(self) self.Songbar.addToolbarButton( - u'Bridge:1', u':/pages/page_bridge.png', + u'Bridge:1', u'B', self.trUtf8('Bridge'), self.onSongBarHandler) self.Songbar.addToolbarButton( - u'Chorus:1', u':/pages/page_chorus.png', + u'Chorus:1', u'C', self.trUtf8('Chorus'), self.onSongBarHandler) for verse in range(1, 12): self.Songbar.addToolbarButton( - unicode(u'Verse:%s'% verse), u':/pages/page_%s.png' % verse, + unicode(u'Verse:%s'% verse), u'%s' % verse, unicode(self.trUtf8('Verse %s'))% verse, self.onSongBarHandler) self.ControllerLayout.addWidget(self.Songbar) @@ -488,7 +488,6 @@ class SlideController(QtGui.QWidget): if self.isLive: self.serviceItem.request_audit() log.debug(u'displayServiceManagerItems End') - print self.slideList #Screen event methods def onSlideSelectedFirst(self): diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index c9d81cf89..244a70d29 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -126,19 +126,6 @@ theme_import.png - page_chorus.png - page_bridge.png - page_1.png - page_2.png - page_3.png - page_4.png - page_5.png - page_6.png - page_7.png - page_8.png - page_9.png - page_10.png - page_11.png - page_12.png + slide.png diff --git a/resources/images/page_1.png b/resources/images/page_1.png deleted file mode 100644 index 091ab47f0cbe0dd6547842ea615d7063b91a0d86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 409 zcmV;K0cQS*P)jl|gQUFc3xmjER&WBu>&*7P)nlsE3H6id9bnLP>>f z+(ihCjb%!z_OFbG|2&>C1{id?eBif|43dHCwQ|Oom!Mge;c(cGyi5k~_b=@CZ*XoM zlnAJ*Pk$l#ptS}O!CH&5EEj=wT@TqRXsuJ=4$KUqex4Elxs|4AK*KyUL+dUDHegm@ z7GRp%(6%iApePD3^El6}ptawdSt*oK==KiGT02cThuxT& z%yJqpf{igCqKApRlb8e(5yE5YfxE7oOwPet3nk*4%_a(#-YEFlfTu~;QOY?t11FpJ zY#K$%AQg*`4Ikt!%N)<}CknkDSSf#dYZQ9_3!JWP8ti+68o!=#=>0QrmI}_kKKUG6 z+6&;|xUIPHL$3$U^DU0Y(@TGlJm1EH=kxnI+5+Pn3&43lk)U3&00000NkvXXu0mjf Dzy`Af diff --git a/resources/images/page_10.png b/resources/images/page_10.png deleted file mode 100644 index a4b2f7491a6f9df0cfb8fd9c178eea67df938afe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 diff --git a/resources/images/page_11.png b/resources/images/page_11.png deleted file mode 100644 index a4b2f7491a6f9df0cfb8fd9c178eea67df938afe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 diff --git a/resources/images/page_12.png b/resources/images/page_12.png deleted file mode 100644 index a4b2f7491a6f9df0cfb8fd9c178eea67df938afe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 diff --git a/resources/images/page_2.png b/resources/images/page_2.png deleted file mode 100644 index c4661947f3994cc4e832d88badb0f853385f9c06..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 396 zcmV;70dxL|P)jmCJ5}Fc3xW%or*5hA-)gMgBT!)Q^awidDY^vT%iY zbP-;50EblVtPG=jn8yWxJ}#F}{5IwcnkTN;ysPW_C8$yg$743~)I4eJH?r&vUAGTP z1myXb|DgGWa}Gp=rfHC-X%tu#MPIGJIkyF_z|0_OqtLP}L3Hn&nc-Zu1+Kv?VD7=> zt-uSu-KH}Oobz|{FbWYt+xFmo*w$KTtzoSN0BB<%BBM?uItmA+6qNFALu);@JXJZJ zqu`j;*1$ycp!L92bzeZ!G+wJiBuTOeo@*Du!vaE4topfj5j-qyu+f$)D9DWqUjj2f zw*TyF7;3$KMB*b@i%|Pt;Psit!M@f5KjVhA2(^C(R$EB`>y``L5&;Kx+wsK@wI0}* q15T&+m;NBe9F~*k^T$3~gz*DcH*+)BCo!G?0000jl}m1eFc60S85<>H!%4bgky}TNdWa~hSoI`ylY%j1 zQ63&+$u&jq3gP*pjvC3PUXzguJeBXLRr3G81_Ml zfU5eC2e}(#42THUS`~!QpTiqg*0Rf>Wa=(_hv^ zw9*Q2+kQ8|S}RhWEX%SW*wqHXQv-ZaDtcEN1W!#Pf6M}7=fC4OT!5L^=>u4gUEm;J zEAmk)U4oeT+W!K_KjAc3Y6bWw(-1RX`)6Ri<=nd6c7nZe+i~OjS^>`UBhKg7r~V*$ iehfP=m$!Yi1mgh+RBSS*!=_aL0000jl}m1eKn#X|d!|anhLd!~BDanj^$<~1vFb@+lY)74 z!9(L=U;>qD3CV-?fB2;V80~)l!e7m0kQ;bB^1f-BLr`liE|+ZPSvUB6{vgZV(f9kH zL_nT@>kqjH5djgQZCj*i8U+?bF=lHZB3s}Z%nYI~3N6bLL__7w43T;Z+<@7Dc?1(- ztuM^%_y!_+Hj7pmW6*W+jEynMkF-Kyt%bGf^=wsD;dDAJG7f>+J;YXR=%vj5^bpZP zt5U1$VE}F0s!{;}M0j)h?Plz1gWzcZzGyA`kTwXOhBmFylxfH(Z(ICbl}&DgFc5{`%s5iQCMW4Ci`+VD)I&s3#i}PE3#c&0 zSr8-JF}9%UNEU|Y_xWcA0A6vsedDj;GsqY2_u3A_unDS^!ufofdCC{N?iZ)i2drHO zB?9XDC!EN?(OQFuV2r`>cq{^&rg^Papta6{doVMI#v=6bcz|fyIWt4+KF~P?4`3EB zdyk2djhVeB(0a&$HADm=5)A6v7O)mw+s=JA&b7i(XegziRPY#w!(ra?ydtk(1eZ!} z2~0$9-T>V9Qv!@J5RvKX>AT%73HH57uuFh5#b@opTKfi$lNW%;aVj%cMoW>>oi_<) zPOlKDiK5pt_6A^)aC<4h(nPVBbK;sPfb(aY2Z!DO9A|n>#NK}ctDKmuhHc=e+*W+? uv*lJ*dt5G`oBkkGwNH!J>(@G3f$;?ReRwgT@Ldi70000;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 diff --git a/resources/images/page_7.png b/resources/images/page_7.png deleted file mode 100644 index a4b2f7491a6f9df0cfb8fd9c178eea67df938afe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 diff --git a/resources/images/page_8.png b/resources/images/page_8.png deleted file mode 100644 index a4b2f7491a6f9df0cfb8fd9c178eea67df938afe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 diff --git a/resources/images/page_9.png b/resources/images/page_9.png deleted file mode 100644 index a4b2f7491a6f9df0cfb8fd9c178eea67df938afe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85md&fiUBq^AjY1g6t)pzOL*y**JLA#CjRON&;}dR!5?U!&f@c)}4A-*fAE z4K_>3C~`h|)1-P(=h_1nO@~j17}HkTbqO#%yUE`Ep+F>lL-{fOhf{<+oF)}(cNF=C z7xa9TYulc;cYoV;uJFUVTiq`4PH$WtGy9rW^;W;|vjsPQhZ~q5SaUW)I&IB=R{Q+B yVfG&P-xpZyF}tf!yZ`sk4;3}HYi2$>rf$R#%egY(^KGDq89ZJ6T-G@yGywn!|B%f9 diff --git a/resources/images/page_bridge.png b/resources/images/page_bridge.png deleted file mode 100644 index 7d81a4a711b9d1d735167921f7086fa5ca604bdd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmV;H0crk;P)bmCtI!Fbu{&Nj{WZ))(0+hrV@L*+Y~va@vbDCD0Mu z@eY|Y+j0Jm2@FX-^ph;f4)9~w>j(a7A%jBUcB`B*W*1Z`h101Vcq$a1&o7kaE1cT~ zB?7AIGY%BKXstm+u-4+`c$|gR_j{17Kx-Z89D`dhGl=>fJ?a{8Zdi}H?!N&bqG2&J zv~K4zHeePocYRc5G)?oH1@pwSKO{$Yd!(O=Mh(EZAB*$||)`TLc?p zhMH{w6A{uejlgZ&Mou}fD3#T`Zx-wu5Q2%QAJo8H*C7o#+dSViKW^l+N={51CicyO znUg8-z$D|`(M)}#9f?ddD>x+CKpEe4;Du~gfOFMbXQ^)lo}1exOMU+htmedAlXilG zk=c0Lr{flZi{gOu`EA!9q$mz~@p5_JMq6Nf13+to!pMG#@&Et;07*qoM6N<$f~cgd A#Q*>R diff --git a/resources/images/page_chorus.png b/resources/images/page_chorus.png deleted file mode 100644 index 80c3a6d53633b9d437eed59c5e46e115180714f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 402 zcmV;D0d4+?P)jl}&EKFc5{`%w&PG$w|6m!L3nI4}nm{suv*$kt%jF zEU3ZbBu+!6J}Ju2)B8M{u^iw>`~4^Ws+d8saX1{+d;b!&C<<&g>j$rh&8GRrdi@5~ zWl$pEc>J;p#V^h|5D~hrLseDx#Dwb8DXLcBoHIUKa0_Mz5m~4zpo(){<6PH(Dv0QD zF*BTNa}|3q3z&NYy<9H$D)?E4eHJ)pXESJph@kK9;O2S-ng${=Xhr-@WY~&PaMyK% zs#3+?EZBSh=-Co55h2~C2Hdu-35EMuE7C Date: Wed, 2 Dec 2009 11:22:48 +0000 Subject: [PATCH 06/13] Verse Tagging complete --- openlp/core/ui/slidecontroller.py | 55 +++++++++++++------------------ 1 file changed, 22 insertions(+), 33 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 04c923901..0465ca471 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -209,19 +209,25 @@ class SlideController(QtGui.QWidget): # Build the Song Toolbar if isLive: self.Songbar = OpenLPToolbar(self) - self.Songbar.addToolbarButton( - u'Bridge:1', u'B', - self.trUtf8('Bridge'), - self.onSongBarHandler) - self.Songbar.addToolbarButton( - u'Chorus:1', u'C', - self.trUtf8('Chorus'), - self.onSongBarHandler) + self.Songbar.addToolbarButton(u'Intro:1', u'I', + self.trUtf8('Intro'),self.onSongBarHandler) + self.Songbar.addToolbarButton(u'Bridge:1', u'B', + self.trUtf8('Bridge'),self.onSongBarHandler) + self.Songbar.addToolbarButton(u'PreChorus:1', u'P', + self.trUtf8('PreChorus'), self.onSongBarHandler) + self.Songbar.addToolbarButton(u'Chorus:1', u'C', + self.trUtf8('Chorus'), self.onSongBarHandler) + self.Songbar.addToolbarButton(u'Tag:1', u'T', + self.trUtf8('Tag'), self.onSongBarHandler) for verse in range(1, 12): self.Songbar.addToolbarButton( unicode(u'Verse:%s'% verse), u'%s' % verse, unicode(self.trUtf8('Verse %s'))% verse, self.onSongBarHandler) + self.Songbar.addToolbarButton(u'Other:1', u'O', + self.trUtf8('Other'), self.onSongBarHandler) + self.Songbar.addToolbarButton(u'Ending:1', u'E', + self.trUtf8('Ending'), self.onSongBarHandler) self.ControllerLayout.addWidget(self.Songbar) self.Songbar.setVisible(False) # Screen preview area @@ -313,18 +319,13 @@ class SlideController(QtGui.QWidget): def onSongBarHandler(self): request = unicode(self.sender().text()) - if request == u'Bridge': - a=c - elif request == u'Chorus': - a=c + #Remember list is 1 out! + slideno = self.slideList[request] + if slideno > self.PreviewListWidget.rowCount(): + self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) else: - #Remember list is 1 out! - slideno = self.slideList[request] - if slideno > self.PreviewListWidget.rowCount(): - self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) - else: - self.PreviewListWidget.selectRow(slideno) - self.onSlideSelected() + self.PreviewListWidget.selectRow(slideno) + self.onSlideSelected() def receiveSpinDelay(self, value): self.DelaySpinBox.setValue(int(value)) @@ -354,20 +355,8 @@ class SlideController(QtGui.QWidget): for action in self.Songbar.actions: self.Songbar.actions[action].setVisible(False) if item.verse_order: - verses = item.verse_order.split(u' ') - for verse in verses: - if verse is not u' ': - pass - try: - if verse == u'C': - self.Songbar.actions[u'Chorus:1'].setVisible(True) - elif verse == u'B': - self.Songbar.actions[u'Bridge:1'].setVisible(True) - else: - vse = u'Verse:%s' % verse - self.Songbar.actions[vse].setVisible(True) - except: - pass + for slide in self.slideList: + self.Songbar.actions[slide].setVisible(True) self.Songbar.setVisible(True) elif item.is_image(): #Not sensible to allow loops with 1 frame From 547074d29a7b1c0cf739bc082e85b9de9d48c4b3 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 4 Dec 2009 18:52:44 +0000 Subject: [PATCH 07/13] Verse tagging verses must be in format of vX --- openlp/plugins/songs/forms/editsongform.py | 24 +++++++++++++++------- openlp/plugins/songs/lib/mediaitem.py | 4 ++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index dcda4ae52..c664e4060 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -401,14 +401,24 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.AuthorsListView.count() == 0: self.SongTabWidget.setCurrentIndex(2) self.AuthorsListView.setFocus() - for verse in unicode(self.VerseOrderEdit.text()): - if verse.isdigit() or u' BCITPEO'.find(verse.upper()) > -1: - pass + for verse in unicode(self.VerseOrderEdit.text()).split(u' '): + if len(verse) == 2: + if verse[0:1] == u'v' and verse[1:].isdigit(): + pass + else: + self.SongTabWidget.setCurrentIndex(0) + self.VerseOrderEdit.setFocus() + return False, \ + self.trUtf8('Invalid verse entry - vX') else: - self.SongTabWidget.setCurrentIndex(0) - self.VerseOrderEdit.setFocus() - return False, \ - self.trUtf8('Invalid verse entry - values must be Numeric, I,B,C,T,P,E,O') + if u' BCITPEO'.find(verse.upper()) > -1: + pass + else: + self.SongTabWidget.setCurrentIndex(0) + self.VerseOrderEdit.setFocus() + return False, \ + self.trUtf8(\ + 'Invalid verse entry - values must be Numeric, I,B,C,T,P,E,O') return True, u'' def onTitleEditItemLostFocus(self): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index a6b909329..25db6bcda 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -297,11 +297,11 @@ class SongMediaItem(MediaManagerItem): for verse in verseList: service_item.add_from_text(verse[1][:30], unicode(verse[1])) else: - for order in service_item.verse_order: + for order in service_item.verse_order.split(u' '): for verse in verseList: if verse[1]: if verse[0][u'type'] == "Verse" and \ - verse[0][u'label'][0] == order[0]: + verse[0][u'label'][0] == order[1:]: verseTag = u'%s:%s' % \ (verse[0][u'type'], verse[0][u'label']) service_item.add_from_text\ From b8149cc8265398e5b95c6ea8f146b37932cbcfa5 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 4 Dec 2009 20:25:48 +0000 Subject: [PATCH 08/13] Fix up Icon code to use isinstance Fix up code to ignore cases when doing tests. --- openlp/core/lib/__init__.py | 6 +++--- openlp/core/ui/slidecontroller.py | 6 +++--- openlp/plugins/songs/forms/editsongform.py | 5 +++-- openlp/plugins/songs/lib/mediaitem.py | 11 +++++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index d6e4b6911..cbde91b17 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -97,9 +97,9 @@ def build_icon(icon): ``:/resource/file.png``, or a file location like ``/path/to/file.png``. """ ButtonIcon = None - if type(icon) is QtGui.QIcon: + if isinstance(icon, QtGui.QIcon): ButtonIcon = icon - elif type(icon) is types.StringType or type(icon) is types.UnicodeType: + elif isinstance(icon, basestring): ButtonIcon = QtGui.QIcon() if icon.startswith(u':/'): ButtonIcon.addPixmap( @@ -124,7 +124,7 @@ def build_icon(icon): ButtonIcon.addPixmap( pmap, QtGui.QIcon.Normal, QtGui.QIcon.Off) - elif type(icon) is QtGui.QImage: + elif isinstance(icon, QtGui.QImage): ButtonIcon = QtGui.QIcon() ButtonIcon.addPixmap( QtGui.QPixmap.fromImage(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 0465ca471..8feee8f87 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -356,7 +356,7 @@ class SlideController(QtGui.QWidget): self.Songbar.actions[action].setVisible(False) if item.verse_order: for slide in self.slideList: - self.Songbar.actions[slide].setVisible(True) + self.Songbar.actions[slide.lower()].setVisible(True) self.Songbar.setVisible(True) elif item.is_image(): #Not sensible to allow loops with 1 frame @@ -447,9 +447,9 @@ class SlideController(QtGui.QWidget): if self.serviceItem.is_text(): #only load the slot once try: - test = self.slideList[frame[u'verseTag']] + test = self.slideList[frame[u'verseTag'].lower()] except: - self.slideList[frame[u'verseTag']] = framenumber + self.slideList[frame[u'verseTag'].lower()] = framenumber item.setText(frame[u'text']) else: label = QtGui.QLabel() diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index c664e4060..e8cb4d1c0 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -401,7 +401,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.AuthorsListView.count() == 0: self.SongTabWidget.setCurrentIndex(2) self.AuthorsListView.setFocus() - for verse in unicode(self.VerseOrderEdit.text()).split(u' '): + #split the verse list by space and mark lower case for testing + for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '): if len(verse) == 2: if verse[0:1] == u'v' and verse[1:].isdigit(): pass @@ -411,7 +412,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): return False, \ self.trUtf8('Invalid verse entry - vX') else: - if u' BCITPEO'.find(verse.upper()) > -1: + if u' bcitped'.find(verse) > -1: pass else: self.SongTabWidget.setCurrentIndex(0) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 25db6bcda..b93ae178a 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -293,21 +293,24 @@ class SongMediaItem(MediaManagerItem): if song.lyrics.startswith(u' Date: Sat, 5 Dec 2009 08:05:11 +0000 Subject: [PATCH 09/13] Fix up song tagging so case does not matter Fix bug in transitions when using images Remove MediaTab as not wanted --- openlp/core/ui/maindisplay.py | 12 ++--- openlp/core/ui/slidecontroller.py | 13 +++--- openlp/plugins/media/lib/mediatab.py | 51 ---------------------- openlp/plugins/media/mediaplugin.py | 3 -- openlp/plugins/songs/forms/editsongform.py | 4 +- openlp/plugins/songs/lib/mediaitem.py | 15 ++++--- 6 files changed, 26 insertions(+), 72 deletions(-) delete mode 100644 openlp/plugins/media/lib/mediatab.py diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 0c8512b19..7a621a8ae 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -198,11 +198,13 @@ class MainDisplay(DisplayWidget): self.displayAlert() elif not self.displayBlank: if transition: - if self.hasTransition and self.frame[u'trans'] is not None: - self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame[u'trans'])) - self.repaint() - self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'trans'])) - self.repaint() + if self.hasTransition: + if self.frame[u'trans'] is not None: + self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame[u'trans'])) + self.repaint() + if frame[u'trans'] is not None: + self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'trans'])) + self.repaint() self.hasTransition = True self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'main'])) self.repaint() diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 8feee8f87..6eb17e397 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -354,9 +354,12 @@ class SlideController(QtGui.QWidget): str_to_bool(self.songsconfig.get_config(u'show songbar', True)): for action in self.Songbar.actions: self.Songbar.actions[action].setVisible(False) - if item.verse_order: - for slide in self.slideList: - self.Songbar.actions[slide.lower()].setVisible(True) + hasButtons = False + for slide in self.slideList: + if slide is not None: + self.Songbar.actions[slide].setVisible(True) + hasButtons = True + if hasButtons: self.Songbar.setVisible(True) elif item.is_image(): #Not sensible to allow loops with 1 frame @@ -447,9 +450,9 @@ class SlideController(QtGui.QWidget): if self.serviceItem.is_text(): #only load the slot once try: - test = self.slideList[frame[u'verseTag'].lower()] + test = self.slideList[frame[u'verseTag']] except: - self.slideList[frame[u'verseTag'].lower()] = framenumber + self.slideList[frame[u'verseTag']] = framenumber item.setText(frame[u'text']) else: label = QtGui.QLabel() diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py deleted file mode 100644 index 03ec2bce3..000000000 --- a/openlp/plugins/media/lib/mediatab.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 - -############################################################################### -# OpenLP - Open Source Lyrics Projection # -# --------------------------------------------------------------------------- # -# Copyright (c) 2008-2009 Raoul Snyman # -# Portions copyright (c) 2008-2009 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard # -# --------------------------------------------------------------------------- # -# This program is free software; you can redistribute it and/or modify it # -# under the terms of the GNU General Public License as published by the Free # -# Software Foundation; version 2 of the License. # -# # -# This program is distributed in the hope that it will be useful, but WITHOUT # -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # -# more details. # -# # -# You should have received a copy of the GNU General Public License along # -# with this program; if not, write to the Free Software Foundation, Inc., 59 # -# Temple Place, Suite 330, Boston, MA 02111-1307 USA # -############################################################################### - -from PyQt4 import QtCore, QtGui - -from openlp.core.lib import SettingsTab, str_to_bool - -class MediaTab(SettingsTab): - """ - mediaTab is the media settings tab in the settings dialog. - """ - def __init__(self, title, section=None): - SettingsTab.__init__(self, title, section) - - def setupUi(self): - self.setObjectName(u'MediaTab') - self.tabTitleVisible = self.trUtf8('Media') - #self.MediaLayout = QtGui.QFormLayout(self) - #self.MediaLayout.setObjectName(u'MediaLayout') - - def retranslateUi(self): - pass - - def load(self): - pass - - def save(self): - pass - diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 3729877d6..a84a4a917 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -40,9 +40,6 @@ class MediaPlugin(Plugin): # passed with drag and drop messages self.dnd_id = u'Media' - def get_settings_tab(self): - return MediaTab(self.name) - def initialise(self): log.info(u'Plugin Initialising') Plugin.initialise(self) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index e8cb4d1c0..dc5b522b4 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -369,7 +369,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for count, parts in enumerate(match.split(u']---\n')): if len(parts) > 1: if count == 0: - variant = parts + #make sure the tag is correctly cased + variant = u'%s%s' % \ + (parts[0:1].upper(), parts[1:].lower()) else: if parts.endswith(u'\n'): parts = parts.rstrip(u'\n') diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index b93ae178a..b677e8c1e 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -289,28 +289,29 @@ class SongMediaItem(MediaManagerItem): service_item.theme = song.theme_name service_item.edit_enabled = True service_item.editId = item_id - service_item.verse_order = song.verse_order if song.lyrics.startswith(u' Date: Sat, 5 Dec 2009 09:44:44 +0000 Subject: [PATCH 10/13] Remove the media tab correctly --- openlp/plugins/media/lib/__init__.py | 3 +-- openlp/plugins/media/mediaplugin.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/media/lib/__init__.py b/openlp/plugins/media/lib/__init__.py index 1b1c62cec..647ebcbcf 100644 --- a/openlp/plugins/media/lib/__init__.py +++ b/openlp/plugins/media/lib/__init__.py @@ -23,7 +23,6 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from mediatab import MediaTab from mediaitem import MediaMediaItem -__all__ = ['MediaTab', 'MediaMediaItem'] +__all__ = ['MediaMediaItem'] diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index a84a4a917..ccaff729f 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -26,7 +26,7 @@ import logging from openlp.core.lib import Plugin, build_icon -from openlp.plugins.media.lib import MediaTab, MediaMediaItem +from openlp.plugins.media.lib import MediaMediaItem class MediaPlugin(Plugin): global log From 583d96b5d15a6717537fbcbd1359465388289c76 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 6 Dec 2009 09:14:11 +0200 Subject: [PATCH 11/13] Song Verses Toolbar: Phase 1 - Convert verse icons to drop-down verse menu. --- openlp/core/lib/toolbar.py | 27 ++++++++++++------ openlp/core/ui/slidecontroller.py | 47 +++++++++++++++---------------- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 5cc14f89b..1b5a7b970 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -68,21 +68,30 @@ class OpenLPToolbar(QtGui.QToolBar): ``objectname`` The name of the object, as used in `