Skip to content

Commit 61b1718

Browse files
committed
wip
1 parent f8a6ba7 commit 61b1718

File tree

14 files changed

+20
-1265
lines changed

14 files changed

+20
-1265
lines changed

Classes/Controllers/ApplicationController.m

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,15 @@
1212
#import "PBGitWindowController.h"
1313
#import "PBServicesController.h"
1414
#import "PBGitXProtocol.h"
15-
#import "PBPrefsWindowController.h"
1615
#import "PBNSURLPathUserDefaultsTransfomer.h"
1716
#import "PBGitDefaults.h"
1817
#import "PBCloneRepositoryPanel.h"
1918
#import "OpenRecentController.h"
2019
#import "PBGitBinary.h"
2120

22-
#import <Sparkle/SUUpdater.h>
23-
#import <Sparkle/SUUpdaterDelegate.h>
24-
2521
static OpenRecentController* recentsDialog = nil;
2622

27-
@interface ApplicationController () <SUUpdaterDelegate>
23+
@interface ApplicationController ()
2824
@end
2925

3026
@implementation ApplicationController
@@ -114,9 +110,6 @@ - (BOOL)applicationOpenUntitledFile:(NSApplication *)theApplication
114110

115111
- (void)applicationDidFinishLaunching:(NSNotification*)notification
116112
{
117-
[[SUUpdater sharedUpdater] setSendsSystemProfile:YES];
118-
[[SUUpdater sharedUpdater] setDelegate:self];
119-
120113
// Make sure Git's SSH password requests get forwarded to our little UI tool:
121114
setenv( "SSH_ASKPASS", [[[NSBundle mainBundle] pathForResource: @"gitx_askpasswd" ofType: @""] UTF8String], 1 );
122115
setenv( "DISPLAY", "localhost:0", 1 );
@@ -150,11 +143,6 @@ - (IBAction)openDocument:(id)sender {
150143
}];
151144
}
152145

153-
- (IBAction)openPreferencesWindow:(id)sender
154-
{
155-
[[PBPrefsWindowController sharedPrefsWindowController] showWindow:nil];
156-
}
157-
158146
- (IBAction)showAboutPanel:(id)sender
159147
{
160148
NSString *gitversion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleGitVersion"];
@@ -179,67 +167,6 @@ - (IBAction) showCloneRepository:(id)sender
179167
[cloneRepositoryPanel showWindow:self];
180168
}
181169

182-
- (IBAction)installCliTool:(id)sender;
183-
{
184-
BOOL success = NO;
185-
NSString* installationPath = @"/usr/local/bin/";
186-
NSString* installationName = @"gitx";
187-
NSString* toolPath = [[NSBundle mainBundle] pathForResource:@"gitx" ofType:@""];
188-
if (toolPath) {
189-
AuthorizationRef auth;
190-
if (AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth) == errAuthorizationSuccess) {
191-
char const* mkdir_arg[] = { "-p", [installationPath UTF8String], NULL};
192-
char const* mkdir = "/bin/mkdir";
193-
AuthorizationExecuteWithPrivileges(auth, mkdir, kAuthorizationFlagDefaults, (char**)mkdir_arg, NULL);
194-
char const* arguments[] = { "-f", "-s", [toolPath UTF8String], [[installationPath stringByAppendingString: installationName] UTF8String], NULL };
195-
char const* helperTool = "/bin/ln";
196-
if (AuthorizationExecuteWithPrivileges(auth, helperTool, kAuthorizationFlagDefaults, (char**)arguments, NULL) == errAuthorizationSuccess) {
197-
int status;
198-
int pid = wait(&status);
199-
if (pid != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0)
200-
success = true;
201-
else
202-
errno = WEXITSTATUS(status);
203-
}
204-
205-
AuthorizationFree(auth, kAuthorizationFlagDefaults);
206-
}
207-
}
208-
209-
NSAlert * alert = [[NSAlert alloc] init];
210-
if (success) {
211-
alert.messageText = NSLocalizedString(@"Installation Complete", @"Headline for successfully completed installation of the command line tool");
212-
alert.informativeText = [NSString stringWithFormat:NSLocalizedString(@"The gitx tool has been installed to %@.", @"Informative text for successfully completed installation of the command line tool at the location %@"), installationPath];
213-
} else {
214-
alert.messageText = NSLocalizedString(@"Installation Failed", @"Headline for failed installation of the command line tool");
215-
alert.informativeText = [NSString stringWithFormat:NSLocalizedString(@"Installation to %@ failed.", @"Informative text for successfully completed installation of the command line tool at the location %@"), installationPath];
216-
}
217-
[alert runModal];
218-
}
219-
220-
#pragma mark Sparkle delegate methods
221-
222-
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile
223-
{
224-
NSArray *keys = [NSArray arrayWithObjects:@"key", @"displayKey", @"value", @"displayValue", nil];
225-
NSMutableArray *feedParameters = [NSMutableArray array];
226-
227-
// only add parameters if the profile is being sent this time
228-
if (sendingProfile) {
229-
NSString *CFBundleGitVersion = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleGitVersion"];
230-
if (CFBundleGitVersion)
231-
[feedParameters addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"CFBundleGitVersion", @"Full Version", CFBundleGitVersion, CFBundleGitVersion, nil]
232-
forKeys:keys]];
233-
234-
NSString *gitVersion = [PBGitBinary version];
235-
if (gitVersion)
236-
[feedParameters addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"gitVersion", @"git Version", gitVersion, gitVersion, nil]
237-
forKeys:keys]];
238-
}
239-
240-
return feedParameters;
241-
}
242-
243170

244171
#pragma mark Help menu
245172

Classes/Controllers/DBPrefsWindowController.h

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)