-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuickWindowController.m
50 lines (42 loc) · 1.12 KB
/
QuickWindowController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// QuickWindowController.m
// PasswordSaver
//
// Created by GuoJing on 10-5-9.
// Copyright 2010 GuoJingMe. All rights reserved.
//
#import "QuickWindowController.h"
@implementation QuickWindowController
@synthesize self_panel;
@synthesize pwd_key_field;
@synthesize error_textfield;
-(id)init{
NSLog(@"quick window called");
[super init];
helper = [[SqliteHelper alloc] init];
return self;
}
-(void)awakeFromNib{
if (![[self self_panel] isVisible]) {
[[self self_panel] makeKeyAndOrderFront:self_panel];
}
}
-(IBAction)onSearchEnd:(id)sender{
[helper connect];
NSString *pwd = [helper checkPwd:pwd_key_field.title];
[pwd retain];
if(pwd && [pwd isEqualToString:@"N"])
//if([pwd isEqualToString:@"N"])
{
error_textfield.title = @"No password";
}
else {
[[NSPasteboard generalPasteboard] declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner:nil];
[[NSPasteboard generalPasteboard] setString: pwd forType: NSStringPboardType];
[self_panel close];
}
[pwd release];
[helper disconnect];
return;
}
@end