Permalink
Browse files

Actually added the appropriate files this time.

  • Loading branch information...
1 parent 1462087 commit 6fd1422eea9f23e9639571e622db4de8dc6cd2e4 andym committed Feb 14, 2008
Showing with 45 additions and 1 deletion.
  1. +1 −1 SUUpdatePermissionPrompt.h
  2. +19 −0 SUWindowController.h
  3. +25 −0 SUWindowController.m
View
2 SUUpdatePermissionPrompt.h
@@ -11,7 +11,7 @@
#import "Sparkle.h"
-@interface SUUpdatePermissionPrompt : NSWindowController {
+@interface SUUpdatePermissionPrompt : SUWindowController {
}
View
19 SUWindowController.h
@@ -0,0 +1,19 @@
+//
+// SUWindowController.h
+// Sparkle
+//
+// Created by Andy Matuschak on 2/13/08.
+// Copyright 2008 Andy Matuschak. All rights reserved.
+//
+
+#ifndef SUWINDOWCONTROLLER_H
+#define SUWINDOWCONTROLLER_H
+
+#import <Cocoa/Cocoa.h>
+
+@interface SUWindowController : NSWindowController { }
+// We use this instead of plain old NSWindowController initWithWindowNibName so that we'll be able to find the right path when running in a bundle loaded from another app.
+- (id)initWithHostBundle:(NSBundle *)hb windowNibName:(NSString *)nibName;
+@end
+
+#endif
View
25 SUWindowController.m
@@ -0,0 +1,25 @@
+//
+// SUWindowController.m
+// Sparkle
+//
+// Created by Andy Matuschak on 2/13/08.
+// Copyright 2008 Andy Matuschak. All rights reserved.
+//
+
+#import "SUWindowController.h"
+
+@implementation SUWindowController
+
+- (id)initWithHostBundle:(NSBundle *)hb windowNibName:(NSString *)nibName
+{
+ NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:nibName ofType:@"nib"];
+ if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations.
+ {
+ NSString *frameworkPath = [[hb sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"];
+ NSBundle *framework = [NSBundle bundleWithPath:frameworkPath];
+ path = [framework pathForResource:nibName ofType:@"nib"];
+ }
+ return [super initWithWindowNibPath:path owner:self];
+}
+
+@end

0 comments on commit 6fd1422

Please sign in to comment.