accounts: import/export

Allow import/export of accounts in the preferences.
PathPasswordWC is a generic modal window asking for a path and a
password. It is used for both export and import UI.

Tuleap: #335
Change-Id: Ic478140e64b51d10672ef466509326fc17be2712
diff --git a/ui/Base.lproj/Accounts.xib b/ui/Base.lproj/Accounts.xib
index f5be086..d764466 100644
--- a/ui/Base.lproj/Accounts.xib
+++ b/ui/Base.lproj/Accounts.xib
@@ -10,6 +10,7 @@
                 <outlet property="accountsListView" destination="jXv-6I-P9R" id="MzW-0C-PN1"/>
                 <outlet property="advancedTabItem" destination="RT7-u6-bhe" id="eAT-ce-MyD"/>
                 <outlet property="configPanels" destination="Jki-s4-F1W" id="nY4-dc-CQg"/>
+                <outlet property="exportAccountButton" destination="8zw-sS-2ZT" id="aIw-Go-uB4"/>
                 <outlet property="generalTabItem" destination="tPR-Ac-N5Y" id="39S-pz-1Xs"/>
                 <outlet property="mediaTabItem" destination="lxr-my-vH8" id="BhJ-cS-yVi"/>
                 <outlet property="protocolList" destination="rZv-qd-BGe" id="yU0-6C-Vt1"/>
@@ -64,12 +65,12 @@
                     </connections>
                 </tabView>
                 <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="57" horizontalPageScroll="10" verticalLineScroll="57" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZBN-hf-rGe">
-                    <rect key="frame" x="20" y="215" width="250" height="400"/>
+                    <rect key="frame" x="20" y="149" width="250" height="400"/>
                     <clipView key="contentView" id="f8N-NI-2Mk">
                         <rect key="frame" x="0.0" y="0.0" width="250" height="400"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="55" rowSizeStyle="automatic" viewBased="YES" outlineTableColumn="eOe-f3-q88" id="jXv-6I-P9R" customClass="RingOutlineView">
+                            <outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" autosaveColumns="NO" rowHeight="55" rowSizeStyle="automatic" viewBased="YES" outlineTableColumn="eOe-f3-q88" id="jXv-6I-P9R" customClass="RingOutlineView">
                                 <rect key="frame" x="0.0" y="0.0" width="250" height="0.0"/>
                                 <autoresizingMask key="autoresizingMask"/>
                                 <size key="intercellSpacing" width="3" height="2"/>
@@ -160,20 +161,20 @@
                         <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                     </clipView>
                     <constraints>
+                        <constraint firstAttribute="height" constant="400" id="UBl-FT-gaL"/>
                         <constraint firstAttribute="width" constant="250" id="aC0-6T-CUo"/>
-                        <constraint firstAttribute="height" constant="400" id="wNL-XJ-NLj"/>
                     </constraints>
                     <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="x1l-v5-r0B">
                         <rect key="frame" x="1" y="119" width="223" height="15"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </scroller>
                     <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="nVp-Qk-GaJ">
-                        <rect key="frame" x="224" y="17" width="15" height="102"/>
+                        <rect key="frame" x="234" y="0.0" width="16" height="0.0"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </scroller>
                 </scrollView>
                 <button identifier="RemoveAccount" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="99I-xI-Ioi">
-                    <rect key="frame" x="14" y="179" width="82" height="32"/>
+                    <rect key="frame" x="14" y="113" width="82" height="32"/>
                     <constraints>
                         <constraint firstAttribute="height" constant="21" id="Lcf-3l-7oj"/>
                         <constraint firstAttribute="width" constant="70" id="YaI-pj-FUh"/>
@@ -187,7 +188,7 @@
                     </connections>
                 </button>
                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zWn-Zy-Uau">
-                    <rect key="frame" x="14" y="125" width="82" height="32"/>
+                    <rect key="frame" x="14" y="562" width="82" height="32"/>
                     <constraints>
                         <constraint firstAttribute="width" constant="70" id="wC2-dX-oeG"/>
                     </constraints>
@@ -199,8 +200,8 @@
                         <action selector="addAccount:" target="-2" id="P9N-LS-Ikk"/>
                     </connections>
                 </button>
-                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9VL-9a-rDg">
-                    <rect key="frame" x="18" y="161" width="107" height="17"/>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9VL-9a-rDg">
+                    <rect key="frame" x="18" y="598" width="105" height="17"/>
                     <constraints>
                         <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="41" id="VFE-du-cB1"/>
                     </constraints>
@@ -211,7 +212,7 @@
                     </textFieldCell>
                 </textField>
                 <popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rZv-qd-BGe">
-                    <rect key="frame" x="96" y="129" width="177" height="26"/>
+                    <rect key="frame" x="96" y="566" width="177" height="26"/>
                     <popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" identifier="protocolList" imageScaling="proportionallyDown" inset="2" id="bfy-Lh-jXj">
                         <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
                         <font key="font" metaFont="menu"/>
@@ -225,8 +226,11 @@
                         <action selector="protocolSelectedChanged:" target="-2" id="83Y-L0-Bav"/>
                     </connections>
                 </popUpButton>
-                <button verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IqR-Q4-2bh">
-                    <rect key="frame" x="196" y="179" width="80" height="32"/>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IqR-Q4-2bh">
+                    <rect key="frame" x="199" y="113" width="77" height="32"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="65" id="QQX-uY-Hq2"/>
+                    </constraints>
                     <buttonCell key="cell" type="push" title="Down" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="6Co-ei-tUA">
                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                         <font key="font" metaFont="system"/>
@@ -235,8 +239,11 @@
                         <action selector="moveDown:" target="-2" id="0GS-Xo-bu7"/>
                     </connections>
                 </button>
