Just a few trivial clean ups

bzr-revno: 1925
This commit is contained in:
Andreas Preikschat 2012-04-02 23:02:39 +02:00 committed by Raoul Snyman
commit eca7552706

View File

@ -233,10 +233,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.loadMediaFiles() self.loadMediaFiles()
self.song = self.manager.get_object(Song, id) self.song = self.manager.get_object(Song, id)
self.titleEdit.setText(self.song.title) self.titleEdit.setText(self.song.title)
if self.song.alternate_title: self.alternativeEdit.setText(
self.alternativeEdit.setText(self.song.alternate_title) self.song.alternate_title if self.song.alternate_title else u'')
else:
self.alternativeEdit.setText(u'')
if self.song.song_book_id != 0: if self.song.song_book_id != 0:
book_name = self.manager.get_object(Book, self.song.song_book_id) book_name = self.manager.get_object(Book, self.song.song_book_id)
find_and_set_in_combo_box( find_and_set_in_combo_box(
@ -244,24 +242,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if self.song.theme_name: if self.song.theme_name:
find_and_set_in_combo_box( find_and_set_in_combo_box(
self.themeComboBox, unicode(self.song.theme_name)) self.themeComboBox, unicode(self.song.theme_name))
if self.song.copyright: self.copyrightEdit.setText(
self.copyrightEdit.setText(self.song.copyright) self.song.copyright if self.song.copyright else u'')
else:
self.copyrightEdit.setText(u'')
self.verseListWidget.clear() self.verseListWidget.clear()
self.verseListWidget.setRowCount(0) self.verseListWidget.setRowCount(0)
if self.song.comments: self.commentsEdit.setPlainText(
self.commentsEdit.setPlainText(self.song.comments) self.song.comments if self.song.comments else u'')
else: self.CCLNumberEdit.setText(
self.commentsEdit.setPlainText(u'') self.song.ccli_number if self.song.ccli_number else u'')
if self.song.ccli_number: self.songBookNumberEdit.setText(
self.CCLNumberEdit.setText(self.song.ccli_number) self.song.song_number if self.song.song_number else u'')
else:
self.CCLNumberEdit.setText(u'')
if self.song.song_number:
self.songBookNumberEdit.setText(self.song.song_number)
else:
self.songBookNumberEdit.setText(u'')
# lazy xml migration for now # lazy xml migration for now
self.verseListWidget.clear() self.verseListWidget.clear()
self.verseListWidget.setRowCount(0) self.verseListWidget.setRowCount(0)