openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #28213
[Merge] lp:~thelinuxguy/openlp/fix-delete-songs into lp:openlp
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-delete-songs into lp:openlp.
Requested reviews:
Tomas Groth (tomasgroth)
For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-delete-songs/+merge/281852
CodecForTr was dropped in Qt5
The deletion of songs still depended on that.
Just a minor edit to drop the dependency
--
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2016-01-07 12:36:45 +0000
@@ -190,8 +190,7 @@
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:
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2016-01-07 12:36:45 +0000
@@ -363,8 +363,8 @@
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
=== modified file 'tests/functional/openlp_core_lib/test_mediamanageritem.py'
--- tests/functional/openlp_core_lib/test_mediamanageritem.py 2015-12-31 22:46:06 +0000
+++ tests/functional/openlp_core_lib/test_mediamanageritem.py 2016-01-07 12:36:45 +0000
@@ -60,6 +60,22 @@
# 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):
Follow ups