aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-10-15 09:53:59 +0000
committerBibiko <bibiko@eva.mpg.de>2009-10-15 09:53:59 +0000
commita1f940c4592776c23d335d76232441aad3157eec (patch)
treedb190d5dcfdb4d23cda767c48dbe594904c5636c /Source/TableDocument.m
parent0eb001d5b887776b827d503568921f6230bf862a (diff)
downloadsequelpro-a1f940c4592776c23d335d76232441aad3157eec.tar.gz
sequelpro-a1f940c4592776c23d335d76232441aad3157eec.tar.bz2
sequelpro-a1f940c4592776c23d335d76232441aad3157eec.zip
• SPF file: remember/restore 'connectionEncoding' and 'toolbar visibility'
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m12
1 files changed, 11 insertions, 1 deletions
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"];