mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-28 22:43:55 -04:00
Fixes for library space detection
This commit is contained in:
parent
d841c3b982
commit
f4bd73e477
@ -192,7 +192,7 @@ class LibraryBooksController: CoreDataCollectionBaseController, UICollectionView
|
|||||||
].flatMap({$0}).joined(separator: " ")
|
].flatMap({$0}).joined(separator: " ")
|
||||||
cell.descriptionLabel.text = book.desc
|
cell.descriptionLabel.text = book.desc
|
||||||
cell.hasPicLabel.isHidden = !book.hasPic
|
cell.hasPicLabel.isHidden = !book.hasPic
|
||||||
cell.spaceStatus = getBookSpaceStatus(fileSize: book.fileSize)
|
if isCloudTab {cell.spaceStatus = getBookSpaceStatus(fileSize: book.fileSize)}
|
||||||
|
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
@ -154,8 +154,9 @@ class LibraryCollectionCell: UICollectionViewCell {
|
|||||||
delegate?.didTapMoreButton(cell: self)
|
delegate?.didTapMoreButton(cell: self)
|
||||||
}
|
}
|
||||||
|
|
||||||
var spaceStatus: SpaceStatus = .enough {
|
var spaceStatus: SpaceStatus? {
|
||||||
didSet {
|
didSet {
|
||||||
|
guard let spaceStatus = spaceStatus else {return}
|
||||||
switch spaceStatus {
|
switch spaceStatus {
|
||||||
case .enough:
|
case .enough:
|
||||||
titleLabel.textColor = UIColor.black
|
titleLabel.textColor = UIColor.black
|
||||||
|
@ -2,4 +2,22 @@
|
|||||||
<Bucket
|
<Bucket
|
||||||
type = "0"
|
type = "0"
|
||||||
version = "2.0">
|
version = "2.0">
|
||||||
|
<Breakpoints>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Kiwix/libkiwix/ZimReader.mm"
|
||||||
|
timestampString = "508185579.868817"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "43"
|
||||||
|
endingLineNumber = "43"
|
||||||
|
landmarkName = "-initWithZIMFileURL:"
|
||||||
|
landmarkType = "7">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
</Breakpoints>
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
@ -114,11 +114,12 @@ extension AlertProcedure {
|
|||||||
return alert
|
return alert
|
||||||
}
|
}
|
||||||
|
|
||||||
static func more(context: UIViewController, book: Book, spaceStatus: SpaceStatus) -> AlertProcedure {
|
static func more(context: UIViewController, book: Book, spaceStatus: SpaceStatus?) -> AlertProcedure {
|
||||||
assert(Thread.isMainThread)
|
assert(Thread.isMainThread)
|
||||||
let alert = AlertProcedure(presentAlertFrom: context, withPreferredStyle: .actionSheet, waitForDismissal: true)
|
let alert = AlertProcedure(presentAlertFrom: context, withPreferredStyle: .actionSheet, waitForDismissal: true)
|
||||||
alert.title = book.title
|
alert.title = book.title
|
||||||
alert.message = {
|
alert.message = {
|
||||||
|
guard let spaceStatus = spaceStatus else {return book.desc}
|
||||||
switch spaceStatus {
|
switch spaceStatus {
|
||||||
case .enough:
|
case .enough:
|
||||||
return book.desc
|
return book.desc
|
||||||
@ -146,7 +147,7 @@ extension AlertProcedure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
alert.add(actionWithTitle: Localized.Common.cancel, style: .cancel) { _ in alert.finish() }
|
alert.add(actionWithTitle: Localized.Common.cancel, style: .cancel) { _ in alert.finish() }
|
||||||
alert.actions.first?.isEnabled = spaceStatus != .notEnough
|
if let _ = spaceStatus {alert.actions.first?.isEnabled = spaceStatus != .notEnough}
|
||||||
return alert
|
return alert
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user