diff options
9 files changed, 31 insertions, 32 deletions
diff --git a/Resources/English.lproj/SPQLPluginConnectionTemplate.html b/Resources/English.lproj/SPQLPluginConnectionTemplate.html index cfce367f..48345fcb 100644 --- a/Resources/English.lproj/SPQLPluginConnectionTemplate.html +++ b/Resources/English.lproj/SPQLPluginConnectionTemplate.html @@ -6,8 +6,6 @@ body { font-family:'Lucida Grande'; font-size:10pt; - background-color:#222222; - color:white; } </style> </head> diff --git a/Resources/English.lproj/SPQLPluginContentFiltersTemplate.html b/Resources/English.lproj/SPQLPluginContentFiltersTemplate.html index c9ad6aa7..b6765826 100644 --- a/Resources/English.lproj/SPQLPluginContentFiltersTemplate.html +++ b/Resources/English.lproj/SPQLPluginContentFiltersTemplate.html @@ -6,12 +6,6 @@ body { font-family:'Lucida Grande'; font-size:10pt; - background-color:#222222; - color:white; -} -textarea { - background-color:#222222; - color:white; } </style> </head> diff --git a/Resources/English.lproj/SPQLPluginQueryFavoritesTemplate.html b/Resources/English.lproj/SPQLPluginQueryFavoritesTemplate.html index 73f9f816..5a04861d 100644 --- a/Resources/English.lproj/SPQLPluginQueryFavoritesTemplate.html +++ b/Resources/English.lproj/SPQLPluginQueryFavoritesTemplate.html @@ -6,12 +6,6 @@ body { font-family:'Lucida Grande'; font-size:10pt; - background-color:#222222; - color:white; -} -textarea { - background-color:#222222; - color:white; } </style> </head> diff --git a/Resources/English.lproj/SPQLPluginSQLTemplate.html b/Resources/English.lproj/SPQLPluginSQLTemplate.html index 52588352..d9f55c09 100644 --- a/Resources/English.lproj/SPQLPluginSQLTemplate.html +++ b/Resources/English.lproj/SPQLPluginSQLTemplate.html @@ -14,7 +14,7 @@ body { <table> <tr> <td valign="right"> -<img width="96" src="data:image/auto;base64,%@"> +<img width="128" heigth="128" src="data:image/auto;base64,%@"> </td> <td> <center> diff --git a/Resources/German.lproj/SPQLPluginConnectionTemplate.html b/Resources/German.lproj/SPQLPluginConnectionTemplate.html index 28d5bbb3..c1e3dc45 100644 --- a/Resources/German.lproj/SPQLPluginConnectionTemplate.html +++ b/Resources/German.lproj/SPQLPluginConnectionTemplate.html @@ -6,8 +6,6 @@ body { font-family:'Lucida Grande'; font-size:10pt; - background-color:#222222; - color:white; } </style> </head> diff --git a/Resources/German.lproj/SPQLPluginContentFiltersTemplate.html b/Resources/German.lproj/SPQLPluginContentFiltersTemplate.html index 34ab2c38..cc3d2828 100644 --- a/Resources/German.lproj/SPQLPluginContentFiltersTemplate.html +++ b/Resources/German.lproj/SPQLPluginContentFiltersTemplate.html @@ -6,12 +6,6 @@ body { font-family:'Lucida Grande'; font-size:10pt; - background-color:#222222; - color:white; -} -textarea { - background-color:#222222; - color:white; } </style> </head> diff --git a/Resources/German.lproj/SPQLPluginQueryFavoritesTemplate.html b/Resources/German.lproj/SPQLPluginQueryFavoritesTemplate.html index 412d8ecb..64494a9d 100644 --- a/Resources/German.lproj/SPQLPluginQueryFavoritesTemplate.html +++ b/Resources/German.lproj/SPQLPluginQueryFavoritesTemplate.html @@ -6,12 +6,6 @@ body { font-family:'Lucida Grande'; font-size:10pt; - background-color:#222222; - color:white; -} -textarea { - background-color:#222222; - color:white; } </style> </head> diff --git a/Resources/German.lproj/SPQLPluginSQLTemplate.html b/Resources/German.lproj/SPQLPluginSQLTemplate.html index 9ced9acd..41bff669 100644 --- a/Resources/German.lproj/SPQLPluginSQLTemplate.html +++ b/Resources/German.lproj/SPQLPluginSQLTemplate.html @@ -14,7 +14,7 @@ body { <table> <tr> <td valign="right"> -<img width="96" src="data:image/auto;base64,%@"> +<img width="128" heigth="128" src="data:image/auto;base64,%@"> </td> <td> <center> diff --git a/Source/GeneratePreviewForURL.m b/Source/GeneratePreviewForURL.m index aaf8a903..9f44bdf9 100644 --- a/Source/GeneratePreviewForURL.m +++ b/Source/GeneratePreviewForURL.m @@ -63,8 +63,12 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, if (QLPreviewRequestIsCancelled(preview)) return noErr; - // Get current set file icon - NSImage *iconImage = [[NSWorkspace sharedWorkspace] iconForFile:[myURL path]]; + // Get current Sequel Pro's set of file icons + NSArray *iconImages = [[[NSWorkspace sharedWorkspace] iconForFile:[myURL path]] representations]; + + // just in case + if(!iconImages || [iconImages count] < 1) + iconImages = [NSArray arrayWithObject:[NSImage imageNamed:NSImageNameStopProgressTemplate]]; NSMutableString *html; NSString *template = nil; @@ -77,6 +81,12 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, // Dispatch different fiel extensions if([urlExtension isEqualToString:@"spf"]) { + NSImage *iconImage; + if([iconImages count] > 0) + iconImage = [iconImages objectAtIndex:1]; + else + iconImage = [iconImages objectAtIndex:0]; + NSError *readError = nil; NSString *convError = nil; NSPropertyListFormat format; @@ -151,6 +161,13 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, } else if([[spf objectForKey:@"format"] isEqualToString:@"content filters"]) { + + NSImage *iconImage; + if([iconImages count] > 0) + iconImage = [iconImages objectAtIndex:1]; + else + iconImage = [iconImages objectAtIndex:0]; + template = [NSString stringWithContentsOfFile:[[NSBundle bundleWithIdentifier:@"com.google.code.sequel-pro.qlgenerator"] pathForResource:@"SPQLPluginContentFiltersTemplate" ofType:@"html"] encoding:NSUTF8StringEncoding error:&templateReadError]; @@ -166,6 +183,13 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, } else if([[spf objectForKey:@"format"] isEqualToString:@"query favorites"]) { + + NSImage *iconImage; + if([iconImages count] > 0) + iconImage = [iconImages objectAtIndex:1]; + else + iconImage = [iconImages objectAtIndex:0]; + template = [NSString stringWithContentsOfFile:[[NSBundle bundleWithIdentifier:@"com.google.code.sequel-pro.qlgenerator"] pathForResource:@"SPQLPluginQueryFavoritesTemplate" ofType:@"html"] encoding:NSUTF8StringEncoding error:&templateReadError]; @@ -185,6 +209,9 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, } else if([urlExtension isEqualToString:@"sql"]) { + + NSImage *iconImage = [iconImages objectAtIndex:0]; + template = [NSString stringWithContentsOfFile:[[NSBundle bundleWithIdentifier:@"com.google.code.sequel-pro.qlgenerator"] pathForResource:@"SPQLPluginSQLTemplate" ofType:@"html"] encoding:NSUTF8StringEncoding error:&templateReadError]; |