Commit c7e68f3c authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

wizard: connect to account manager

Change-Id: Ieadb3a1dd3f16fcf97183f5df747d07fb46c337f
parent 4db61096
......@@ -182,6 +182,8 @@ SET(ringclient_CONTROLLERS
src/ChooseContactVC.h
src/CallInConferenceVC.mm
src/CallInConferenceVC.h
src/ConnectToAccManagerVC.mm
src/ConnectToAccManagerVC.h
)
SET(ringclient_VIEWS
......@@ -283,6 +285,7 @@ SET(ringclient_XIBS
RecordFileVC
ChooseContactVC
CallInConferenceVC
ConnectToAccManagerVC
)
# Icons
......
......@@ -49,10 +49,12 @@
@property (unsafe_unretained) IBOutlet NSTextField *displayNameField;
@property (unsafe_unretained) IBOutlet NSTextField *ringIDField;
@property (unsafe_unretained) IBOutlet NSTextField *registeredNameField;
@property (unsafe_unretained) IBOutlet NSTextField *passwordField;
@property (unsafe_unretained) IBOutlet RoundedTextField *accountStatus;
@property (unsafe_unretained) IBOutlet NSButton *registerNameButton;
@property (unsafe_unretained) IBOutlet NSButton* photoView;
@property (unsafe_unretained) IBOutlet NSButton* passwordButton;
@property (unsafe_unretained) IBOutlet NSButton* linkDeviceButton;
@property (unsafe_unretained) IBOutlet NSButton* removeAccountButton;
@property (unsafe_unretained) IBOutlet NSImageView* addProfilePhotoImage;
@property (unsafe_unretained) IBOutlet NSTableView* devicesTableView;
......@@ -90,7 +92,8 @@ QMetaObject::Connection accountStateChangedSignal;
@synthesize delegate;
@synthesize devicesTableView;
@synthesize blockedContactsTableView;
@synthesize linkDeviceButton;
@synthesize passwordField;
typedef NS_ENUM(NSInteger, TagViews) {
DISPLAYNAME = 100,
......@@ -166,6 +169,12 @@ typedef NS_ENUM(NSInteger, TagViews) {
[passwordButton setTitle:accountProperties.archiveHasPassword ? @"Change password" : @"Create password"];
self.accountEnabled = account.enabled;
bool hideLocalAccountConfig = !accountProperties.managerUri.empty();
[registerNameButton setHidden:hideLocalAccountConfig];
[passwordButton setHidden:hideLocalAccountConfig];
[linkDeviceButton setHidden:hideLocalAccountConfig];
[passwordField setHidden:hideLocalAccountConfig];
NSMutableAttributedString *colorTitle = [[NSMutableAttributedString alloc] initWithAttributedString:[removeAccountButton attributedTitle]];
NSRange titleRange = NSMakeRange(0, [colorTitle length]);
[colorTitle addAttribute:NSForegroundColorAttributeName value:[NSColor errorColor] range:titleRange];
......
......@@ -50,7 +50,7 @@ NSTimer* timeoutTimer;
- (void)viewDidLoad {
[super viewDidLoad];
[self.view setAutoresizingMask: NSViewHeightSizable];
[self.view setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
}
-(id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil accountmodel:(lrc::api::NewAccountModel*) accountModel {
......@@ -67,6 +67,7 @@ NSTimer* timeoutTimer;
photoView.layer.masksToBounds = YES;
[photoView setBordered:YES];
[addProfilePhotoImage setWantsLayer: YES];
[self.delegate showView:self.view];
}
- (IBAction)cancel:(id)sender
......
/*
* Copyright (C) 2019 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@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 "LrcModelsProtocol.h"
@protocol RingWizardAccManagerDelegate <NSObject>
- (void)didSignInSuccess:(BOOL)success;
- (void)showView:(NSView*)view;
@end
@interface ConnectToAccManagerVC: NSViewController <LrcModelsProtocol>
@property (nonatomic, weak) NSWindowController <RingWizardAccManagerDelegate>* delegate;
/*
* KVO value username
*/
@property (nonatomic, weak) NSString* username;
/*
* KVO value password
*/
@property (nonatomic, weak) NSString* password;
/*
* KVO value account manager
*/
@property (nonatomic, weak) NSString* accountManager;
- (void)show;
@end
/*
* Copyright (C) 2019 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@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 "ConnectToAccManagerVC.h"
#import "utils.h"
//LRC
#import <api/lrc.h>
#import <api/newaccountmodel.h>
@interface ConnectToAccManagerVC ()
@end
@implementation ConnectToAccManagerVC {
__unsafe_unretained IBOutlet NSView* initialContainer;
__unsafe_unretained IBOutlet NSView* loadingContainer;
__unsafe_unretained IBOutlet NSProgressIndicator* progressBar;
__unsafe_unretained IBOutlet NSView* errorContainer;
__unsafe_unretained IBOutlet NSTextField* userNameField;
__unsafe_unretained IBOutlet NSTextField* accountManagerField;
__unsafe_unretained IBOutlet NSSecureTextField* passwordTextField;
}
QMetaObject::Connection accountCreatedSuccess;
QMetaObject::Connection accountNotCreated;
std::string accointId;
@synthesize accountModel;
-(id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil accountmodel:(lrc::api::NewAccountModel*) accountModel {
if (self = [self initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
{
self.accountModel = accountModel;
}
return self;
}
- (void)show
{
self.username = userNameField.stringValue = @"";
self.password = passwordTextField.stringValue = @"";
self.accountManager = accountManagerField.stringValue = @"";
[self.delegate showView:initialContainer];
}
- (void)showError
{
[self.delegate showView:errorContainer];
}
- (void)showLoading
{
[progressBar startAnimation:nil];
[self.delegate showView:loadingContainer];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self.view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
}
- (IBAction)dismissViewWithError:(id)sender
{
[self.delegate didSignInSuccess:NO];
}
- (IBAction)startAgain:(id)sender
{
[self show];
}
- (IBAction)signIn:(id)sender
{
QObject::disconnect(accountCreatedSuccess);
QObject::disconnect(accountNotCreated);
accountCreatedSuccess = QObject::connect(self.accountModel,
&lrc::api::NewAccountModel::accountAdded,
[self] (const std::string& accountID) {
if(accountID.compare(accointId) != 0) {
return;
}
[self.delegate didSignInSuccess:YES];
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(accountID);
accountProperties.Ringtone.ringtonePath = [defaultRingtonePath() UTF8String];
self.accountModel->setAccountConfig(accountID, accountProperties);
QObject::disconnect(accountCreatedSuccess);
QObject::disconnect(accountNotCreated);
});
accountNotCreated = QObject::connect(self.accountModel,
&lrc::api::NewAccountModel::accountRemoved,
[self] (const std::string& accountID) {
if(accountID.compare(accointId) == 0) {
[self showError];
}
});
accountNotCreated = QObject::connect(self.accountModel,
&lrc::api::NewAccountModel::invalidAccountDetected,
[self] (const std::string& accountID) {
if(accountID.compare(accointId) == 0) {
[self showError];
}
});
[self showLoading];
accointId = self.accountModel->connectToAccountManager([userNameField.stringValue UTF8String], [passwordTextField.stringValue UTF8String], [accountManagerField.stringValue UTF8String]);
}
@end
......@@ -152,7 +152,7 @@ NSInteger const PASSWORD_TAG = 3;
}
case NameDirectory::LookupStatus::INVALID_NAME:
{
message = NSLocalizedString(@"The entered username is invalid. It must have at least 3 characters and contain only lowercase alphanumeric characters.",
message = NSLocalizedString(@"Invalid username",
@"Text shown to user when his username is invalid to be registered");
isAvailable = NO;
break;
......
......@@ -540,7 +540,7 @@ typedef NS_ENUM(NSInteger, ViewState) {
- (void) createNewAccount {
[self changeViewTo:SHOW_WELCOME_SCREEN];
wizard = [[RingWizardWC alloc] initWithNibName:@"RingWizard" bundle: nil accountmodel: self.accountModel];
[wizard showChooseWithCancelButton: YES andAdvanced: YES];
[wizard showChooseWithCancelButton: YES];
[self.window beginSheet:wizard.window completionHandler:nil];
}
......
......@@ -24,9 +24,11 @@
typedef NS_ENUM(NSInteger, WizardAction) {
WIZARD_ACTION_INVALID = -1,
WIZARD_ACTION_NEW = 0,
WIZARD_ACTION_LINK = 1,
WIZARD_ACTION_ADVANCED = 2,
WIZARD_ACTION_SIP_ACCOUNT = 3
WIZARD_ACTION_IMPORT_FROM_DEVICE= 1,
WIZARD_ACTION_IMPORT_FROM_ADCHIVE= 2,
WIZARD_ACTION_ADVANCED = 3,
WIZARD_ACTION_SIP_ACCOUNT = 4,
WIZARD_ACTION_ACCOUNT_MANAGER = 5
};
@protocol RingWizardChooseDelegate <NSObject>
......@@ -40,12 +42,8 @@ typedef NS_ENUM(NSInteger, WizardAction) {
@property (weak, nonatomic) id <RingWizardChooseDelegate> delegate;
@property BOOL isCancelable;
@property BOOL withAdvancedOptions;
- (void)showCancelButton:(BOOL)showCancel;
- (void)showAdvancedButton:(BOOL)showAdvanced;
- (void)updateFrame;
- (void)showInitialwithCancell:(BOOL)showCancel;
@end
......@@ -26,44 +26,46 @@
@implementation RingWizardChooseVC {
__unsafe_unretained IBOutlet NSButton* createSIPAccount;
__unsafe_unretained IBOutlet NSLayoutConstraint* buttonTopConstraint;
__unsafe_unretained IBOutlet NSButton* connectToManager;
__unsafe_unretained IBOutlet NSLayoutConstraint* viewBottomConstraint;
}
@synthesize delegate;
#define heightWithAdvanced 220
#define heightWithCancel 148
#define heightWithCancelAndAdvanced 168
#define defaultHeight 128
- (void)showCancelButton:(BOOL)showCancel {
[createSIPAccount setHidden: YES];
buttonTopConstraint.constant = showCancel ? 25 : 0;
- (void)showInitialwithCancell:(BOOL)showCancel {
self.isCancelable = showCancel;
[self.view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[createSIPAccount setHidden: YES];
[connectToManager setHidden: YES];
viewBottomConstraint.constant = showCancel ? 25 : 0;
}
- (void)showAdvancedButton:(BOOL)showAdvanced {
self.withAdvancedOptions = showAdvanced;
- (IBAction)createRingAccount:(id)sender
{
if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
[delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_NEW];
}
}
- (void)updateFrame {
NSRect viewFrame = self.view.frame;
viewFrame.size.height = (self.isCancelable && self.withAdvancedOptions) ? heightWithCancelAndAdvanced : self.isCancelable ? heightWithCancel : defaultHeight;
self.view.frame = viewFrame;
- (IBAction)importFromArchive:(id)sender
{
if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
[delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_IMPORT_FROM_ADCHIVE];
}
}
- (IBAction)createRingAccount:(id)sender
- (IBAction)importFromDevice:(id)sender
{
if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
[delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_NEW];
[delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_IMPORT_FROM_DEVICE];
}
}
- (IBAction)linkExistingRingAccount:(id)sender
- (IBAction)connectToAccountManager:(id)sender
{
if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
[delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_LINK];
[delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_ACCOUNT_MANAGER];
}
}
......@@ -74,15 +76,12 @@ __unsafe_unretained IBOutlet NSLayoutConstraint* buttonTopConstraint;
}
}
- (IBAction)showCreateSIP:(id)sender
- (IBAction)expandAdwanced:(id)sender
{
if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
buttonTopConstraint.constant = 57;
NSRect viewFrame = self.view.frame;
viewFrame.size.height = heightWithAdvanced;
self.view.frame = viewFrame;
[createSIPAccount setHidden: !createSIPAccount.isHidden];
[connectToManager setHidden: !connectToManager.isHidden];
[delegate didCompleteWithAction:WIZARD_ACTION_ADVANCED];
[createSIPAccount setHidden: NO];
}
}
......
......@@ -25,11 +25,16 @@
- (void)showView:(NSView*)view;
@end
typedef NS_ENUM(NSInteger, IMPORT_TYPE) {
IMPORT_FROM_DEVICE = 0,
IMPORT_FROM_BACKUP = 1
};
@interface RingWizardLinkAccountVC : NSViewController <LrcModelsProtocol>
@property (nonatomic, weak) NSWindowController <RingWizardLinkDelegate>* delegate;
@property (nonatomic, weak) NSString* pinValue;
@property (nonatomic, weak) NSString* passwordValue;
@property NSURL* backupFile;
- (void)show;
- (void)showImportViewOfType:(IMPORT_TYPE)type;
@end
......@@ -53,6 +53,8 @@
__unsafe_unretained IBOutlet NSButton* linkButton;
__unsafe_unretained IBOutlet NSPopover* helpPINContainer;
__unsafe_unretained IBOutlet NSPopover* helpArchiveFileContainer;
__unsafe_unretained IBOutlet NSStackView* pinContainer;
__unsafe_unretained IBOutlet NSStackView* filePathContainer;
NSString *fileButtonTitleBackup;
QMetaObject::Connection accountCreated;
......@@ -72,12 +74,18 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self.view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[initialContainer setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[loadingContainer setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[errorContainer setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
fileButtonTitleBackup = NSLocalizedString(@"Select archive",
@"export account button title");
}
- (void)show
- (void)showImportViewOfType:(IMPORT_TYPE)type
{
[pinContainer setHidden: type == IMPORT_FROM_BACKUP];
[filePathContainer setHidden: type == IMPORT_FROM_DEVICE];
[self.delegate showView:initialContainer];
[fileButton setTitle:fileButtonTitleBackup];
backupFile = nil;
......
......@@ -23,7 +23,6 @@
@protocol RingWizardNewDelegate <NSObject>
- (void)didCreateAccountWithSuccess:(BOOL)success;
- (void)showView:(NSView*)view;
- (void) updateFrame:(float)height;
@end
@interface RingWizardNewAccountVC : NSViewController <LrcModelsProtocol>
......@@ -41,4 +40,6 @@
@property (readonly)BOOL withBlockchain;
@property (assign)NSInteger signUpBlockchainState;
- (void)show;
- (void)prepareViewToShow;
@end
This diff is collapsed.
......@@ -23,12 +23,15 @@
#import "RingWizardLinkAccountVC.h"
#import "LrcModelsProtocol.h"
#import "AddSIPAccountVC.h"
#import "ConnectToAccManagerVC.h"
@interface RingWizardWC : NSWindowController <NSWindowDelegate, NSPathControlDelegate,
NSOpenSavePanelDelegate, RingWizardChooseDelegate, RingWizardNewDelegate,
RingWizardLinkDelegate, AddSIPAccountDelegate, LrcModelsProtocol>
- (void)showChooseWithCancelButton:(BOOL)showCancel andAdvanced:(BOOL)showAdvanced;
RingWizardLinkDelegate, AddSIPAccountDelegate, RingWizardAccManagerDelegate,
LrcModelsProtocol>
- (void)showChooseWithCancelButton:(BOOL)showCancel;
- (void)showNewAccountVC;
- (void)showLinkAccountVC;
- (void)showSIPAccountVC;
- (void)showConnectToAccountManager;
@end
......@@ -29,6 +29,7 @@
#import "RingWizardNewAccountVC.h"
#import "RingWizardLinkAccountVC.h"
#import "RingWizardChooseVC.h"
#import "ConnectToAccManagerVC.h"
@interface RingWizardWC ()
......@@ -43,8 +44,8 @@
IBOutlet RingWizardLinkAccountVC* linkAccountWC;
IBOutlet RingWizardChooseVC* chooseActiontWC;
IBOutlet AddSIPAccountVC* addSIPAccountVC;
IBOutlet ConnectToAccManagerVC* connectToAccManagerVC;
BOOL isCancelable;
BOOL withAdvanced;
}
@synthesize accountModel, ringImage, titleConstraint;
......@@ -66,11 +67,13 @@
chooseActiontWC = [[RingWizardChooseVC alloc] initWithNibName:@"RingWizardChoose" bundle:nil];
linkAccountWC = [[RingWizardLinkAccountVC alloc] initWithNibName:@"RingWizardLinkAccount" bundle:nil accountmodel:self.accountModel];
addSIPAccountVC = [[AddSIPAccountVC alloc] initWithNibName:@"AddSIPAccountVC" bundle:nil accountmodel:self.accountModel];
connectToAccManagerVC = [[ConnectToAccManagerVC alloc] initWithNibName:@"ConnectToAccManagerVC" bundle:nil accountmodel:self.accountModel];
[addSIPAccountVC setDelegate:self];
[chooseActiontWC setDelegate:self];
[linkAccountWC setDelegate:self];
[newAccountWC setDelegate:self];
[self showChooseWithCancelButton:isCancelable andAdvanced: withAdvanced];
[connectToAccManagerVC setDelegate:self];
[self showChooseWithCancelButton:isCancelable];
}
- (void)removeSubviews
......@@ -81,83 +84,47 @@
}
}
#define headerHeight 70
#define minHeight 140
#define defaultMargin 5
- (void)showView:(NSView*)view
{
[self removeSubviews];
NSRect frame = [self.container frame];
CGFloat height = minHeight;
float sizeFrame = MAX(height, view.frame.size.height);
frame.size.height = sizeFrame;
[view setFrame: frame];
[self.container setFrame:frame];
float titleBarHeight = self.window.frame.size.height -
[NSWindow contentRectForFrameRect: self.window.frame styleMask:self.window.styleMask].size.height;
titleBarHeight = self.window.isSheet ? 0 : titleBarHeight;
float size = headerHeight + sizeFrame + titleBarHeight;
NSRect frameWindows = self.window.frame;
frameWindows.size.height = size;
[self.window setFrame:frameWindows display:YES animate:YES];
[self.container setFrameSize:view.frame.size];
[self.container addSubview:view];
}
- (void) updateFrame:(float) height {
float titleBarHeight = self.window.frame.size.height -
[NSWindow contentRectForFrameRect: self.window.frame styleMask:self.window.styleMask].size.height;
titleBarHeight = self.window.isSheet ? 0 : titleBarHeight;
float size = headerHeight + height + titleBarHeight;
NSRect frameWindows = self.window.frame;
frameWindows.size.height = size;
[self.window setFrame:frameWindows display:YES animate:YES];
}
- (void)showChooseWithCancelButton:(BOOL)showCancel andAdvanced:(BOOL)showAdvanced {
[self.windowHeader setStringValue: NSLocalizedString(@"Welcome to Jami",
@"Welcome title")];
[ringImage setHidden: NO];
titleConstraint.constant = -26.5;
[self showView:chooseActiontWC.view];
[chooseActiontWC showCancelButton:showCancel];
[chooseActiontWC showAdvancedButton:showAdvanced];
isCancelable = showCancel;
withAdvanced = showAdvanced;
[chooseActiontWC updateFrame];
[self showView:chooseActiontWC.view];
}
- (void)showChooseWithCancelButton:(BOOL)showCancel
{
[self.windowHeader setStringValue: NSLocalizedString(@"Welcome to Jami",
@"Welcome title")];
[ringImage setHidden: NO];
titleConstraint.constant = -26.5;
[self showView:chooseActiontWC.view];
[chooseActiontWC showCancelButton:showCancel];
[chooseActiontWC showInitialwithCancell:showCancel];
isCancelable = showCancel;
[self showView:chooseActiontWC.view];
}
- (void)showNewAccountVC
{
[self.windowHeader setStringValue: NSLocalizedString(@"Create a new account",
@"Welcome title")];
[chooseActiontWC showCancelButton: isCancelable];
[ringImage setHidden: YES];
titleConstraint.constant = 0;
[newAccountWC prepareViewToShow];
[self showView: newAccountWC.view];
[newAccountWC show];
}
- (void)showLinkAccountVC
- (void)showImportWithType:(IMPORT_TYPE)type
{
[self.windowHeader setStringValue: NSLocalizedString(@"Link to an account",
@"link account title")];
auto header = type == IMPORT_FROM_DEVICE ?
NSLocalizedString(@"Import from other device",
@"link account title") :
NSLocalizedString(@"Import from backup",
@"link account title");
[self.windowHeader setStringValue: header];
[ringImage setHidden: YES];
titleConstraint.constant = 0;
[chooseActiontWC showCancelButton: isCancelable];
[self showView: linkAccountWC.view];
[linkAccountWC show];
[linkAccountWC showImportViewOfType: type];
}
- (void)showSIPAccountVC
......@@ -167,10 +134,19 @@
[ringImage setHidden: YES];
titleConstraint.constant = 0;
[self showView: addSIPAccountVC.view];
[chooseActiontWC showAdvancedButton: NO];
[addSIPAccountVC show];
}
- (void)showConnectToAccountManager
{
[self.windowHeader setStringValue: NSLocalizedString(@"Sign In",
@"Sign In")];
[ringImage setHidden: YES];
titleConstraint.constant = 0;
[self showView: connectToAccManagerVC.view];
[connectToAccManagerVC show];
}
# pragma NSWindowDelegate methods
- (void)windowWillClose:(NSNotification *)notification
......@@ -187,18 +163,30 @@
- (void)didCompleteWithAction:(WizardAction)action
{
if (action == WIZARD_ACTION_LINK) {
[self showLinkAccountVC];
} else if (action == WIZARD_ACTION_NEW) {
[self showNewAccountVC];
} else if (action == WIZARD_ACTION_ADVANCED) {
[self showView:chooseActiontWC.view];
} else if (action == WIZARD_ACTION_SIP_ACCOUNT) {
[self showSIPAccountVC];
} else {
[self.window close];
[NSApp endSheet:self.window];
[[NSApplication sharedApplication] removeWindowsItem:self.window];
switch (action) {
case WIZARD_ACTION_IMPORT_FROM_DEVICE:
[self showImportWithType: IMPORT_FROM_DEVICE];
break;
case WIZARD_ACTION_IMPORT_FROM_ADCHIVE:
[self showImportWithType: IMPORT_FROM_BACKUP];
break;
case WIZARD_ACTION_NEW:
[self showNewAccountVC];
break;
case WIZARD_ACTION_ADVANCED:
[self showView:chooseActiontWC.view];
break;
case WIZARD_ACTION_SIP_ACCOUNT:
[self showSIPAccountVC];
break;
case WIZARD_ACTION_ACCOUNT_MANAGER:
[self showConnectToAccountManager];
break;
default:
[self.window close];
[NSApp endSheet:self.window];
[[NSApplication sharedApplication] removeWindowsItem:self.window];
break;
}
}
......@@ -206,23 +194,23 @@
- (void)didCreateAccountWithSuccess:(BOOL)success
{
if (success) {
[self.window close];
[NSApp endSheet:self.window];
[[NSApplication sharedApplication] removeWindowsItem:self.window];
if (!isCancelable){
AppDelegate* appDelegate = (AppDelegate *)[[NSApplication sharedApplication] delegate];
[appDelegate showMainWindow];
}
} else {
[self showChooseWithCancelButton: isCancelable andAdvanced: withAdvanced];
}
[self completedWithSuccess:success];
}
#pragma - WizardLinkAccountDelegate methods
- (void)didLinkAccountWithSuccess:(BOOL)success
{
[self completedWithSuccess:success];
}
#pragma - RingWizardAccManagerDelegate
- (void)didSignInSuccess:(BOOL)success {
[self completedWithSuccess:success];
}
-(void) completedWithSuccess:(BOOL) success {
if (success) {
[self.window close];
[NSApp endSheet:self.window];
......@@ -232,7 +220,7 @@
[appDelegate showMainWindow];
}
} else {
[self showChooseWithCancelButton: isCancelable andAdvanced: withAdvanced];
[self showChooseWithCancelButton: isCancelable];
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="System colors introduced in macOS 10.14" minToolsVersion="10.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
......@@ -15,7 +15,9 @@
<outlet property="blockedContactsTableView" destination="aau-IO-oSs" id="Vek-r1-CDK"/>
<outlet property="devicesTableView" destination="Zw2-AJ-V23" id="fdL-VK-1ao"/>
<outlet property="displayNameField" destination="n2O-cF-oZh" id="EaH-qO-DhI"/>
<outlet property="linkDeviceButton" destination="xuK-C2-qCq" id="Syf-y5-KnW"/>
<outlet property="passwordButton" destination="jn6-I2-q72" id="ElE-O6-kva"/>
<outlet property="passwordField" destination="jfs-pl-8Bb" id="RYs-Qw-rCE"/>
<outlet property="photoView" destination="a04-w7-5Bn" id="cGK-Ao-FaB"/>
<outlet property="registerNameButton" destination="wRD-yN-Fq8" id="Nd0-BQ-cfn"/>
<outlet property="registeredNameField" destination="WON-75-xph" id="0Gt-gX-edt"/>
......@@ -420,7 +422,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="1" viewBased="YES" id="aau-IO-oSs">
<rect key="frame" x="0.0" y="0.0" width="578" height="52"/>
<rect key="frame" x="0.0" y="0.0" width="578" height="1"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="0.0"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
......
This diff is collapsed.
This diff is collapsed.
......@@ -147,7 +147,7 @@
"The entered username is available" = "The entered username is available";
/* Text shown to user when his username is invalid to be registered */
"The entered username is invalid. It must have at least 3 characters and contain only lowercase alphanumeric characters." = "The entered username is invalid. It must have at least 3 characters and contain only lowercase alphanumeric characters.";
"Invalid username" = "Invalid username";
/* Text shown to user when his username is already registered */
"The entered username is not available" = "The entered username is not available";
......@@ -180,7 +180,10 @@
"Select archive" = "Select archive";
/* link account title */
"Link to an account" = "Link to an account";
"Import from backup" = "Import from backup";
/* link account title */
"Import from other device" = "Import from other device";
/* Welcome title */
"Welcome to Ring" = "Welcome to Jami";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.