1 #import "LoginDialogController.h"
3 @implementation LoginDialogController
5 @synthesize host = m_host;
6 @synthesize pass = m_pass;
7 @synthesize port = m_port;
9 - (bool)showDlg:(NSWindow *)window {
11 [NSBundle loadNibNamed: @"LoginDialog" owner: self];
14 NSString *default_host = [[NSUserDefaults standardUserDefaults] stringForKey:@"LastTargetHost"];
15 if ( default_host != nil ) {
16 [m_host_field setStringValue: default_host];
19 NSString *default_port = [[NSUserDefaults standardUserDefaults] stringForKey:@"LastTargetPort"];
20 if ( default_port != nil ) {
21 [m_port_field setStringValue:[[NSUserDefaults standardUserDefaults] stringForKey:@"LastTargetPort"]];
23 [NSApp beginSheet: m_dlg modalForWindow: window
24 modalDelegate: nil didEndSelector: nil contextInfo: nil];
26 [NSApp runModalForWindow: m_dlg];
28 [NSApp endSheet: m_dlg];
30 [m_dlg orderOut: self];
36 - (IBAction)closeCancel:(id)sender {
41 - (IBAction)closeOK:(id)sender {
44 m_host = [m_host_field stringValue];
45 NSString *port = [m_port_field stringValue];
46 m_port = [port intValue];
47 m_pass = [m_pass_field stringValue];