openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00244
[Merge] lp:~raoul-snyman/openlp/songmaintenance into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/songmaintenance into lp:openlp.
Requested reviews:
openlp.org Core (openlp-core)
Make the "Edit All" button work.
--
https://code.launchpad.net/~raoul-snyman/openlp/songmaintenance/+merge/11216
Your team openlp.org Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2009-09-02 01:44:09 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2009-09-04 17:19:54 +0000
@@ -22,8 +22,8 @@
from PyQt4 import Qt, QtCore, QtGui
-from openlp.core.lib import SongXMLBuilder, SongXMLParser, \
- translate, Receiver
+from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, \
+ translate
from openlp.plugins.songs.forms import EditVerseForm
from openlp.plugins.songs.lib.models import Song
from editsongdialog import Ui_EditSongDialog
@@ -61,6 +61,8 @@
QtCore.SIGNAL(u'clicked()'), self.onVerseAddButtonClicked)
QtCore.QObject.connect(self.VerseEditButton,
QtCore.SIGNAL(u'clicked()'), self.onVerseEditButtonClicked)
+ QtCore.QObject.connect(self.VerseEditAllButton,
+ QtCore.SIGNAL(u'clicked()'), self.onVerseEditAllButtonClicked)
QtCore.QObject.connect(self.VerseDeleteButton,
QtCore.SIGNAL(u'clicked()'), self.onVerseDeleteButtonClicked)
QtCore.QObject.connect(self.VerseListWidget,
@@ -287,6 +289,24 @@
self.VerseEditButton.setEnabled(False)
self.VerseDeleteButton.setEnabled(False)
+ def onVerseEditAllButtonClicked(self):
+ verse_list = u''
+ if self.VerseListWidget.count() > 0:
+ for row in range(0, self.VerseListWidget.count()):
+ item = self.VerseListWidget.item(row)
+ verse_list += item.text()
+ verse_list += u'\n\n'
+ self.verse_form.setVerse(verse_list)
+ else:
+ self.verse_form.setVerse(u'')
+ if self.verse_form.exec_():
+ verse_list = self.verse_form.getVerse()
+ verse_list = verse_list.replace(u'\r\n', u'\n')
+ self.VerseListWidget.clear()
+ for row in verse_list.split(u'\n\n'):
+ self.VerseListWidget.addItem(row)
+ self.VerseListWidget.repaint()
+
def onVerseDeleteButtonClicked(self):
item = self.VerseListWidget.takeItem(self.VerseListWidget.currentRow())
item = None
Follow ups