← 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:
  Tim Bentley (trb143)
  Andreas Preikschat (googol)

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

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
-- 
https://code.launchpad.net/~smpettit/openlp/custom-delete/+merge/66068
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 05:18:34 +0000
@@ -200,6 +200,16 @@
         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(s)?', '',
+                QtCore.QCoreApplication.CodecForTr, len(items)),
+                QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok |
+                QtGui.QMessageBox.Cancel),
+                QtGui.QMessageBox.Ok) == QtGui.QMessageBox.Cancel:
+                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