diff --git a/SUAutomaticUpdateAlert.h b/SUAutomaticUpdateAlert.h index 2b8ea1b8..192ba737 100644 --- a/SUAutomaticUpdateAlert.h +++ b/SUAutomaticUpdateAlert.h @@ -9,8 +9,10 @@ #ifndef SUAUTOMATICUPDATEALERT_H #define SUAUTOMATICUPDATEALERT_H +#import "SUWindowController.h" + @class SUAppcastItem; -@interface SUAutomaticUpdateAlert : NSWindowController { +@interface SUAutomaticUpdateAlert : SUWindowController { SUAppcastItem *updateItem; NSBundle *hostBundle; } diff --git a/SUAutomaticUpdateAlert.m b/SUAutomaticUpdateAlert.m index 4a0865dd..982195bb 100644 --- a/SUAutomaticUpdateAlert.m +++ b/SUAutomaticUpdateAlert.m @@ -15,18 +15,8 @@ { updateItem = [item retain]; hostBundle = [hb retain]; - - NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUAutomaticUpdateAlert" ofType:@"nib"]; - if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations. - { - NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"]; - NSBundle *framework = [NSBundle bundleWithPath:frameworkPath]; - path = [framework pathForResource:@"SUAutomaticUpdateAlert" ofType:@"nib"]; - } - - self = [super initWithWindowNibPath:path owner:self]; - [self setShouldCascadeWindows:NO]; - + [super initWithHostBundle:hb windowNibName:@"SUAutomaticUpdateAlert"]; + [self setShouldCascadeWindows:NO]; return self; } diff --git a/SUStatusController.h b/SUStatusController.h index 8778d027..e56dc8e7 100644 --- a/SUStatusController.h +++ b/SUStatusController.h @@ -9,8 +9,9 @@ #ifndef SUSTATUSCONTROLLER_H #define SUSTATUSCONTROLLER_H +#import "SUWindowController.h" -@interface SUStatusController : NSWindowController { +@interface SUStatusController : SUWindowController { double progressValue, maxProgressValue; NSString *title, *statusText, *buttonTitle; IBOutlet NSButton *actionButton; diff --git a/SUStatusController.m b/SUStatusController.m index 714947af..7cff8ec3 100644 --- a/SUStatusController.m +++ b/SUStatusController.m @@ -14,14 +14,7 @@ - (id)initWithHostBundle:(NSBundle *)hb { hostBundle = [hb retain]; - NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUStatus" ofType:@"nib"]; - if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations. - { - NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"]; - NSBundle *framework = [NSBundle bundleWithPath:frameworkPath]; - path = [framework pathForResource:@"SUStatus" ofType:@"nib"]; - } - self = [super initWithWindowNibPath:path owner:self]; + [super initWithHostBundle:hb windowNibName:@"SUStatus"]; [self setShouldCascadeWindows:NO]; return self; } diff --git a/SUUpdateAlert.h b/SUUpdateAlert.h index c16fc6ce..a0288aba 100644 --- a/SUUpdateAlert.h +++ b/SUUpdateAlert.h @@ -9,6 +9,8 @@ #ifndef SUUPDATEALERT_H #define SUUPDATEALERT_H +#import "SUWindowController.h" + typedef enum { SUInstallUpdateChoice, @@ -17,7 +19,7 @@ typedef enum } SUUpdateAlertChoice; @class WebView, SUAppcastItem; -@interface SUUpdateAlert : NSWindowController { +@interface SUUpdateAlert : SUWindowController { SUAppcastItem *updateItem; NSBundle *hostBundle; id delegate; diff --git a/SUUpdateAlert.m b/SUUpdateAlert.m index 7530833d..f57cd135 100644 --- a/SUUpdateAlert.m +++ b/SUUpdateAlert.m @@ -17,16 +17,7 @@ { hostBundle = [hb retain]; updateItem = [item retain]; - - NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUUpdateAlert" ofType:@"nib"]; - if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations. - { - NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"]; - NSBundle *framework = [NSBundle bundleWithPath:frameworkPath]; - path = [framework pathForResource:@"SUUpdateAlert" ofType:@"nib"]; - } - - self = [super initWithWindowNibPath:path owner:self]; + [super initWithHostBundle:hb windowNibName:@"SUUpdateAlert"]; [self setShouldCascadeWindows:NO]; return self; } diff --git a/Sparkle.h b/Sparkle.h index 52836d1b..5d709867 100644 --- a/Sparkle.h +++ b/Sparkle.h @@ -25,9 +25,9 @@ // there are name-space collisions) so we can list all of them to start with: #import "NSBundle+SUAdditions.h" +#import "NSFileManager+Aliases.h" #import "NSFileManager+Authentication.h" #import "NSFileManager+Verification.h" -#import "NSFileManager+Aliases.h" #import "NSString+extras.h" #import "NSWorkspace_RBAdditions.h" @@ -48,5 +48,6 @@ #import "SUUpdater.h" #import "SUUserDefaults.h" #import "SUVersionComparisonProtocol.h" +#import "SUWindowController.h" #endif diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index ef82685e..30f74a10 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -15,6 +15,8 @@ 611779590D1111C900749C97 /* NSWorkspace_RBAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 611779570D1111C400749C97 /* NSWorkspace_RBAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6117795A0D1111C900749C97 /* NSWorkspace_RBAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 611779560D1111C400749C97 /* NSWorkspace_RBAdditions.m */; }; 61177A1F0D1112E900749C97 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6117796E0D1112E000749C97 /* IOKit.framework */; }; + 61180BCA0D64138900B4E0D1 /* SUWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 61180BC80D64138900B4E0D1 /* SUWindowController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 61180BCB0D64138900B4E0D1 /* SUWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61180BC90D64138900B4E0D1 /* SUWindowController.m */; }; 6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6120721309CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */; }; 61299A2F09CA2DAB00B7442F /* NSFileManager+Verification.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A2D09CA2DAB00B7442F /* NSFileManager+Verification.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -122,6 +124,8 @@ 611779560D1111C400749C97 /* NSWorkspace_RBAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSWorkspace_RBAdditions.m; sourceTree = ""; }; 611779570D1111C400749C97 /* NSWorkspace_RBAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSWorkspace_RBAdditions.h; sourceTree = ""; }; 6117796E0D1112E000749C97 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; + 61180BC80D64138900B4E0D1 /* SUWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUWindowController.h; sourceTree = ""; }; + 61180BC90D64138900B4E0D1 /* SUWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUWindowController.m; sourceTree = ""; }; 6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAutomaticUpdateAlert.h; sourceTree = ""; }; 6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAutomaticUpdateAlert.m; sourceTree = ""; }; 6129984309C9E2DA00B7442F /* NSFileManager+Authentication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Authentication.h"; sourceTree = ""; }; @@ -412,6 +416,8 @@ 6196CFE409C71ADE000DC222 /* SUStatusController.m */, 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */, 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */, + 61180BC80D64138900B4E0D1 /* SUWindowController.h */, + 61180BC90D64138900B4E0D1 /* SUWindowController.m */, ); name = "User Interface"; sourceTree = ""; @@ -485,6 +491,7 @@ 6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */, 612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */, 6171D9070D57B81800BFE886 /* NSFileManager+Aliases.h in Headers */, + 61180BCA0D64138900B4E0D1 /* SUWindowController.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -683,6 +690,7 @@ 61A2279D0D1CEE7600430CCD /* SUSystemProfiler.m in Sources */, 612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */, 6171D9080D57B81800BFE886 /* NSFileManager+Aliases.m in Sources */, + 61180BCB0D64138900B4E0D1 /* SUWindowController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/en.lproj/SUPermissionPrompt.nib/info.nib b/en.lproj/SUPermissionPrompt.nib/info.nib index 54bcba5f..70dd7529 100644 --- a/en.lproj/SUPermissionPrompt.nib/info.nib +++ b/en.lproj/SUPermissionPrompt.nib/info.nib @@ -8,7 +8,7 @@ 5 IBOpenObjects - 5 + 6 IBSystem Version 9B18 diff --git a/en.lproj/SUPermissionPrompt.nib/keyedobjects.nib b/en.lproj/SUPermissionPrompt.nib/keyedobjects.nib index 40c86ef6..6b635bd1 100644 Binary files a/en.lproj/SUPermissionPrompt.nib/keyedobjects.nib and b/en.lproj/SUPermissionPrompt.nib/keyedobjects.nib differ