From 8929aaaa2301cc41e368f47118ec1ec1d3700bfc Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 28 Nov 2010 16:10:51 +0100 Subject: [PATCH] docs; make sure, that the edit/delete buttons are always disabled after loading the window --- openlp/plugins/songs/forms/editsongform.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 241c6fd95..d81f1a27a 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -152,6 +152,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def newSong(self): log.debug(u'New Song') + self.initialise() self.SongTabWidget.setCurrentIndex(0) self.TitleEditItem.setText(u'') self.AlternativeEdit.setText(u'') @@ -170,8 +171,18 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): # it's a new song to preview is not possible self.previewButton.setVisible(False) - def loadSong(self, id, preview): + def loadSong(self, id, preview=False): + """ + Loads a song. + + ``id`` + The song id (int). + + ``preview`` + Should be ``True`` if the song is also previewed (boolean). + """ log.debug(u'Load Song') + self.initialise() self.SongTabWidget.setCurrentIndex(0) self.loadAuthors() self.loadTopics() @@ -594,6 +605,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): """ Save and Preview button pressed. The Song is valid so as the plugin to add it to preview to see. + + ``button`` + A button (QPushButton). """ log.debug(u'onPreview') if unicode(button.objectName()) == u'previewButton' and \ @@ -631,7 +645,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): database. ``preview`` - Should be True if song is also previewed. + Should be ``True`` if the song is also previewed (boolean). """ self.song.title = unicode(self.TitleEditItem.text()) self.song.alternate_title = unicode(self.AlternativeEdit.text())