diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 812274263..25970a91d 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -190,8 +190,7 @@ class CustomMediaItem(MediaManagerItem): if QtWidgets.QMessageBox.question( self, UiStrings().ConfirmDelete, translate('CustomPlugin.MediaItem', - 'Are you sure you want to delete the %n selected custom slide(s)?', - '', QtCore.QCoreApplication.CodecForTr, len(items)), + 'Are you sure you want to delete the "%d" selected custom slide(s)?') %len(items), QtWidgets.QMessageBox.StandardButtons( QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No), QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No: diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 4f23bbfd1..35ca9861c 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -363,8 +363,8 @@ class SongMediaItem(MediaManagerItem): items = self.list_view.selectedIndexes() if QtWidgets.QMessageBox.question( self, UiStrings().ConfirmDelete, - translate('SongsPlugin.MediaItem', 'Are you sure you want to delete the %n selected song(s)?', '', - QtCore.QCoreApplication.CodecForTr, len(items)), + translate('SongsPlugin.MediaItem', + 'Are you sure you want to delete the "%d" selected song(s)?') % len(items), QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No), QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No: return diff --git a/tests/functional/openlp_core_lib/test_mediamanageritem.py b/tests/functional/openlp_core_lib/test_mediamanageritem.py index 848f34233..a3674f591 100644 --- a/tests/functional/openlp_core_lib/test_mediamanageritem.py +++ b/tests/functional/openlp_core_lib/test_mediamanageritem.py @@ -60,6 +60,22 @@ class TestMediaManagerItem(TestCase, TestMixin): # THEN: on_preview_click() should have been called mocked_on_preview_click.assert_called_with() + def required_icons_test(self): + """ + Test the default icons for plugins + """ + # GIVEN: A MediaManagerItem + mmi = MediaManagerItem(None) + # WHEN: Object is created + mmi.required_icons() + # THEN: Default icons should be populated + self.assertFalse(mmi.has_import_icon, 'There should be no import icon by default') + self.assertTrue(mmi.has_new_icon, 'By default a new icon should be present') + self.assertFalse(mmi.has_file_icon, 'There should be no file icon by default') + self.assertTrue(mmi.has_delete_icon, 'By default a delete icon should be present') + self.assertFalse(mmi.add_to_service_item, 'There should be no add_to_service icon by default') + + @patch(u'openlp.core.lib.mediamanageritem.Settings') @patch(u'openlp.core.lib.mediamanageritem.MediaManagerItem.on_live_click') def on_double_clicked_go_live_test(self, mocked_on_live_click, MockedSettings):