瀏覽代碼

User Profile

Marino Faggiana 8 年之前
父節點
當前提交
17984010e0

+ 0 - 2
iOSClient/AppDelegate.h

@@ -54,8 +54,6 @@
 @property (nonatomic, strong) NSString *activeUser;
 @property (nonatomic, strong) NSString *activePassword;
 @property (nonatomic, strong) NSString *directoryUser;
-@property double quotaUsed;
-@property double quotaAvailable;
 
 // next version ... ? ...
 @property double currentLatitude;

+ 0 - 1
iOSClient/CCGlobal.h

@@ -179,7 +179,6 @@ extern NSString *const BKPasscodeKeychainServiceName;
 #define selectorReadFileFolder                          @"readFileFolder"
 #define selectorReadFileUploadFile                      @"readFileUploadFile"
 #define selectorReadFileVerifyUpload                    @"readFileVerifyUpload"
-#define selectorReadFileQuota                           @"readFileQuota"
 #define selectorReadFolder                              @"readFolder"
 #define selectorReadFolderForced                        @"readFolderForced"
 #define selectorReadShare                               @"readShare"

+ 1 - 0
iOSClient/FileSystem/CCCoreData.m

@@ -509,6 +509,7 @@
         TableAccount *record = [TableAccount MR_findFirstWithPredicate:predicate inContext:localContext];
         
         if (record) {
+            
             record.enabled = [NSNumber numberWithBool:userProfile.enabled];
             record.address = userProfile.address;
             record.displayName = userProfile.displayName;

+ 0 - 12
iOSClient/Main/CCMain.m

@@ -1166,11 +1166,6 @@
 
     metadataNet.action = actionGetUserProfile;
     [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
-    
-    metadataNet.action = actionReadFile;
-    metadataNet.selector = selectorReadFileQuota;
-    metadataNet.serverUrl = [CCUtility getHomeServerUrlActiveUrl:app.activeUrl];
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
 }
 
 #pragma --------------------------------------------------------------------------------------------
@@ -1715,13 +1710,6 @@
         else
             [app addNetworkingOperationQueue:app.netQueueUpload delegate:self metadataNet:metadataNet];
     }
-    
-    // Quota
-    if ([metadataNet.selector isEqualToString:selectorReadFileQuota]) {
-        
-        if (app.activeSettings)
-            [app.activeSettings reloadForm];        
-    }
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 1 - 21
iOSClient/Networking/OCNetworking.m

@@ -346,16 +346,6 @@
         // Update metadataNet.directoryID
         _metadataNet.directoryID = directoryID;
         
