From 18760262ab5eaec49028f5f3d5a8386ed7b8ec92 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 7 Feb 2010 20:11:37 +0000 Subject: [PATCH 1/3] Edit Cancel updating song by accident --- openlp/plugins/songs/forms/editsongform.py | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index fb7e0eecd..e06551631 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -316,13 +316,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onVerseAddButtonClicked(self): self.verse_form.setVerse(u'', self.VerseListWidget.count() + 1, True) - self.verse_form.exec_() - afterText, verse, subVerse = self.verse_form.getVerse() - data = u'%s:%s' %(verse, subVerse) - item = QtGui.QListWidgetItem(afterText) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data)) - item.setText(afterText) - self.VerseListWidget.addItem(item) + if self.verse_form.exec_(): + afterText, verse, subVerse = self.verse_form.getVerse() + data = u'%s:%s' %(verse, subVerse) + item = QtGui.QListWidgetItem(afterText) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data)) + item.setText(afterText) + self.VerseListWidget.addItem(item) def onVerseEditButtonClicked(self): item = self.VerseListWidget.currentItem() @@ -331,25 +331,25 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode((item.data(QtCore.Qt.UserRole)).toString()) self.verse_form.setVerse(tempText, \ self.VerseListWidget.count(), True, verseId) - self.verse_form.exec_() - afterText, verse, subVerse = self.verse_form.getVerse() - data = u'%s:%s' %(verse, subVerse) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data)) - item.setText(afterText) - #number of lines has change so repaint the list moving the data - if len(tempText.split(u'\n')) != len(afterText.split(u'\n')): - tempList = {} - tempId = {} - for row in range(0, self.VerseListWidget.count()): - tempList[row] = self.VerseListWidget.item(row).text() - tempId[row] = self.VerseListWidget.item(row).\ - data(QtCore.Qt.UserRole) - self.VerseListWidget.clear() - for row in range (0, len(tempList)): - item = QtGui.QListWidgetItem(tempList[row]) - item.setData(QtCore.Qt.UserRole, tempId[row]) - self.VerseListWidget.addItem(item) - self.VerseListWidget.repaint() + if self.verse_form.exec_(): + afterText, verse, subVerse = self.verse_form.getVerse() + data = u'%s:%s' %(verse, subVerse) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data)) + item.setText(afterText) + #number of lines has change so repaint the list moving the data + if len(tempText.split(u'\n')) != len(afterText.split(u'\n')): + tempList = {} + tempId = {} + for row in range(0, self.VerseListWidget.count()): + tempList[row] = self.VerseListWidget.item(row).text() + tempId[row] = self.VerseListWidget.item(row).\ + data(QtCore.Qt.UserRole) + self.VerseListWidget.clear() + for row in range (0, len(tempList)): + item = QtGui.QListWidgetItem(tempList[row]) + item.setData(QtCore.Qt.UserRole, tempId[row]) + self.VerseListWidget.addItem(item) + self.VerseListWidget.repaint() self.VerseEditButton.setEnabled(False) self.VerseDeleteButton.setEnabled(False) @@ -533,4 +533,4 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.song.search_title = self.song.search_title.replace(u'{', u'') self.song.search_title = self.song.search_title.replace(u'}', u'') self.song.search_title = self.song.search_title.replace(u'?', u'') - self.song.search_title = unicode(self.song.search_title) \ No newline at end of file + self.song.search_title = unicode(self.song.search_title) From fc9b8fcdadf2bbcfd91cb3f4196e0d38dac59bc0 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 9 Feb 2010 08:28:34 +0000 Subject: [PATCH 2/3] fix presentation import values --- openlp/plugins/presentations/lib/mediaitem.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 0b14f797d..38a4d0343 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -67,6 +67,7 @@ class PresentationMediaItem(MediaManagerItem): for controller in self.controllers: if self.controllers[controller].enabled: for type in self.controllers[controller].supports: + type = u'*%s' % type if fileType.find(type) == -1: fileType += type + u' ' self.OnNewFileMasks = self.trUtf8('Presentations (%s)' % fileType) From be4c40b401af92f684de92d8d18dedc7b71b000f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 9 Feb 2010 11:20:19 +0000 Subject: [PATCH 3/3] Cleaner fix --- openlp/plugins/presentations/lib/mediaitem.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 38a4d0343..590074ead 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -67,9 +67,8 @@ class PresentationMediaItem(MediaManagerItem): for controller in self.controllers: if self.controllers[controller].enabled: for type in self.controllers[controller].supports: - type = u'*%s' % type if fileType.find(type) == -1: - fileType += type + u' ' + fileType += u'*%s ' % type self.OnNewFileMasks = self.trUtf8('Presentations (%s)' % fileType) def requiredIcons(self):