mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Added SUWindowController to reduce duplication of running-in-bundle special-case code.
This commit is contained in:
1 parent
9eb1cb4693
commit
1462087cc6
10 files changed
+23
-35
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+3
-1
@@ -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;
|
||||
|
||||
+1
-10
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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 = "<group>"; };
|
||||
611779570D1111C400749C97 /* NSWorkspace_RBAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSWorkspace_RBAdditions.h; sourceTree = "<group>"; };
|
||||
6117796E0D1112E000749C97 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
|
||||
61180BC80D64138900B4E0D1 /* SUWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUWindowController.h; sourceTree = "<group>"; };
|
||||
61180BC90D64138900B4E0D1 /* SUWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUWindowController.m; sourceTree = "<group>"; };
|
||||
6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAutomaticUpdateAlert.h; sourceTree = "<group>"; };
|
||||
6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAutomaticUpdateAlert.m; sourceTree = "<group>"; };
|
||||
6129984309C9E2DA00B7442F /* NSFileManager+Authentication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Authentication.h"; sourceTree = "<group>"; };
|
||||
@@ -412,6 +416,8 @@
|
||||
6196CFE409C71ADE000DC222 /* SUStatusController.m */,
|
||||
612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */,
|
||||
612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */,
|
||||
61180BC80D64138900B4E0D1 /* SUWindowController.h */,
|
||||
61180BC90D64138900B4E0D1 /* SUWindowController.m */,
|
||||
);
|
||||
name = "User Interface";
|
||||
sourceTree = "<group>";
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Generated
+1
-1
@@ -8,7 +8,7 @@
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
<integer>6</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9B18</string>
|
||||
|
||||
BIN
Binary file not shown.
Reference in new issue
Block a user