diff --git a/Resources/English.lproj/ServerDisplay.nib/designable.nib b/Resources/English.lproj/ServerDisplay.nib/designable.nib index fe2f4bf..71f20a6 100644 --- a/Resources/English.lproj/ServerDisplay.nib/designable.nib +++ b/Resources/English.lproj/ServerDisplay.nib/designable.nib @@ -1,1692 +1,320 @@ - - - - 1060 - 10K549 - 851 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 851 - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - ServerDataViewController - - - FirstResponder - - - NSApplication - - - 3 - 2 - {{472, 412}, {368, 375}} - 1886912512 - Connect - NSPanel - - View - - {3.40282e+38, 3.40282e+38} - {213, 107} - - - 256 - - - - 256 - - - - 256 - - - - 268 - {{26, 17}, {69, 13}} - - YES - - 67239424 - 4194304 - Connecting... - - LucidaGrande - 10 - 2843 - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2ODY1AA - - - - 1 - MC40MjkzNDc4MTMxIDAuNDI5MzQ3ODEzMSAwLjQyOTM0NzgxMzEAA - - - - - - 265 - {{105, 311}, {218, 22}} - - YES - - -1804468671 - 4195328 - - - LucidaGrande - 13 - 1044 - - server address - - YES - - 6 - System - textBackgroundColor - - 3 - MQA - - - - 6 - System - textColor - - 3 - MAA - - - - - - - 265 - {{32, 250}, {68, 17}} - - YES - - 67239424 - 67108864 - Password: - - - - - 6 - System - controlTextColor - - - - - - - 265 - {{52, 200}, {48, 17}} - - YES - - 67239424 - 67108864 - Profile: - - - - - - - - - 265 - {{64, 313}, {38, 17}} - - YES - - 67239424 - 67108864 - Host: - - - - - - - - - 265 - {{105, 277}, {60, 22}} - - YES - - -1804468672 - 71304192 - - 0 - 0 - NO - NO - 1 - AAAAAAAAAAAAAAAAAAAAAA - - - LucidaGrande - 12 - 16 - - - - - - - - - NaN - - - - 0 - - - . - - , - - - - - 0 - 2 - NO - YES - 1 - n4YBAAAAAAAAAAAAAAAAAA - - - 0 - 0 - NO - NO - 1 - AAAAAAAAAAAAAAAAAAAAAA - - -0 - 0 - - - 0 - -0 - - - - - - - - - . - , - NO - NO - YES - - 0 - - YES - - - - - - - 265 - {{-3, 273}, {105, 24}} - - YES - - 67239424 - 67108864 - Display or port: - - - - - - - - - 265 - {{102, 193}, {224, 26}} - - YES - - 67239488 - 1024 - - - -2038284033 - 1 - - - - 400 - 75 - - - default - - 1048576 - 2147483647 - 1 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - - YES - - OtherViews - - - - - 3 - YES - YES - 1 - - - - - 265 - {{103, 223}, {222, 18}} - - YES - - 67239424 - 0 - Remember Password - - - 1211912703 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - - - - 265 - {{237, 7}, {92, 32}} - - YES - - -2080244224 - 134217728 - Connect - - - -2038284033 - 1 - - - DQ - 200 - 25 - - - - - 265 - {{-1, 43}, {327, 5}} - - {0, 0} - - 67239424 - 0 - Box - - - - 3 - MCAwLjgwMDAwMDAxMTkAA - - - 3 - 2 - 0 - NO - - - - 265 - {{105, 247}, {218, 22}} - - YES - - -1804468672 - 4195328 - - - - YES - - - - - - - 265 - {{103, 141}, {222, 18}} - - YES - - 67239424 - 0 - Allow other clients to connect - - - 1211912703 - 0 - - - - - 200 - 25 - - - - - 1292 - - {{6, 15}, {16, 16}} - - 28938 - 100 - - - - 265 - {{103, 121}, {222, 18}} - - YES - - 67239424 - 0 - Fullscreen display - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 265 - {{103, 161}, {222, 18}} - - YES - - 67239424 - 0 - View only - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 268 - {{173, 280}, {153, 17}} - - YES - - 68288064 - 71304192 - Display 10 is port 5910 - - - - - 1 - MC4zMjA2NTIxODY5IDAuMzIwNjUyMTg2OSAwLjMyMDY1MjE4NjkAA - - - - - - 256 - {{3, 16}, {83, 16}} - - YES - - 67239424 - 131072 - Save Server - - LucidaGrande - 11 - 3100 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 265 - {{103, 86}, {222, 18}} - - YES - - 67239424 - 0 - Tunnel over SSH - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 265 - {{105, 58}, {218, 22}} - - YES - - -1804468671 - 272630784 - - - - YES - - - - - - - 265 - {{38, 63}, {64, 17}} - - YES - - 68288064 - 272630784 - SSH host: - - - - - - - - {{1, 1}, {326, 333}} - - - - {{20, 20}, {328, 335}} - - {0, 0} - - 67239424 - 0 - Box - - - - 3 - MCAwLjgwMDAwMDAxMTkAA - - - - 1 - 3 - 0 - NO - - - {368, 375} - - - {{0, 0}, {1280, 832}} - {213, 129} - {3.40282e+38, 3.40282e+38} - - - - - - - hostName - - - - 39 - - - - rememberPwd - - - - 42 - - - - shared - - - - 43 - - - - profilePopup - - - - 44 - - - - box - - - - 45 - - - - window - - - - 54 - - - - connectIndicator - - - - 55 - - - - connectIndicatorText - - - - 56 - - - - connectBtn - - - - 62 - - - - sharedChanged: - - - - 75 - - - - rememberPwdChanged: - - - - 77 - - - - profileSelectionChanged: - - - - 78 - - - - connectToServer: - - - - 79 - - - - display - - - - 80 - - - - password - - - - 81 - - - - nextKeyView - - - - 82 - - - - nextKeyView - - - - 83 - - - - nextKeyView - - - - 84 - - - - nextKeyView - - - - 85 - - - - nextKeyView - - - - 86 - - - - nextKeyView - - - - 87 - - - - nextKeyView - - - - 88 - - - - delegate - - - - 89 - - - - delegate - - - - 90 - - - - fullscreen - - - - 93 - - - - fullscreenChanged: - - - - 94 - - - - save - - - - 96 - - - - addServerChanged: - - - - 97 - - - - viewOnly - - - - 109 - - - - viewOnlyChanged: - - - - 110 - - - - displayDescription - - - - 130 - - - - useSshTunnelChanged: - - - - 137 - - - - sshHostChanged: - - - - 138 - - - - sshHost - - - - 139 - - - - useSshTunnel - - - - 140 - - - - passwordChanged: - - - - 141 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - 6 - - - - - - Connect - - - 5 - - - - - - - - 23 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -3 - - - Application - - - 95 - - - - - - - - 125 - - - - - 11 - - - - - - - - 116 - - - - - 10 - - - - - - - - 115 - - - - - 25 - - - - - - - - 122 - - - - - 8 - - - - - - - - 113 - - - - - 18 - - - - - - - - 120 - - - - - - - - 49 - - - - - 15 - - - - - - - - 118 - - - - - 17 - - - - - - - - 119 - - - - - - - - 21 - - - - - - - - 13 - - - - - 20 - - - - - - - - 121 - - - - - 14 - - - - - - - - 117 - - - - - 19 - - - - - 256 - {{2, 2}, {332, 1}} - - - - - - 12 - - - - - 7 - - - - - - - - 112 - - - - - 26 - - - - - - - - 123 - - - - - 92 - - - - - - - - 124 - - - - - 98 - - - - - - - - 126 - - - - - 127 - - - - - - - - 128 - - - - - 9 - - - - - - - - 114 - - - - - 27 - - - - - 131 - - - - - - - - 132 - - - - - 133 - - - - - - - - 134 - - - - - 135 - - - - - - - - 136 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - ToolTip - - ToolTip - - The host name or IP address of the server to which you wish to connect. You can optionally append a port number with a colon. - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCHAAAwxEAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABC0gAAwtQAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABBoAAAwvIAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - ToolTip - - ToolTip - - Connect to the server now - - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDbQAAwhQAAA - - - com.apple.InterfaceBuilder.CocoaPlugin - - - ToolTip - - ToolTip - - Select your desired connection profile. - - - com.apple.InterfaceBuilder.CocoaPlugin - - - ToolTip - - ToolTip - - The display number of the server to which you wish to connect - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - Ab+AAABCLAAAA - - - - ToolTip - - ToolTip - - Store this password in your Keychain for automatic retrieval next time. - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - AUGgAABCfAAAA - - - com.apple.InterfaceBuilder.CocoaPlugin - - - ToolTip - - ToolTip - - Other clients can connect to the server at the same time as you. - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABAwAAAwbAAAA - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{336, 631}, {368, 375}} - com.apple.InterfaceBuilder.CocoaPlugin - {{336, 631}, {368, 375}} - - - {213, 107} - NSSecureTextField - - ToolTip - - ToolTip - - The password for the server to which you wish to connect - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABB0AAAwagAAA - - - - ToolTip - - ToolTip - - Hide your menubar and Dock and use the entire screen. - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - ToolTip - - ToolTip - - Keyboard and mouse events will not be sent to the server, you will only be observing. - - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - - 141 - - - - - FirstResponder - NSObject - - : - id - - - : - - : - id - - - - IBUserSource - - - - - NSObject - - IBProjectSource - Source/NSObject_Chicken.h - - - - ServerDataViewController - NSWindowController - - id - id - id - id - id - id - id - id - id - id - id - id - - - - addServerChanged: - id - - - cancelConnect: - id - - - connectToServer: - id - - - fullscreenChanged: - id - - - passwordChanged: - id - - - profileSelectionChanged: - id - - - rememberPwdChanged: - id - - - sharedChanged: - id - - - showProfileManager: - id - - - sshHostChanged: - id - - - useSshTunnelChanged: - id - - - viewOnlyChanged: - id - - - - NSBox - NSButton - NSProgressIndicator - NSTextField - NSTextField - NSTextField - NSButton - NSTextField - NSTextField - NSPopUpButton - NSButton - NSButton - NSButton - NSTextField - NSButton - NSButton - - - - box - NSBox - - - connectBtn - NSButton - - - connectIndicator - NSProgressIndicator - - - connectIndicatorText - NSTextField - - - display - NSTextField - - - displayDescription - NSTextField - - - fullscreen - NSButton - - - hostName - NSTextField - - - password - NSTextField - - - profilePopup - NSPopUpButton - - - rememberPwd - NSButton - - - save - NSButton - - - shared - NSButton - - - sshHost - NSTextField - - - useSshTunnel - NSButton - - - viewOnly - NSButton - - - - IBProjectSource - Source/ServerDataViewController.h - - - - ServerDataViewController - NSWindowController - - IBUserSource - - - - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUAppcast.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUUpdater.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - YES - ../../Chicken of the VNC.xcodeproj - 3 - - {9, 8} - {7, 2} - {15, 15} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/English.lproj/ServerDisplay.nib/keyedobjects.nib b/Resources/English.lproj/ServerDisplay.nib/keyedobjects.nib index 8626375..12f9564 100644 Binary files a/Resources/English.lproj/ServerDisplay.nib/keyedobjects.nib and b/Resources/English.lproj/ServerDisplay.nib/keyedobjects.nib differ diff --git a/Source/IServerData.h b/Source/IServerData.h old mode 100644 new mode 100755 index 6e6fca2..c2dcce8 --- a/Source/IServerData.h +++ b/Source/IServerData.h @@ -29,6 +29,7 @@ typedef enum EDIT_ADDRESS, EDIT_PORT, EDIT_NAME, + EDIT_USERNAME, EDIT_PASSWORD, CONNECT, } SUPPORT_TYPE; @@ -41,6 +42,7 @@ typedef enum - (NSString*)name; - (NSString*)host; +- (NSString*)userName; - (NSString*)password; - (bool)rememberPassword; - (int)port; diff --git a/Source/RFBConnection.h b/Source/RFBConnection.h old mode 100644 new mode 100755 index 82d3292..1b8f19c --- a/Source/RFBConnection.h +++ b/Source/RFBConnection.h @@ -59,6 +59,7 @@ ByteReader *currentReader; RFBHandshaker *handshaker; id server_; + NSString *userName; NSString *password; RFBProtocol *rfbProtocol; CARD16 lastMouseX; // location of last mouse position we sent @@ -95,6 +96,7 @@ - (void)setRfbView:(RFBView *)view; - (void)setSession:(Session *)aSession; +- (void)setUserName:(NSString *)userName; - (void)setPassword:(NSString *)password; - (void)setSshTunnel:(SshTunnel *)tunnel; - (void)setReader:(ByteReader*)aReader; @@ -133,6 +135,7 @@ - (Profile*)profile; - (int) protocolMajorVersion; - (int) protocolMinorVersion; +- (NSString*)userName; - (NSString*)password; - (BOOL)connectShared; - (BOOL)viewOnly; diff --git a/Source/RFBConnection.m b/Source/RFBConnection.m old mode 100644 new mode 100755 index 2a84dfb..89b5481 --- a/Source/RFBConnection.m +++ b/Source/RFBConnection.m @@ -80,6 +80,7 @@ - (id)initWithFileHandle:(NSFileHandle*)file server:(id)server currentReader = nil; server_ = [(id)server retain]; + userName = [[server userName] retain]; password = [[server password] retain]; _eventFilter = [[EventFilter alloc] init]; @@ -177,6 +178,12 @@ - (void)setSession:(Session *)aSession session = aSession; } +- (void)setUserName:(NSString *)aUserName +{ + [userName release]; + userName = [aUserName retain]; +} + - (void)setPassword:(NSString *)aPassword { [password release]; @@ -300,6 +307,11 @@ - (void)start:(ServerInitMessage*)info handshaker = nil; } +- (NSString*)userName +{ + return userName; +} + - (NSString*)password { return password; diff --git a/Source/RFBHandshaker.m b/Source/RFBHandshaker.m old mode 100644 new mode 100755 index c1cf402..f0728aa --- a/Source/RFBHandshaker.m +++ b/Source/RFBHandshaker.m @@ -155,9 +155,18 @@ - (void)setAuthArray:(NSData*)authTypeArray { } - (void)atenDiscardDone { + const char *userName = [connection.userName UTF8String]; + if (userName == NULL) { + userName = ""; + } + const char *password = [connection.password UTF8String]; + if (password == NULL) { + password = ""; + } + unsigned char auth[48] = {0}; // *SPIT* - strlcpy((char*) &auth[0], "testuser", 24); - strlcpy((char*) &auth[24], "testpass", 24); + strlcpy((char*) &auth[0], userName, 24); + strlcpy((char*) &auth[24], password, 24); [connection writeBytes:&auth[0] length:sizeof(auth)]; [connection setReader:authResultReader]; } diff --git a/Source/ServerBase.h b/Source/ServerBase.h old mode 100644 new mode 100755 index 655a009..d59fd80 --- a/Source/ServerBase.h +++ b/Source/ServerBase.h @@ -29,6 +29,7 @@ // This represents all the data and settings needed to connect to a VNC server. @interface ServerBase : NSObject { NSString* _host; + NSString* _userName; NSString* _password; int _port; bool _shared; @@ -52,6 +53,7 @@ - (NSString*)name; - (NSString*)host; +- (NSString*)userName; - (NSString*)password; - (BOOL)rememberPassword; - (int)port; @@ -68,6 +70,7 @@ - (void)setHost: (NSString*)host; - (BOOL)setHostAndPort: (NSString*)host; +- (void)setUserName: (NSString*)userName; - (void)setPassword: (NSString*)password; - (void)setDisplay: (int)display; - (void)setShared: (bool)shared; diff --git a/Source/ServerBase.m b/Source/ServerBase.m old mode 100644 new mode 100755 index 7445187..1c0547d --- a/Source/ServerBase.m +++ b/Source/ServerBase.m @@ -40,6 +40,7 @@ - (id)init if( self = [super init] ) { _host = @"localhost"; + _userName = nil; _password = nil; _port = 5900; _shared = NO; @@ -81,6 +82,11 @@ - (NSString*)host return _host; } +- (NSString*)userName +{ + return _userName; +} + - (NSString*)password { return _password; @@ -204,6 +210,12 @@ - (BOOL)setHostAndPort: (NSString*)hostAndPort return NO; } +- (void)setUserName:(NSString *)userName +{ + [_userName autorelease]; + _userName = [userName retain]; +} + - (void)setPassword: (NSString*)password { [_password autorelease]; diff --git a/Source/ServerDataViewController.h b/Source/ServerDataViewController.h old mode 100644 new mode 100755 index fcab354..981705d --- a/Source/ServerDataViewController.h +++ b/Source/ServerDataViewController.h @@ -35,6 +35,7 @@ IBOutlet NSTextField *display; IBOutlet NSTextField *displayDescription; IBOutlet NSTextField *hostName; + IBOutlet NSTextField *userName; IBOutlet NSTextField *password; IBOutlet NSPopUpButton *profilePopup; IBOutlet NSButton *rememberPwd; @@ -66,6 +67,7 @@ - (void)setServer:(id)server; - (id)server; +- (IBAction)userNameChanged:(id)sender; - (IBAction)passwordChanged:(id)sender; - (IBAction)rememberPwdChanged:(id)sender; - (IBAction)profileSelectionChanged:(id)sender; diff --git a/Source/ServerDataViewController.m b/Source/ServerDataViewController.m old mode 100644 new mode 100755 index 8654183..2165b00 --- a/Source/ServerDataViewController.m +++ b/Source/ServerDataViewController.m @@ -42,23 +42,23 @@ - (id)init if (self = [super init]) { [NSBundle loadNibNamed:@"ServerDisplay.nib" owner:self]; - + selfTerminate = NO; removedSaveCheckbox = NO; - + [connectIndicatorText setStringValue:@""]; [box setBorderType:NSNoBorder]; connectionWaiter = nil; - + [self loadProfileIntoView]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateProfileView:) name:ProfileListChangeMsg object:(id)[ProfileDataManager sharedInstance]]; } - + return self; } @@ -68,7 +68,7 @@ - (id)initWithServer:(id)server { [self setServer:server]; } - + return self; } @@ -77,13 +77,13 @@ - (id)initWithReleaseOnCloseOrConnect if (self = [self init]) { selfTerminate = YES; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowClose:) name:NSWindowWillCloseNotification object:(id)[self window]]; } - + return self; } @@ -94,11 +94,11 @@ - (void)dealloc { [save release]; } - + [connectionWaiter cancel]; [connectionWaiter release]; [super dealloc]; - + [[NSNotificationCenter defaultCenter] removeObserver:self]; } @@ -111,18 +111,18 @@ - (void)setServer:(id)server object:(id)mServer]; [(id)mServer autorelease]; } - + mServer = [(id)server retain]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateView:) name:ServerChangeMsg object:(id)mServer]; - + [self updateView:nil]; } - + - (void)updateView:(id)notification -{ +{ // Set properties in dialog box if (mServer != nil) { @@ -133,12 +133,13 @@ - (void)updateView:(id)notification { [self setSaveCheckboxIsVisible: NO]; } - + [hostName setEnabled: YES]; + [userName setEnabled: YES]; [password setEnabled: YES]; [shared setEnabled: YES]; [profilePopup setEnabled: YES]; - + if (port < DISPLAY_MAX) { // Low port numbers have to be encoded as host:port so they won't be // interpreted as display numbers @@ -173,6 +174,7 @@ - (void)updateView:(id)notification /* It's important to do password before rememberPwd so that * the latter will reflect a failure to retrieve the * passsword from the key chain. */ + [userName setStringValue:[mServer userName] ? [mServer userName] : @""]; [password setStringValue:[mServer password] ? [mServer password] : @""]; [rememberPwd setIntValue:[mServer rememberPassword]]; [shared setIntValue:[mServer shared]]; @@ -186,8 +188,9 @@ - (void)updateView:(id)notification [useSshTunnel setIntValue:YES]; [sshHost setStringValue:[mServer sshString]]; } - + [hostName setEnabled: [mServer doYouSupport:EDIT_ADDRESS]]; + [userName setEnabled: [mServer doYouSupport:EDIT_USERNAME]]; [password setEnabled: [mServer doYouSupport:EDIT_PASSWORD]]; [rememberPwd setEnabled: [mServer respondsToSelector:@selector(setRememberPassword:)]]; [useSshTunnel setEnabled: YES]; @@ -200,6 +203,7 @@ - (void)updateView:(id)notification else { [hostName setEnabled: NO]; + [userName setEnabled: NO]; [password setEnabled: NO]; [rememberPwd setEnabled: NO]; [display setEnabled: NO]; @@ -210,6 +214,7 @@ - (void)updateView:(id)notification [sshHost setEnabled: NO]; [hostName setStringValue:@""]; + [userName setStringValue:@""]; [password setStringValue:@""]; [rememberPwd setIntValue:0]; [display setStringValue:@""]; @@ -243,13 +248,13 @@ - (void)setProfilePopupToProfile: (Profile *)profile - (void)loadProfileIntoView { [profilePopup removeAllItems]; - + NSArray* profileKeys = [NSArray arrayWithArray:[[ProfileDataManager sharedInstance] sortedKeyArray]]; - + [profilePopup addItemsWithTitles:profileKeys]; [[profilePopup menu] addItem: [NSMenuItem separatorItem]]; [profilePopup addItemWithTitle:NSLocalizedString(@"EditProfiles", nil)]; - + [self setProfilePopupToProfile: [mServer profile]]; } @@ -286,7 +291,7 @@ - (void)descriptionFromPort { int port = [mServer port]; NSString *str; - + if (port >= PORT_BASE && port < PORT_BASE + DISPLAY_MAX) { NSString *fmt = NSLocalizedString(@"PortIsDisplay", nil); @@ -321,7 +326,7 @@ - (void)takePortFromDisplay - (void)controlTextDidChange:(NSNotification *)aNotification { NSControl* sender = [aNotification object]; - + if( display == sender ) { if( nil != mServer && [mServer doYouSupport:EDIT_PORT] ) @@ -354,6 +359,19 @@ - (void)controlTextDidChange:(NSNotification *)aNotification } } +- (IBAction)userNameChanged:(id)sender { + if ([mServer doYouSupport:EDIT_USERNAME]) { + NSString *str = [sender stringValue]; + + if ([str length] > 0) + [mServer setUserName:str]; + else { + [mServer setUserName:nil]; + } + } + +} + - (IBAction)passwordChanged:(id)sender { if ([mServer doYouSupport:EDIT_PASSWORD]) { @@ -483,7 +501,7 @@ - (IBAction)connectToServer:(id)sender server = s; } else server = mServer; - + // Asynchronously creates a connection to the server connectionWaiter = [[ConnectionWaiter waiterForServer:server delegate:self @@ -545,6 +563,7 @@ - (void)disableControls { [display setEnabled: NO]; [hostName setEnabled: NO]; + [userName setEnabled: NO]; [password setEnabled: NO]; [profilePopup setEnabled: NO]; [rememberPwd setEnabled: NO]; @@ -557,7 +576,7 @@ - (void)disableControls } - (void)windowClose:(id)notification -{ +{ if([notification object] == [self window]) { if( YES == selfTerminate ) diff --git a/Source/ServerFromConnection.m b/Source/ServerFromConnection.m old mode 100644 new mode 100755 index 3f7417c..c1e925f --- a/Source/ServerFromConnection.m +++ b/Source/ServerFromConnection.m @@ -45,6 +45,7 @@ - (bool)doYouSupport: (SUPPORT_TYPE)type case EDIT_ADDRESS: case EDIT_PORT: case EDIT_NAME: + case EDIT_USERNAME: case EDIT_PASSWORD: case CONNECT: return NO; diff --git a/Source/ServerFromPrefs.m b/Source/ServerFromPrefs.m old mode 100644 new mode 100755 index 2bc7fc4..ab92782 --- a/Source/ServerFromPrefs.m +++ b/Source/ServerFromPrefs.m @@ -149,6 +149,7 @@ - (bool)doYouSupport: (SUPPORT_TYPE)type case EDIT_ADDRESS: case EDIT_PORT: case EDIT_NAME: + case EDIT_USERNAME: case EDIT_PASSWORD: case CONNECT: return YES; diff --git a/Source/ServerStandAlone.m b/Source/ServerStandAlone.m old mode 100644 new mode 100755 index 9cb1bff..b8a34ea --- a/Source/ServerStandAlone.m +++ b/Source/ServerStandAlone.m @@ -40,6 +40,7 @@ - (bool)doYouSupport: (SUPPORT_TYPE)type case EDIT_ADDRESS: case EDIT_PORT: case EDIT_NAME: + case EDIT_USERNAME: case EDIT_PASSWORD: case CONNECT: return YES;