blockchain: register name in account settings

- Show field of blockchain server. No edition possible yet since this
feature has not been tested well enough
- Display register name window

Change-Id: I2b19ce83e40de9a6cda0e0ec601516b75c01702b
Tuleap: #1158
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2b5f558..b427364 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,6 +156,8 @@
    src/RingWizardNewAccountVC.h
    src/DialpadWC.mm
    src/DialpadWC.h
+   src/RegisterNameWC.mm
+   src/RegisterNameWC.h
 )
 
 SET(ringclient_BACKENDS
@@ -223,6 +225,7 @@
    RingWizardNewAccount
    RingWizardChoose
    Dialpad
+   RegisterNameWindow
 )
 
 # Icons
diff --git a/src/AccRingVC.mm b/src/AccRingVC.mm
index 4b9dc1d..1705e57 100644
--- a/src/AccRingVC.mm
+++ b/src/AccRingVC.mm
@@ -21,26 +21,34 @@
 #import <accountmodel.h>
 #import <qitemselectionmodel.h>
 
-@interface AccRingVC ()
+#import "RegisterNameWC.h"
 
-@property (assign) IBOutlet NSTextField *aliasTextField;
-@property (assign) IBOutlet NSTextField *bootstrapField;
-@property (assign) IBOutlet NSTextField *hashField;
+@interface AccRingVC () <RegisterNameDelegate>
 
-@property (assign) IBOutlet NSButton *upnpButton;
-@property (assign) IBOutlet NSButton *autoAnswerButton;
-@property (assign) IBOutlet NSButton *userAgentButton;
-@property (assign) IBOutlet NSTextField *userAgentTextField;
+@property (unsafe_unretained) IBOutlet NSTextField *aliasTextField;
+@property (unsafe_unretained) IBOutlet NSTextField *bootstrapField;
+@property (unsafe_unretained) IBOutlet NSTextField *blockchainField;
+@property (unsafe_unretained) IBOutlet NSTextField *ringIDField;
+@property (unsafe_unretained) IBOutlet NSButton *registerBlockchainNameButton;
+@property (unsafe_unretained) IBOutlet NSTextField *registeredNameField;
+
+@property (unsafe_unretained) IBOutlet NSButton *upnpButton;
+@property (unsafe_unretained) IBOutlet NSButton *autoAnswerButton;
+@property (unsafe_unretained) IBOutlet NSButton *userAgentButton;
+@property (unsafe_unretained) IBOutlet NSTextField *userAgentTextField;
 @property (unsafe_unretained) IBOutlet NSButton *allowUnknown;
 @property (unsafe_unretained) IBOutlet NSButton *allowHistory;
 @property (unsafe_unretained) IBOutlet NSButton *allowContacts;
 
+@property AbstractLoadingWC* accountModal;
+
 @end
 
 @implementation AccRingVC
 @synthesize bootstrapField;
-@synthesize hashField;
+@synthesize ringIDField;
 @synthesize aliasTextField;
+@synthesize blockchainField;
 @synthesize upnpButton;
 @synthesize autoAnswerButton;
 @synthesize userAgentButton;
@@ -51,6 +59,7 @@
     ALIAS = 0,
     HOSTNAME,
     USERAGENT,
+    BLOCKCHAIN,
 };
 
 - (void)awakeFromNib
@@ -59,6 +68,7 @@
     [aliasTextField setTag:TagViews::ALIAS];
     [userAgentTextField setTag:TagViews::USERAGENT];
     [bootstrapField setTag:TagViews::HOSTNAME];
