try again and fix from last merge

This commit is contained in:
Tim Bentley 2010-06-06 17:25:39 +01:00
parent cb35fb7be4
commit 950dc73d2b
2 changed files with 5 additions and 4 deletions

View File

@ -33,11 +33,12 @@ class VerseType(object):
Intro = 4 Intro = 4
Ending = 5 Ending = 5
Other = 6 Other = 6
verse_string = u'verse'
@staticmethod @staticmethod
def to_string(verse_type): def to_string(verse_type):
if verse_type == VerseType.Verse: if verse_type == VerseType.Verse:
return translate('VerseType', 'Verse') return translate('VerseType', VerseType.verse_string.title())
elif verse_type == VerseType.Chorus: elif verse_type == VerseType.Chorus:
return translate('VerseType', 'Chorus') return translate('VerseType', 'Chorus')
elif verse_type == VerseType.Bridge: elif verse_type == VerseType.Bridge:
@ -54,7 +55,7 @@ class VerseType(object):
@staticmethod @staticmethod
def from_string(verse_type): def from_string(verse_type):
verse_type = verse_type.lower() verse_type = verse_type.lower()
if verse_type == translate('VerseType', 'verse'): if verse_type == translate('VerseType', VerseType.verse_string):
return VerseType.Verse return VerseType.Verse
elif verse_type == translate('VerseType', 'chorus'): elif verse_type == translate('VerseType', 'chorus'):
return VerseType.Chorus return VerseType.Chorus

View File

@ -198,8 +198,8 @@ class SongMediaItem(MediaManagerItem):
self.ListView.clear() self.ListView.clear()
for author in searchresults: for author in searchresults:
for song in author.songs: for song in author.songs:
song_detail = unicode(self.trUtf8('%s (%s)') % \ song_detail = unicode(self.trUtf8('%s (%s)') %
(author.display_name, song.title) (author.display_name, song.title))
song_name = QtGui.QListWidgetItem(song_detail) song_name = QtGui.QListWidgetItem(song_detail)
song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
self.ListView.addItem(song_name) self.ListView.addItem(song_name)