-#ifndef EXTENSION
-        NSString *root = [CCUtility getHomeServerUrlActiveUrl:_activeUrl];
-        
-        if ([root isEqualToString:_metadataNet.serverUrl]) {
-            
-            app.quotaUsed = itemDtoDirectory.quotaUsed;
-            app.quotaAvailable = itemDtoDirectory.quotaAvailable;
-        }
-#endif
-        
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
 
             NSArray *itemsSortedArray = [items sortedArrayUsingComparator:^NSComparisonResult(id a, id b) {
@@ -666,17 +656,7 @@
             NSString *directoryUser = [CCUtility getDirectoryActiveUser:_activeUser activeUrl:_activeUrl];
         
             metadata = [CCUtility trasformedOCFileToCCMetadata:itemDto fileNamePrint:_metadataNet.fileNamePrint serverUrl:_metadataNet.serverUrl directoryID:directoryID cameraFolderName:cameraFolderName cameraFolderPath:cameraFolderPath activeAccount:_metadataNet.account directoryUser:directoryUser];
-            
-#ifndef EXTENSION
-            NSString *root = [CCUtility getHomeServerUrlActiveUrl:_activeUrl];
-            
-            if ([root isEqualToString:fileName]) {
-                
-                app.quotaUsed = itemDto.quotaUsed;
-                app.quotaAvailable = itemDto.quotaAvailable;
-            }
-#endif
-            
+                        
             if([self.delegate respondsToSelector:@selector(readFileSuccess:metadata:)])
                 [self.delegate readFileSuccess:_metadataNet metadata:metadata];
         }

+ 14 - 14
iOSClient/Notification/CCNotification.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="eRR-MW-ghy">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="eRR-MW-ghy">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
@@ -14,33 +14,33 @@
         <scene sceneID="dZP-R1-zZF">
             <objects>
                 <tableViewController id="c26-Us-IIn" customClass="CCNotification" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
-                    <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="90" sectionHeaderHeight="28" sectionFooterHeight="28" id="vzh-aE-2MF">
+                    <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="120" sectionHeaderHeight="28" sectionFooterHeight="28" id="vzh-aE-2MF">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                         <prototypes>
-                            <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="120" id="R1c-h5-BOp" customClass="CCNotificationCell" customModule="Nextcloud" customModuleProvider="target">
-                                <rect key="frame" x="0.0" y="28" width="375" height="120"/>
+                            <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="160" id="R1c-h5-BOp" customClass="CCNotificationCell" customModule="Nextcloud" customModuleProvider="target">
+                                <rect key="frame" x="0.0" y="28" width="375" height="160"/>
                                 <autoresizingMask key="autoresizingMask"/>
                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="R1c-h5-BOp" id="9Bv-1W-yVV">
-                                    <rect key="frame" x="0.0" y="0.0" width="375" height="119.5"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="375" height="160"/>
                                     <autoresizingMask key="autoresizingMask"/>
                                     <subviews>
-                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pg1-7p-7Rz" userLabel="subject">
-                                            <rect key="frame" x="47" y="27" width="320" height="38"/>
+                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pg1-7p-7Rz" userLabel="subject">
+                                            <rect key="frame" x="47" y="27" width="320" height="75"/>
                                             <constraints>
-                                                <constraint firstAttribute="height" constant="38" id="HIf-ra-ApH"/>
+                                                <constraint firstAttribute="height" constant="75" id="HIf-ra-ApH"/>
                                             </constraints>
-                                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                                            <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                             <nil key="textColor"/>
                                             <nil key="highlightedColor"/>
                                         </label>
-                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9fz-sr-8Gv" userLabel="message">
-                                            <rect key="frame" x="47" y="70" width="320" height="44"/>
+                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9fz-sr-8Gv" userLabel="message">
+                                            <rect key="frame" x="47" y="110" width="320" height="44"/>
                                             <constraints>
                                                 <constraint firstAttribute="height" constant="44" id="w3S-Mr-J41"/>
                                             </constraints>
-                                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                                            <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                             <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
                                             <nil key="highlightedColor"/>
                                         </label>
@@ -66,7 +66,7 @@
                                         <constraint firstItem="YPu-No-c8x" firstAttribute="top" secondItem="9Bv-1W-yVV" secondAttribute="topMargin" constant="-6" id="Z41-Sh-h01"/>
                                         <constraint firstAttribute="trailingMargin" secondItem="YPu-No-c8x" secondAttribute="trailing" constant="2" id="ato-Mb-ehY"/>
                                         <constraint firstItem="9fz-sr-8Gv" firstAttribute="leading" secondItem="pg1-7p-7Rz" secondAttribute="leading" id="h4U-rq-Ehk"/>
-                                        <constraint firstItem="9fz-sr-8Gv" firstAttribute="top" secondItem="pg1-7p-7Rz" secondAttribute="bottom" constant="5" id="heM-QX-U30"/>
+                                        <constraint firstItem="9fz-sr-8Gv" firstAttribute="top" secondItem="pg1-7p-7Rz" secondAttribute="bottom" constant="8" id="heM-QX-U30"/>
                                         <constraint firstItem="YPu-No-c8x" firstAttribute="leading" secondItem="9Bv-1W-yVV" secondAttribute="leadingMargin" constant="41" id="oKi-mq-icZ"/>
                                         <constraint firstItem="pg1-7p-7Rz" firstAttribute="leading" secondItem="9Bv-1W-yVV" secondAttribute="leadingMargin" constant="39" id="wM1-G2-xgz"/>
                                     </constraints>
@@ -96,7 +96,7 @@
             <objects>
                 <navigationController storyboardIdentifier="CCNotification" automaticallyAdjustsScrollViewInsets="NO" id="eRR-MW-ghy" sceneMemberID="viewController">
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="jDh-Ju-bUL">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="jDh-Ju-bUL">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>

+ 8 - 5
iOSClient/Notification/CCNotification.swift

@@ -132,11 +132,11 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
         
         if notification.message.characters.count > 0 {
             
-            return 120
+            return 160
             
         } else {
             
-            return 80
+            return 120
         }
     }
     
