diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-06-25 22:26:23 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-06-25 22:26:23 +0000 |
commit | 4a9e9737832222dac26551c90af7279b348690b2 (patch) | |
tree | 763e9464f22c8b6212d60e82fcf729c9bf46701d /Source/SPAppController.m | |
parent | b8b9b9e732829c21bb422adff2bbd557f1a8eca3 (diff) | |
download | sequelpro-4a9e9737832222dac26551c90af7279b348690b2.tar.gz sequelpro-4a9e9737832222dac26551c90af7279b348690b2.tar.bz2 sequelpro-4a9e9737832222dac26551c90af7279b348690b2.zip |
• further progress for open/save session
- remember window position
- remember save accessory view settings in spfs file
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r-- | Source/SPAppController.m | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 7d44ee0c..f86a77cf 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -329,17 +329,10 @@ for(NSDictionary *window in [[[spfs objectForKey:@"windows"] reverseObjectEnumerator] allObjects]) { - static NSPoint cascadeLocation = {.x = 0, .y = 0}; - // Create a new window controller, and set up a new connection view within it. SPWindowController *newWindowController = [[SPWindowController alloc] initWithWindowNibName:@"MainWindow"]; NSWindow *newWindow = [newWindowController window]; - // Cascading defaults to on - retrieve the window origin automatically assigned by cascading, - // and convert to a top left point. - NSPoint topLeftPoint = [newWindow frame].origin; - topLeftPoint.y += [newWindow frame].size.height; - // The first window should use autosaving; subsequent windows should cascade. // So attempt to set the frame autosave name; this will succeed for the very // first window, and fail for others. @@ -348,8 +341,8 @@ [newWindow setFrameUsingName:@"DBView"]; } - // Cascade according to the statically stored cascade location. - cascadeLocation = [newWindow cascadeTopLeftFromPoint:cascadeLocation]; + if([window objectForKey:@"frame"]) + [newWindow setFrame:NSRectFromString([window objectForKey:@"frame"]) display:NO]; // Set the window controller as the window's delegate [newWindow setDelegate:newWindowController]; @@ -389,10 +382,21 @@ } [newWindowController selectTabAtIndex:[[window objectForKey:@"selectedTabIndex"] intValue]]; - [[NSApp delegate] setSessionURL:filename]; } + + NSMutableDictionary *spfsDocData = [NSMutableDictionary dictionary]; + [spfsDocData setObject:[NSNumber numberWithBool:[[spfs objectForKey:@"encrypted"] boolValue]] forKey:@"encrypted"]; + [spfsDocData setObject:[NSNumber numberWithBool:[[spfs objectForKey:@"auto_connect"] boolValue]] forKey:@"auto_connect"]; + [spfsDocData setObject:[NSNumber numberWithBool:[[spfs objectForKey:@"save_password"] boolValue]] forKey:@"save_password"]; + [spfsDocData setObject:[NSNumber numberWithBool:[[spfs objectForKey:@"include_session"] boolValue]] forKey:@"include_session"]; + [spfsDocData setObject:[NSNumber numberWithBool:[[spfs objectForKey:@"save_editor_content"] boolValue]] forKey:@"save_editor_content"]; + + [[NSApp delegate] spfSessionDocData:spfsDocData]; + [[NSApp delegate] setSessionURL:filename]; + } + [spfs release]; } else { |