Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Commit

Permalink
Backported all Balance Open functionality to Balance. THERE CAN BE ON…
Browse files Browse the repository at this point in the history
…LY ONE!
  • Loading branch information
einsteinx2 committed Aug 25, 2017
1 parent fa7013c commit 71c7c90
Show file tree
Hide file tree
Showing 1,354 changed files with 487,436 additions and 10,007 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Carthage/* linguist-vendored
Balance/Shared/Frameworks/* linguist-vendored
Balance/macOS/Frameworks/* linguist-vendored
Balance/iOS/Frameworks/* linguist-vendored
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#########
# SQLCipher Build Files
#########

# Sqlcipher build files
sqlcipher/tsrc/parse.c
sqlcipher/sqlite3.c
sqlcipher/parse.out
Expand All @@ -13,6 +10,7 @@ sqlcipher/config.log
sqlcipher/config.status
sqlcipher/Makefile


# Created by https://www.gitignore.io/api/xcode,osx

### Xcode ###
Expand Down Expand Up @@ -71,7 +69,6 @@ Temporary Items

# Carthage
Carthage/Checkouts
Carthage/Build/iOS
Carthage/Build/tvOS
Carthage/Build/watchOS

Expand Down
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: objective-c
osx_image: xcode7.3
before_install:
- brew update
- brew outdated xctool || brew upgrade xctool
- brew outdated carthage || brew upgrade carthage
- carthage bootstrap --platform OSX
script:
- xctool -project Bal.xcodeproj -scheme Balance -sdk macosx10.11 -configuration Release CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=""
15 changes: 0 additions & 15 deletions AutoLaunchBalanceHelper/AppDelegate.h

This file was deleted.

32 changes: 0 additions & 32 deletions AutoLaunchBalanceHelper/AppDelegate.m

This file was deleted.

388 changes: 0 additions & 388 deletions AutoLaunchBalanceHelper/Base.lproj/Main.storyboard

This file was deleted.

13 changes: 0 additions & 13 deletions AutoLaunchBalanceHelper/Supporting Files/main.m

This file was deleted.

13 changes: 13 additions & 0 deletions Bal Helper/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// AppDelegate.h
// Bal
//
// Created by Benjamin Baron on 12/15/16.
// Copyright © 2016 Balanced Software, Inc. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject<NSApplicationDelegate>

@end
45 changes: 45 additions & 0 deletions Bal Helper/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// AppDelegate.m
// Bal
//
// Created by Benjamin Baron on 12/15/16.
// Copyright © 2016 Balanced Software, Inc. All rights reserved.
//

#import "AppDelegate.h"

#define mainAppId @"software.balanced.balancemac"

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)notification {
// Check if main app is already running
BOOL alreadyRunning = NO;
NSArray *runningApplications = [[NSWorkspace sharedWorkspace] runningApplications];
for (NSRunningApplication *app in runningApplications) {
if ([app.bundleIdentifier isEqualToString:mainAppId]) {
alreadyRunning = YES;
break;
}
}

NSLog(@"Balance helper alreadyRunning: %i", alreadyRunning);
if (!alreadyRunning) {
// Calculate the path to Balance
NSArray *pathComponents = [[[NSBundle mainBundle] bundleURL] pathComponents];
NSMutableArray *subComponents = [[pathComponents subarrayWithRange:NSMakeRange(0, pathComponents.count - 3)] mutableCopy];
[subComponents addObject:@"MacOS"];
[subComponents addObject:@"Balance"];
NSString *path = [NSString pathWithComponents:subComponents];
NSLog(@"Balance helper launching Balance at path: %@", path);

// Launch Balance
[[NSWorkspace sharedWorkspace] launchApplication:path];

// Terminate after 10 seconds
sleep(10);
[NSApp terminate:nil];
}
}

@end
5 changes: 5 additions & 0 deletions Bal Helper/Bal Helper.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
Loading

0 comments on commit 71c7c90

Please sign in to comment.