mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-26 21:39:37 -04:00
commit
This commit is contained in:
parent
896d8dcdf9
commit
72a885d604
@ -59,7 +59,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
}
|
||||
|
||||
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
|
||||
guard url.scheme!.caseInsensitiveCompare("kiwix") == .OrderedSame else {return false}
|
||||
guard url.isKiwixURL else {return false}
|
||||
let operation = ArticleLoadOperation(url: url)
|
||||
GlobalQueue.shared.add(load: operation)
|
||||
return true
|
||||
|
@ -135,3 +135,12 @@ class ShowHelpPageOperation: Operation {
|
||||
}
|
||||
}
|
||||
|
||||
class CannotFinishHandoffAlert: AlertOperation<UIViewController> {
|
||||
init(context: UIViewController) {
|
||||
super.init(presentAlertFrom: context)
|
||||
title = NSLocalizedString("Cannot Finish Handoff", comment: "Cannot Finish Handoff Alert")
|
||||
message = NSLocalizedString("The book required to complete the Handoff is not on the device. Please download the book and try again.", comment: "Cannot Finish Handoff Alert")
|
||||
addActionWithTitle(LocalizedStrings.ok)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,8 @@ class MainController: UIViewController {
|
||||
let operation = ArticleLoadOperation(url: url)
|
||||
GlobalQueue.shared.add(load: operation)
|
||||
} else {
|
||||
// TODO: - Alert cannot complete hand off
|
||||
let operation = CannotFinishHandoffAlert(context: self)
|
||||
GlobalQueue.shared.addOperation(operation)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.998</string>
|
||||
<string>1.8.1009</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.1002</string>
|
||||
<string>1.8.1013</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
|
@ -19,5 +19,21 @@
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Kiwix/Operations/GlobalQueue.swift"
|
||||
timestampString = "496186011.525439"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "44"
|
||||
endingLineNumber = "44"
|
||||
landmarkName = "add(load:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
||||
|
@ -77,10 +77,12 @@ class ArticleLoadOperation: Operation {
|
||||
NSOperationQueue.mainQueue().addOperationWithBlock {
|
||||
controller.hideSearch(animated: self.animated)
|
||||
controller.presentingViewController?.dismissViewControllerAnimated(self.animated, completion: nil)
|
||||
// hide toc
|
||||
if controller.traitCollection.horizontalSizeClass == .Compact {controller.hideTableOfContentsController()}
|
||||
|
||||
if controller.webView.request?.URL != url {
|
||||
controller.webView.loadRequest(request)
|
||||
}
|
||||
|
||||
guard controller.webView.request?.URL != url else {return}
|
||||
controller.webView.loadRequest(request)
|
||||
self.finish()
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,7 @@ class ScanLocalBookOperation: Operation {
|
||||
book.isLocal = true
|
||||
book.hasIndex = reader.hasIndex()
|
||||
book.hasPic = !reader.fileURL.absoluteString!.containsString("nopic")
|
||||
if let downloadTask = book.downloadTask {context.deleteObject(downloadTask)}
|
||||
}
|
||||
|
||||
for (id, book) in localBooks {
|
||||
|
Loading…
x
Reference in New Issue
Block a user