marinofaggiana 3 年之前
父节点
当前提交
a016c32d92

+ 6 - 0
iOSClient/NCGlobal.swift

@@ -342,3 +342,9 @@ class NCGlobal: NSObject {
 
 //#if TARGET_OS_SIMULATOR
 //#endif
+
+//if let popoverController = alertController.popoverPresentationController {
+//    popoverController.sourceView = self.view
+//    popoverController.sourceRect = CGRect(x: self.view.bounds.midX, y: self.view.bounds.midY, width: 0, height: 0)
+//    popoverController.permittedArrowDirections = []
+//}

+ 1 - 1
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -801,7 +801,7 @@
 "_modify_"                  = "Modify";
 "_overwrite_original_"      = "Overwrite original";
 "_save_as_copy_"            = "Save as copy";
-"_discard_changes_"         = "Discard changes";
+"_discard_changes_"         = "Close and discard changes";
 
 // ----------------------------------------------------------------------------------------------------------------------------------
 // IM

+ 7 - 0
iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift

@@ -93,6 +93,7 @@ import QuickLook
     @objc func dismissPreviewController() {
         
         if editingMode {
+            
             let alertController = UIAlertController(title: NSLocalizedString("_save_", comment: ""), message: "", preferredStyle: .alert)
             
             if metadata?.livePhoto == false {
@@ -101,17 +102,23 @@ import QuickLook
                     self.dismiss(animated: true)
                 })
             }
+            
             alertController.addAction(UIAlertAction(title: NSLocalizedString("_save_as_copy_", comment: ""), style: .default) { (action:UIAlertAction) in
                 self.saveMode = .copy
                 self.dismiss(animated: true)
             })
+            
             alertController.addAction(UIAlertAction(title: NSLocalizedString("_discard_changes_", comment: ""), style: .destructive) { (action:UIAlertAction) in
                 self.saveMode = .discard
                 self.dismiss(animated: true)
             })
             
+            alertController.addAction(UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel) { (action:UIAlertAction) in })
+            
             self.present(alertController, animated: true)
+            
         } else {
+            
             self.dismiss(animated: true)
         }
     }