diff --git a/enzevalos_iphone/SwiftUI/Read/ReadViewCoordinator.swift b/enzevalos_iphone/SwiftUI/Read/ReadViewCoordinator.swift index 8d5ebfe53796ba1b44970a474fa850ed0545580e..646a591c15dc900b6d10d8ca5382a9a83cefa495 100644 --- a/enzevalos_iphone/SwiftUI/Read/ReadViewCoordinator.swift +++ b/enzevalos_iphone/SwiftUI/Read/ReadViewCoordinator.swift @@ -18,6 +18,13 @@ import Foundation import SwiftUI +/* + TODOS: + * Remove download -> All files are allready downloaded + * Does Views disappear? + * Add Security indicator +*/ + class ReadViewCoordinator { let root: UINavigationController @@ -33,29 +40,14 @@ class ReadViewCoordinator { } func pushReadView(mail: PersistentMail){ - root.isToolbarHidden = true - try? AppDelegate.getAppDelegate().mailHandler.startIMAPIdleIfSupported() AppDelegate.getAppDelegate().mailHandler.updateFolder(folder: Folder.inbox, completionCallback: {_ in }) - - if let vc = readView { - if root.viewControllers.contains(vc) { - while root.topViewController != vc { - root.popViewController(animated: true) - } - } else { - root.pushViewController(vc, animated: true) - } - } - else { - let context = DataHandler.handler.managedObjectContext - let vc = UIHostingController(rootView: ReadMainView(mail: mail, coord: self).environment(\.managedObjectContext,context)) - readView = vc - root.pushViewController(vc, animated: true) - } + let vc = UIHostingController(rootView: ReadMainView(mail: mail, coord: self)) + readView = vc + root.pushViewController(vc, animated: true) } func delete(mail: PersistentMail){ diff --git a/enzevalos_iphone/SwiftUI/Read/Tabbed Views/AttachmentsViewMain.swift b/enzevalos_iphone/SwiftUI/Read/Tabbed Views/AttachmentsViewMain.swift index 80a5701edd24e4b742632c1c52c1037738220502..2e2395c9031add826083fdb7195444341fedf9c5 100644 --- a/enzevalos_iphone/SwiftUI/Read/Tabbed Views/AttachmentsViewMain.swift +++ b/enzevalos_iphone/SwiftUI/Read/Tabbed Views/AttachmentsViewMain.swift @@ -19,12 +19,14 @@ import SwiftUI struct AttachmentsViewMain: View { + let mail:PersistentMail let coord:ReadViewCoordinator //gets the attachments as attachments not as nsElemets @State var Attachments:[Attachment]? = nil + func attachmentList()->[Attachment]{ if Attachments != nil { return Attachments!}//if we already converted the attachments print((mail.attachments ?? []).count) @@ -46,6 +48,7 @@ struct AttachmentsViewMain: View { } @State var dlAll=false;//whether the Download all button was clicked + var attachments: some View { return VStack(alignment: .leading, spacing: 5){ @@ -157,7 +160,7 @@ struct AttPrev:View{ if preload {self.download()} //this QuickLookView has to be defined here so it reloads on every state-change - var QLV = QuickLookView(name: self.attachment.name!, data: self.attachment.data!, shallDL: self.isDownloaded) + let QLV = QuickLookView(name: self.attachment.name!, data: self.attachment.data!, shallDL: self.isDownloaded) return VStack{ Group{ CardV(title: self.attachment.name ?? "", diff --git a/enzevalos_iphone/de.lproj/Localizable.strings b/enzevalos_iphone/de.lproj/Localizable.strings index d1ea62e4b54b93ca0e1a0bcd915bfe69e3529d4c..05c1df13839a2c1a6632da9733ed721e84b14f51 100644 --- a/enzevalos_iphone/de.lproj/Localizable.strings +++ b/enzevalos_iphone/de.lproj/Localizable.strings @@ -153,6 +153,15 @@ "Sender" = "Absender"; "To" = "An"; "to" = "an"; +"ReadView.Open" = "öffnen"; +"ReadView.Share" = "teilen"; +"ReadView.Download" = "herunterladen"; +"ReadView.Download.All" = "alle herunterladen"; +"ReadView.Download.Again" = "nochmals herunterladen"; +"ReadView.Delete" = "löschen"; +"ReadView.Attachments.No" = "Keine Anhänge vorhanden"; +"ReadView.Attachments.Headline" = "Anhänge:"; +"ReadView.Links.Future" = "a list of links contained in this mail will be visable here in a future update"; "Transportencryption" = "Transferverschlüsselung"; "Trash" = "Papierkorb"; "TwoDaysAgo" = "Vorgestern"; diff --git a/enzevalos_iphone/en.lproj/Localizable.strings b/enzevalos_iphone/en.lproj/Localizable.strings index 2f436017fcce324449012b7e848321028790df1c..6719f20a897f191af49ad159780391d9cec0a79c 100644 --- a/enzevalos_iphone/en.lproj/Localizable.strings +++ b/enzevalos_iphone/en.lproj/Localizable.strings @@ -150,6 +150,15 @@ "Subject" = "Subject"; "subject" = "subject"; "SubjectNo" = "No subject"; +"ReadView.Open" = "open"; +"ReadView.Share" = "share"; +"ReadView.Download" = "download"; +"ReadView.Download.All" = "download all"; +"ReadView.Download.Again" = "download again"; +"ReadView.Delete" = "delete"; +"ReadView.Attachments.No" = "This mail doesn't contain any attachments"; +"ReadView.Attachments.Headline" = "Attachments:"; +"ReadView.Links.Future" = "A list of links contained in this mail will be visable here in a future update"; "Sender" = "Sender"; "To" = "To"; "to" = "to"; diff --git a/enzevalos_iphone/mail/IncomingMail.swift b/enzevalos_iphone/mail/IncomingMail.swift index 77eb67af441dd2e22bafd0652ff5a7e4bdf45c1d..9d02442ff0fac3eccdbb5cfa4c6d3f6da6a82b75 100644 --- a/enzevalos_iphone/mail/IncomingMail.swift +++ b/enzevalos_iphone/mail/IncomingMail.swift @@ -332,6 +332,8 @@ class IncomingMail { if travelMail { publicKeyRaw = parseTravelMail() } + readableAttachments=parseUserReadableAttachments(parser: msgParser) + for a in msgParser.attachments() { if let attachment = a as? MCOAttachment {