forked from openlp/openlp
Bring Custom and Song editing in line
This commit is contained in:
parent
3ec9771a9c
commit
32ee1d36d4
@ -200,7 +200,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
|||||||
def onSaveButtonPressed(self):
|
def onSaveButtonPressed(self):
|
||||||
if self.editAll:
|
if self.editAll:
|
||||||
self.VerseListView.clear()
|
self.VerseListView.clear()
|
||||||
for row in unicode(self.VerseTextEdit.toPlainText()).split(u'---'):
|
for row in unicode(self.VerseTextEdit.toPlainText()).split(u'\n---\n'):
|
||||||
self.VerseListView.addItem(row)
|
self.VerseListView.addItem(row)
|
||||||
else:
|
else:
|
||||||
self.VerseListView.currentItem().setText(
|
self.VerseListView.currentItem().setText(
|
||||||
@ -227,15 +227,13 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
|||||||
self.EditAllButton.setEnabled(True)
|
self.EditAllButton.setEnabled(True)
|
||||||
|
|
||||||
def _validate(self):
|
def _validate(self):
|
||||||
valid = True
|
|
||||||
message = u''
|
|
||||||
if len(self.TitleEdit.displayText()) == 0:
|
if len(self.TitleEdit.displayText()) == 0:
|
||||||
valid = False
|
self.TitleEdit.setFocus()
|
||||||
message = translate(
|
return False, translate(
|
||||||
u'customEditDialog', u'You need to enter a title \n')
|
u'customEditDialog', u'You need to enter a title \n')
|
||||||
# must have 1 slide
|
# must have 1 slide
|
||||||
if self.VerseListView.count() == 0:
|
if self.VerseListView.count() == 0:
|
||||||
valid = False
|
self.VerseTextEdit.setFocus()
|
||||||
message += translate(
|
return False, translate(
|
||||||
u'customEditDialog', u'You need to enter a slide \n')
|
u'customEditDialog', u'You need to enter a slide \n')
|
||||||
return valid, message
|
return True, u''
|
||||||
|
@ -335,7 +335,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
verse_list = self.verse_form.getVerse()
|
verse_list = self.verse_form.getVerse()
|
||||||
verse_list = verse_list.replace(u'\r\n', u'\n')
|
verse_list = verse_list.replace(u'\r\n', u'\n')
|
||||||
self.VerseListWidget.clear()
|
self.VerseListWidget.clear()
|
||||||
for row in verse_list.split(u'---'):
|
for row in verse_list.split(u'\n---\n'):
|
||||||
self.VerseListWidget.addItem(row)
|
self.VerseListWidget.addItem(row)
|
||||||
self.VerseListWidget.repaint()
|
self.VerseListWidget.repaint()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user