aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-06-21 11:38:43 +0000
committerBibiko <bibiko@eva.mpg.de>2010-06-21 11:38:43 +0000
commite9f34249920eea69ca0dc116d21c1403c49ec0f4 (patch)
tree12e1198bd8f1f0fe65fc78a1d707f5f7385a9bef /Source/SPAppController.m
parent43410663ca0338c8203c30156bd5391bb1f8fb37 (diff)
downloadsequelpro-e9f34249920eea69ca0dc116d21c1403c49ec0f4.tar.gz
sequelpro-e9f34249920eea69ca0dc116d21c1403c49ec0f4.tar.bz2
sequelpro-e9f34249920eea69ca0dc116d21c1403c49ec0f4.zip
• initial preparations to support the storage of the entire SP session (all windows including tabs)
• added file extension 'spfs' as SP bundle Note: The idea is to save inside the given spfs bundle a file 'Info.list' which contains the entire structure (which window, which tabs, selected items, etc.; each single connection is saved as separate spf file - if untitled inside the bundle in the sub-folder 'Contents' or if not the absolute path to a already saved spf file). This should insure that the user can open a single spf file in SP or as part of a spfs bundle session without loosing having two different spf file for the same connection. - Comments are welcome
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r--Source/SPAppController.m23
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m
index 7a3ec334..45deeff9 100644
--- a/Source/SPAppController.m
+++ b/Source/SPAppController.m
@@ -43,6 +43,7 @@
- (id)init
{
if ((self = [super init])) {
+ _sessionURL = nil;
[NSApp setDelegate:self];
}
@@ -295,6 +296,9 @@
[[self frontDocument] initWithConnectionFile:filename];
}
+ else if([[[filename pathExtension] lowercaseString] isEqualToString:@"spfs"]) {
+
+ }
else {
NSLog(@"Only files with the extensions ‘spf’ or ‘sql’ are allowed.");
}
@@ -435,6 +439,23 @@
return nil;
}
+/**
+ * Retrieve the session URL. Return nil if no session is opened
+ */
+- (NSURL *)sessionURL
+{
+ return _sessionURL;
+}
+
+/**
+ * Set the global session URL used for Save (As) Session.
+ */
+- (void)setSessionURL:(NSString *)urlString
+{
+ if(_sessionURL) [_sessionURL release], _sessionURL = nil;
+ _sessionURL = [[NSURL fileURLWithPath:urlString] retain];
+}
+
#pragma mark -
#pragma mark Services menu methods
@@ -768,7 +789,7 @@
{
[prefsController release], prefsController = nil;
[aboutController release], aboutController = nil;
-
+ if(_sessionURL) [_sessionURL release], _sessionURL = nil;
[super dealloc];
}