Bläddra i källkod

EditController: Separate deletion message from playlist and playlist content

Soomin Lee 5 år sedan
förälder
incheckning
56207962d8
2 ändrade filer med 6 tillägg och 6 borttagningar
  1. 2 1
      Resources/en.lproj/Localizable.strings
  2. 4 5
      Sources/EditController.swift

+ 2 - 1
Resources/en.lproj/Localizable.strings

@@ -290,7 +290,8 @@
 "DELETE_ITEM_HINT" = "Press %@ to Delete"; /* Insert %@ where play-pause-glyph should be placed */
 
 "DELETE_MESSAGE" = "Confirm the deletion of the selection";
-"DELETE_MESSAGE_PLAYLIST" = "Confirm the deletion of the selection from the playlist\nMedia items are not deleted";
+"DELETE_MESSAGE_PLAYLIST" = "Are you sure to delete the selected playlist?\nAssociated media files won't be deleted.";
+"DELETE_MESSAGE_PLAYLIST_CONTENT" = "Are you sure to remove the selected media from the playlist?\nThey won't be deleted from the disk.";
 "DELETE_TITLE" = "Delete Selection";
 
 //Drag and Drop

+ 4 - 5
Sources/EditController.swift

@@ -195,11 +195,10 @@ extension EditController: EditToolbarDelegate {
 
         var message = NSLocalizedString("DELETE_MESSAGE", comment: "")
 
-        // Check if we are deleting media inside a playlist
-        if let collectionModel = model as? CollectionModel {
-            if collectionModel.mediaCollection is VLCMLPlaylist {
-                message = NSLocalizedString("DELETE_MESSAGE_PLAYLIST", comment: "")
-            }
+        if model is PlaylistModel {
+            message = NSLocalizedString("DELETE_MESSAGE_PLAYLIST", comment: "")
+        } else if (model as? CollectionModel)?.mediaCollection is VLCMLPlaylist {
+            message = NSLocalizedString("DELETE_MESSAGE_PLAYLIST_CONTENT", comment: "")
         }
 
         let cancelButton = VLCAlertButton(title: NSLocalizedString("BUTTON_CANCEL", comment: ""),