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

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

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

Changed dialog heading to "Confirm Delete"
Changed Songs dialog to match Custom Slides

Moved "Confirm Delete" translate string to ui.py

-- 
https://code.launchpad.net/~smpettit/openlp/custom-delete/+merge/66206
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/ui.py'
--- openlp/core/lib/ui.py	2011-06-16 20:11:12 +0000
+++ openlp/core/lib/ui.py	2011-06-28 20:43:28 +0000
@@ -64,6 +64,7 @@
         self.Cancel = translate('OpenLP.Ui', 'Cancel')
         self.CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:')
         self.CreateService = translate('OpenLP.Ui', 'Create a new service.')
+        self.ConfirmDelete = translate('OpenLP.Ui', 'Confirm Delete')
         self.Continuous = translate('OpenLP.Ui', 'Continuous')
         self.Default = unicode(translate('OpenLP.Ui', 'Default'))
         self.Delete = translate('OpenLP.Ui', '&Delete')

=== 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 20:43:28 +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,
+                UiStrings().ConfirmDelete,
+                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]

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2011-06-19 22:18:06 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2011-06-28 20:43:28 +0000
@@ -353,13 +353,13 @@
         if check_item_selected(self.listView, UiStrings().SelectDelete):
             items = self.listView.selectedIndexes()
             if QtGui.QMessageBox.question(self,
-                translate('SongsPlugin.MediaItem', 'Delete Song(s)?'),
+                UiStrings().ConfirmDelete,
                 translate('SongsPlugin.MediaItem',
                 'Are you sure you want to delete the %n selected song(s)?', '',
                 QtCore.QCoreApplication.CodecForTr, len(items)),
-                QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok |
-                QtGui.QMessageBox.Cancel),
-                QtGui.QMessageBox.Ok) == QtGui.QMessageBox.Cancel:
+                QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
+                QtGui.QMessageBox.No),
+                QtGui.QMessageBox.Yes) == QtGui.QMessageBox.No:
                 return
             for item in items:
                 item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]


Follow ups