浏览代码

alter table tableLocalFile: add onDevice flag

Marino Faggiana 6 年之前
父节点
当前提交
0d3a46fee2

+ 1 - 0
iOSClient/Database/NCDatabase.swift

@@ -186,6 +186,7 @@ class tableLocalFile: Object {
     @objc dynamic var favorite: Bool = false
     @objc dynamic var fileID = ""
     @objc dynamic var fileName = ""
+    @objc dynamic var onDevice: Bool = false
     @objc dynamic var size: Double = 0
     
     override static func primaryKey() -> String {

+ 2 - 1
iOSClient/Database/NCManageDatabase.swift

@@ -57,7 +57,7 @@ class NCManageDatabase: NSObject {
         let config = Realm.Configuration(
         
             fileURL: dirGroup?.appendingPathComponent("\(k_appDatabaseNextcloud)/\(k_databaseDefault)"),
-            schemaVersion: 29,
+            schemaVersion: 30,
             
             // 10 : Version 2.18.0
             // 11 : Version 2.18.2
@@ -79,6 +79,7 @@ class NCManageDatabase: NSObject {
             // 27 : Version 2.22.0.7
             // 28 : Version 2.22.3.5
             // 29 : Version 2.22.5.2
+            // 30 : Version 2.22.6.0
             
             migrationBlock: { migration, oldSchemaVersion in
                 // We haven’t migrated anything yet, so oldSchemaVersion == 0

+ 10 - 1
iOSClient/Main/Main.storyboard

@@ -607,6 +607,7 @@
                         <segue destination="Gtp-25-3Em" kind="show" identifier="segueTransfers" id="OLL-6n-NHS"/>
                         <segue destination="7jW-Ey-7M7" kind="show" identifier="segueShares" id="EzC-w0-JAm"/>
                         <segue destination="WTp-0D-Gpe" kind="show" identifier="segueTrash" id="bPq-YD-SUy"/>
+                        <segue destination="biz-Qc-WHi" kind="show" identifier="segueOnDevice" id="Pdi-HO-f4O"/>
                     </connections>
                 </navigationController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="D7n-Z1-9wU" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -619,7 +620,15 @@
                 <viewControllerPlaceholder storyboardIdentifier="NCTrash.storyboard" storyboardName="NCTrash" referencedIdentifier="NCTrash.storyboard" id="WTp-0D-Gpe" sceneMemberID="viewController"/>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="WGZ-c6-AXe" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="10883" y="326"/>
+            <point key="canvasLocation" x="10863" y="240"/>
+        </scene>
+        <!--NCOnDevice.storyboard-->
+        <scene sceneID="mwv-1V-aJg">
+            <objects>
+                <viewControllerPlaceholder storyboardIdentifier="NCOnDevice.storyboard" storyboardName="NCOnDevice" referencedIdentifier="NCOnDevice.storyboard" id="biz-Qc-WHi" sceneMemberID="viewController"/>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="d9n-lT-FK4" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="10882" y="420"/>
         </scene>
         <!--Activity-->
         <scene sceneID="Mfj-Rm-dhR">

+ 11 - 3
iOSClient/OnDevice/NCOnDevice.swift

@@ -29,7 +29,7 @@ class NCOnDevice: UIViewController ,UICollectionViewDataSource, UICollectionView
 
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
     var path = ""
-    var titleCurrentFolder = NSLocalizedString("_trash_view_", comment: "")
+    var titleCurrentFolder = NSLocalizedString("_on_device_", comment: "")
     var datasource = [tableTrash]()
     var datasourceSorted = ""
     var datasourceAscending = true
@@ -115,15 +115,23 @@ class NCOnDevice: UIViewController ,UICollectionViewDataSource, UICollectionView
     }
     
     func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? {
-        return CCGraphics.changeThemingColorImage(UIImage.init(named: "trashNoFiles"), multiplier: 2, color: NCBrandColor.sharedInstance.graySoft)
+        return CCGraphics.changeThemingColorImage(UIImage.init(named: "filesNoFiles"), multiplier: 2, color: NCBrandColor.sharedInstance.graySoft)
     }
     
     func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? {
-        let text = "\n"+NSLocalizedString("_trash_no_trash_", comment: "")
+        let text = "\n"+NSLocalizedString("_files_no_files_", comment: "")
         let attributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 20), NSAttributedString.Key.foregroundColor: UIColor.lightGray]
         return NSAttributedString.init(string: text, attributes: attributes)
     }
     
+    /*
+    func description(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? {
+        let text = "\n"+NSLocalizedString("_no_file_pull_down_", comment: "")
+        let attributes = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14), NSAttributedString.Key.foregroundColor: UIColor.lightGray]
+        return NSAttributedString.init(string: text, attributes: attributes)
+    }
+    */
+    
     func emptyDataSetShouldAllowScroll(_ scrollView: UIScrollView) -> Bool {
         return true
     }