+    [blockchainField setTag:TagViews::BLOCKCHAIN];
 
     QObject::connect(AccountModel::instance().selectionModel(),
                      &QItemSelectionModel::currentChanged,
@@ -90,13 +100,37 @@
     [userAgentTextField setStringValue:account->userAgent().toNSString()];
 
     [bootstrapField setStringValue:account->hostname().toNSString()];
+    [blockchainField setStringValue:account->nameServiceURL().toNSString()];
 
-    if([account->username().toNSString() isEqualToString:@""])
-        [hashField setStringValue:NSLocalizedString(@"Reopen account to see your hash",
+    if([account->username().toNSString() isEqualToString:@""]) {
+        [ringIDField setStringValue:NSLocalizedString(@"Reopen account to see your hash",
                                                     @"Show advice to user")];
-    else
-        [hashField setStringValue:account->username().toNSString()];
+    } else {
+        [ringIDField setStringValue:account->username().toNSString()];
+    }
 
+    [self refreshRegisteredName:account];
+}
+
+- (void) refreshRegisteredName:(Account*) account
+{
+    [self.registerBlockchainNameButton setHidden:!account->registeredName().isEmpty()];
+    [self.registeredNameField setStringValue:account->registeredName().toNSString()];
+}
+
+- (IBAction)startNameRegistration:(id)sender
+{
+    auto registerWC = [[RegisterNameWC alloc] initWithDelegate:self];
+#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_9
+    [self.view.window beginSheet:registerWC.window completionHandler:nil];
+#else
+    [NSApp beginSheet: registerWC.window
+       modalForWindow: self.view.window
+        modalDelegate: self
+       didEndSelector: nil
+          contextInfo: nil];
+#endif
+    self.accountModal = registerWC;
 }
 
 - (IBAction)toggleUpnp:(NSButton *)sender {
@@ -146,9 +180,18 @@
         case TagViews::USERAGENT:
             AccountModel::instance().selectedAccount()->setUserAgent([[textField stringValue] UTF8String]);
             break;
+        case TagViews::BLOCKCHAIN:
+            AccountModel::instance().selectedAccount()->setNameServiceURL([[textField stringValue] UTF8String]);
+            break;
         default:
             break;
     }
 }
 
+- (void) didRegisterNameWithSuccess
+{
+    [self.accountModal close];
+    [self refreshRegisteredName:AccountModel::instance().selectedAccount()];
+}
+
 @end
diff --git a/src/RegisterNameWC.h b/src/RegisterNameWC.h
new file mode 100644
index 0000000..ae54e29
--- /dev/null
+++ b/src/RegisterNameWC.h
@@ -0,0 +1,55 @@
+/*
+ *  Copyright (C) 2016 Savoir-faire Linux Inc.
+ *  Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+#import "AbstractLoadingWC.h"
+#import "LoadingWCDelegate.h"
+
+@protocol RegisterNameDelegate <LoadingWCDelegate>
+
+@optional
+
+- (void) didRegisterNameWithSuccess;
+
+@end
+
+@interface RegisterNameWC : AbstractLoadingWC
+
+- (id)initWithDelegate:(id <LoadingWCDelegate>) del;
+
+@property (nonatomic, weak) NSWindowController <RegisterNameDelegate>* delegate;
+
+/**
+ * KVO with the registeredNameField
+ */
+@property (nonatomic, weak)NSString* registeredName;
+
+/**
+ * KVO with the passwordField
+ */
+@property (nonatomic, weak)NSString* password;
+
+/**
+ * KVO validators for the UI
+ */
+@property (readonly)BOOL isPasswordValid;
+@property (assign)BOOL isUserNameAvailable;
+
+@end
diff --git a/src/RegisterNameWC.mm b/src/RegisterNameWC.mm
new file mode 100644
index 0000000..063018f
--- /dev/null
+++ b/src/RegisterNameWC.mm
@@ -0,0 +1,248 @@
+/*
+ *  Copyright (C) 2016 Savoir-faire Linux Inc.
+ *  Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
+ */
+
+#import "RegisterNameWC.h"
+
+
+//Cocoa
+#import <AddressBook/AddressBook.h>
+
+//LRC
+#import <accountmodel.h>
+#import <QItemSelectionModel>
+#import <account.h>
+
+#import "AppDelegate.h"
+
+@interface RegisterNameWC ()
+@end
+
+@implementation RegisterNameWC
+{
+    __unsafe_unretained IBOutlet NSTextField* registeredNameField;
+    __unsafe_unretained IBOutlet NSSecureTextField* passwordField;
+    __unsafe_unretained IBOutlet NSImageView* ivLookupResult;
+    __unsafe_unretained IBOutlet NSProgressIndicator* indicatorLookupResult;
+
+    __unsafe_unretained IBOutlet NSProgressIndicator *registrationProgress;
+
+    QMetaObject::Connection registrationEnded;
+    QMetaObject::Connection registeredNameFound;
+
+    BOOL lookupQueued;
+    NSString* usernameWaitingForLookupResult;
+}
+
+NSInteger const BLOCKCHAIN_NAME_TAG             = 2;
+
+- (id)initWithDelegate:(id <LoadingWCDelegate>) del
+{
+    return [self initWithDelegate:del actionCode:0];
+}
+
+- (id)initWithDelegate:(id <RegisterNameDelegate>) del actionCode:(NSInteger) code
+{
+    return [super initWithWindowNibName:@"RegisterNameWindow" delegate:del actionCode:code];
+}
+
+- (void)windowDidLoad
+{
+    [super windowDidLoad];
+    [registeredNameField setTag:BLOCKCHAIN_NAME_TAG];
+    self.registeredName = @"";
+    [ivLookupResult setHidden:YES];
+    [indicatorLookupResult setHidden:YES];
+}
+
+#pragma mark - Input validation
+
+- (BOOL)isPasswordValid
+{
+    return self.password.length >= 6;
+}
+
+#pragma mark - Username validation delegate methods
+
+- (BOOL)userNameAvailable
+{
+    return (self.registeredName.length > 0 && self.isUserNameAvailable);
+}
+
+- (void)showLookUpAvailable:(BOOL)available andText:(NSString *)message
+{
+    [ivLookupResult setImage:[NSImage imageNamed:(available?@"ic_action_accept":@"ic_action_cancel")]] ;
+    [ivLookupResult setHidden:NO];
+    [ivLookupResult setToolTip:message];
+}
+
+- (void)onUsernameAvailabilityChangedWithNewAvailability:(BOOL)newAvailability
+{
+    self.isUserNameAvailable = newAvailability;
+}
+
+- (void)hideLookupSpinner
+{
+    [indicatorLookupResult setHidden:YES];
+}
+
+- (void)showLookupSpinner
+{
+    [ivLookupResult setHidden:YES];
+    [indicatorLookupResult setHidden:NO];
+    [indicatorLookupResult startAnimation:nil];
+}
+
+- (BOOL)lookupUserName
+{
+    [self showLookupSpinner];
+    QObject::disconnect(registeredNameFound);
+    registeredNameFound = QObject::connect(
+                                           &NameDirectory::instance(),
+                                           &NameDirectory::registeredNameFound,
+                                           [=] ( const Account* account, NameDirectory::LookupStatus status,  const QString& address, const QString& name) {
+                                               NSLog(@"Name lookup ended");
+                                               lookupQueued = NO;
+                                               //If this is the username we are waiting for, we can disconnect.
+                                               if (name.compare(QString::fromNSString(usernameWaitingForLookupResult)) == 0) {
+                                                   QObject::disconnect(registeredNameFound);
+                                               } else {
+                                                   //Keep waiting...
+                                                   return;
+                                               }
+
+                                               //We may now stop the spinner
+                                               [self hideLookupSpinner];
+
+                                               BOOL isAvailable = NO;
+                                               NSString* message;
+                                               switch(status)
+                                               {
+                                                   case NameDirectory::LookupStatus::SUCCESS:
+                                                   {
+                                                       message = NSLocalizedString(@"The entered username is not available",
+                                                                                   @"Text shown to user when his username is already registered");
+                                                       isAvailable = NO;
+                                                       break;
+                                                   }
+                                                   case NameDirectory::LookupStatus::NOT_FOUND:
+                                                   {
+                                                       message = NSLocalizedString(@"The entered username is available",
+                                                                                   @"Text shown to user when his username is available to be registered");
+                                                       isAvailable = YES;
+                                                       break;
+                                                   }
+                                                   case NameDirectory::LookupStatus::INVALID_NAME:
+                                                   {
+                                                       message = NSLocalizedString(@"The entered username is invalid. It must have at leat 3 characters and contains only lowercase alphanumeric characters.",
+                                                                                   @"Text shown to user when his username is invalid to be registered");
+                                                       isAvailable = NO;
+                                                       break;
+                                                   }
+                                                   case NameDirectory::LookupStatus::ERROR:
+                                                   default:
+                                                   {
+                                                       message = NSLocalizedString(@"Failed to perform lookup",
+                                                                                   @"Text shown to user when an error occur at registration");
+                                                       isAvailable = NO;
+                                                       break;
+                                                   }
+                                               }
+                                               [self showLookUpAvailable:isAvailable andText: message];
+                                               [self onUsernameAvailabilityChangedWithNewAvailability:isAvailable];
+
+                                           }
+                                           );
+
+    //Start the lookup in a second so that the UI dosen't seem to freeze
+    BOOL result = NameDirectory::instance().lookupName(nullptr, QString(), QString::fromNSString(usernameWaitingForLookupResult));
+
+}
+
+- (void)controlTextDidChange:(NSNotification *)notif
+{
+    NSTextField* textField = [notif object];
+    if (textField.tag != BLOCKCHAIN_NAME_TAG) {
+        return;
+    }
+    NSString* alias = textField.stringValue;
+
+    [self showLookupSpinner];
+    [self onUsernameAvailabilityChangedWithNewAvailability:NO];
+    [NSObject cancelPreviousPerformRequestsWithTarget:self];
+    [self performSelector:@selector(lookUp:) withObject:alias afterDelay:0.5];
+}
+
+- (void) lookUp:(NSString*) name
+{
+    if (!lookupQueued) {
+        usernameWaitingForLookupResult = name;
+        lookupQueued = YES;
+        [self lookupUserName];
+    }
+}
+
+#pragma mark - Registration process
+
+- (IBAction)registerUsername:(id)sender
+{
+    [registrationProgress startAnimation:nil];
+    [self showLoading];
+    [self setCallback];
+
+    self.isUserNameAvailable = AccountModel::instance().selectedAccount()->registerName(QString::fromNSString(self.password),
+                                                                                        QString::fromNSString(self.registeredName));
+    if (!self.isUserNameAvailable) {
+        NSLog(@"Could not initialize registerName operation");
+        QObject::disconnect(registrationEnded);
+    }
+}
+
+- (void)setCallback
+{
+    QObject::disconnect(registrationEnded);
+    registrationEnded = QObject::connect(AccountModel::instance().selectedAccount(),
+                                         &Account::nameRegistrationEnded,
+                                         [=] (NameDirectory::RegisterNameStatus status,  const QString& name)
+                                         {
+                                             QObject::disconnect(registrationEnded);
+                                             switch(status) {
+                                                 case NameDirectory::RegisterNameStatus::WRONG_PASSWORD:
+                                                 case NameDirectory::RegisterNameStatus::ALREADY_TAKEN:
+                                                 case NameDirectory::RegisterNameStatus::NETWORK_ERROR:
+                                                     [self showError];
+                                                     break;
+                                                 case NameDirectory::RegisterNameStatus::SUCCESS:
+                                                     [self.delegate didRegisterNameWithSuccess];
+                                                     break;
+                                             }
+                                         });
+}
+
+
++ (NSSet *)keyPathsForValuesAffectingUserNameAvailableORNotBlockchain
+{
+    return [NSSet setWithObjects: NSStringFromSelector(@selector(isUserNameAvailable)), nil];
+}
+
++ (NSSet *)keyPathsForValuesAffectingIsPasswordValid
+{
+    return [NSSet setWithObjects:@"password", nil];
+}
+
+@end
diff --git a/ui/Base.lproj/AccRing.xib b/ui/Base.lproj/AccRing.xib
index cfb0536..a42adae 100644
--- a/ui/Base.lproj/AccRing.xib
+++ b/ui/Base.lproj/AccRing.xib
@@ -2,6 +2,8 @@
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="16B2553a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
+        <capability name="Alignment constraints to the first baseline" minToolsVersion="6.0"/>
+        <capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="AccRingVC">
@@ -11,8 +13,11 @@
                 <outlet property="allowHistory" destination="c6K-nF-ezL" id="d4A-JI-MHb"/>
                 <outlet property="allowUnknown" destination="reK-M8-Eie" id="cVi-aY-v2K"/>
                 <outlet property="autoAnswerButton" destination="6uh-UC-6i9" id="6e1-1I-OY3"/>
+                <outlet property="blockchainField" destination="gCl-aM-td9" id="0yr-mK-DoC"/>
                 <outlet property="bootstrapField" destination="phb-wW-DQS" id="kcY-7z-bjM"/>
-                <outlet property="hashField" destination="c6M-WV-uVk" id="Jhb-0k-sBc"/>
+                <outlet property="registerBlockchainNameButton" destination="Ddu-Gm-dVv" id="65l-z1-9ta"/>
+                <outlet property="registeredNameField" destination="MwI-Dp-6ii" id="zxN-3A-N0P"/>
+                <outlet property="ringIDField" destination="c6M-WV-uVk" id="mjI-fW-Ft2"/>
                 <outlet property="upnpButton" destination="eaR-8q-smW" id="8KN-3k-B3c"/>
                 <outlet property="userAgentButton" destination="e6G-kW-opo" id="HC1-QL-Z0U"/>
                 <outlet property="userAgentTextField" destination="fJM-4J-mvZ" id="2jX-ak-jgJ"/>
@@ -22,14 +27,11 @@
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="629" height="424"/>
+            <rect key="frame" x="0.0" y="0.0" width="629" height="407"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iSd-2v-I3h">
-                    <rect key="frame" x="18" y="387" width="58" height="17"/>
-                    <constraints>
-                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="52" id="4PJ-hh-4LN"/>
-                    </constraints>
+                    <rect key="frame" x="18" y="370" width="58" height="17"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Account" id="1Sx-Et-CDM">
                         <font key="font" metaFont="systemBold"/>
                         <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -37,11 +39,11 @@
                     </textFieldCell>
                 </textField>
                 <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="D7f-4A-xXM">
-                    <rect key="frame" x="135" y="357" width="154" height="22"/>
+                    <rect key="frame" x="155" y="341" width="154" height="21"/>
                     <constraints>
-                        <constraint firstAttribute="width" constant="154" id="Gon-tm-69r"/>
+                        <constraint firstAttribute="width" constant="154" id="OIw-ij-Jc7"/>
                     </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Name or nickname..." drawsBackground="YES" id="HN3-i9-zmw">
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Name or nickname..." bezelStyle="round" id="HN3-i9-zmw">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -51,9 +53,9 @@
                     </connections>
                 </textField>
                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="idQ-yZ-XB3">
-                    <rect key="frame" x="95" y="360" width="34" height="17"/>
+                    <rect key="frame" x="18" y="343" width="131" height="17"/>
                     <constraints>
-                        <constraint firstAttribute="width" constant="30" id="nRP-gu-xqb"/>
+                        <constraint firstAttribute="width" constant="127" id="4zR-td-c0O"/>
                     </constraints>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Alias" id="Wzq-V2-YLU">
                         <font key="font" metaFont="system"/>
@@ -61,40 +63,26 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="EVi-Oa-N9k">
-                    <rect key="frame" x="295" y="361" width="316" height="14"/>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="This will be displayed to unknown peers" id="0Yt-xC-OWa">
-                        <font key="font" metaFont="smallSystem"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FlW-Vd-Eem">
-                    <rect key="frame" x="38" y="236" width="112" height="17"/>
+                    <rect key="frame" x="38" y="254" width="112" height="17"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Bootstrap server" id="B6b-iB-REZ">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" misplaced="YES" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4QL-FW-Kjb">
-                    <rect key="frame" x="40" y="301" width="571" height="24"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="24" id="PLh-Bg-UXZ"/>
-                    </constraints>
-                    <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="This is your RingID. Copy and share it with your friends!" id="bca-Wv-Xul">
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="u7B-1Y-aZ4">
+                    <rect key="frame" x="40" y="318" width="112" height="17"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="RingID" id="8WI-fC-Due">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="P8b-Ru-H5G">
-                    <rect key="frame" x="18" y="332" width="97" height="17"/>
-                    <constraints>
-                        <constraint firstAttribute="width" constant="93" id="vYc-ad-Epx"/>
-                    </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Ring Identifier" id="dPO-b1-o58">
-                        <font key="font" metaFont="systemBold"/>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ACD-mw-NMI">
+                    <rect key="frame" x="40" y="291" width="112" height="17"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Registered Name" id="sBB-y7-xhL">
+                        <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
@@ -102,7 +90,7 @@
                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DUI-3g-gHb">
                     <rect key="frame" x="18" y="102" width="85" height="17"/>
                     <constraints>
-                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="81" id="QUl-KS-t7T"/>
+                        <constraint firstAttribute="width" constant="81" id="9yh-6o-5CF"/>
                     </constraints>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Permissions" id="EDd-FX-wcz">
                         <font key="font" metaFont="systemBold"/>
@@ -111,11 +99,11 @@
                     </textFieldCell>
                 </textField>
                 <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="phb-wW-DQS">
-                    <rect key="frame" x="156" y="233" width="303" height="22"/>
+                    <rect key="frame" x="158" y="251" width="303" height="22"/>
                     <constraints>
-                        <constraint firstAttribute="width" constant="303" id="XJW-G4-8oP"/>
+                        <constraint firstAttribute="width" constant="303" id="jgH-aI-hLW"/>
                     </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="WQz-3X-MeC">
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" bezelStyle="round" id="WQz-3X-MeC">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -127,7 +115,7 @@
                 <button translatesAutoresizingMaskIntoConstraints="NO" id="6uh-UC-6i9">
                     <rect key="frame" x="40" y="165" width="135" height="18"/>
                     <constraints>
-                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="131" id="nz6-VO-e7L"/>
+                        <constraint firstAttribute="width" constant="131" id="ucC-Fg-wm2"/>
                     </constraints>
                     <buttonCell key="cell" type="check" title="Auto-answer calls" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="OeY-na-0YT">
                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -140,7 +128,7 @@
                 <button translatesAutoresizingMaskIntoConstraints="NO" id="e6G-kW-opo">
                     <rect key="frame" x="40" y="134" width="168" height="18"/>
                     <constraints>
-                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="164" id="5wa-WK-mit"/>
+                        <constraint firstAttribute="width" constant="164" id="8KH-j1-D7I"/>
                     </constraints>
                     <buttonCell key="cell" type="check" title="Use custom user-agent" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="ddk-1G-0jU">
                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -153,9 +141,9 @@
                 <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fJM-4J-mvZ">
                     <rect key="frame" x="214" y="132" width="195" height="22"/>
                     <constraints>
-                        <constraint firstAttribute="width" constant="195" id="WWj-hO-krj"/>
+                        <constraint firstAttribute="width" constant="195" id="pup-8Z-mAe"/>
                     </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="Rs0-jZ-NYs">
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" bezelStyle="round" id="Rs0-jZ-NYs">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -166,9 +154,6 @@
                 </textField>
                 <button translatesAutoresizingMaskIntoConstraints="NO" id="eaR-8q-smW">
                     <rect key="frame" x="40" y="195" width="110" height="18"/>
-                    <constraints>
-                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="106" id="jHN-QU-IsY"/>
-                    </constraints>
                     <buttonCell key="cell" type="check" title="Upnp enabled" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="lHI-bz-ddQ">
                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                         <font key="font" metaFont="system"/>
@@ -177,7 +162,7 @@
                         <action selector="toggleUpnp:" target="-2" id="Ptl-25-3Xz"/>
                     </connections>
                 </button>
-                <button misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="c6K-nF-ezL">
+                <button translatesAutoresizingMaskIntoConstraints="NO" id="c6K-nF-ezL">
                     <rect key="frame" x="40" y="44" width="571" height="18"/>
                     <buttonCell key="cell" type="check" title="Allow calls from peers in your call history" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="PaC-xE-SHA">
                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -187,7 +172,7 @@
                         <action selector="toggleAllowFromHistory:" target="-2" id="nl2-H4-ARL"/>
                     </connections>
                 </button>
-                <button misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="reK-M8-Eie">
+                <button translatesAutoresizingMaskIntoConstraints="NO" id="reK-M8-Eie">
                     <rect key="frame" x="40" y="71" width="571" height="18"/>
                     <buttonCell key="cell" type="check" title="Allow calls from unknown peers" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="kmI-jb-aal">
                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -197,7 +182,7 @@
                         <action selector="toggleAllowFromUnknown:" target="-2" id="St8-jV-rUj"/>
                     </connections>
                 </button>
-                <button misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zpn-KI-Jfm">
+                <button translatesAutoresizingMaskIntoConstraints="NO" id="Zpn-KI-Jfm">
                     <rect key="frame" x="40" y="18" width="571" height="18"/>
                     <buttonCell key="cell" type="check" title="Allow calls from peers in your contact list" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="fX7-9W-XFl">
                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -207,14 +192,10 @@
                         <action selector="toggleAllowFromContacts:" target="-2" id="s1A-th-o6G"/>
                     </connections>
                 </button>
-                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="c6M-WV-uVk">
-                    <rect key="frame" x="111" y="265" width="407" height="30"/>
-                    <constraints>
-                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="407" id="Q9u-bY-u9w"/>
-                        <constraint firstAttribute="height" constant="30" id="aBK-vN-6hT"/>
-                    </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" borderStyle="border" alignment="center" id="cf0-xD-2WZ">
-                        <font key="font" metaFont="system"/>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="MwI-Dp-6ii">
+                    <rect key="frame" x="154" y="291" width="411" height="17"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" alignment="left" placeholderString="" id="19d-qq-55F">
+                        <font key="font" metaFont="systemBold"/>
                         <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
@@ -227,51 +208,109 @@
                         </fragment>
                     </attributedString>
                 </textField>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Mcy-ih-XuK">
+                    <rect key="frame" x="38" y="224" width="112" height="17"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Blockchain server" id="fSU-Pc-Y5a">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gCl-aM-td9">
+                    <rect key="frame" x="157" y="219" width="303" height="22"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="303" id="7hV-Jk-qZt"/>
+                    </constraints>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" enabled="NO" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" bezelStyle="round" id="Dwo-oq-fKh">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                    <connections>
+                        <outlet property="delegate" destination="-2" id="4tC-UG-SoS"/>
+                    </connections>
+                </textField>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="c6M-WV-uVk">
+                    <rect key="frame" x="156" y="318" width="411" height="17"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" alignment="left" placeholderString="" id="cf0-xD-2WZ">
+                        <font key="font" metaFont="systemBold"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                    <attributedString key="userComments">
+                        <fragment content="Display hash ring">
+                            <attributes>
+                                <font key="NSFont" metaFont="smallSystem"/>
+                                <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural"/>
+                            </attributes>
+                        </fragment>
+                    </attributedString>
+                </textField>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ddu-Gm-dVv">
+                    <rect key="frame" x="152" y="282" width="127" height="32"/>
+                    <buttonCell key="cell" type="push" title="Register name" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="G8M-go-xvD">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="startNameRegistration:" target="-2" id="ASJ-KU-yTA"/>
+                    </connections>
+                </button>
             </subviews>
             <constraints>
-                <constraint firstItem="Zpn-KI-Jfm" firstAttribute="leading" secondItem="reK-M8-Eie" secondAttribute="leading" id="0aK-Ci-93E"/>
-                <constraint firstItem="eaR-8q-smW" firstAttribute="top" secondItem="FlW-Vd-Eem" secondAttribute="bottom" constant="25" id="1Ac-Xz-kiF"/>
-                <constraint firstItem="D7f-4A-xXM" firstAttribute="centerY" secondItem="EVi-Oa-N9k" secondAttribute="centerY" id="3Wv-ku-nKu"/>
-                <constraint firstItem="6uh-UC-6i9" firstAttribute="top" secondItem="eaR-8q-smW" secondAttribute="bottom" constant="16" id="3sD-WB-JUQ"/>
-                <constraint firstAttribute="centerX" secondItem="c6M-WV-uVk" secondAttribute="centerX" id="4bm-Jh-lHq"/>
-                <constraint firstItem="DUI-3g-gHb" firstAttribute="top" secondItem="e6G-kW-opo" secondAttribute="bottom" constant="17" id="6Ox-HY-vGc"/>
-                <constraint firstItem="FlW-Vd-Eem" firstAttribute="baseline" secondItem="phb-wW-DQS" secondAttribute="baseline" id="9hL-zn-yqS"/>
-                <constraint firstItem="reK-M8-Eie" firstAttribute="trailing" secondItem="c6K-nF-ezL" secondAttribute="trailing" id="Bip-i0-UGG"/>
-                <constraint firstItem="idQ-yZ-XB3" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="97" id="Emn-oU-5hP"/>
-                <constraint firstItem="4QL-FW-Kjb" firstAttribute="top" secondItem="P8b-Ru-H5G" secondAttribute="bottom" constant="7" id="MJu-ce-p7b"/>
-                <constraint firstItem="idQ-yZ-XB3" firstAttribute="top" secondItem="iSd-2v-I3h" secondAttribute="bottom" constant="10" id="N9g-nF-5Oc"/>
-                <constraint firstItem="D7f-4A-xXM" firstAttribute="leading" secondItem="idQ-yZ-XB3" secondAttribute="trailing" constant="8" id="UB7-B8-DZ4"/>
-                <constraint firstItem="e6G-kW-opo" firstAttribute="leading" secondItem="reK-M8-Eie" secondAttribute="leading" id="Uj3-sN-iro"/>
-                <constraint firstItem="Zpn-KI-Jfm" firstAttribute="top" secondItem="c6K-nF-ezL" secondAttribute="bottom" constant="12" id="Ul6-uZ-rUH"/>
-                <constraint firstItem="6uh-UC-6i9" firstAttribute="leading" secondItem="e6G-kW-opo" secondAttribute="leading" id="VEx-1I-aYY"/>
-                <constraint firstItem="eaR-8q-smW" firstAttribute="leading" secondItem="6uh-UC-6i9" secondAttribute="leading" id="Vot-8V-LMK"/>
-                <constraint firstItem="EVi-Oa-N9k" firstAttribute="top" secondItem="iSd-2v-I3h" secondAttribute="bottom" constant="12" id="Whf-mb-blO"/>
-                <constraint firstItem="iSd-2v-I3h" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="Yt2-Su-eTG"/>
-                <constraint firstItem="4QL-FW-Kjb" firstAttribute="leading" secondItem="eaR-8q-smW" secondAttribute="leading" id="d0b-y1-sUR"/>
-                <constraint firstItem="reK-M8-Eie" firstAttribute="top" secondItem="DUI-3g-gHb" secondAttribute="bottom" constant="15" id="eqT-VA-5sh"/>
-                <constraint firstItem="4QL-FW-Kjb" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="42" id="fxN-ZC-slK"/>
-                <constraint firstItem="FlW-Vd-Eem" firstAttribute="trailing" secondItem="eaR-8q-smW" secondAttribute="trailing" id="gAq-5h-P4g"/>
-                <constraint firstItem="c6K-nF-ezL" firstAttribute="trailing" secondItem="Zpn-KI-Jfm" secondAttribute="trailing" id="gUO-w0-j6J"/>
-                <constraint firstItem="phb-wW-DQS" firstAttribute="top" secondItem="c6M-WV-uVk" secondAttribute="bottom" constant="10" symbolic="YES" id="gsp-Gr-Vqf"/>
-                <constraint firstAttribute="trailing" secondItem="EVi-Oa-N9k" secondAttribute="trailing" constant="20" id="h2t-Ki-rWO"/>
-                <constraint firstItem="e6G-kW-opo" firstAttribute="baseline" secondItem="fJM-4J-mvZ" secondAttribute="baseline" id="iOa-53-MkS"/>
-                <constraint firstItem="iSd-2v-I3h" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="jT1-wr-Whu"/>
-                <constraint firstItem="c6K-nF-ezL" firstAttribute="top" secondItem="reK-M8-Eie" secondAttribute="bottom" constant="13" id="kta-4V-sYw"/>
-                <constraint firstItem="P8b-Ru-H5G" firstAttribute="top" secondItem="idQ-yZ-XB3" secondAttribute="bottom" constant="11" id="mbu-AH-UaM"/>
-                <constraint firstItem="fJM-4J-mvZ" firstAttribute="leading" secondItem="e6G-kW-opo" secondAttribute="trailing" constant="8" id="nAb-oD-B0a"/>
-                <constraint firstItem="c6M-WV-uVk" firstAttribute="top" secondItem="4QL-FW-Kjb" secondAttribute="bottom" constant="6" id="nCs-kI-HyR"/>
-                <constraint firstItem="Zpn-KI-Jfm" firstAttribute="leading" secondItem="c6K-nF-ezL" secondAttribute="leading" id="pc0-SZ-zeC"/>
-                <constraint firstItem="EVi-Oa-N9k" firstAttribute="leading" secondItem="D7f-4A-xXM" secondAttribute="trailing" constant="8" id="qrl-ic-eji"/>
-                <constraint firstItem="P8b-Ru-H5G" firstAttribute="leading" secondItem="DUI-3g-gHb" secondAttribute="leading" id="qti-V2-tKH"/>
-                <constraint firstItem="e6G-kW-opo" firstAttribute="top" secondItem="6uh-UC-6i9" secondAttribute="bottom" constant="17" id="ren-Fm-2Bi"/>
-                <constraint firstItem="4QL-FW-Kjb" firstAttribute="trailing" secondItem="reK-M8-Eie" secondAttribute="trailing" id="su4-3k-jUa"/>
-                <constraint firstItem="D7f-4A-xXM" firstAttribute="top" secondItem="iSd-2v-I3h" secondAttribute="bottom" constant="8" id="tbv-Kr-rbA"/>
-                <constraint firstItem="phb-wW-DQS" firstAttribute="leading" secondItem="FlW-Vd-Eem" secondAttribute="trailing" constant="8" id="uCI-Vd-ae3"/>
-                <constraint firstItem="iSd-2v-I3h" firstAttribute="leading" secondItem="P8b-Ru-H5G" secondAttribute="leading" id="waU-DP-not"/>
-                <constraint firstItem="idQ-yZ-XB3" firstAttribute="baseline" secondItem="D7f-4A-xXM" secondAttribute="baseline" id="xs3-In-hx1"/>
-                <constraint firstItem="FlW-Vd-Eem" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="40" id="zOA-nT-eVd"/>
+                <constraint firstItem="Mcy-ih-XuK" firstAttribute="top" secondItem="gCl-aM-td9" secondAttribute="top" id="088-R8-A7x"/>
+                <constraint firstItem="u7B-1Y-aZ4" firstAttribute="baseline" secondItem="c6M-WV-uVk" secondAttribute="baseline" id="0Lq-Wb-NQd"/>
+                <constraint firstItem="gCl-aM-td9" firstAttribute="leading" secondItem="Mcy-ih-XuK" secondAttribute="trailing" constant="9" id="0T9-E2-CTQ"/>
+                <constraint firstItem="D7f-4A-xXM" firstAttribute="baseline" secondItem="idQ-yZ-XB3" secondAttribute="firstBaseline" id="0pf-Su-5OZ"/>
+                <constraint firstItem="c6M-WV-uVk" firstAttribute="top" secondItem="D7f-4A-xXM" secondAttribute="bottom" constant="6" id="2xe-gB-xBJ"/>
+                <constraint firstItem="FlW-Vd-Eem" firstAttribute="trailing" secondItem="Mcy-ih-XuK" secondAttribute="trailing" id="3Dw-ZK-jwp"/>
+                <constraint firstItem="ACD-mw-NMI" firstAttribute="baseline" secondItem="MwI-Dp-6ii" secondAttribute="baseline" id="8Z6-Su-7YZ"/>
+                <constraint firstItem="iSd-2v-I3h" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="9C2-zB-eSk"/>
+                <constraint firstItem="DUI-3g-gHb" firstAttribute="leading" secondItem="idQ-yZ-XB3" secondAttribute="leading" id="9fo-yX-dnP"/>
+                <constraint firstItem="gCl-aM-td9" firstAttribute="top" secondItem="phb-wW-DQS" secondAttribute="bottom" constant="10" id="AY5-6L-Kqx"/>
+                <constraint firstItem="u7B-1Y-aZ4" firstAttribute="leading" secondItem="ACD-mw-NMI" secondAttribute="leading" id="AaV-Gh-QE1"/>
+                <constraint firstItem="idQ-yZ-XB3" firstAttribute="top" secondItem="iSd-2v-I3h" secondAttribute="bottom" constant="10" id="CE9-x9-fe5"/>
+                <constraint firstItem="D7f-4A-xXM" firstAttribute="leading" secondItem="idQ-yZ-XB3" secondAttribute="trailing" constant="8" symbolic="YES" id="Cb6-Mc-o5P"/>
+                <constraint firstItem="ACD-mw-NMI" firstAttribute="leading" secondItem="eaR-8q-smW" secondAttribute="leading" id="Cpf-nt-I9h"/>
+                <constraint firstItem="Ddu-Gm-dVv" firstAttribute="leading" secondItem="ACD-mw-NMI" secondAttribute="trailing" constant="8" symbolic="YES" id="DyM-eD-6Fi"/>
+                <constraint firstItem="idQ-yZ-XB3" firstAttribute="baseline" secondItem="D7f-4A-xXM" secondAttribute="baseline" id="EOp-OD-A8f"/>
+                <constraint firstItem="FlW-Vd-Eem" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="40" id="Eed-m7-lZ3"/>
+                <constraint firstItem="e6G-kW-opo" firstAttribute="top" secondItem="6uh-UC-6i9" secondAttribute="bottom" constant="17" id="F1x-0c-Ger"/>
+                <constraint firstItem="c6K-nF-ezL" firstAttribute="top" secondItem="reK-M8-Eie" secondAttribute="bottom" constant="13" id="FBI-fX-Uj6"/>
+                <constraint firstItem="FlW-Vd-Eem" firstAttribute="centerY" secondItem="phb-wW-DQS" secondAttribute="centerY" id="HMW-aR-IfK"/>
+                <constraint firstItem="c6K-nF-ezL" firstAttribute="trailing" secondItem="Zpn-KI-Jfm" secondAttribute="trailing" id="HPc-Ww-Fs6"/>
+                <constraint firstItem="eaR-8q-smW" firstAttribute="leading" secondItem="6uh-UC-6i9" secondAttribute="leading" id="Jm2-Y9-vi6"/>
+                <constraint firstItem="idQ-yZ-XB3" firstAttribute="centerY" secondItem="D7f-4A-xXM" secondAttribute="centerY" id="Jul-sT-nCJ"/>
+                <constraint firstItem="e6G-kW-opo" firstAttribute="centerY" secondItem="fJM-4J-mvZ" secondAttribute="centerY" id="K6f-72-eFR"/>
+                <constraint firstItem="reK-M8-Eie" firstAttribute="top" secondItem="DUI-3g-gHb" secondAttribute="bottom" constant="15" id="Pdl-rB-B7s"/>
+                <constraint firstItem="phb-wW-DQS" firstAttribute="top" secondItem="Ddu-Gm-dVv" secondAttribute="bottom" constant="16" id="QZg-59-HHA"/>
+                <constraint firstItem="iSd-2v-I3h" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" symbolic="YES" id="QmT-MQ-AUa"/>
+                <constraint firstItem="Zpn-KI-Jfm" firstAttribute="top" secondItem="c6K-nF-ezL" secondAttribute="bottom" constant="12" id="U30-P5-8cs"/>
+                <constraint firstItem="Mcy-ih-XuK" firstAttribute="trailing" secondItem="eaR-8q-smW" secondAttribute="trailing" id="VJb-1G-Eeb"/>
+                <constraint firstItem="c6M-WV-uVk" firstAttribute="leading" secondItem="Ddu-Gm-dVv" secondAttribute="leading" id="bhF-J6-14r"/>
+                <constraint firstItem="eaR-8q-smW" firstAttribute="top" secondItem="Mcy-ih-XuK" secondAttribute="bottom" constant="13" id="cbk-YJ-gyw"/>
+                <constraint firstItem="ACD-mw-NMI" firstAttribute="centerY" secondItem="Ddu-Gm-dVv" secondAttribute="centerY" id="fzo-Vk-RNV"/>
+                <constraint firstAttribute="trailing" secondItem="MwI-Dp-6ii" secondAttribute="trailing" constant="66" id="g8q-qo-81E"/>
+                <constraint firstItem="c6K-nF-ezL" firstAttribute="leading" secondItem="Zpn-KI-Jfm" secondAttribute="leading" id="imu-G3-5BC"/>
+                <constraint firstItem="iSd-2v-I3h" firstAttribute="leading" secondItem="idQ-yZ-XB3" secondAttribute="leading" id="jQT-cz-HzH"/>
+                <constraint firstAttribute="trailing" secondItem="c6M-WV-uVk" secondAttribute="trailing" constant="64" id="l6X-by-ylJ"/>
+                <constraint firstItem="reK-M8-Eie" firstAttribute="leading" secondItem="c6K-nF-ezL" secondAttribute="leading" id="o1h-vX-h9J"/>
+                <constraint firstItem="fJM-4J-mvZ" firstAttribute="leading" secondItem="e6G-kW-opo" secondAttribute="trailing" constant="8" symbolic="YES" id="pJ0-Er-GbJ"/>
+                <constraint firstItem="DUI-3g-gHb" firstAttribute="top" secondItem="e6G-kW-opo" secondAttribute="bottom" constant="17" id="qwW-Da-9eq"/>
+                <constraint firstItem="phb-wW-DQS" firstAttribute="leading" secondItem="FlW-Vd-Eem" secondAttribute="trailing" constant="10" id="rbD-in-h2a"/>
+                <constraint firstItem="Ddu-Gm-dVv" firstAttribute="top" secondItem="c6M-WV-uVk" secondAttribute="bottom" constant="8" id="s8c-MY-9QO"/>
+                <constraint firstItem="6uh-UC-6i9" firstAttribute="leading" secondItem="e6G-kW-opo" secondAttribute="leading" id="sKK-Sp-j9H"/>
+                <constraint firstItem="MwI-Dp-6ii" firstAttribute="leading" secondItem="ACD-mw-NMI" secondAttribute="trailing" constant="6" id="uD6-eE-7Cm"/>
+                <constraint firstItem="FlW-Vd-Eem" firstAttribute="leading" secondItem="Mcy-ih-XuK" secondAttribute="leading" id="uDa-13-qvQ"/>
+                <constraint firstItem="reK-M8-Eie" firstAttribute="trailing" secondItem="c6K-nF-ezL" secondAttribute="trailing" id="v1t-Gm-Bgr"/>
+                <constraint firstItem="Ddu-Gm-dVv" firstAttribute="leading" secondItem="phb-wW-DQS" secondAttribute="leading" id="vXt-cg-jHD"/>
+                <constraint firstItem="u7B-1Y-aZ4" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="42" id="wxa-gJ-bNx"/>
+                <constraint firstItem="6uh-UC-6i9" firstAttribute="top" secondItem="eaR-8q-smW" secondAttribute="bottom" constant="16" id="xE2-Hc-W8P"/>
+                <constraint firstItem="c6M-WV-uVk" firstAttribute="leading" secondItem="u7B-1Y-aZ4" secondAttribute="trailing" constant="8" symbolic="YES" id="xNm-4M-mkk"/>
+                <constraint firstAttribute="trailing" secondItem="reK-M8-Eie" secondAttribute="trailing" constant="20" symbolic="YES" id="zL7-hR-J7q"/>
+                <constraint firstItem="reK-M8-Eie" firstAttribute="leading" secondItem="e6G-kW-opo" secondAttribute="leading" id="zNM-4E-UIY"/>
             </constraints>
-            <point key="canvasLocation" x="213.5" y="230"/>
+            <point key="canvasLocation" x="210.5" y="193.5"/>
         </customView>
         <userDefaultsController representsSharedInstance="YES" id="OEq-Ja-Vda"/>
     </objects>
diff --git a/ui/Base.lproj/BackupAccountWindow.strings b/ui/Base.lproj/BackupAccountWindow.strings
new file mode 100644
index 0000000..7528056
--- /dev/null
+++ b/ui/Base.lproj/BackupAccountWindow.strings
@@ -0,0 +1,54 @@
+
+/* Class = "NSSecureTextFieldCell"; placeholderString = "Confirm..."; ObjectID = "5Qf-em-tN4"; */
+"5Qf-em-tN4.placeholderString" = "Confirm...";
+
+/* Class = "CocoaBindingsConnection"; ibShadowedIsNilPlaceholder = "Password..."; ObjectID = "5cX-yS-4Sl"; */
+"5cX-yS-4Sl.ibShadowedIsNilPlaceholder" = "Password...";
+
+/* Class = "CocoaBindingsConnection"; ibShadowedMultipleValuesPlaceholder = "Password..."; ObjectID = "5cX-yS-4Sl"; */
+"5cX-yS-4Sl.ibShadowedMultipleValuesPlaceholder" = "Password...";
+
+/* Class = "CocoaBindingsConnection"; ibShadowedNoSelectionPlaceholder = "Password..."; ObjectID = "5cX-yS-4Sl"; */
+"5cX-yS-4Sl.ibShadowedNoSelectionPlaceholder" = "Password...";
+
+/* Class = "CocoaBindingsConnection"; ibShadowedNotApplicablePlaceholder = "Password..."; ObjectID = "5cX-yS-4Sl"; */
+"5cX-yS-4Sl.ibShadowedNotApplicablePlaceholder" = "Password...";
+
+/* Class = "NSTextFieldCell"; title = "Where"; ObjectID = "9h8-GU-av4"; */
+"9h8-GU-av4.title" = "Where";
+
+/* Class = "NSTextFieldCell"; title = "Choose where to backup your account. It needs to be password protected."; ObjectID = "KYZ-TW-44Y"; */
+"KYZ-TW-44Y.title" = "Choose where to backup your account. It needs to be password protected.";
+
+/* Class = "NSWindow"; title = "Window"; ObjectID = "QvC-M9-y7g"; */
+"QvC-M9-y7g.title" = "Window";
+
+/* Class = "NSButtonCell"; title = "OK"; ObjectID = "VN1-A3-RIh"; */
+"VN1-A3-RIh.title" = "OK";
+
+/* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "cSU-aD-OwX"; */
+"cSU-aD-OwX.title" = "Cancel";
+
+/* Class = "CocoaBindingsConnection"; ibShadowedIsNilPlaceholder = "Password..."; ObjectID = "ccf-Bx-Qq8"; */
+"ccf-Bx-Qq8.ibShadowedIsNilPlaceholder" = "Password...";
+
+/* Class = "CocoaBindingsConnection"; ibShadowedMultipleValuesPlaceholder = "Password..."; ObjectID = "ccf-Bx-Qq8"; */
+"ccf-Bx-Qq8.ibShadowedMultipleValuesPlaceholder" = "Password...";
+
+/* Class = "CocoaBindingsConnection"; ibShadowedNoSelectionPlaceholder = "Password..."; ObjectID = "ccf-Bx-Qq8"; */
+"ccf-Bx-Qq8.ibShadowedNoSelectionPlaceholder" = "Password...";
+
+/* Class = "CocoaBindingsConnection"; ibShadowedNotApplicablePlaceholder = "Password..."; ObjectID = "ccf-Bx-Qq8"; */
+"ccf-Bx-Qq8.ibShadowedNotApplicablePlaceholder" = "Password...";
+
+/* Class = "NSTextFieldCell"; title = "An error occured during the backup"; ObjectID = "e7n-Ev-bK7"; */
+"e7n-Ev-bK7.title" = "An error occured during the backup";
+
+/* Class = "NSButtonCell"; title = "OK"; ObjectID = "rW5-Il-5YD"; */
+"rW5-Il-5YD.title" = "OK";
+
+/* Class = "NSTextFieldCell"; title = "Password"; ObjectID = "vwh-K9-3O9"; */
+"vwh-K9-3O9.title" = "Password";
+
+/* Class = "NSSecureTextFieldCell"; placeholderString = "Password..."; ObjectID = "xqz-Uz-hqU"; */
+"xqz-Uz-hqU.placeholderString" = "Password...";
diff --git a/ui/Base.lproj/Dialpad.strings b/ui/Base.lproj/Dialpad.strings
new file mode 100644
index 0000000..8b28d2a
--- /dev/null
+++ b/ui/Base.lproj/Dialpad.strings
@@ -0,0 +1,39 @@
+
+/* Class = "NSButtonCell"; title = "7"; ObjectID = "4Dd-Ba-oRg"; */
+"4Dd-Ba-oRg.title" = "7";
+
+/* Class = "NSButtonCell"; title = "*"; ObjectID = "6ZB-c1-gR6"; */
+"6ZB-c1-gR6.title" = "*";
+
+/* Class = "NSButtonCell"; title = "8"; ObjectID = "CTZ-Rn-5oT"; */
+"CTZ-Rn-5oT.title" = "8";
+
+/* Class = "NSButtonCell"; title = "6"; ObjectID = "ENK-x9-8ps"; */
+"ENK-x9-8ps.title" = "6";
+
+/* Class = "NSButtonCell"; title = "4"; ObjectID = "GvJ-yA-EDa"; */
+"GvJ-yA-EDa.title" = "4";
+
+/* Class = "NSButtonCell"; title = "#"; ObjectID = "H5T-k1-cjZ"; */
+"H5T-k1-cjZ.title" = "#";
+
+/* Class = "NSButtonCell"; title = "3"; ObjectID = "Hd9-Py-oob"; */
+"Hd9-Py-oob.title" = "3";
+
+/* Class = "NSButtonCell"; title = "1"; ObjectID = "Mda-73-3kM"; */
+"Mda-73-3kM.title" = "1";
+
+/* Class = "NSButtonCell"; title = "9"; ObjectID = "TYj-va-kS8"; */
+"TYj-va-kS8.title" = "9";
+
+/* Class = "NSButtonCell"; title = "2"; ObjectID = "anB-0b-8qb"; */
+"anB-0b-8qb.title" = "2";
+
+/* Class = "NSButtonCell"; title = "5"; ObjectID = "cXL-QF-edl"; */
+"cXL-QF-edl.title" = "5";
+
+/* Class = "NSButtonCell"; title = "0"; ObjectID = "u3Z-SY-MgY"; */
+"u3Z-SY-MgY.title" = "0";
+
+/* Class = "NSWindow"; title = "Dial Pad"; ObjectID = "vrA-VP-2Md"; */
+"vrA-VP-2Md.title" = "Dial Pad";
diff --git a/ui/Base.lproj/RegisterNameWindow.xib b/ui/Base.lproj/RegisterNameWindow.xib
new file mode 100644
index 0000000..f8c844e
--- /dev/null
+++ b/ui/Base.lproj/RegisterNameWindow.xib
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="16B2553a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="RegisterNameWC">
+            <connections>
+                <outlet property="errorContainer" destination="szF-XD-rRG" id="fdo-QS-CE2"/>
+                <outlet property="indicatorLookupResult" destination="Osd-Vq-u7C" id="Adn-ta-XTG"/>
+                <outlet property="initialContainer" destination="gKX-gX-nko" id="tjc-HW-KBM"/>
+                <outlet property="ivLookupResult" destination="kfj-jZ-xal" id="w7y-8W-MWT"/>
+                <outlet property="passwordField" destination="ie2-fK-FsB" id="yvN-p1-A4r"/>
+                <outlet property="progressContainer" destination="WWd-Hs-Pwi" id="YK7-bp-wp7"/>
+                <outlet property="registeredNameField" destination="LVv-bg-Ols" id="2Cc-TI-koh"/>
+                <outlet property="registrationProgress" destination="1rt-CR-Wpz" id="djT-M6-eei"/>
+                <outlet property="window" destination="JWw-7m-ywL" id="9MN-aN-6lE"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="JWw-7m-ywL">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="131" y="165" width="440" height="213"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="900"/>
+            <view key="contentView" id="fhx-qk-94n">
+                <rect key="frame" x="0.0" y="0.0" width="440" height="213"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="szF-XD-rRG">
+                        <rect key="frame" x="0.0" y="0.0" width="440" height="213"/>
+                        <subviews>
+                            <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YAP-cJ-hMx">
+                                <rect key="frame" x="48" y="98" width="344" height="17"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="340" id="2Gn-1g-YtT"/>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="340" id="lK4-ZA-NTA"/>
+                                </constraints>
+                                <textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="center" title="An error occured during your username registration" id="Aeh-tK-RjX">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OLz-JI-6Uy">
+                                <rect key="frame" x="369" y="13" width="57" height="32"/>
+                                <buttonCell key="cell" type="push" title="Ok" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="fOn-FV-2x8">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="cancelPressed:" target="-2" id="tu6-rH-SaR"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <constraints>
+                            <constraint firstAttribute="bottom" secondItem="OLz-JI-6Uy" secondAttribute="bottom" constant="20" id="0NR-IY-c6R"/>
+                            <constraint firstItem="YAP-cJ-hMx" firstAttribute="centerX" secondItem="szF-XD-rRG" secondAttribute="centerX" id="67H-Op-7GF"/>
+                            <constraint firstItem="YAP-cJ-hMx" firstAttribute="centerY" secondItem="szF-XD-rRG" secondAttribute="centerY" id="J3M-SN-DVB"/>
+                            <constraint firstAttribute="trailing" secondItem="OLz-JI-6Uy" secondAttribute="trailing" constant="20" id="yR1-UC-5B7"/>
+                        </constraints>
+                    </customView>
+                    <view translatesAutoresizingMaskIntoConstraints="NO" id="gKX-gX-nko">
+                        <rect key="frame" x="0.0" y="0.0" width="440" height="213"/>
+                        <subviews>
+                            <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hwE-M9-zUH">
+                                <rect key="frame" x="113" y="91" width="215" height="17"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="200" id="nga-zR-QQ3"/>
+                                </constraints>
+                                <textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="center" title="Enter your Ring account password" id="B6x-jj-48R">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3cW-Kr-1oI">
+                                <rect key="frame" x="18" y="176" width="404" height="17"/>
+                                <textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="left" title="Register username on the blockchain" id="tje-EZ-ZPI">
+                                    <font key="font" metaFont="systemBold"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ie2-fK-FsB" customClass="NSSecureTextField">
+                                <rect key="frame" x="120" y="61" width="200" height="22"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="200" id="nTg-zI-DZQ"/>
+                                </constraints>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Mandatory*" bezelStyle="round" id="1TO-Ov-S8j" customClass="NSSecureTextFieldCell">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                                <connections>
+                                    <binding destination="-2" name="value" keyPath="self.password" id="hN2-41-kSt">
+                                        <dictionary key="options">
+                                            <bool key="NSContinuouslyUpdatesValue" value="YES"/>
+                                        </dictionary>
+                                    </binding>
+                                </connections>
+                            </textField>
+                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="oFy-jN-crC">
+                                <rect key="frame" x="18" y="154" width="404" height="14"/>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Other users can use it instead of your RingID" id="9gi-0u-67t">
+                                    <font key="font" metaFont="smallSystem"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="LVv-bg-Ols">
+                                <rect key="frame" x="120" y="124" width="200" height="22"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="200" id="tbX-cT-w6C"/>
+                                </constraints>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Username..." bezelStyle="round" id="bdC-Uc-Qhs">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                                <connections>
+                                    <binding destination="-2" name="value" keyPath="self.registeredName" id="4qm-Qc-63E">
+                                        <dictionary key="options">
+                                            <bool key="NSContinuouslyUpdatesValue" value="YES"/>
+                                            <bool key="NSValidatesImmediately" value="YES"/>
+                                        </dictionary>
+                                    </binding>
+                                    <outlet property="delegate" destination="-2" id="WvF-ix-1Nv"/>
+                                    <outlet property="nextKeyView" destination="ie2-fK-FsB" id="R1t-Gl-whB"/>
+                                </connections>
+                            </textField>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="GhT-2W-DrB">
+                                <rect key="frame" x="254" y="13" width="82" height="32"/>
+                                <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="eoS-s7-b3w">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+Gw
+</string>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="cancelPressed:" target="-2" id="GnK-nq-Ia1"/>
+                                </connections>
+                            </button>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kxj-la-grj">
+                                <rect key="frame" x="336" y="13" width="90" height="32"/>
+                                <buttonCell key="cell" type="push" title="Register" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="lT3-Bh-MnL">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="registerUsername:" target="-2" id="zAU-Ve-eYp"/>
+                                    <binding destination="-2" name="enabled2" keyPath="self.isPasswordValid" previousBinding="DJ0-jU-oIl" id="C15-Pk-yfw">
+                                        <dictionary key="options">
+                                            <integer key="NSMultipleValuesPlaceholder" value="-1"/>
+                                            <integer key="NSNoSelectionPlaceholder" value="-1"/>
+                                            <integer key="NSNotApplicablePlaceholder" value="-1"/>
+                                            <integer key="NSNullPlaceholder" value="-1"/>
+                                        </dictionary>
+                                    </binding>
+                                    <binding destination="-2" name="enabled" keyPath="self.isUserNameAvailable" id="DJ0-jU-oIl"/>
+                                </connections>
+                            </button>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="JGA-h8-Nhd">
+                                <rect key="frame" x="320" y="124" width="36" height="22"/>
+                                <subviews>
+                                    <progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="Osd-Vq-u7C">
+                                        <rect key="frame" x="10" y="4" width="16" height="16"/>
+                                    </progressIndicator>
+                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kfj-jZ-xal">
+                                        <rect key="frame" x="8" y="2" width="20" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="Ukr-7U-1Lh"/>
+                                            <constraint firstAttribute="width" constant="20" id="XOS-nb-g7U"/>
+                                        </constraints>
+                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_action_accept" id="70V-q1-CFT"/>
+                                    </imageView>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="36" id="IVh-Ql-XWq"/>
+                                    <constraint firstItem="Osd-Vq-u7C" firstAttribute="top" secondItem="JGA-h8-Nhd" secondAttribute="top" constant="2" id="QCZ-3B-Liq"/>
+                                    <constraint firstItem="kfj-jZ-xal" firstAttribute="top" secondItem="JGA-h8-Nhd" secondAttribute="top" id="QMo-Hp-R0Z"/>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="36" id="UZc-UT-SwO"/>
+                                    <constraint firstItem="Osd-Vq-u7C" firstAttribute="leading" secondItem="kfj-jZ-xal" secondAttribute="trailing" constant="-18" id="hYw-u6-0di"/>
+                                    <constraint firstItem="kfj-jZ-xal" firstAttribute="leading" secondItem="JGA-h8-Nhd" secondAttribute="leading" constant="8" id="meP-Fh-jjj"/>
+                                </constraints>
+                            </customView>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="ie2-fK-FsB" firstAttribute="top" secondItem="hwE-M9-zUH" secondAttribute="bottom" constant="8" id="4sp-IS-fb7"/>
+                            <constraint firstAttribute="bottom" secondItem="GhT-2W-DrB" secondAttribute="bottom" constant="20" id="Fkg-bx-DFy"/>
+                            <constraint firstItem="oFy-jN-crC" firstAttribute="top" secondItem="3cW-Kr-1oI" secondAttribute="bottom" constant="8" id="HZx-66-fG3"/>
+                            <constraint firstItem="LVv-bg-Ols" firstAttribute="top" secondItem="oFy-jN-crC" secondAttribute="bottom" constant="8" id="I29-cu-eYL"/>
+                            <constraint firstItem="3cW-Kr-1oI" firstAttribute="top" secondItem="gKX-gX-nko" secondAttribute="top" constant="20" id="Idb-Wu-QEH"/>
+                            <constraint firstAttribute="trailing" secondItem="oFy-jN-crC" secondAttribute="trailing" constant="20" id="LRD-Au-XwG"/>
+                            <constraint firstItem="JGA-h8-Nhd" firstAttribute="top" secondItem="oFy-jN-crC" secondAttribute="bottom" constant="8" id="P1a-dv-SBs"/>
+                            <constraint firstItem="LVv-bg-Ols" firstAttribute="centerX" secondItem="gKX-gX-nko" secondAttribute="centerX" id="P4A-jf-guk"/>
+                            <constraint firstItem="ie2-fK-FsB" firstAttribute="centerX" secondItem="gKX-gX-nko" secondAttribute="centerX" id="QdK-Ie-iHr"/>
+                            <constraint firstAttribute="trailing" secondItem="kxj-la-grj" secondAttribute="trailing" constant="20" id="WS6-w2-SOa"/>
+                            <constraint firstItem="oFy-jN-crC" firstAttribute="leading" secondItem="gKX-gX-nko" secondAttribute="leading" constant="20" id="X0d-vt-KnX"/>
+                            <constraint firstItem="kxj-la-grj" firstAttribute="leading" secondItem="GhT-2W-DrB" secondAttribute="trailing" constant="12" id="bwP-n4-ByA"/>
+                            <constraint firstItem="JGA-h8-Nhd" firstAttribute="leading" secondItem="LVv-bg-Ols" secondAttribute="trailing" id="fLa-8w-Usq"/>
+                            <constraint firstItem="hwE-M9-zUH" firstAttribute="centerX" secondItem="gKX-gX-nko" secondAttribute="centerX" id="i59-fF-YT5"/>
+                            <constraint firstItem="JGA-h8-Nhd" firstAttribute="centerY" secondItem="LVv-bg-Ols" secondAttribute="centerY" id="k40-hp-KCp"/>
+                            <constraint firstItem="hwE-M9-zUH" firstAttribute="top" secondItem="LVv-bg-Ols" secondAttribute="bottom" constant="16" id="pFN-VK-bHT"/>
+                            <constraint firstAttribute="trailing" secondItem="3cW-Kr-1oI" secondAttribute="trailing" constant="20" id="ukZ-Cr-ZvP"/>
+                            <constraint firstAttribute="bottom" secondItem="kxj-la-grj" secondAttribute="bottom" constant="20" id="w0D-Vo-Z48"/>
+                            <constraint firstItem="3cW-Kr-1oI" firstAttribute="leading" secondItem="gKX-gX-nko" secondAttribute="leading" constant="20" id="y5J-9x-SsV"/>
+                        </constraints>
+                    </view>
+                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="WWd-Hs-Pwi">
+                        <rect key="frame" x="0.0" y="0.0" width="440" height="213"/>
+                        <subviews>
+                            <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1hK-Hw-cJh">
+                                <rect key="frame" x="34" y="70" width="344" height="17"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="340" id="tHE-Zh-IYn"/>
+                                </constraints>
+                                <textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="center" title="Just a moment..." id="YIN-YL-JBs">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <progressIndicator wantsLayer="YES" maxValue="100" indeterminate="YES" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="1rt-CR-Wpz">
+                                <rect key="frame" x="158" y="95" width="96" height="32"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="96" id="g01-Ci-luV"/>
+                                </constraints>
+                            </progressIndicator>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nQA-Bl-kuO">
+                                <rect key="frame" x="14" y="13" width="82" height="32"/>
+                                <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="cbA-c2-LlV">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+Gw
+</string>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="cancelPressed:" target="-2" id="8gY-z8-LZN"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <constraints>
+                            <constraint firstAttribute="bottom" secondItem="nQA-Bl-kuO" secondAttribute="bottom" constant="20" id="FCD-G1-gcU"/>
+                            <constraint firstItem="nQA-Bl-kuO" firstAttribute="leading" secondItem="WWd-Hs-Pwi" secondAttribute="leading" constant="20" id="N0f-mf-Av6"/>
+                            <constraint firstAttribute="height" constant="213" id="em8-4v-FVz"/>
+                            <constraint firstItem="1hK-Hw-cJh" firstAttribute="top" secondItem="1rt-CR-Wpz" secondAttribute="bottom" constant="8" id="kRx-lu-H03"/>
+                            <constraint firstItem="1rt-CR-Wpz" firstAttribute="centerY" secondItem="WWd-Hs-Pwi" secondAttribute="centerY" constant="-4.5" id="tFP-f6-B38"/>
+                            <constraint firstItem="1hK-Hw-cJh" firstAttribute="centerX" secondItem="1rt-CR-Wpz" secondAttribute="centerX" id="upr-bY-gXb"/>
+                            <constraint firstItem="1rt-CR-Wpz" firstAttribute="centerX" secondItem="WWd-Hs-Pwi" secondAttribute="centerX" constant="-14" id="vuy-f9-mI8"/>
+                            <constraint firstAttribute="width" constant="440" id="yos-v5-cU0"/>
+                        </constraints>
+                    </customView>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="gKX-gX-nko" firstAttribute="top" secondItem="fhx-qk-94n" secondAttribute="top" id="2lY-3k-wn5"/>
+                    <constraint firstAttribute="bottom" secondItem="gKX-gX-nko" secondAttribute="bottom" id="8Oa-Uz-6LG"/>
+                    <constraint firstAttribute="bottom" secondItem="szF-XD-rRG" secondAttribute="bottom" id="F9k-Zf-lBc"/>
+                    <constraint firstItem="WWd-Hs-Pwi" firstAttribute="centerY" secondItem="fhx-qk-94n" secondAttribute="centerY" id="dS5-As-4zt"/>
+                    <constraint firstItem="szF-XD-rRG" firstAttribute="leading" secondItem="fhx-qk-94n" secondAttribute="leading" id="feD-HN-B22"/>
+                    <constraint firstItem="gKX-gX-nko" firstAttribute="leading" secondItem="fhx-qk-94n" secondAttribute="leading" id="gAf-Wj-ShA"/>
+                    <constraint firstAttribute="trailing" secondItem="gKX-gX-nko" secondAttribute="trailing" id="iHs-YI-w1M"/>
+                    <constraint firstItem="szF-XD-rRG" firstAttribute="top" secondItem="fhx-qk-94n" secondAttribute="top" id="iSn-Iu-o8u"/>
+                    <constraint firstAttribute="trailing" secondItem="szF-XD-rRG" secondAttribute="trailing" id="tAM-X8-ofp"/>
+                    <constraint firstItem="WWd-Hs-Pwi" firstAttribute="centerX" secondItem="fhx-qk-94n" secondAttribute="centerX" id="zrg-bI-umR"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="pFe-Nr-AEd"/>
+                <outlet property="initialFirstResponder" destination="gKX-gX-nko" id="Tak-CI-JfO"/>
+            </connections>
+            <point key="canvasLocation" x="-446" y="439.5"/>
+        </window>
+    </objects>
+    <resources>
+        <image name="ic_action_accept" width="72" height="72"/>
+    </resources>
+</document>