浏览代码

add _remove_local_file_

Marino Faggiana 8 年之前
父节点
当前提交
83705551d6

+ 1 - 0
iOSClient/CCStandardImages.h

@@ -31,6 +31,7 @@
 #define image_actionSheetOffline                @"actionSheetOffline"
 #define image_actionSheetFavorite               @"actionSheetFavorite"
 #define image_actionSheetLocal                  @"localStorage"
+#define image_actionSheetRemoveLocal            @"actionSheetRemoveLocal"
 #define image_activeCameraUpload                @"activeCameraUpload"
 #define image_attention                         @"attention"
 #define image_audio                             @"audio"

+ 23 - 0
iOSClient/Images.xcassets/actionSheetRemoveLocal.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "actionSheetRemoveLocal.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "actionSheetRemoveLocal@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "actionSheetRemoveLocal@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
iOSClient/Images.xcassets/actionSheetRemoveLocal.imageset/actionSheetRemoveLocal.png


二进制
iOSClient/Images.xcassets/actionSheetRemoveLocal.imageset/actionSheetRemoveLocal@2x.png


二进制
iOSClient/Images.xcassets/actionSheetRemoveLocal.imageset/actionSheetRemoveLocal@3x.png


+ 27 - 0
iOSClient/Main/CCMain.m

@@ -3149,6 +3149,15 @@
     if (indexPath) [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationAutomatic];
 }
 
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark ===== Remove Local File =====
+#pragma --------------------------------------------------------------------------------------------
+
+- (void)removeLocalFile:(CCMetadata *)metadata
+{
+    
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Order Table & GroupBy & DirectoryOnTop =====
 #pragma --------------------------------------------------------------------------------------------
@@ -4299,6 +4308,8 @@
         else titoloLock = [NSString stringWithFormat:NSLocalizedString(@"_protect_passcode_", nil)];
     }
     
+    TableLocalFile *recordLocalFile = [CCCoreData getLocalFileWithFileID:_metadata.fileID activeAccount:app.activeAccount];
+
     /******************************************* AHKActionSheet *******************************************/
     
     UIImage *iconHeader;
@@ -4637,6 +4648,22 @@
                                     }];
         }
         
+        if (recordLocalFile) {
+        
+            [actionSheet addButtonWithTitle:NSLocalizedString(@"_remove_local_file_", nil)
+                                      image:[UIImage imageNamed:image_actionSheetRemoveLocal]
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
+                                       type:AHKActionSheetButtonTypeDefault
+                                    handler:^(AHKActionSheet *as) {
+                                    
+                                        // close swipe
+                                        [self setEditing:NO animated:YES];
+                                    
+                                        [self performSelector:@selector(removeLocalFile:) withObject:_metadata];
+                                    }];
+        }
+
 #ifndef OPTION_OFFLINE_DISABLE
         
         if (!_metadata.cryptated) {