From 566d0e45b177c384e63854066fee0a56498f1cf6 Mon Sep 17 00:00:00 2001 From: automactic Date: Tue, 17 May 2016 11:37:45 -0400 Subject: [PATCH] Refactor + OS X Preference Window --- Kiwix-OSX/AppDelegate.swift | 2 +- .../PreferenceGeneralController.swift | 22 ++ .../PreferenceLibraryController.swift | 22 ++ Kiwix-OSX/Info.plist | 2 + .../Main.storyboard | 202 ++++++++++++++++-- Kiwix-OSX/StoryBoards/Preference.storyboard | 75 +++++++ Kiwix.xcodeproj/project.pbxproj | 109 +++++++--- Kiwix/LocalizedStrings.swift | 24 --- Kiwix/Preference.storyboard | 75 +++++++ Kiwix/PreferenceTabController.swift | 23 ++ StringTools.swift | 21 ++ 11 files changed, 504 insertions(+), 73 deletions(-) create mode 100644 Kiwix-OSX/Controllers/PreferenceGeneralController.swift create mode 100644 Kiwix-OSX/Controllers/PreferenceLibraryController.swift rename Kiwix-OSX/{Base.lproj => StoryBoards}/Main.storyboard (77%) create mode 100644 Kiwix-OSX/StoryBoards/Preference.storyboard delete mode 100644 Kiwix/LocalizedStrings.swift create mode 100644 Kiwix/Preference.storyboard create mode 100644 Kiwix/PreferenceTabController.swift diff --git a/Kiwix-OSX/AppDelegate.swift b/Kiwix-OSX/AppDelegate.swift index b9b93772..1081c185 100644 --- a/Kiwix-OSX/AppDelegate.swift +++ b/Kiwix-OSX/AppDelegate.swift @@ -32,7 +32,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { lazy var managedObjectModel: NSManagedObjectModel = { // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model. - let modelURL = NSBundle.mainBundle().URLForResource("Kiwix_OSX", withExtension: "momd")! + let modelURL = NSBundle.mainBundle().URLForResource("Kiwix", withExtension: "momd")! return NSManagedObjectModel(contentsOfURL: modelURL)! }() diff --git a/Kiwix-OSX/Controllers/PreferenceGeneralController.swift b/Kiwix-OSX/Controllers/PreferenceGeneralController.swift new file mode 100644 index 00000000..f7f1592c --- /dev/null +++ b/Kiwix-OSX/Controllers/PreferenceGeneralController.swift @@ -0,0 +1,22 @@ +// +// PreferenceGeneralController.swift +// Kiwix +// +// Created by Chris Li on 5/17/16. +// Copyright © 2016 Chris. All rights reserved. +// + +import Cocoa + +class PreferenceGeneralController: NSViewController { + + override func viewDidLoad() { + super.viewDidLoad() + } + + override func viewDidAppear() { + super.viewDidAppear() + view.window?.title = LocalizedStrings.General + } + +} diff --git a/Kiwix-OSX/Controllers/PreferenceLibraryController.swift b/Kiwix-OSX/Controllers/PreferenceLibraryController.swift new file mode 100644 index 00000000..0db41126 --- /dev/null +++ b/Kiwix-OSX/Controllers/PreferenceLibraryController.swift @@ -0,0 +1,22 @@ +// +// PreferenceLibraryController.swift +// Kiwix +// +// Created by Chris Li on 5/17/16. +// Copyright © 2016 Chris. All rights reserved. +// + +import Cocoa + +class PreferenceLibraryController: NSViewController { + + override func viewDidLoad() { + super.viewDidLoad() + } + + override func viewDidAppear() { + super.viewDidAppear() + view.window?.title = LocalizedStrings.Library + } + +} diff --git a/Kiwix-OSX/Info.plist b/Kiwix-OSX/Info.plist index 866806dd..1e799d5f 100644 --- a/Kiwix-OSX/Info.plist +++ b/Kiwix-OSX/Info.plist @@ -22,6 +22,8 @@ ???? CFBundleVersion 1 + LSApplicationCategoryType + public.app-category.reference LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/Kiwix-OSX/Base.lproj/Main.storyboard b/Kiwix-OSX/StoryBoards/Main.storyboard similarity index 77% rename from Kiwix-OSX/Base.lproj/Main.storyboard rename to Kiwix-OSX/StoryBoards/Main.storyboard index 97091e61..315fcd99 100644 --- a/Kiwix-OSX/Base.lproj/Main.storyboard +++ b/Kiwix-OSX/StoryBoards/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -10,9 +11,9 @@ - + - + @@ -21,7 +22,11 @@ - + + + + + @@ -641,12 +646,12 @@ - + - + - + @@ -657,25 +662,190 @@ - + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kiwix-OSX/StoryBoards/Preference.storyboard b/Kiwix-OSX/StoryBoards/Preference.storyboard new file mode 100644 index 00000000..24969a46 --- /dev/null +++ b/Kiwix-OSX/StoryBoards/Preference.storyboard @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kiwix.xcodeproj/project.pbxproj b/Kiwix.xcodeproj/project.pbxproj index 0dcc8f30..2adf21a9 100644 --- a/Kiwix.xcodeproj/project.pbxproj +++ b/Kiwix.xcodeproj/project.pbxproj @@ -73,7 +73,7 @@ 9711879B1CEB546C00B9909D /* CoreDataExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971187991CEB546C00B9909D /* CoreDataExtension.swift */; }; 9711879D1CEB577400B9909D /* StringTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9711879C1CEB577400B9909D /* StringTools.swift */; }; 9711879E1CEB577400B9909D /* StringTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9711879C1CEB577400B9909D /* StringTools.swift */; }; - 9711879F1CEB58BF00B9909D /* LocalizedStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 978C58891C1CD1DB0077AE47 /* LocalizedStrings.swift */; }; + 971187A91CEB694400B9909D /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 971187A81CEB694400B9909D /* WebKit.framework */; }; 9714D8D71C6E5C2600AABCA7 /* LTBarButtonItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9714D8D61C6E5C2600AABCA7 /* LTBarButtonItem.swift */; }; 97163D2B1CD7CEFA008BE2D6 /* WebViewVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97163D2A1CD7CEFA008BE2D6 /* WebViewVC.swift */; }; 97163D2F1CD7DF1A008BE2D6 /* DownloaderLearnMore.html in Resources */ = {isa = PBXBuildFile; fileRef = 97163D2E1CD7DF1A008BE2D6 /* DownloaderLearnMore.html */; }; @@ -91,7 +91,6 @@ 973BCCEC1CEB3FA400F10B44 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCCEB1CEB3FA400F10B44 /* AppDelegate.swift */; }; 973BCCEE1CEB3FA400F10B44 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCCED1CEB3FA400F10B44 /* ViewController.swift */; }; 973BCCF31CEB3FA400F10B44 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 973BCCF21CEB3FA400F10B44 /* Assets.xcassets */; }; - 973BCCF61CEB3FA400F10B44 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 973BCCF41CEB3FA400F10B44 /* Main.storyboard */; }; 973BCD011CEB3FA500F10B44 /* Kiwix_OSXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCD001CEB3FA500F10B44 /* Kiwix_OSXTests.swift */; }; 973BCD0C1CEB3FA500F10B44 /* Kiwix_OSXUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCD0B1CEB3FA500F10B44 /* Kiwix_OSXUITests.swift */; }; 973BCD191CEB402900F10B44 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 973BCD171CEB402900F10B44 /* Info.plist */; }; @@ -107,6 +106,11 @@ 974570F41C2DABB500680E43 /* ZIMMultiReaderAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 974570F31C2DABB500680E43 /* ZIMMultiReaderAPI.swift */; }; 974570F81C2DE67A00680E43 /* KiwixURLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 974570F71C2DE67A00680E43 /* KiwixURLProtocol.swift */; }; 9749A1B11C43064A000F2D1E /* BookmarkTBVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9749A1B01C43064A000F2D1E /* BookmarkTBVC.swift */; }; + 975334C91CEB6A3D007ED50B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 975334C81CEB6A3D007ED50B /* Main.storyboard */; }; + 975334CB1CEB6A43007ED50B /* Preference.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 975334CA1CEB6A43007ED50B /* Preference.storyboard */; }; + 975334D01CEB6AE3007ED50B /* PreferenceGeneralController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975334CF1CEB6AE3007ED50B /* PreferenceGeneralController.swift */; }; + 975334D21CEB6B01007ED50B /* PreferenceLibraryController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975334D11CEB6B01007ED50B /* PreferenceLibraryController.swift */; }; + 975334D41CEB6EED007ED50B /* PreferenceTabController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975334D31CEB6EED007ED50B /* PreferenceTabController.swift */; }; 97546E961CAEBC2C002FE3FD /* SearchTabController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97546E951CAEBC2C002FE3FD /* SearchTabController.swift */; }; 975952EA1C5EA47B004F7E76 /* BookCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975952E91C5EA47B004F7E76 /* BookCollectionCell.swift */; }; 9768957C1CB6A7D300F02686 /* SearchScopeSelectTBVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9768957B1CB6A7D300F02686 /* SearchScopeSelectTBVC.swift */; }; @@ -130,7 +134,6 @@ 978C58841C1CCE4D0077AE47 /* LanguageTBVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 978C58831C1CCE4D0077AE47 /* LanguageTBVC.swift */; }; 978C58861C1CD08F0077AE47 /* Setting.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 978C58851C1CD08F0077AE47 /* Setting.storyboard */; }; 978C58881C1CD0F50077AE47 /* SettingTBVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 978C58871C1CD0F50077AE47 /* SettingTBVC.swift */; }; - 978C588A1C1CD1DB0077AE47 /* LocalizedStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 978C58891C1CD1DB0077AE47 /* LocalizedStrings.swift */; }; 978C58961C1CD86E0077AE47 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = 978C588E1C1CD86E0077AE47 /* Language.swift */; }; 978C58981C1CD86E0077AE47 /* Book.swift in Sources */ = {isa = PBXBuildFile; fileRef = 978C58901C1CD86E0077AE47 /* Book.swift */; }; 978C589C1C1CD86E0077AE47 /* Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 978C58941C1CD86E0077AE47 /* Article.swift */; }; @@ -302,6 +305,7 @@ 9711878C1CEB541100B9909D /* Kiwix.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Kiwix.xcdatamodel; sourceTree = ""; }; 971187991CEB546C00B9909D /* CoreDataExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CoreDataExtension.swift; path = Kiwix/CoreData/CoreDataExtension.swift; sourceTree = ""; }; 9711879C1CEB577400B9909D /* StringTools.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringTools.swift; sourceTree = ""; }; + 971187A81CEB694400B9909D /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/WebKit.framework; sourceTree = DEVELOPER_DIR; }; 9714D8D61C6E5C2600AABCA7 /* LTBarButtonItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LTBarButtonItem.swift; sourceTree = ""; }; 97163D2A1CD7CEFA008BE2D6 /* WebViewVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebViewVC.swift; sourceTree = ""; }; 97163D2E1CD7DF1A008BE2D6 /* DownloaderLearnMore.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = DownloaderLearnMore.html; path = HelpDocuments/DownloaderLearnMore.html; sourceTree = ""; }; @@ -320,7 +324,6 @@ 973BCCEB1CEB3FA400F10B44 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = "Kiwix-OSX/AppDelegate.swift"; sourceTree = SOURCE_ROOT; }; 973BCCED1CEB3FA400F10B44 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ViewController.swift; path = "Kiwix-OSX/ViewController.swift"; sourceTree = SOURCE_ROOT; }; 973BCCF21CEB3FA400F10B44 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = "Kiwix-OSX/Assets.xcassets"; sourceTree = SOURCE_ROOT; }; - 973BCCF51CEB3FA400F10B44 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 973BCCF71CEB3FA400F10B44 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Kiwix-OSX/Info.plist"; sourceTree = SOURCE_ROOT; }; 973BCCFC1CEB3FA400F10B44 /* Kiwix-OSXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Kiwix-OSXTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 973BCD001CEB3FA500F10B44 /* Kiwix_OSXTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Kiwix_OSXTests.swift; sourceTree = ""; }; @@ -341,6 +344,11 @@ 974570F31C2DABB500680E43 /* ZIMMultiReaderAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZIMMultiReaderAPI.swift; sourceTree = ""; }; 974570F71C2DE67A00680E43 /* KiwixURLProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KiwixURLProtocol.swift; sourceTree = ""; }; 9749A1B01C43064A000F2D1E /* BookmarkTBVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookmarkTBVC.swift; sourceTree = ""; }; + 975334C81CEB6A3D007ED50B /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = "Kiwix-OSX/StoryBoards/Main.storyboard"; sourceTree = SOURCE_ROOT; }; + 975334CA1CEB6A43007ED50B /* Preference.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Preference.storyboard; path = "Kiwix-OSX/StoryBoards/Preference.storyboard"; sourceTree = SOURCE_ROOT; }; + 975334CF1CEB6AE3007ED50B /* PreferenceGeneralController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PreferenceGeneralController.swift; path = "Kiwix-OSX/Controllers/PreferenceGeneralController.swift"; sourceTree = SOURCE_ROOT; }; + 975334D11CEB6B01007ED50B /* PreferenceLibraryController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PreferenceLibraryController.swift; path = "Kiwix-OSX/Controllers/PreferenceLibraryController.swift"; sourceTree = SOURCE_ROOT; }; + 975334D31CEB6EED007ED50B /* PreferenceTabController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferenceTabController.swift; sourceTree = ""; }; 97546E951CAEBC2C002FE3FD /* SearchTabController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchTabController.swift; sourceTree = ""; }; 975952E91C5EA47B004F7E76 /* BookCollectionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookCollectionCell.swift; sourceTree = ""; }; 9768957B1CB6A7D300F02686 /* SearchScopeSelectTBVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchScopeSelectTBVC.swift; sourceTree = ""; }; @@ -364,7 +372,6 @@ 978C58831C1CCE4D0077AE47 /* LanguageTBVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LanguageTBVC.swift; sourceTree = ""; }; 978C58851C1CD08F0077AE47 /* Setting.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Setting.storyboard; sourceTree = ""; }; 978C58871C1CD0F50077AE47 /* SettingTBVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingTBVC.swift; sourceTree = ""; }; - 978C58891C1CD1DB0077AE47 /* LocalizedStrings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocalizedStrings.swift; sourceTree = ""; }; 978C588E1C1CD86E0077AE47 /* Language.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Language.swift; path = Kiwix/CoreData/Language.swift; sourceTree = ""; }; 978C58901C1CD86E0077AE47 /* Book.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; name = Book.swift; path = Kiwix/CoreData/Book.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 978C58941C1CD86E0077AE47 /* Article.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Article.swift; path = Kiwix/CoreData/Article.swift; sourceTree = ""; }; @@ -450,6 +457,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 971187A91CEB694400B9909D /* WebKit.framework in Frameworks */, 971187631CEB512F00B9909D /* libicuuc.55.dylib in Frameworks */, 971187611CEB512F00B9909D /* libicutest.55.dylib in Frameworks */, 9711875D1CEB512F00B9909D /* libicui18n.55.dylib in Frameworks */, @@ -617,6 +625,24 @@ path = Kiwix; sourceTree = ""; }; + 971187AA1CEB69D500B9909D /* Controllers */ = { + isa = PBXGroup; + children = ( + 975334CE1CEB6AB0007ED50B /* Preference */, + 973BCCED1CEB3FA400F10B44 /* ViewController.swift */, + ); + name = Controllers; + sourceTree = ""; + }; + 971187AB1CEB69DF00B9909D /* StoryBoards */ = { + isa = PBXGroup; + children = ( + 975334C81CEB6A3D007ED50B /* Main.storyboard */, + 975334CA1CEB6A43007ED50B /* Preference.storyboard */, + ); + name = StoryBoards; + sourceTree = ""; + }; 97163D321CD7E79F008BE2D6 /* Help Docs */ = { isa = PBXGroup; children = ( @@ -670,8 +696,6 @@ 978C58A31C1CFD8B0077AE47 /* Lib */, 978C58791C1CCC920077AE47 /* Supporting */, 97A2AB891C1B80FF00052E74 /* Products */, - 97A2ABA21C1B80FF00052E74 /* Kiwix-iOSTests */, - 97A2ABAD1C1B810000052E74 /* Kiwix-UITests */, ); name = iOS; sourceTree = ""; @@ -722,6 +746,38 @@ name = Bookmark; sourceTree = ""; }; + 975334CC1CEB6A4D007ED50B /* Supporting */ = { + isa = PBXGroup; + children = ( + 973BCCF21CEB3FA400F10B44 /* Assets.xcassets */, + 973BCCF71CEB3FA400F10B44 /* Info.plist */, + ); + name = Supporting; + sourceTree = ""; + }; + 975334CD1CEB6A78007ED50B /* Others */ = { + isa = PBXGroup; + children = ( + 973BCCFF1CEB3FA500F10B44 /* Kiwix-OSXTests */, + 973BCD0A1CEB3FA500F10B44 /* Kiwix-OSXUITests */, + 97A2ABA21C1B80FF00052E74 /* Kiwix-iOSTests */, + 97A2ABAD1C1B810000052E74 /* Kiwix-iOSUITests */, + 784457131AE044F91977B64B /* Pods */, + CFDF64EC6F9DB861DEEB91A0 /* Frameworks */, + ); + name = Others; + sourceTree = ""; + }; + 975334CE1CEB6AB0007ED50B /* Preference */ = { + isa = PBXGroup; + children = ( + 975334D31CEB6EED007ED50B /* PreferenceTabController.swift */, + 975334CF1CEB6AE3007ED50B /* PreferenceGeneralController.swift */, + 975334D11CEB6B01007ED50B /* PreferenceLibraryController.swift */, + ); + name = Preference; + sourceTree = ""; + }; 9768957A1CB6A35E00F02686 /* Dashboard */ = { isa = PBXGroup; children = ( @@ -824,7 +880,6 @@ children = ( 97EE24EF1C2078A400DFC672 /* Extension */, 97E891681CA976E90001CA32 /* FileManager.swift */, - 978C58891C1CD1DB0077AE47 /* LocalizedStrings.swift */, 974570F71C2DE67A00680E43 /* KiwixURLProtocol.swift */, 971904A41CA3204B002E9CFF /* Network */, 97E5712A1CA0525300FF4F1D /* Operation */, @@ -887,8 +942,7 @@ 973BCD1F1CEB412E00F10B44 /* Shared */, 97A2AB8A1C1B80FF00052E74 /* OS X */, 973BCCE41CEB3EDE00F10B44 /* iOS */, - 784457131AE044F91977B64B /* Pods */, - CFDF64EC6F9DB861DEEB91A0 /* Frameworks */, + 975334CD1CEB6A78007ED50B /* Others */, ); sourceTree = ""; }; @@ -909,12 +963,9 @@ isa = PBXGroup; children = ( 973BCCEB1CEB3FA400F10B44 /* AppDelegate.swift */, - 973BCCED1CEB3FA400F10B44 /* ViewController.swift */, - 973BCCF21CEB3FA400F10B44 /* Assets.xcassets */, - 973BCCF41CEB3FA400F10B44 /* Main.storyboard */, - 973BCCF71CEB3FA400F10B44 /* Info.plist */, - 973BCCFF1CEB3FA500F10B44 /* Kiwix-OSXTests */, - 973BCD0A1CEB3FA500F10B44 /* Kiwix-OSXUITests */, + 971187AA1CEB69D500B9909D /* Controllers */, + 975334CC1CEB6A4D007ED50B /* Supporting */, + 971187AB1CEB69DF00B9909D /* StoryBoards */, ); name = "OS X"; path = Kiwix; @@ -930,13 +981,13 @@ path = KiwixTests; sourceTree = ""; }; - 97A2ABAD1C1B810000052E74 /* Kiwix-UITests */ = { + 97A2ABAD1C1B810000052E74 /* Kiwix-iOSUITests */ = { isa = PBXGroup; children = ( 973BCD1B1CEB403700F10B44 /* Info.plist */, 973BCD1C1CEB403700F10B44 /* KiwixUITests.swift */, ); - name = "Kiwix-UITests"; + name = "Kiwix-iOSUITests"; path = KiwixUITests; sourceTree = ""; }; @@ -1043,6 +1094,7 @@ CFDF64EC6F9DB861DEEB91A0 /* Frameworks */ = { isa = PBXGroup; children = ( + 971187A81CEB694400B9909D /* WebKit.framework */, 9711871D1CEB449A00B9909D /* libz.tbd */, 9711871B1CEB448400B9909D /* libz.tbd */, 6693AC18F86E44ABA71C3201 /* Pods_Kiwix.framework */, @@ -1232,7 +1284,8 @@ buildActionMask = 2147483647; files = ( 973BCCF31CEB3FA400F10B44 /* Assets.xcassets in Resources */, - 973BCCF61CEB3FA400F10B44 /* Main.storyboard in Resources */, + 975334C91CEB6A3D007ED50B /* Main.storyboard in Resources */, + 975334CB1CEB6A43007ED50B /* Preference.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1344,10 +1397,13 @@ buildActionMask = 2147483647; files = ( 971187941CEB541A00B9909D /* Article.swift in Sources */, + 975334D01CEB6AE3007ED50B /* PreferenceGeneralController.swift in Sources */, + 975334D41CEB6EED007ED50B /* PreferenceTabController.swift in Sources */, 971187981CEB542500B9909D /* Language+CoreDataProperties.swift in Sources */, 9711878E1CEB541100B9909D /* Kiwix.xcdatamodeld in Sources */, 9711873A1CEB510900B9909D /* stringTools.cpp in Sources */, 971187961CEB542500B9909D /* DownloadTask+CoreDataProperties.swift in Sources */, + 975334D21CEB6B01007ED50B /* PreferenceLibraryController.swift in Sources */, 971187971CEB542500B9909D /* Article+CoreDataProperties.swift in Sources */, 9711879E1CEB577400B9909D /* StringTools.swift in Sources */, 971187381CEB510900B9909D /* reader.cpp in Sources */, @@ -1357,7 +1413,6 @@ 9711878F1CEB541600B9909D /* 1.5.xcmappingmodel in Sources */, 973BCCEE1CEB3FA400F10B44 /* ViewController.swift in Sources */, 973BCCEC1CEB3FA400F10B44 /* AppDelegate.swift in Sources */, - 9711879F1CEB58BF00B9909D /* LocalizedStrings.swift in Sources */, 971187311CEB50FC00B9909D /* ZimReader.mm in Sources */, 971187911CEB541A00B9909D /* Book.swift in Sources */, 971187901CEB541600B9909D /* MigrationPolicy.swift in Sources */, @@ -1452,7 +1507,6 @@ 9779987B1C1E1C9600B1DD5E /* Extensions.swift in Sources */, 97E0672A1C52AD050079C13C /* MainVCLoading.swift in Sources */, 977998761C1E0B7900B1DD5E /* DownloadTask.swift in Sources */, - 978C588A1C1CD1DB0077AE47 /* LocalizedStrings.swift in Sources */, 97E570FD1CA0500400FF4F1D /* BlockObserver.swift in Sources */, 975952EA1C5EA47B004F7E76 /* BookCollectionCell.swift in Sources */, 97E5711A1CA0500400FF4F1D /* OperationObserver.swift in Sources */, @@ -1557,15 +1611,6 @@ path = Localization; sourceTree = ""; }; - 973BCCF41CEB3FA400F10B44 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 973BCCF51CEB3FA400F10B44 /* Base */, - ); - name = Main.storyboard; - path = "Kiwix-OSX"; - sourceTree = SOURCE_ROOT; - }; 97A2AB971C1B80FF00052E74 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -1598,7 +1643,7 @@ "$(PROJECT_DIR)/Kiwix/libkiwix/shared", ); MACOSX_DEPLOYMENT_TARGET = 10.10; - PRODUCT_BUNDLE_IDENTIFIER = "org.kiwix.Kiwix-OSX"; + PRODUCT_BUNDLE_IDENTIFIER = org.kiwix.osx; PRODUCT_NAME = Kiwix; SDKROOT = macosx; SWIFT_OBJC_BRIDGING_HEADER = "Kiwix/Kiwix-Bridging-Header.h"; @@ -1627,7 +1672,7 @@ "$(PROJECT_DIR)/Kiwix/libkiwix/shared", ); MACOSX_DEPLOYMENT_TARGET = 10.10; - PRODUCT_BUNDLE_IDENTIFIER = "org.kiwix.Kiwix-OSX"; + PRODUCT_BUNDLE_IDENTIFIER = org.kiwix.osx; PRODUCT_NAME = Kiwix; SDKROOT = macosx; SWIFT_OBJC_BRIDGING_HEADER = "Kiwix/Kiwix-Bridging-Header.h"; diff --git a/Kiwix/LocalizedStrings.swift b/Kiwix/LocalizedStrings.swift deleted file mode 100644 index b43b9ea4..00000000 --- a/Kiwix/LocalizedStrings.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// LocalizedStrings.swift -// Kiwix -// -// Created by Chris on 12/12/15. -// Copyright © 2015 Chris. All rights reserved. -// - -class LocalizedStrings { - // Basic - class var yes: String {return NSLocalizedString("Yes", comment: "Basic")} - class var no: String {return NSLocalizedString("No", comment: "Basic")} - class var on: String {return NSLocalizedString("On", comment: "Basic")} - class var off: String {return NSLocalizedString("Off", comment: "Basic")} - class var and: String {return NSLocalizedString("and", comment: "Basic")} - class var ok: String {return NSLocalizedString("OK", comment: "Basic")} - class var cancel: String {return NSLocalizedString("Cancel", comment: "Basic")} - class var others: String {return NSLocalizedString("Others", comment: "Basic")} - class var unknown: String {return NSLocalizedString("Unknown", comment: "Basic")} - class var disabled: String {return NSLocalizedString("Disabled", comment: "Basic")} - class var remove: String {return NSLocalizedString("Remove", comment: "Basic")} - class var delete: String {return NSLocalizedString("Delete", comment: "Basic")} - class var refreshing: String {return NSLocalizedString("Refreshing...", comment: "Basic")} -} diff --git a/Kiwix/Preference.storyboard b/Kiwix/Preference.storyboard new file mode 100644 index 00000000..8f64ef3b --- /dev/null +++ b/Kiwix/Preference.storyboard @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kiwix/PreferenceTabController.swift b/Kiwix/PreferenceTabController.swift new file mode 100644 index 00000000..44dd23de --- /dev/null +++ b/Kiwix/PreferenceTabController.swift @@ -0,0 +1,23 @@ +// +// PreferenceTabController.swift +// Kiwix +// +// Created by Chris Li on 5/17/16. +// Copyright © 2016 Chris. All rights reserved. +// + +import Cocoa + +class PreferenceTabController: NSTabViewController { + + override func viewDidLoad() { + super.viewDidLoad() + } + + override func viewWillAppear() { + super.viewWillAppear() + tabViewItems[0].label = LocalizedStrings.General + tabViewItems[1].label = LocalizedStrings.Library + } + +} diff --git a/StringTools.swift b/StringTools.swift index 9ad80258..c233d4d0 100644 --- a/StringTools.swift +++ b/StringTools.swift @@ -48,3 +48,24 @@ extension String { } } +class LocalizedStrings { + // Basic + class var yes: String {return NSLocalizedString("Yes", comment: "Basic")} + class var no: String {return NSLocalizedString("No", comment: "Basic")} + class var on: String {return NSLocalizedString("On", comment: "Basic")} + class var off: String {return NSLocalizedString("Off", comment: "Basic")} + class var and: String {return NSLocalizedString("and", comment: "Basic")} + class var ok: String {return NSLocalizedString("OK", comment: "Basic")} + class var cancel: String {return NSLocalizedString("Cancel", comment: "Basic")} + class var others: String {return NSLocalizedString("Others", comment: "Basic")} + class var unknown: String {return NSLocalizedString("Unknown", comment: "Basic")} + class var disabled: String {return NSLocalizedString("Disabled", comment: "Basic")} + class var remove: String {return NSLocalizedString("Remove", comment: "Basic")} + class var delete: String {return NSLocalizedString("Delete", comment: "Basic")} + class var refreshing: String {return NSLocalizedString("Refreshing...", comment: "Basic")} + + // MARK: - OS X + class var General: String {return NSLocalizedString("General", comment: "OS X, Preference")} + class var Library: String {return NSLocalizedString("Library", comment: "OS X, Preference")} + +}