@@ -163,10 +163,13 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
         } else {
             
             let notification = appDelegate.listOfNotifications.object(at: indexPath.row) as! OCNotifications
+            let urlIcon = URL(string: notification.icon)
+            var image : UIImage?
             
-            let urlIcon = URL(string: notification.icon)!
-            let pathFileName = (appDelegate.directoryUser) + "/" + urlIcon.lastPathComponent
-            let image = UIImage(contentsOfFile: pathFileName)
+            if urlIcon != nil {
+                let pathFileName = (appDelegate.directoryUser) + "/" + (urlIcon?.lastPathComponent)!
+                image = UIImage(contentsOfFile: pathFileName)
+            }
             
             if image == nil {
                 

+ 14 - 3
iOSClient/Settings/CCSettings.m

@@ -24,6 +24,7 @@
 #import "CCSettings.h"
 #import "AppDelegate.h"
 #import "CCMain.h"
+#import "TableAccount+CoreDataClass.h"
 
 #define alertViewEsci 1
 #define alertViewAzzeraCache 2
@@ -101,6 +102,12 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"detailTextLabel.font"];
     [section addFormRow:row];
     
+    // information
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"userinformation" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_information_", nil)];
+    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"detailTextLabel.font"];
+    [section addFormRow:row];
+    
     // quota
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"quota" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_quota_", nil)];
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
@@ -314,6 +321,7 @@
     
     XLFormRowDescriptor *rowUrlCloud = [self.form formRowWithTag:@"urlcloud"];
     XLFormRowDescriptor *rowUserNameCloud = [self.form formRowWithTag:@"usernamecloud"];
+    XLFormRowDescriptor *rowUserInformation = [self.form formRowWithTag:@"userinformation"];
     XLFormRowDescriptor *rowQuota = [self.form formRowWithTag:@"quota"];
     
     // ------------------------------------------------------------------
@@ -329,12 +337,15 @@
     if ([CCUtility getSimplyBlockCode]) [rowSimplyPasscode setValue:@1]; else [rowSimplyPasscode setValue:@0];
     if ([CCUtility getOnlyLockDir]) [rowOnlyLockDir setValue:@1]; else [rowOnlyLockDir setValue:@0];
     
+    TableAccount *tableAccount = [CCCoreData getActiveAccount];
+    
     rowVersionServer.value =  [CCNetworking sharedNetworking].sharedOCCommunication.getCurrentServerVersion;
     rowUrlCloud.value = app.activeUrl;
-    rowUserNameCloud.value = app.activeUser;
+    rowUserNameCloud.value = [NSString stringWithFormat:@"%@ - %@",app.activeUser, tableAccount.displayName];
+    rowUserInformation.value = [NSString stringWithFormat:@"%@  %@",tableAccount.address, tableAccount.phone];
     
-    NSString *quota = [CCUtility transformedSize:(app.quotaAvailable + app.quotaUsed)];
-    NSString *quotaAvailable = [CCUtility transformedSize:(app.quotaAvailable)];
+    NSString *quota = [CCUtility transformedSize:[tableAccount.quotaTotal doubleValue]];
+    NSString *quotaAvailable = [CCUtility transformedSize:[tableAccount.quotaFree doubleValue]];
     
     rowQuota.value = [NSString stringWithFormat:@"%@ / %@ %@", quota, quotaAvailable, NSLocalizedString(@"_available_", nil)];