From a1f940c4592776c23d335d76232441aad3157eec Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 15 Oct 2009 09:53:59 +0000 Subject: =?UTF-8?q?=E2=80=A2=20SPF=20file:=20remember/restore=20'connectio?= =?UTF-8?q?nEncoding'=20and=20'toolbar=20visibility'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TableDocument.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 427e73fd..46423f2c 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -476,6 +476,10 @@ if([tables indexOfObject:[spfSession objectForKey:@"table"]] == NSNotFound) return; + // Restore toolbar setting + if([spfSession objectForKey:@"isToolbarVisible"]) + [[tableWindow toolbar] setVisible:[[spfSession objectForKey:@"isToolbarVisible"] boolValue]]; + // TODO up to now it doesn't work if([spfSession objectForKey:@"contentSelectedIndexSet"]) { NSMutableIndexSet *anIndexSet = [NSMutableIndexSet indexSet]; @@ -500,7 +504,10 @@ // Select table [tablesListInstance selectTableAtIndex:[NSNumber numberWithInt:[tables indexOfObject:[spfSession objectForKey:@"table"]]]]; - // [tablesListInstance setContentRequiresReload:YES]; + + // Reset database view encoding if differs from default + if([spfSession objectForKey:@"connectionEncoding"] && ![[self connectionEncoding] isEqualToString:[spfSession objectForKey:@"connectionEncoding"]]) + [self setConnectionEncoding:[spfSession objectForKey:@"connectionEncoding"] reloadingViews:YES]; // Select view if([[spfSession objectForKey:@"view"] isEqualToString:@"SP_VIEW_STRUCTURE"]) @@ -2479,6 +2486,9 @@ } [session setObject:aString forKey:@"view"]; + [session setObject:[NSNumber numberWithBool:[[tableWindow toolbar] isVisible]] forKey:@"isToolbarVisible"]; + [session setObject:[self connectionEncoding] forKey:@"connectionEncoding"]; + [session setObject:[NSNumber numberWithBool:[tableContentInstance sortColumnIsAscending]] forKey:@"contentSortColIsAsc"]; [session setObject:[NSNumber numberWithInt:[tableContentInstance limitStart]] forKey:@"contentLimitStartPosition"]; [session setObject:NSStringFromRect([tableContentInstance viewport]) forKey:@"contentViewport"]; -- cgit v1.2.3