Fix Qstring bug

Update Combo code

bzr-revno: 834
This commit is contained in:
Meinert Jordan 2010-06-07 06:07:26 +01:00 committed by Tim Bentley
commit 3bc1482588
3 changed files with 11 additions and 6 deletions

View File

@ -60,8 +60,11 @@ class ImageMediaItem(MediaManagerItem):
def retranslateUi(self):
self.OnNewPrompt = self.trUtf8('Select Image(s)')
self.OnNewFileMasks = self.trUtf8(
'Images (*.jpg *.jpeg *.gif *.png *.bmp);; All files (*)')
file_formats = u''
for file_format in QtGui.QImageReader.supportedImageFormats():
file_formats += u'*.%s ' % file_format
self.OnNewFileMasks = unicode(
self.trUtf8('Images (%s);; All files (*)')) % file_formats
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)

View File

@ -103,8 +103,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
if match:
verse_type = match.group(1)
verse_number = int(match.group(2))
self.VerseTypeComboBox.setCurrentIndex(VerseType.from_string(verse_type))
self.VerseNumberBox.setValue(verse_number)
verse_type_index = VerseType.from_string(verse_type)
if verse_type_index:
self.VerseTypeComboBox.setCurrentIndex(verse_type_index)
self.VerseNumberBox.setValue(verse_number)
def setVerse(self, text, single=False,
tag=u'%s:1' % VerseType.to_string(VerseType.Verse)):

View File

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