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