openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #04158
[Merge] lp:~googol-hush/openlp/songs into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/songs into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
- fix for bug #657694 (lines)
- enhanced the
--
https://code.launchpad.net/~googol-hush/openlp/songs/+merge/38141
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/songs into lp:openlp.
=== modified file 'openlp/plugins/songs/forms/editverseform.py'
--- openlp/plugins/songs/forms/editverseform.py 2010-09-14 18:18:47 +0000
+++ openlp/plugins/songs/forms/editverseform.py 2010-10-11 17:23:39 +0000
@@ -66,27 +66,16 @@
self.verseTextEdit.setFocus()
def onInsertButtonClicked(self):
- if self.verseTextEdit.textCursor().columnNumber() != 0:
- self.verseTextEdit.insertPlainText(u'\n')
verse_type = self.verseTypeComboBox.currentIndex()
- if verse_type == VerseType.Verse:
- self.insertVerse(VerseType.to_string(VerseType.Verse),
- self.verseNumberBox.value())
- elif verse_type == VerseType.Chorus:
- self.insertVerse(VerseType.to_string(VerseType.Chorus),
- self.verseNumberBox.value())
- elif verse_type == VerseType.Bridge:
- self.insertVerse(VerseType.to_string(VerseType.Bridge))
- elif verse_type == VerseType.PreChorus:
- self.insertVerse(VerseType.to_string(VerseType.PreChorus))
- elif verse_type == VerseType.Intro:
- self.insertVerse(VerseType.to_string(VerseType.Intro))
- elif verse_type == VerseType.Ending:
- self.insertVerse(VerseType.to_string(VerseType.Ending))
- elif verse_type == VerseType.Other:
- self.insertVerse(VerseType.to_string(VerseType.Other))
+ if VerseType.to_string(verse_type) is not None:
+ self.insertVerse(VerseType.to_string(verse_type),
+ self.verseNumberBox.value())
def onCursorPositionChanged(self):
+ """
+ Determines the previous verse type and number in regard to the cursor's
+ position and adjusts the ComboBox and SpinBox to these values.
+ """
position = self.verseTextEdit.textCursor().position()
text = unicode(self.verseTextEdit.toPlainText())
if not text:
Follow ups