Marino Faggiana hace 6 años
padre
commit
4e91a8d720

+ 1 - 0
iOSClient/Main/Cell/CCCellMainTransfer.h

@@ -28,6 +28,7 @@
 
 @property(nonatomic, weak) IBOutlet UIImageView *file;
 @property(nonatomic, weak) IBOutlet UIImageView *status;
+@property(nonatomic, weak) IBOutlet UIImageView *user;
 
 @property(nonatomic, weak) IBOutlet UILabel *labelTitle;
 @property(nonatomic, weak) IBOutlet UILabel *labelInfoFile;

+ 20 - 8
iOSClient/Main/Cell/CCCellMainTransfer.xib

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -19,13 +19,13 @@
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QNC-8X-DAC" userLabel="labelTitle">
-                        <rect key="frame" x="65" y="13" width="480" height="18"/>
+                        <rect key="frame" x="65" y="13" width="38" height="18"/>
                         <fontDescription key="fontDescription" type="system" pointSize="15"/>
                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p7I-KN-FVZ" userLabel="labelInfoFile">
-                        <rect key="frame" x="65" y="31" width="480" height="15"/>
+                        <rect key="frame" x="65" y="31" width="31" height="15"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.63921568627450975" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
@@ -45,8 +45,12 @@
                         </constraints>
                     </imageView>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dhS-83-mLd" userLabel="transferButton" customClass="PKStopDownloadButton">
-                        <rect key="frame" x="558" y="14.5" width="29" height="29"/>
+                        <rect key="frame" x="557" y="15" width="30" height="30"/>
                         <color key="tintColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="30" id="D19-j7-ihe"/>
+                            <constraint firstAttribute="height" constant="30" id="cqM-8R-MXo"/>
+                        </constraints>
                         <userDefinedRuntimeAttributes>
                             <userDefinedRuntimeAttribute type="number" keyPath="radius">
                                 <real key="value" value="15"/>
@@ -65,6 +69,13 @@
                             </userDefinedRuntimeAttribute>
                         </userDefinedRuntimeAttributes>
                     </view>
+                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="jy6-cx-LK4">
+                        <rect key="frame" x="30" y="25" width="25" height="25"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="25" id="3xZ-lf-n4v"/>
+                            <constraint firstAttribute="height" constant="25" id="l81-IO-fzK"/>
+                        </constraints>
+                    </imageView>
                 </subviews>
                 <color key="tintColor" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                 <constraints>
@@ -73,13 +84,13 @@
                     <constraint firstItem="p7I-KN-FVZ" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="4Xt-42-ra7"/>
                     <constraint firstItem="5" firstAttribute="leading" secondItem="DQR-yN-JaH" secondAttribute="trailing" constant="-10" id="6Op-l4-GTN"/>
                     <constraint firstItem="DQR-yN-JaH" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="-10" id="CGn-pQ-QmD"/>
+                    <constraint firstItem="jy6-cx-LK4" firstAttribute="bottom" secondItem="5" secondAttribute="bottom" id="MNe-PS-i7m"/>
+                    <constraint firstItem="jy6-cx-LK4" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="Ooq-nL-VC8"/>
                     <constraint firstItem="5" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="asW-ir-Cfb"/>
                     <constraint firstItem="QNC-8X-DAC" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="top" constant="13" id="d78-LV-sUw"/>
                     <constraint firstItem="dhS-83-mLd" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="eA9-jd-n75"/>
                     <constraint firstAttribute="trailing" secondItem="dhS-83-mLd" secondAttribute="trailing" constant="13" id="j62-Bl-LTq"/>
                     <constraint firstAttribute="bottom" secondItem="p7I-KN-FVZ" secondAttribute="bottom" constant="13.5" id="ofO-Ef-6wt"/>
-                    <constraint firstItem="dhS-83-mLd" firstAttribute="leading" secondItem="QNC-8X-DAC" secondAttribute="trailing" constant="13" id="vgg-Ni-Tci"/>
-                    <constraint firstItem="dhS-83-mLd" firstAttribute="leading" secondItem="p7I-KN-FVZ" secondAttribute="trailing" constant="13" id="zUF-S2-yOW"/>
                 </constraints>
             </tableViewCellContentView>
             <connections>
@@ -88,8 +99,9 @@
                 <outlet property="labelTitle" destination="QNC-8X-DAC" id="coV-Xj-n1Q"/>
                 <outlet property="status" destination="DQR-yN-JaH" id="neR-jW-zwL"/>
                 <outlet property="transferButton" destination="dhS-83-mLd" id="eza-fH-eAU"/>
+                <outlet property="user" destination="jy6-cx-LK4" id="PgZ-Rz-vJZ"/>
             </connections>
-            <point key="canvasLocation" x="414" y="244"/>
+            <point key="canvasLocation" x="662.39999999999998" y="219.49025487256372"/>
         </tableViewCell>
     </objects>
 </document>

+ 19 - 0
iOSClient/Main/NCMainCommon.swift

@@ -717,6 +717,25 @@ class NCMainCommon: NSObject {
             // Progress
             cell.transferButton.progress = progress
             
+            // User
+            if metadata.account != appDelegate.activeAccount {
+                let tableAccount = NCManageDatabase.sharedInstance.getAccount(predicate: NSPredicate(format: "account == %@", metadata.account))
+                if tableAccount != nil {
+                    let fileNamePath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(tableAccount?.user, activeUrl: tableAccount?.url) + "-avatar.png"
+                    var avatar = UIImage.init(contentsOfFile: fileNamePath)
+                    if avatar != nil {
+                        let avatarImageView = CCAvatar.init(image: avatar, borderColor: UIColor.lightGray, borderWidth: 0.5)
+                        let imageSize = avatarImageView?.bounds.size
+                        UIGraphicsBeginImageContext(imageSize!)
+                        let context = UIGraphicsGetCurrentContext()
+                        avatarImageView?.layer.render(in: context!)
+                        avatar = UIGraphicsGetImageFromCurrentImageContext()
+                        UIGraphicsEndImageContext()
+                        cell.user.image = avatar
+                    }
+                }
+            }
+            
             return cell
         }
     }