Replace str with unicode

refresh the list screen when we change things
This commit is contained in:
Tim Bentley 2009-06-11 22:14:12 +01:00
parent 5871e3419d
commit 56680463c7
3 changed files with 13 additions and 10 deletions

View File

@ -165,7 +165,7 @@ class GeneralTab(SettingsTab):
def load(self):
for screen in self.screen_list:
screen_name = translate(u'GeneralTab', u'Screen') + u' ' + \
str(screen[u'number'] + 1)
unicode(screen[u'number'] + 1)
if screen[u'primary']:
screen_name = screen_name + u' (' + \
translate(u'GeneralTab', u'primary') + u')'
@ -174,9 +174,9 @@ class GeneralTab(SettingsTab):
self.MonitorNumber = int(self.config.get_config(u'Monitor', u'0'))
self.Warning = str_to_bool(self.config.get_config(u'Warning', u'False'))
self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u'False'))
self.CCLNumber = str(self.config.get_config(u'CCL Number', u'XXX'))
self.Username = str(self.config.get_config(u'User Name', u''))
self.Password = str(self.config.get_config(u'Password', u''))
self.CCLNumber = unicode(self.config.get_config(u'CCL Number', u'XXX'))
self.Username = unicode(self.config.get_config(u'User Name', u''))
self.Password = unicode(self.config.get_config(u'Password', u''))
# Set a few things up
self.MonitorComboBox.setCurrentIndex(self.MonitorNumber)
self.WarningCheckBox.setChecked(self.Warning)

View File

@ -101,7 +101,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
# clear the results
self.AuthorsListView.clear()
for author in self.song.authors:
author_name = QtGui.QListWidgetItem(str(author.display_name))
author_name = QtGui.QListWidgetItem(unicode(author.display_name))
author_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(author.id))
self.AuthorsListView.addItem(author_name)
self._validate_song()

View File

@ -174,7 +174,7 @@ class SongMediaItem(MediaManagerItem):
if author_list != u'':
author_list = author_list + u', '
author_list = author_list + author.display_name
song_detail = str(u'%s (%s)' % (str(song.title), str(author_list)))
song_detail = unicode(u'%s (%s)' % (unicode(song.title), unicode(author_list)))
self.SongListData.addRow(song.id,song_detail)
def onClearTextButtonClick(self):
@ -191,7 +191,7 @@ class SongMediaItem(MediaManagerItem):
self.onSearchTextButtonClick()
def onSearchTextButtonClick(self):
search_keywords = str(self.SearchTextEdit.displayText())
search_keywords = unicode(self.SearchTextEdit.displayText())
search_results = []
search_type = self.SearchTypeComboBox.currentIndex()
if search_type == 0:
@ -207,6 +207,7 @@ class SongMediaItem(MediaManagerItem):
def onSongNewClick(self):
self.edit_song_form.exec_()
self.onSearchTextButtonClick()
def onSongEditClick(self):
indexes = self.SongListView.selectedIndexes()
@ -214,6 +215,7 @@ class SongMediaItem(MediaManagerItem):
id = self.SongListData.getId(index)
self.edit_song_form.loadSong(id)
self.edit_song_form.exec_()
self.onSearchTextButtonClick()
def onSongDeleteClick(self):
indexes = self.SongListView.selectedIndexes()
@ -221,6 +223,7 @@ class SongMediaItem(MediaManagerItem):
id = self.SongListData.getId(index)
self.parent.songmanager.delete_song(id)
self.SongListData.deleteRow(index)
self.onSearchTextButtonClick()
def onSongPreviewClick(self):
service_item = ServiceItem(self.parent)
@ -248,15 +251,15 @@ class SongMediaItem(MediaManagerItem):
for author in song.authors:
if len(author_list) > 1:
author_list = author_list + u', '
author_list = author_list + str(author.display_name)
author_list = author_list + unicode(author.display_name)
if song.ccli_number == None or len(song.ccli_number) == 0:
ccl = self.parent.settings.GeneralTab.CCLNumber
else:
ccl = str(song.ccli_number)
ccl = unicode(song.ccli_number)
raw_footer.append(song.title)
raw_footer.append(author_list)
raw_footer.append(song.copyright )
raw_footer.append(str(translate(u'SongMediaItem', u'CCL Licence: ') + ccl ))
raw_footer.append(unicode(translate(u'SongMediaItem', u'CCL Licence: ') + ccl ))
service_item.raw_footer = raw_footer
def onSongLiveClick(self):