From: <de...@us...> - 2009-09-18 13:26:29
|
Revision: 1808 http://iterm.svn.sourceforge.net/iterm/?rev=1808&view=rev Author: delx Date: 2009-09-18 13:26:21 +0000 (Fri, 18 Sep 2009) Log Message: ----------- Show correct window titles (#2765347) Modified Paths: -------------- trunk/Changelog trunk/PTYSession.m trunk/PseudoTerminal.m Modified: trunk/Changelog =================================================================== --- trunk/Changelog 2009-09-18 03:22:14 UTC (rev 1807) +++ trunk/Changelog 2009-09-18 13:26:21 UTC (rev 1808) @@ -1,5 +1,6 @@ 2009-09-17 delx * Save cursor position separately for alternate screens (#2833765) + * Show correct window titles (#2765347) 2009-09-16 delx * Fixed CMD-num tab switching (#2271203) Modified: trunk/PTYSession.m =================================================================== --- trunk/PTYSession.m 2009-09-18 03:22:14 UTC (rev 1807) +++ trunk/PTYSession.m 2009-09-18 13:26:21 UTC (rev 1808) @@ -1164,81 +1164,82 @@ return ([self tty]); } -- (void) setUniqueID: (NSString *)uniqueID +- (void) setUniqueID:(NSString*)uniqueID { NSLog(@"Not allowed to set unique ID"); } -- (NSString *) defaultName +- (NSString*)defaultName { - return (defaultName); + return defaultName; } -- (void) setDefaultName: (NSString *) theName +- (void)setDefaultName:(NSString*)theName { - if([defaultName isEqualToString: theName]) + if([defaultName isEqualToString:theName]) return; - - if(defaultName) - { + + if(defaultName) { // clear the window title if it is not different - if([self windowTitle] == nil || [name isEqualToString: [self windowTitle]]) - [self setWindowTitle: nil]; - [defaultName release]; - defaultName = nil; - } - if (!theName) - theName = NSLocalizedStringFromTableInBundle(@"Untitled",@"iTerm", [NSBundle bundleForClass: [self class]], @"Profiles"); - + if(windowTitle == nil || [name isEqualToString:windowTitle]) + windowTitle = nil; + [defaultName release]; + defaultName = nil; + } + if(!theName) { + theName = NSLocalizedStringFromTableInBundle(@"Untitled",@"iTerm", + [NSBundle bundleForClass:[self class]], @"Profiles"); + } + defaultName = [theName retain]; } -- (NSString *) name +- (NSString*)name { - return (name); + return name; } -- (void) setName: (NSString *) theName +- (void)setName:(NSString*)theName { - if([name isEqualToString: theName]) + if([name isEqualToString:theName]) return; - - if(name) - { + + if(name) { // clear the window title if it is not different - if([self windowTitle] == nil || [name isEqualToString: [self windowTitle]]) - [self setWindowTitle: nil]; - [name release]; - name = nil; - } - if (!theName) - theName = NSLocalizedStringFromTableInBundle(@"Untitled",@"iTerm", [NSBundle bundleForClass: [self class]], @"Profiles"); - + if([name isEqualToString:windowTitle]) + windowTitle = nil; + [name release]; + name = nil; + } + if(!theName) { + theName = NSLocalizedStringFromTableInBundle(@"Untitled",@"iTerm", + [NSBundle bundleForClass:[self class]], @"Profiles"); + } + name = [theName retain]; // sync the window title if it is not set to something else - if([self windowTitle] == nil) - [self setWindowTitle: theName]; - - - [tabViewItem setLabel: name]; - [self setBell: NO]; - - - // get the session submenu to be rebuilt - if([[iTermController sharedInstance] currentTerminal] == [self parent]) - { - [[NSNotificationCenter defaultCenter] postNotificationName: @"iTermNameOfSessionDidChange" object: [self parent] userInfo: nil]; - } + if(windowTitle == nil) + [self setWindowTitle:theName]; + + [tabViewItem setLabel:name]; + [self setBell:NO]; + + // get the session submenu to be rebuilt + if([[iTermController sharedInstance] currentTerminal] == [self parent]) { + [[NSNotificationCenter defaultCenter] + postNotificationName:@"iTermNameOfSessionDidChange" + object:[self parent] userInfo:nil]; + } } -- (NSString *) windowTitle +- (NSString*)windowTitle { - return (windowTitle); + return windowTitle; } -- (void) setWindowTitle: (NSString *) theTitle +- (void)setWindowTitle:(NSString*)theTitle { - if ([theTitle isEqualToString:windowTitle]) return; + if([theTitle isEqualToString:windowTitle]) return; [windowTitle autorelease]; windowTitle = nil; Modified: trunk/PseudoTerminal.m =================================================================== --- trunk/PseudoTerminal.m 2009-09-18 03:22:14 UTC (rev 1807) +++ trunk/PseudoTerminal.m 2009-09-18 13:26:21 UTC (rev 1808) @@ -1167,9 +1167,6 @@ NSLog(@"%s(%d):-[PseudoTerminal setWindowTitle:%@]", __FILE__, __LINE__, title); #endif - if([title length] == 0) { - NSLog(@"ack"); - } NSParameterAssert([title length] > 0); if([self sendInputToAllSessions]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |