Commit 9c1ec620 authored by Alexandre Lision's avatar Alexandre Lision Committed by Alexandre Lision

wizard: update linking process layout

Divide the linking device process in two screens:
- One explaining the feature and how to get the PIN code. Validation
  button is 'I'm ready'
- Second presenting the two fields 'Enter your generated PIN' and
  'Enter your account password'

Change-Id: Id1756d72913bbb37a3cc1366d2263a35fe468e85
Tuleap: #1291
parent 5dc5d31e
......@@ -46,30 +46,43 @@
@implementation RingWizardLinkAccountVC {
__unsafe_unretained IBOutlet NSView* initialContainer;
__unsafe_unretained IBOutlet NSTextField* pinField;
__unsafe_unretained IBOutlet NSSecureTextField* passwordField;
__unsafe_unretained IBOutlet NSTextField* pinLabel;
__unsafe_unretained IBOutlet NSTextField* passwordLabel;
__unsafe_unretained IBOutlet NSButton* createButton;
__unsafe_unretained IBOutlet NSView* firstStepContainer;
__unsafe_unretained IBOutlet NSView* loadingContainer;
__unsafe_unretained IBOutlet NSProgressIndicator* progressBar;
__unsafe_unretained IBOutlet NSView* errorContainer;
__unsafe_unretained IBOutlet NSPopover* helpContainer;
Account* accountToCreate;
NSTimer* errorTimer;
QMetaObject::Connection stateChanged;
}
- (void)show
- (IBAction)goToStepTwo:(id)sender
{
[self disconnectCallback];
[firstStepContainer setHidden:YES];
[initialContainer setHidden:NO];
[loadingContainer setHidden:YES];
[errorContainer setHidden:YES];
}
- (IBAction)goToStepOne:(id)sender
{
[firstStepContainer setHidden:NO];
[initialContainer setHidden:YES];
[loadingContainer setHidden:YES];
[errorContainer setHidden:YES];
}
- (void)show
{
[firstStepContainer setHidden:NO];
[initialContainer setHidden:YES];
[loadingContainer setHidden:YES];
[errorContainer setHidden:YES];
}
- (void)showError
{
[initialContainer setHidden:YES];
......@@ -84,12 +97,6 @@
[errorContainer setHidden:YES];
}
- (IBAction)showHelp:(id)sender
{
[helpContainer showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMaxYEdge];
}
- (IBAction)importRingAccount:(id)sender
{
[self showLoading];
......@@ -118,6 +125,7 @@
- (IBAction)back:(id)sender
{
[self deleteAccount];
[self show];
}
......@@ -143,6 +151,20 @@
accountToCreate << Account::EditAction::SAVE;
}
- (void)deleteAccount
{
if(auto account = AccountModel::instance().getById(accountToCreate->id())) {
AccountModel::instance().remove(accountToCreate);
AccountModel::instance().save();
}
}
- (void)disconnectCallback
{
[errorTimer invalidate];
QObject::disconnect(stateChanged);
}
- (void)setCallback
{
errorTimer = [NSTimer scheduledTimerWithTimeInterval:30
......@@ -177,7 +199,6 @@
});
}
- (void)didLinkFailed
{
[self showError];
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment