aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-08-10 11:08:24 +0000
committerBibiko <bibiko@eva.mpg.de>2010-08-10 11:08:24 +0000
commit0ffc3f17de7204040d230f4d322b9d9fdc54a2aa (patch)
tree7895520934f25e6a077a931880e59ffed25b7b1a
parent7996d9e6f96701af2bf9e52055f6f95b81a28cad (diff)
downloadsequelpro-0ffc3f17de7204040d230f4d322b9d9fdc54a2aa.tar.gz
sequelpro-0ffc3f17de7204040d230f4d322b9d9fdc54a2aa.tar.bz2
sequelpro-0ffc3f17de7204040d230f4d322b9d9fdc54a2aa.zip
• added first implementation for spfs file Quicklook
-rw-r--r--Resources/English.lproj/SPQLPluginConnectionBundleTemplate.html30
-rw-r--r--Resources/English.lproj/SPQLPluginConnectionBundleWindowTemplate.html17
-rw-r--r--Resources/German.lproj/SPQLPluginConnectionBundleTemplate.html30
-rw-r--r--Resources/German.lproj/SPQLPluginConnectionBundleWindowTemplate.html17
-rw-r--r--Resources/Plists/Info.plist384
-rw-r--r--Resources/Plists/Sequel Pro QLGenerator-Info.plist1
-rw-r--r--Source/GeneratePreviewForURL.m141
-rw-r--r--sequel-pro.xcodeproj/project.pbxproj28
8 files changed, 456 insertions, 192 deletions
diff --git a/Resources/English.lproj/SPQLPluginConnectionBundleTemplate.html b/Resources/English.lproj/SPQLPluginConnectionBundleTemplate.html
new file mode 100644
index 00000000..02e5601d
--- /dev/null
+++ b/Resources/English.lproj/SPQLPluginConnectionBundleTemplate.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<style>
+body {
+ font-family:'Lucida Grande';
+ font-size:10pt;
+}
+</style>
+</head>
+<body>
+<center>
+<table>
+<tr>
+<td valign="right">
+<img width="128" heigth="128" src="data:image/auto;base64,%@">
+</td>
+<td>
+<center>
+<b style="font-size:12pt">Sequel Pro Session File</b><br />
+(%ld connections)
+</center><br /><br />
+</td>
+</tr>
+</table>
+%@
+</center>
+</body>
+</html>
diff --git a/Resources/English.lproj/SPQLPluginConnectionBundleWindowTemplate.html b/Resources/English.lproj/SPQLPluginConnectionBundleWindowTemplate.html
new file mode 100644
index 00000000..1d5a80a2
--- /dev/null
+++ b/Resources/English.lproj/SPQLPluginConnectionBundleWindowTemplate.html
@@ -0,0 +1,17 @@
+<table>
+<tr>
+<td align="right">Server: </td><td width="200px">%@&nbsp;(%@)</td>
+</tr>
+<tr>
+<td align="right">Name: </td><td>%@%@</td>
+</tr>
+<tr>
+<td align="right">Host: </td><td>%@</td>
+</tr>
+<tr>
+<td align="right">User: </td><td>%@</td>
+</tr>
+<tr>
+<td align="right">Database: </td><td>%@</td>
+</tr>
+</table> \ No newline at end of file
diff --git a/Resources/German.lproj/SPQLPluginConnectionBundleTemplate.html b/Resources/German.lproj/SPQLPluginConnectionBundleTemplate.html
new file mode 100644
index 00000000..6dea8846
--- /dev/null
+++ b/Resources/German.lproj/SPQLPluginConnectionBundleTemplate.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<style>
+body {
+ font-family:'Lucida Grande';
+ font-size:10pt;
+}
+</style>
+</head>
+<body>
+<center>
+<table>
+<tr>
+<td valign="right">
+<img width="128" heigth="128" src="data:image/auto;base64,%@">
+</td>
+<td>
+<center>
+<b style="font-size:12pt">Sequel Pro Session-Datei</b><br />
+(%ld Verbindungen)
+</center><br /><br />
+</td>
+</tr>
+</table>
+%@
+</center>
+</body>
+</html>
diff --git a/Resources/German.lproj/SPQLPluginConnectionBundleWindowTemplate.html b/Resources/German.lproj/SPQLPluginConnectionBundleWindowTemplate.html
new file mode 100644
index 00000000..c5cc4c1b
--- /dev/null
+++ b/Resources/German.lproj/SPQLPluginConnectionBundleWindowTemplate.html
@@ -0,0 +1,17 @@
+<table>
+<tr>
+<td align="right">Server: </td><td width="200px">%@&nbsp;(%@)</td>
+</tr>
+<tr>
+<td align="right">Name: </td><td>%@%@</td>
+</tr>
+<tr>
+<td align="right">Host: </td><td>%@</td>
+</tr>
+<tr>
+<td align="right">Benutzer: </td><td>%@</td>
+</tr>
+<tr>
+<td align="right">Datenbank: </td><td>%@</td>
+</tr>
+</table> \ No newline at end of file
diff --git a/Resources/Plists/Info.plist b/Resources/Plists/Info.plist
index 2b7aa0a0..ef5bf3fa 100644
--- a/Resources/Plists/Info.plist
+++ b/Resources/Plists/Info.plist
@@ -1,214 +1,214 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>spf</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string>spficon.icns</string>
+ <key>CFBundleTypeName</key>
+ <string>Sequel Pro Connection</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>connection</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>NSDocumentClass</key>
+ <string>SPDocumentController</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>com.google.code.sequel-pro.spf</string>
+ </array>
+ </dict>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>spfs</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string>spficon.icns</string>
+ <key>CFBundleTypeName</key>
+ <string>Sequel Pro Session</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>connections</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>NSDocumentClass</key>
+ <string>SPDocumentController</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>com.google.code.sequel-pro.spfs</string>
+ </array>
+ <key>LSTypeIsPackage</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>sql</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string>sqlicon.icns</string>
+ <key>CFBundleTypeName</key>
+ <string>SQL File</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>sql text</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>NSDocumentClass</key>
+ <string>SPDocumentController</string>
+ </dict>
+ </array>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleHelpBookFolder</key>
+ <string>english_help</string>
+ <key>CFBundleHelpBookName</key>
+ <string>Sequel Pro Help</string>
+ <key>CFBundleIconFile</key>
+ <string>appicon.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.google.code.sequel-pro</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.9.8</string>
+ <key>CFBundleVersion</key>
+ <string></string>
+ <key>FRFeedbackReporter.maxConsoleLogSize</key>
+ <integer>10000</integer>
+ <key>FRFeedbackReporter.targetURL</key>
+ <string>http://log.sequelpro.com/submit</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.5.0</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleDocumentTypes</key>
- <array>
+ <key>i386</key>
+ <string>10.5.0</string>
+ <key>ppc</key>
+ <string>10.5.0</string>
+ <key>x86_64</key>
+ <string>10.6.0</string>
+ </dict>
+ <key>NSAppleScriptEnabled</key>
+ <true/>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright 2002-2010 Sequel Pro and CocoaMySQL team.</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>FRExceptionReportingApplication</string>
+ <key>NSServices</key>
+ <array>
+ <dict>
+ <key>NSKeyEquivalent</key>
<dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>spf</string>
- </array>
- <key>CFBundleTypeIconFile</key>
- <string>spficon.icns</string>
- <key>CFBundleTypeName</key>
- <string>Sequel Pro Connection</string>
- <key>CFBundleTypeOSTypes</key>
- <array>
- <string>connection</string>
- </array>
- <key>CFBundleTypeRole</key>
- <string>Editor</string>
- <key>NSDocumentClass</key>
- <string>SPDocumentController</string>
- <key>LSItemContentTypes</key>
- <array>
- <string>com.google.code.sequel-pro.spf</string>
- </array>
+ <key>default</key>
+ <string>M</string>
</dict>
+ <key>NSMenuItem</key>
<dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>spfs</string>
- </array>
- <key>CFBundleTypeIconFile</key>
- <string>spficon.icns</string>
- <key>CFBundleTypeName</key>
- <string>Sequel Pro Connection Bundle</string>
- <key>CFBundleTypeOSTypes</key>
- <array>
- <string>connections</string>
- </array>
- <key>CFBundleTypeRole</key>
- <string>Editor</string>
- <key>NSDocumentClass</key>
- <string>SPDocumentController</string>
- <key>LSItemContentTypes</key>
- <array>
- <string>com.google.code.sequel-pro.spfs</string>
- </array>
- <key>LSTypeIsPackage</key>
- <true/>
+ <key>default</key>
+ <string>Sequel Pro/Perform selection as MySQL query</string>
</dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>sql</string>
- </array>
- <key>CFBundleTypeIconFile</key>
- <string>sqlicon.icns</string>
- <key>CFBundleTypeName</key>
- <string>SQL File</string>
- <key>CFBundleTypeOSTypes</key>
- <array>
- <string>sql text</string>
- </array>
- <key>CFBundleTypeRole</key>
- <string>Editor</string>
- <key>NSDocumentClass</key>
- <string>SPDocumentController</string>
- </dict>
- </array>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleHelpBookFolder</key>
- <string>english_help</string>
- <key>CFBundleHelpBookName</key>
- <string>Sequel Pro Help</string>
- <key>CFBundleIconFile</key>
- <string>appicon.icns</string>
- <key>CFBundleIdentifier</key>
- <string>com.google.code.sequel-pro</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>0.9.8</string>
- <key>CFBundleVersion</key>
- <string></string>
- <key>FRFeedbackReporter.maxConsoleLogSize</key>
- <integer>10000</integer>
- <key>FRFeedbackReporter.targetURL</key>
- <string>http://log.sequelpro.com/submit</string>
- <key>LSMinimumSystemVersion</key>
- <string>10.5.0</string>
- <key>LSMinimumSystemVersionByArchitecture</key>
- <dict>
- <key>i386</key>
- <string>10.5.0</string>
- <key>ppc</key>
- <string>10.5.0</string>
- <key>x86_64</key>
- <string>10.6.0</string>
+ <key>NSMessage</key>
+ <string>doPerformQueryService</string>
+ <key>NSPortName</key>
+ <string>Sequel Pro</string>
+ <key>NSSendTypes</key>
+ <array>
+ <string>NSStringPboardType</string>
+ <string>NSURLPboardType</string>
+ </array>
</dict>
- <key>NSAppleScriptEnabled</key>
- <true/>
- <key>NSHumanReadableCopyright</key>
- <string>Copyright 2002-2010 Sequel Pro and CocoaMySQL team.</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>FRExceptionReportingApplication</string>
- <key>NSServices</key>
- <array>
- <dict>
- <key>NSKeyEquivalent</key>
- <dict>
- <key>default</key>
- <string>M</string>
- </dict>
- <key>NSMenuItem</key>
- <dict>
- <key>default</key>
- <string>Sequel Pro/Perform selection as MySQL query</string>
- </dict>
- <key>NSMessage</key>
- <string>doPerformQueryService</string>
- <key>NSPortName</key>
- <string>Sequel Pro</string>
- <key>NSSendTypes</key>
- <array>
- <string>NSStringPboardType</string>
- <string>NSURLPboardType</string>
- </array>
- </dict>
- </array>
- <key>SUEnableSystemProfiling</key>
- <true/>
- <key>SUFeedURL</key>
- <string>http://www.sequelpro.com/appcast/app-releases.xml</string>
- <key>SUPublicDSAKeyFile</key>
- <string>sparkle-public-key.pem</string>
- <key>UTExportedTypeDeclarations</key>
- <array>
+ </array>
+ <key>SUEnableSystemProfiling</key>
+ <true/>
+ <key>SUFeedURL</key>
+ <string>http://www.sequelpro.com/appcast/app-releases.xml</string>
+ <key>SUPublicDSAKeyFile</key>
+ <string>sparkle-public-key.pem</string>
+ <key>UTExportedTypeDeclarations</key>
+ <array>
+ <dict>
+ <key>UTTypeDescription</key>
+ <string>Sequel Pro Connection</string>
+ <key>UTTypeIconFile</key>
+ <string></string>
+ <key>UTTypeIdentifier</key>
+ <string>com.google.code.sequel-pro.spf</string>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.plain-text</string>
+ </array>
+ <key>UTTypeTagSpecification</key>
<dict>
- <key>UTTypeDescription</key>
- <string>Sequel Pro Connection</string>
- <key>UTTypeIconFile</key>
- <string></string>
- <key>UTTypeIdentifier</key>
- <string>com.google.code.sequel-pro.spf</string>
- <key>UTTypeConformsTo</key>
+ <key>com.apple.ostype</key>
+ <string>connection</string>
+ <key>public.filename-extension</key>
<array>
- <string>public.plain-text</string>
+ <string>spf</string>
</array>
- <key>UTTypeTagSpecification</key>
- <dict>
- <key>com.apple.ostype</key>
- <string>connection</string>
- <key>public.filename-extension</key>
- <array>
- <string>spf</string>
- </array>
- </dict>
</dict>
+ </dict>
+ <dict>
+ <key>UTTypeDescription</key>
+ <string>Sequel Pro Session</string>
+ <key>UTTypeIconFile</key>
+ <string></string>
+ <key>UTTypeIdentifier</key>
+ <string>com.google.code.sequel-pro.spfs</string>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>com.apple.package</string>
+ </array>
+ <key>UTTypeTagSpecification</key>
<dict>
- <key>UTTypeDescription</key>
- <string>Sequel Pro Connection Bundle</string>
- <key>UTTypeIconFile</key>
- <string></string>
- <key>UTTypeIdentifier</key>
- <string>com.google.code.sequel-pro.spfs</string>
- <key>UTTypeConformsTo</key>
+ <key>com.apple.ostype</key>
+ <string>connections</string>
+ <key>public.filename-extension</key>
<array>
- <string>com.apple.package</string>
+ <string>spfs</string>
</array>
- <key>UTTypeTagSpecification</key>
- <dict>
- <key>com.apple.ostype</key>
- <string>connections</string>
- <key>public.filename-extension</key>
- <array>
- <string>spfs</string>
- </array>
- </dict>
</dict>
+ </dict>
+ <dict>
+ <key>UTTypeDescription</key>
+ <string>SQL File</string>
+ <key>UTTypeIconFile</key>
+ <string></string>
+ <key>UTTypeIdentifier</key>
+ <string>com.google.code.sequel-pro.sql</string>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.plain-text</string>
+ </array>
+ <key>UTTypeTagSpecification</key>
<dict>
- <key>UTTypeDescription</key>
- <string>SQL File</string>
- <key>UTTypeIconFile</key>
- <string></string>
- <key>UTTypeIdentifier</key>
- <string>com.google.code.sequel-pro.sql</string>
- <key>UTTypeConformsTo</key>
+ <key>com.apple.ostype</key>
+ <string>sql text</string>
+ <key>public.filename-extension</key>
<array>
- <string>public.plain-text</string>
+ <string>sql</string>
</array>
- <key>UTTypeTagSpecification</key>
- <dict>
- <key>com.apple.ostype</key>
- <string>sql text</string>
- <key>public.filename-extension</key>
- <array>
- <string>sql</string>
- </array>
- </dict>
</dict>
- </array>
- </dict>
+ </dict>
+ </array>
+</dict>
</plist>
diff --git a/Resources/Plists/Sequel Pro QLGenerator-Info.plist b/Resources/Plists/Sequel Pro QLGenerator-Info.plist
index aca09b59..59418aad 100644
--- a/Resources/Plists/Sequel Pro QLGenerator-Info.plist
+++ b/Resources/Plists/Sequel Pro QLGenerator-Info.plist
@@ -13,6 +13,7 @@
<array>
<string>com.google.code.sequel-pro.spf</string>
<string>com.google.code.sequel-pro.sql</string>
+ <string>com.google.code.sequel-pro.spfs</string>
</array>
</dict>
</array>
diff --git a/Source/GeneratePreviewForURL.m b/Source/GeneratePreviewForURL.m
index 9f44bdf9..c6c980d1 100644
--- a/Source/GeneratePreviewForURL.m
+++ b/Source/GeneratePreviewForURL.m
@@ -208,6 +208,147 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
}
+ else if([urlExtension isEqualToString:@"spfs"]) {
+
+ NSImage *iconImage = [iconImages objectAtIndex:0];
+
+ template = [NSString stringWithContentsOfFile:[[NSBundle bundleWithIdentifier:@"com.google.code.sequel-pro.qlgenerator"] pathForResource:@"SPQLPluginConnectionBundleTemplate" ofType:@"html"]
+ encoding:NSUTF8StringEncoding error:&templateReadError];
+
+ if (template == nil || ![template length] || templateReadError != nil) {
+ [pool release];
+ return noErr;
+ }
+
+ NSString *windowTemplate = [NSString stringWithContentsOfFile:[[NSBundle bundleWithIdentifier:@"com.google.code.sequel-pro.qlgenerator"] pathForResource:@"SPQLPluginConnectionBundleWindowTemplate" ofType:@"html"]
+ encoding:NSUTF8StringEncoding error:&templateReadError];
+
+ if (windowTemplate == nil || ![windowTemplate length] || templateReadError != nil) {
+ [pool release];
+ return noErr;
+ }
+
+ NSError *readError = nil;
+ NSString *convError = nil;
+ NSPropertyListFormat format;
+ NSDictionary *spf = nil;
+
+ // Get info.plist data as dictionary
+ NSData *pData = [NSData dataWithContentsOfFile:[NSString stringWithFormat:@"%@/info.plist", [myURL path]] options:NSUncachedRead error:&readError];
+ spf = [[NSPropertyListSerialization propertyListFromData:pData
+ mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&convError] retain];
+
+ if(!spf || readError != nil || [convError length] || !(format == NSPropertyListXMLFormat_v1_0 || format == NSPropertyListBinaryFormat_v1_0)) {
+ if(spf) [spf release];
+ [pool release];
+ return noErr;
+ }
+
+ NSMutableString *spfsHTML = [NSMutableString string];
+ NSInteger connectionCounter = 0;
+
+ NSArray *theWindows = [spf objectForKey:@"windows"];
+ for(NSDictionary *window in theWindows) {
+
+ NSInteger tabCounter = 0;
+ NSInteger selectedTab = [[window objectForKey:@"selectedTabIndex"] integerValue];
+
+ [spfsHTML appendString:@"<table width='100%' border=1 style='border-collapse:collapse;border:2px solid lightgrey'>"];
+
+ NSArray *theTabs = [window objectForKey:@"tabs"];
+ for(NSDictionary *tab in theTabs) {
+
+ connectionCounter++;
+
+ if(tabCounter == selectedTab)
+ [spfsHTML appendString:@"<tr><td style='background-color:#EEEEEE'>"];
+ else
+ [spfsHTML appendString:@"<tr><td>"];
+
+ NSString *spfPath = @"";
+ NSString *spfPathDisplay = @"";
+ if([[tab objectForKey:@"isAbsolutePath"] boolValue]) {
+ spfPath = [tab objectForKey:@"path"];
+ if([spfPath hasPrefix:NSHomeDirectory()]) {
+ spfPathDisplay = [spfPath stringByReplacingOccurrencesOfString:NSHomeDirectory() withString:@"~"];
+ } else {
+ spfPathDisplay = spfPath;
+ }
+ spfPathDisplay = [NSString stringWithFormat:@"&nbsp;(%@)", spfPathDisplay];
+
+ } else {
+ spfPathDisplay = @"";
+ spfPath = [NSString stringWithFormat:@"%@/Contents/%@", [myURL path], [tab objectForKey:@"path"]];
+ }
+
+ if(spfPath == nil || ![spfPath length]) {
+ [spfsHTML appendString:@"&nbsp;&nbsp;&nbsp;&nbsp;∅"];
+ continue;
+ }
+ // Get info.plist data as dictionary
+ NSDictionary *sessionSpf;
+ NSData *pData = [NSData dataWithContentsOfFile:spfPath options:NSUncachedRead error:&readError];
+ sessionSpf = [[NSPropertyListSerialization propertyListFromData:pData
+ mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&convError] retain];
+
+ if(!sessionSpf || readError != nil || [convError length] || !(format == NSPropertyListXMLFormat_v1_0 || format == NSPropertyListBinaryFormat_v1_0)) {
+ [spfsHTML appendFormat:@"&nbsp;&nbsp;&nbsp;&nbsp;%@&nbsp;∅", [tab objectForKey:@"path"]];
+ } else {
+
+ NSString *name = @"••••";
+ NSString *host = @"••••";
+ NSString *user = @"••••";
+ NSString *database = @"••••";
+
+ if([[sessionSpf objectForKey:@"data"] isKindOfClass:[NSDictionary class]]) {
+ if([[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] && [[[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] objectForKey:@"name"])
+ name = [[[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] objectForKey:@"name"];
+ else
+ name = @"";
+ if([[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] && [[[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] objectForKey:@"host"])
+ host = [[[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] objectForKey:@"host"];
+ else
+ host = @"";
+ if([[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] && [[[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] objectForKey:@"user"])
+ user = [[[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] objectForKey:@"user"];
+ else
+ user = @"";
+ if([[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] && [[[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] objectForKey:@"database"])
+ database = [[[sessionSpf objectForKey:@"data"] objectForKey:@"connection"] objectForKey:@"database"];
+ else
+ database = @"";
+ }
+
+ [spfsHTML appendFormat:windowTemplate,
+ [sessionSpf objectForKey:@"rdbms_type"],
+ [sessionSpf objectForKey:@"rdbms_version"],
+ [name stringByReplacingOccurrencesOfString:@" " withString:@"&nbsp;"],
+ spfPathDisplay,
+ [host stringByReplacingOccurrencesOfString:@" " withString:@"&nbsp;"],
+ [user stringByReplacingOccurrencesOfString:@" " withString:@"&nbsp;"],
+ [database stringByReplacingOccurrencesOfString:@" " withString:@"&nbsp;"]
+ ];
+ }
+
+ tabCounter++;
+
+ [spfsHTML appendString:@"</td></tr>"];
+
+ }
+
+ [spfsHTML appendString:@"</table><br />"];
+
+ }
+
+ html = [[NSMutableString alloc] initWithString:[NSString stringWithFormat:template,
+ [[iconImage TIFFRepresentationUsingCompression:NSTIFFCompressionJPEG factor:0.01] base64EncodingWithLineLength:0],
+ connectionCounter,
+ spfsHTML
+ ]];
+
+
+ }
+
else if([urlExtension isEqualToString:@"sql"]) {
NSImage *iconImage = [iconImages objectAtIndex:0];
diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj
index 423886c3..450a5c8b 100644
--- a/sequel-pro.xcodeproj/project.pbxproj
+++ b/sequel-pro.xcodeproj/project.pbxproj
@@ -360,6 +360,7 @@
BCA6F631100FA7D700E80253 /* FieldEditorSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCA6F62F100FA7D700E80253 /* FieldEditorSheet.xib */; };
BCB56197106F893F00167321 /* ContentFilters.plist in Resources */ = {isa = PBXBuildFile; fileRef = BCB56196106F893F00167321 /* ContentFilters.plist */; };
BCB5619B106F8A1B00167321 /* EditorQuickLookTypes.plist in Resources */ = {isa = PBXBuildFile; fileRef = BCB5619A106F8A1B00167321 /* EditorQuickLookTypes.plist */; };
+ BCBB3C17121158790011F962 /* SPQLPluginConnectionBundleTemplate.html in Resources */ = {isa = PBXBuildFile; fileRef = BCBB3C15121158790011F962 /* SPQLPluginConnectionBundleTemplate.html */; };
BCCBD7FC104408B000D4C50A /* SaveSPFAccessory.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCCBD7FA104408B000D4C50A /* SaveSPFAccessory.xib */; };
BCCDED68115940CB00285E65 /* sync_arrows_01.tiff in Resources */ = {isa = PBXBuildFile; fileRef = BCCDED62115940CB00285E65 /* sync_arrows_01.tiff */; };
BCCDED69115940CB00285E65 /* sync_arrows_02.tiff in Resources */ = {isa = PBXBuildFile; fileRef = BCCDED63115940CB00285E65 /* sync_arrows_02.tiff */; };
@@ -371,6 +372,7 @@
BCD06FC7120AAACB00C73602 /* SPStringAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1789343A0F30C1DD0097539A /* SPStringAdditions.h */; };
BCD0AD490FBBFC340066EA5C /* SPSQLTokenizer.l in Sources */ = {isa = PBXBuildFile; fileRef = BCD0AD480FBBFC340066EA5C /* SPSQLTokenizer.l */; };
BCE0025D11173D2A009DA533 /* SPFieldMapperController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE0025C11173D2A009DA533 /* SPFieldMapperController.m */; };
+ BCEC862012115A30002561DA /* SPQLPluginConnectionBundleWindowTemplate.html in Resources */ = {isa = PBXBuildFile; fileRef = BCEC861F12115A30002561DA /* SPQLPluginConnectionBundleWindowTemplate.html */; };
BCEF78C6115215CA0023F8C2 /* network-small.tif in Resources */ = {isa = PBXBuildFile; fileRef = BCEF78C5115215CA0023F8C2 /* network-small.tif */; };
/* End PBXBuildFile section */
@@ -989,6 +991,8 @@
BCA6F630100FA7D700E80253 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/FieldEditorSheet.xib; sourceTree = "<group>"; };
BCB56194106F893700167321 /* ContentFilters.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ContentFilters.plist; sourceTree = "<group>"; };
BCB56198106F8A1600167321 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = English; path = English.lproj/EditorQuickLookTypes.plist; sourceTree = "<group>"; };
+ BCBB3C16121158790011F962 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = English; path = English.lproj/SPQLPluginConnectionBundleTemplate.html; sourceTree = "<group>"; };
+ BCBB3C181211589D0011F962 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = German; path = German.lproj/SPQLPluginConnectionBundleTemplate.html; sourceTree = "<group>"; };
BCCBD7FB104408B000D4C50A /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/SaveSPFAccessory.xib; sourceTree = "<group>"; };
BCCDED62115940CB00285E65 /* sync_arrows_01.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = sync_arrows_01.tiff; sourceTree = "<group>"; };
BCCDED63115940CB00285E65 /* sync_arrows_02.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = sync_arrows_02.tiff; sourceTree = "<group>"; };
@@ -1000,6 +1004,8 @@
BCD0AD4A0FBBFC480066EA5C /* SPSQLTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPSQLTokenizer.h; sourceTree = "<group>"; };
BCE0025B11173D2A009DA533 /* SPFieldMapperController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPFieldMapperController.h; sourceTree = "<group>"; };
BCE0025C11173D2A009DA533 /* SPFieldMapperController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPFieldMapperController.m; sourceTree = "<group>"; };
+ BCEC861D12115A2B002561DA /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = English; path = English.lproj/SPQLPluginConnectionBundleWindowTemplate.html; sourceTree = "<group>"; };
+ BCEC862112115A3D002561DA /* German */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = German; path = German.lproj/SPQLPluginConnectionBundleWindowTemplate.html; sourceTree = "<group>"; };
BCEF78C5115215CA0023F8C2 /* network-small.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "network-small.tif"; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -1932,10 +1938,12 @@
584756F7120A1B0B0057631F /* QuickLook Plugin */ = {
isa = PBXGroup;
children = (
+ BCBB3C15121158790011F962 /* SPQLPluginConnectionBundleTemplate.html */,
584756FA120A1B290057631F /* SPQLPluginConnectionTemplate.html */,
584756FC120A1B290057631F /* SPQLPluginContentFiltersTemplate.html */,
584756FE120A1B290057631F /* SPQLPluginQueryFavoritesTemplate.html */,
58475700120A1B290057631F /* SPQLPluginSQLTemplate.html */,
+ BCEC861F12115A30002561DA /* SPQLPluginConnectionBundleWindowTemplate.html */,
);
name = "QuickLook Plugin";
sourceTree = "<group>";
@@ -2332,6 +2340,8 @@
58475703120A1B290057631F /* SPQLPluginContentFiltersTemplate.html in Resources */,
58475704120A1B290057631F /* SPQLPluginQueryFavoritesTemplate.html in Resources */,
58475705120A1B290057631F /* SPQLPluginSQLTemplate.html in Resources */,
+ BCBB3C17121158790011F962 /* SPQLPluginConnectionBundleTemplate.html in Resources */,
+ BCEC862012115A30002561DA /* SPQLPluginConnectionBundleWindowTemplate.html in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3027,6 +3037,15 @@
name = EditorQuickLookTypes.plist;
sourceTree = "<group>";
};
+ BCBB3C15121158790011F962 /* SPQLPluginConnectionBundleTemplate.html */ = {
+ isa = PBXVariantGroup;
+ children = (
+ BCBB3C16121158790011F962 /* English */,
+ BCBB3C181211589D0011F962 /* German */,
+ );
+ name = SPQLPluginConnectionBundleTemplate.html;
+ sourceTree = "<group>";
+ };
BCCBD7FA104408B000D4C50A /* SaveSPFAccessory.xib */ = {
isa = PBXVariantGroup;
children = (
@@ -3035,6 +3054,15 @@
name = SaveSPFAccessory.xib;
sourceTree = "<group>";
};
+ BCEC861F12115A30002561DA /* SPQLPluginConnectionBundleWindowTemplate.html */ = {
+ isa = PBXVariantGroup;
+ children = (
+ BCEC861D12115A2B002561DA /* English */,
+ BCEC862112115A3D002561DA /* German */,
+ );
+ name = SPQLPluginConnectionBundleWindowTemplate.html;
+ sourceTree = "<group>";
+ };
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */