mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 08:52:20 +00:00
Wired up TOTPSetup pop over
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#import "MPAddCustomFieldContextMenuDelegate.h"
|
||||
#import "KeePassKit/KeePassKit.h"
|
||||
|
||||
#import "MPEntryInspectorViewController.h"
|
||||
|
||||
/*
|
||||
HmacOtp-Secret (the UTF-8 representation of the value is the secret),
|
||||
@@ -66,8 +67,8 @@
|
||||
|
||||
/* Time OPT*/
|
||||
- (void)_setupTOTPMenuItemsToMenu:(NSMenu *)menu {
|
||||
NSMenuItem *setupItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SETUP_TOTP_SETTINGS", @"Menu item title editing TOTP settings") action:@selector(_setupTOTPSettings:) keyEquivalent:@""];
|
||||
setupItem.target = self;
|
||||
NSMenuItem *setupItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SETUP_TOTP_SETTINGS", @"Menu item title editing TOTP settings") action:@selector(showOTPSetup:) keyEquivalent:@""];
|
||||
setupItem.target = self.viewController;
|
||||
[menu addItem:setupItem];
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
- (IBAction)showPasswordGenerator:(id)sender;
|
||||
- (IBAction)showReferenceBuilder:(id)sender;
|
||||
- (IBAction)showAutotypeBuilder:(id)sender;
|
||||
- (IBAction)showOTPSetup:(id)sender;
|
||||
|
||||
- (IBAction)saveAttachment:(id)sender;
|
||||
- (IBAction)addAttachment:(id)sender;
|
||||
@@ -97,4 +98,5 @@
|
||||
|
||||
- (IBAction)toggleQuicklookPreview:(id)sender;
|
||||
- (IBAction)toggleExpire:(NSButton*)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#import "MPAutotypeBuilderViewController.h"
|
||||
#import "MPReferenceBuilderViewController.h"
|
||||
#import "MPTOTPViewController.h"
|
||||
#import "MPTOTPSetupViewController.h"
|
||||
|
||||
#import "MPPrettyPasswordTransformer.h"
|
||||
#import "NSString+MPPasswordCreation.h"
|
||||
@@ -381,6 +382,20 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
[self _showPopopver:viewController atView:sender onEdge:NSMinYEdge];
|
||||
}
|
||||
|
||||
- (IBAction)showOTPSetup:(id)sender {
|
||||
NSView *location;
|
||||
if([sender isKindOfClass:NSView.class]) {
|
||||
location = sender;
|
||||
}
|
||||
else {
|
||||
// we do not have anything to do!
|
||||
}
|
||||
MPTOTPSetupViewController *vc = [[MPTOTPSetupViewController alloc] init];
|
||||
vc.representedObject = self.representedObject;
|
||||
|
||||
[self _showPopopver:vc atView:location onEdge:NSMinYEdge];
|
||||
}
|
||||
|
||||
- (void)dismissViewController:(NSViewController *)viewController {
|
||||
if([viewController isKindOfClass:MPAutotypeBuilderViewController.class]) {
|
||||
self.showCustomAssociationSequenceAutotypeBuilderButton.enabled = YES;
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="showOTPSetup:" target="-1" id="mJ4-w0-CGo"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<visibilityPriorities>
|
||||
|
||||
Reference in New Issue
Block a user