-                <button verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dxk-Wh-H0B">
-                    <rect key="frame" x="120" y="179" width="80" height="32"/>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dxk-Wh-H0B">
+                    <rect key="frame" x="126" y="113" width="77" height="32"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="65" id="ZIi-di-Z52"/>
+                    </constraints>
                     <buttonCell key="cell" type="push" title="Up" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="HoA-BH-xam">
                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                         <font key="font" metaFont="system"/>
@@ -245,27 +252,47 @@
                         <action selector="moveUp:" target="-2" id="Na8-jb-xhV"/>
                     </connections>
                 </button>
+                <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="on2-tl-jhF">
+                    <rect key="frame" x="59" y="50" width="80" height="32"/>
+                    <buttonCell key="cell" type="push" title="Import" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="zov-Bb-Fgp">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="importAccount:" target="-2" id="0Dl-fT-SY4"/>
+                    </connections>
+                </button>
+                <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8zw-sS-2ZT">
+                    <rect key="frame" x="152" y="50" width="80" height="32"/>
+                    <buttonCell key="cell" type="push" title="Export" bezelStyle="rounded" alignment="center" enabled="NO" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="OeK-Sf-pdc">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="exportAccount:" target="-2" id="AXf-KV-GAn"/>
+                    </connections>
+                </button>
             </subviews>
             <constraints>
+                <constraint firstItem="9VL-9a-rDg" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="6f4-PL-Fhx"/>
                 <constraint firstAttribute="bottom" secondItem="Jki-s4-F1W" secondAttribute="bottom" constant="20" id="C1O-rd-eUI"/>
-                <constraint firstItem="ZBN-hf-rGe" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="HGs-9d-fQj"/>
-                <constraint firstItem="9VL-9a-rDg" firstAttribute="top" secondItem="99I-xI-Ioi" secondAttribute="bottom" constant="8" id="Hqz-b8-72b"/>
                 <constraint firstAttribute="trailing" secondItem="Jki-s4-F1W" secondAttribute="trailing" constant="20" id="J96-3h-sxa"/>
                 <constraint firstItem="zWn-Zy-Uau" firstAttribute="top" secondItem="rZv-qd-BGe" secondAttribute="top" id="KqW-8M-1Ad"/>
                 <constraint firstItem="99I-xI-Ioi" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" id="Mif-e1-csx"/>
                 <constraint firstItem="IqR-Q4-2bh" firstAttribute="top" secondItem="ZBN-hf-rGe" secondAttribute="bottom" constant="8" id="MpQ-8y-79O"/>
                 <constraint firstItem="zWn-Zy-Uau" firstAttribute="leading" secondItem="9VL-9a-rDg" secondAttribute="leading" id="N5s-qp-4jy"/>
-                <constraint firstItem="zWn-Zy-Uau" firstAttribute="top" secondItem="9VL-9a-rDg" secondAttribute="bottom" constant="8" id="PQk-F1-OVM"/>
-                <constraint firstItem="zWn-Zy-Uau" firstAttribute="bottom" secondItem="rZv-qd-BGe" secondAttribute="bottom" id="UIa-O1-w7s"/>
                 <constraint firstItem="rZv-qd-BGe" firstAttribute="trailing" secondItem="ZBN-hf-rGe" secondAttribute="trailing" id="UlG-Hv-ZCc"/>
+                <constraint firstItem="ZBN-hf-rGe" firstAttribute="top" secondItem="rZv-qd-BGe" secondAttribute="bottom" constant="20" id="Zpc-1R-BnS"/>
                 <constraint firstItem="Jki-s4-F1W" firstAttribute="leading" secondItem="ZBN-hf-rGe" secondAttribute="trailing" constant="8" id="Zzg-Tr-BVP"/>
+                <constraint firstItem="Jki-s4-F1W" firstAttribute="leading" secondItem="IqR-Q4-2bh" secondAttribute="trailing" constant="8" id="aSV-XE-k1u"/>
                 <constraint firstItem="zWn-Zy-Uau" firstAttribute="leading" secondItem="99I-xI-Ioi" secondAttribute="leading" id="b1b-5h-ggf"/>
                 <constraint firstItem="Jki-s4-F1W" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="fez-KJ-jhG"/>
+                <constraint firstItem="rZv-qd-BGe" firstAttribute="top" secondItem="9VL-9a-rDg" secondAttribute="bottom" constant="8" id="ge2-uV-Gff"/>
                 <constraint firstItem="zWn-Zy-Uau" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" id="lRr-SS-K5h"/>
+                <constraint firstItem="IqR-Q4-2bh" firstAttribute="leading" secondItem="dxk-Wh-H0B" secondAttribute="trailing" constant="8" id="pYF-s0-cSa"/>
                 <constraint firstItem="99I-xI-Ioi" firstAttribute="top" secondItem="ZBN-hf-rGe" secondAttribute="bottom" constant="8" id="qlR-1N-Pj8"/>
                 <constraint firstItem="ZBN-hf-rGe" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" id="u8B-Kk-OHn"/>
                 <constraint firstItem="rZv-qd-BGe" firstAttribute="leading" secondItem="zWn-Zy-Uau" secondAttribute="trailing" constant="8" id="y2z-JO-Y63"/>
-                <constraint firstItem="IqR-Q4-2bh" firstAttribute="leading" secondItem="dxk-Wh-H0B" secondAttribute="trailing" constant="8" id="yYZ-UL-F0F"/>
                 <constraint firstItem="dxk-Wh-H0B" firstAttribute="top" secondItem="ZBN-hf-rGe" secondAttribute="bottom" constant="8" id="zTd-2r-hid"/>
             </constraints>
             <point key="canvasLocation" x="542" y="273.5"/>