Parcourir la source

【fix】【BOTA】添加注释回复后,点击more-删除所有回复,没有二次提示弹窗(参考Windows)

tangchao il y a 5 mois
Parent
commit
d46951358b

+ 21 - 16
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift

@@ -557,25 +557,30 @@ extension KMLeftSideViewController {
     }
     
     @objc func removeAllReplyAnnotations(_ sender: NSMenuItem?) {
-        self.dataUpdating = true
-        for model in self.annoListModel?.datas ?? [] {
-            for item in model.items {
-//                if let anno = item.anno {
-//                    self.listView?.remove(anno)
-//                }
-                guard let annoM = item as? KMBotaAnnotationModel else {
-                    continue
-                }
-                for replyM in annoM.replyAnnos {
-//                    self.listView?.remove(replyM.replyAnno)
-                    replyM.replyAnno?.page.removeAnnotation(replyM.replyAnno)
+        Task {
+            let response = await KMAlertTool.runModel(message: KMLocalizedString("Are you sure to delete all comment replies?", nil), buttons: [KMLocalizedString("Yes", nil), KMLocalizedString("No", nil)])
+            if response == .alertFirstButtonReturn {
+                self.dataUpdating = true
+                for model in self.annoListModel?.datas ?? [] {
+                    for item in model.items {
+                        //                if let anno = item.anno {
+                        //                    self.listView?.remove(anno)
+                        //                }
+                        guard let annoM = item as? KMBotaAnnotationModel else {
+                            continue
+                        }
+                        for replyM in annoM.replyAnnos {
+                            //                    self.listView?.remove(replyM.replyAnno)
+                            replyM.replyAnno?.page.removeAnnotation(replyM.replyAnno)
+                        }
+                        annoM.replyAnnos.removeAll()
+                    }
                 }
-                annoM.replyAnnos.removeAll()
+                self.dataUpdating = false
+                
+                self.note_refrshUIIfNeed()
             }
         }
-        self.dataUpdating = false
-
-        self.note_refrshUIIfNeed()
     }
     
     @objc func editNoteTextFromTable(_ sender: NSMenuItem) {

+ 2 - 0
PDF Office/PDF Master/Strings/ar.lproj/Localizable.strings

@@ -4729,3 +4729,5 @@
 "Add or Remove Marked" = "إضافة أو إزالة العلامات";
 "Reply" = "رد";
 "Delete All Reply" = "حذف كافة الردود";
+
+"Are you sure to delete all comment replies?" = "هل أنت متأكد من حذف جميع الردود على التعليقات؟";

+ 2 - 0
PDF Office/PDF Master/Strings/de.lproj/Localizable.strings

@@ -3094,3 +3094,5 @@
 "Add or Remove Marked" = "Tags hinzufügen oder entfernen";
 "Reply" = "Antwort";
 "Delete All Reply" = "Alle Antworten löschen";
+
+"Are you sure to delete all comment replies?" = "Sind Sie sicher, alle Kommentarantworten zu löschen?";

+ 2 - 0
PDF Office/PDF Master/Strings/en.lproj/Localizable.strings

@@ -4260,3 +4260,5 @@
 "Add or Remove Marked" = "Add or Remove Marked";
 "Reply" = "Reply";
 "Delete All Reply" = "Delete All Reply";
+
+"Are you sure to delete all comment replies?" = "Are you sure to delete all comment replies?";

+ 2 - 0
PDF Office/PDF Master/Strings/es.lproj/Localizable.strings

@@ -3177,3 +3177,5 @@
 "Reply" = "responder";
 "Delete All Reply" = "Eliminar todas las respuestas";
 
+"Are you sure to delete all comment replies?" = "¿Estás seguro de eliminar todas las respuestas a los comentarios?";
+

+ 2 - 0
PDF Office/PDF Master/Strings/fr.lproj/Localizable.strings

@@ -3058,3 +3058,5 @@
 "Add or Remove Marked" = "Ajouter ou supprimer des balises";
 "Reply" = "répondre";
 "Delete All Reply" = "Supprimer toutes les réponses";
+
+"Are you sure to delete all comment replies?" = "Êtes-vous sûr de supprimer toutes les réponses aux commentaires ?";

+ 2 - 0
PDF Office/PDF Master/Strings/it.lproj/Localizable.strings

@@ -2972,3 +2972,5 @@
 "Add or Remove Marked" = "Aggiungi o rimuovi tag";
 "Reply" = "rispondere";
 "Delete All Reply" = "Elimina tutte le risposte";
+
+"Are you sure to delete all comment replies?" = "Sei sicuro di eliminare tutte le risposte ai commenti?";

+ 2 - 0
PDF Office/PDF Master/Strings/ja.lproj/Localizable.strings

@@ -3251,3 +3251,5 @@
 "Add or Remove Marked" = "タグの追加または削除";
 "Reply" = "返事";
 "Delete All Reply" = "すべての返信を削除する";
+
+"Are you sure to delete all comment replies?" = "コメント返信をすべて削除してもよろしいですか?";

+ 2 - 0
PDF Office/PDF Master/Strings/nl.lproj/Localizable.strings

@@ -3131,3 +3131,5 @@
 "Add or Remove Marked" = "Tags toevoegen of verwijderen";
 "Reply" = "antwoord";
 "Delete All Reply" = "Verwijder alle antwoorden";
+
+"Are you sure to delete all comment replies?" = "Weet u zeker dat u alle reacties wilt verwijderen?";

+ 2 - 0
PDF Office/PDF Master/Strings/pl.lproj/Localizable.strings

@@ -3188,3 +3188,5 @@
 "Add or Remove Marked" = "Dodaj lub usuń tagi";
 "Reply" = "odpowiedź";
 "Delete All Reply" = "Usuń wszystkie odpowiedzi";
+
+"Are you sure to delete all comment replies?" = "Czy na pewno chcesz usunąć wszystkie odpowiedzi na komentarze?";

+ 2 - 0
PDF Office/PDF Master/Strings/pt.lproj/Localizable.strings

@@ -4650,3 +4650,5 @@
 "Add or Remove Marked" = "Adicionar ou remover tags";
 "Reply" = "responder";
 "Delete All Reply" = "Excluir todas as respostas";
+
+"Are you sure to delete all comment replies?" = "Tem certeza de que deseja excluir todas as respostas aos comentários?";

+ 2 - 0
PDF Office/PDF Master/Strings/ru.lproj/Localizable.strings

@@ -3122,3 +3122,5 @@
 "Add or Remove Marked" = "Добавить или удалить теги";
 "Reply" = "отвечать";
 "Delete All Reply" = "Удалить все ответы";
+
+"Are you sure to delete all comment replies?" = "Вы уверены, что удалите все ответы на комментарии?";

+ 2 - 0
PDF Office/PDF Master/Strings/zh-Hans.lproj/Localizable.strings

@@ -4161,3 +4161,5 @@
 "Add or Remove Marked" = "添加或移除标记";
 "Reply" = "回复";
 "Delete All Reply" = "删除所有回复";
+
+"Are you sure to delete all comment replies?" = "确定删除所有注释回复?";

+ 2 - 0
PDF Office/PDF Master/Strings/zh-Hant.lproj/Localizable.strings

@@ -4292,3 +4292,5 @@
 "Add or Remove Marked" = "新增或移除標記";
 "Reply" = "回覆";
 "Delete All Reply" = "刪除所有回复";
+
+"Are you sure to delete all comment replies?" = "確定删除所有注釋回復?";