← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~smpettit/openlp/custom-delete into lp:openlp

 

Stevan Pettit has proposed merging lp:~smpettit/openlp/custom-delete into lp:openlp.

Requested reviews:
  Raoul Snyman (raoul-snyman)
  Andreas Preikschat (googol)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~smpettit/openlp/custom-delete/+merge/66150

Added code to openlp/plugins/custom/lib/customtab.py to allow the user to set an option if they want delete confirmation for Custom slides or not.

Added code to openlp/plugins/custom/lib/mediaitem.py to ask for delete confirmation when deleting a Custom slide if the user has set the option.

Moved signal to end of the __init__

I am requesting this change because the person running OpenLP at church "accidentally" delete our Announcements custom containing 17 slides (all of which had to be retyped)

Removed custom delete settings

Changed dialog message and button names
-- 
https://code.launchpad.net/~smpettit/openlp/custom-delete/+merge/66150
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py	2011-06-17 14:15:07 +0000
+++ openlp/plugins/custom/lib/mediaitem.py	2011-06-28 13:47:13 +0000
@@ -200,6 +200,17 @@
         Remove a custom item from the list and database
         """
         if check_item_selected(self.listView, UiStrings().SelectDelete):
+            items = self.listView.selectedIndexes()
+            if QtGui.QMessageBox.question(self,
+                translate('CustomPlugin.MediaItem', 'Delete Custom(s)?'),
+                translate('CustomPlugin.MediaItem',
+                'Are you sure you want to delete the %n selected custom' \
+                    ' slides(s)?', '',
+                QtCore.QCoreApplication.CodecForTr, len(items)),
+                QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
+                QtGui.QMessageBox.No),
+                QtGui.QMessageBox.Yes) == QtGui.QMessageBox.No:
+                return
             row_list = [item.row() for item in self.listView.selectedIndexes()]
             row_list.sort(reverse=True)
             id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0]


Follow ups