mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-22 17:39:24 +00:00
More work on Password creation
This commit is contained in:
@@ -8,19 +8,45 @@
|
||||
|
||||
#import "MPPasswordCreatorViewController.h"
|
||||
|
||||
#define MIN_PASSWORD_LENGTH 1
|
||||
#define MAX_PASSWORD_LENGTH 64
|
||||
|
||||
@interface MPPasswordCreatorViewController ()
|
||||
@property (assign) IBOutlet NSTextField *passwordTextField;
|
||||
@property (assign) IBOutlet NSTextField *passwordLengthTextField;
|
||||
@property (assign) IBOutlet NSTextField *customCharactersTextField;
|
||||
@property (assign) IBOutlet NSSlider *passwordLengthSlider;
|
||||
|
||||
@property (assign) NSUInteger passwordLength;
|
||||
|
||||
- (IBAction)_create:(id)sender;
|
||||
- (IBAction)_toggleCharacters:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPPasswordCreatorViewController
|
||||
|
||||
- (id)init
|
||||
{
|
||||
- (id)init {
|
||||
self = [super initWithNibName:@"PasswordCreatorView" bundle:nil];
|
||||
if (self) {
|
||||
// setup
|
||||
_passwordLength = 12;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)didLoadView {
|
||||
[self.passwordLengthSlider setMinValue:MIN_PASSWORD_LENGTH];
|
||||
[self.passwordLengthSlider setMaxValue:MAX_PASSWORD_LENGTH];
|
||||
[self.passwordLengthSlider setContinuous:YES];
|
||||
/* Value Transformer */
|
||||
[self.passwordLengthSlider bind:NSValueBinding toObject:self withKeyPath:@"passwordLength" options:nil];
|
||||
[self.passwordLengthTextField bind:NSValueBinding toObject:self withKeyPath:@"passwordLength" options:nil];
|
||||
}
|
||||
|
||||
- (IBAction)_create:(id)sender {
|
||||
|
||||
}
|
||||
|
||||
- (IBAction)_toggleCharacters:(id)sender {
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user