diff --git a/Kiwix-iOS/Controller/Library/BookDetailController.swift b/Kiwix-iOS/Controller/Library/BookDetailController.swift index 7c0313b8..8c9a69f0 100644 --- a/Kiwix-iOS/Controller/Library/BookDetailController.swift +++ b/Kiwix-iOS/Controller/Library/BookDetailController.swift @@ -17,8 +17,6 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp @IBOutlet weak var hasPicIndicator: UILabel! @IBOutlet weak var hasPicLabel: UILabel! - @IBOutlet weak var hasIndexIndicator: UILabel! - @IBOutlet weak var hasIndexLabel: UILabel! private(set) var context: UnsafeMutablePointer = nil @@ -38,9 +36,7 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp tableView.rowHeight = UITableViewAutomaticDimension hasPicIndicator.layer.cornerRadius = 2.0 - hasIndexIndicator.layer.cornerRadius = 2.0 hasPicIndicator.layer.masksToBounds = true - hasIndexIndicator.layer.masksToBounds = true } override func viewWillAppear(animated: Bool) { @@ -74,13 +70,8 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp func configureIndicators(with book: Book) { hasPicIndicator.backgroundColor = book.hasPic ? AppColors.hasPicTintColor : UIColor.lightGrayColor() hasPicLabel.text = book.hasPic ? LocalizedStrings.hasPic : LocalizedStrings.noPic - hasIndexIndicator.backgroundColor = book.hasIndex ? AppColors.hasIndexTintColor : UIColor.lightGrayColor() - hasIndexLabel.text = book.hasIndex ? LocalizedStrings.hasIndex : LocalizedStrings.noIndex - hasPicIndicator.hidden = false hasPicLabel.hidden = false - hasIndexIndicator.hidden = false - hasIndexLabel.hidden = false } func configureDescriptionSection(with book: Book) { @@ -123,14 +114,18 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp func configureBookInfoSection(with book: Book) { sectionHeaders.append(LocalizedStrings.bookInfo) sectionFooters.append(nil) - cellTitles.append([ + var titles = [ LocalizedStrings.size, LocalizedStrings.createDate, LocalizedStrings.arcitleCount, LocalizedStrings.language, LocalizedStrings.creator, - LocalizedStrings.publisher - ]) + LocalizedStrings.publisher, + ] + if let _ = ZimMultiReader.shared.readers[book.id] { + titles.append(LocalizedStrings.index) + } + cellTitles.append(titles) } func configurePIDSection(with book: Book) { @@ -217,6 +212,19 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp cell.detailTextLabel?.text = book?.creator case LocalizedStrings.publisher: cell.detailTextLabel?.text = book?.publisher + case LocalizedStrings.index: + guard let book = book, let reader = ZimMultiReader.shared.readers[book.id] else {break} + cell.detailTextLabel?.text = { + if reader.hasIndex() { + if reader.idxFolderURL != nil { + return LocalizedStrings.external + } else { + return LocalizedStrings.embedded + } + } else { + return LocalizedStrings.none + } + }() default: break } @@ -273,9 +281,7 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp class LocalizedStrings { private static let comment = "Library, Book Detail" - static let hasIndex = NSLocalizedString("Index", comment: comment) static let hasPic = NSLocalizedString("Pictures", comment: comment) - static let noIndex = NSLocalizedString("No Index", comment: comment) static let noPic = NSLocalizedString("No Picture", comment: comment) static let download = NSLocalizedString("Download", comment: comment) @@ -295,6 +301,11 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp static let language = NSLocalizedString("Language", comment: comment) static let creator = NSLocalizedString("Creator", comment: comment) static let publisher = NSLocalizedString("Publisher", comment: comment) + static let index = NSLocalizedString("Index", comment: comment) + + static let none = NSLocalizedString("None", comment: comment) + static let embedded = NSLocalizedString("Embedded", comment: comment) + static let external = NSLocalizedString("External", comment: comment) static let pid = NSLocalizedString("Persistent ID", comment: comment) static let pidNote = NSLocalizedString("This ID does not change in different versions of the same book.", comment: comment) diff --git a/Kiwix-iOS/Info.plist b/Kiwix-iOS/Info.plist index 17c40b19..774fcceb 100644 --- a/Kiwix-iOS/Info.plist +++ b/Kiwix-iOS/Info.plist @@ -49,7 +49,7 @@ CFBundleVersion - 1.8.1211 + 1.8.1249 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/Kiwix-iOS/Storyboard/Library.storyboard b/Kiwix-iOS/Storyboard/Library.storyboard index 9d6aa793..9087136d 100644 --- a/Kiwix-iOS/Storyboard/Library.storyboard +++ b/Kiwix-iOS/Storyboard/Library.storyboard @@ -155,13 +155,6 @@ - - - - - - - - - @@ -201,21 +179,15 @@ - - - - - - + - - + @@ -337,8 +309,6 @@ - - diff --git a/Kiwix-iOSWidgets/Bookmarks/Info.plist b/Kiwix-iOSWidgets/Bookmarks/Info.plist index c899d6bd..4d2a69fe 100644 --- a/Kiwix-iOSWidgets/Bookmarks/Info.plist +++ b/Kiwix-iOSWidgets/Bookmarks/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 1.8.1215 + 1.8.1253 NSExtension NSExtensionMainStoryboard diff --git a/Kiwix.xcworkspace/xcuserdata/chrisli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Kiwix.xcworkspace/xcuserdata/chrisli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index dc70e498..4d17879a 100644 --- a/Kiwix.xcworkspace/xcuserdata/chrisli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Kiwix.xcworkspace/xcuserdata/chrisli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -56,7 +56,7 @@ moduleName = "Kiwix" usesParentBreakpointCondition = "Yes" urlString = "file:///Volumes/Data/Developer/Kiwix/Kiwix/Operations/BookmarkMigrationOperation.swift" - timestampString = "496693865.757662" + timestampString = "496704126.923131" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "27" @@ -71,7 +71,7 @@ moduleName = "Kiwix" usesParentBreakpointCondition = "Yes" urlString = "file:///Volumes/Data/Developer/Kiwix/Kiwix/Operations/BookmarkMigrationOperation.swift" - timestampString = "496693865.758711" + timestampString = "496704126.924306" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "27"