Skip to content

Commit

Permalink
Merge pull request #12 from vineetchoudhary/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
vineetchoudhary authored Dec 18, 2016
2 parents 80bcb95 + 021aa41 commit 87a89f2
Show file tree
Hide file tree
Showing 14 changed files with 501 additions and 306 deletions.
10 changes: 10 additions & 0 deletions AppBox.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
E188EA181D78570800EBCA52 /* ISO8601.framework in Copy Files (1 item) */ = {isa = PBXBuildFile; fileRef = E188EA151D7856D200EBCA52 /* ISO8601.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E18DCB171DFE729300BD7F11 /* MailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E18DCB161DFE729300BD7F11 /* MailViewController.m */; };
E18DCB1D1DFED95000BD7F11 /* UserData.m in Sources */ = {isa = PBXBuildFile; fileRef = E18DCB1C1DFED95000BD7F11 /* UserData.m */; };
E1A3965D1E040C9E0065FC7F /* NetworkHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = E1A3965C1E040C9E0065FC7F /* NetworkHandler.m */; };
E1A3965E1E04123E0065FC7F /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E1C148731E027A6100EE637F /* AFNetworking.framework */; };
E1A3965F1E04123E0065FC7F /* AFNetworking.framework in Copy Files (1 item) */ = {isa = PBXBuildFile; fileRef = E1C148731E027A6100EE637F /* AFNetworking.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E1C148741E027A6100EE637F /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E1C148731E027A6100EE637F /* AFNetworking.framework */; };
E1CFC65E1D7E7FEA005872BE /* Common.m in Sources */ = {isa = PBXBuildFile; fileRef = E1CFC65D1D7E7FEA005872BE /* Common.m */; };
E1FB91D91D78055200F8DF46 /* ZipArchive.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E1FB91D81D78055200F8DF46 /* ZipArchive.framework */; };
Expand All @@ -52,6 +55,7 @@
dstSubfolderSpec = 10;
files = (
E188EA181D78570800EBCA52 /* ISO8601.framework in Copy Files (1 item) */,
E1A3965F1E04123E0065FC7F /* AFNetworking.framework in Copy Files (1 item) */,
E188EA171D78570300EBCA52 /* CMDQueryStringSerialization.framework in Copy Files (1 item) */,
E1FB91DA1D78087A00F8DF46 /* ZipArchive.framework in Copy Files (1 item) */,
E16438A61D746A2F00CE8B7E /* DropboxOSX.framework in Copy Files (1 item) */,
Expand Down Expand Up @@ -107,6 +111,8 @@
E18DCB161DFE729300BD7F11 /* MailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MailViewController.m; sourceTree = "<group>"; };
E18DCB1B1DFED95000BD7F11 /* UserData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserData.h; sourceTree = "<group>"; };
E18DCB1C1DFED95000BD7F11 /* UserData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserData.m; sourceTree = "<group>"; };
E1A3965B1E040C9E0065FC7F /* NetworkHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkHandler.h; sourceTree = "<group>"; };
E1A3965C1E040C9E0065FC7F /* NetworkHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NetworkHandler.m; sourceTree = "<group>"; };
E1C148731E027A6100EE637F /* AFNetworking.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AFNetworking.framework; sourceTree = "<group>"; };
E1CFC65C1D7E7FEA005872BE /* Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = "<group>"; };
E1CFC65D1D7E7FEA005872BE /* Common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Common.m; sourceTree = "<group>"; };
Expand All @@ -128,6 +134,7 @@
E16437F91D743D4500CE8B7E /* DropboxOSX.framework in Frameworks */,
E1FB91D91D78055200F8DF46 /* ZipArchive.framework in Frameworks */,
E188EA161D7856D200EBCA52 /* ISO8601.framework in Frameworks */,
E1A3965E1E04123E0065FC7F /* AFNetworking.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -337,6 +344,8 @@
E16018F11DEC0EB700E3A377 /* Constants.h */,
E18DCB1B1DFED95000BD7F11 /* UserData.h */,
E18DCB1C1DFED95000BD7F11 /* UserData.m */,
E1A3965B1E040C9E0065FC7F /* NetworkHandler.h */,
E1A3965C1E040C9E0065FC7F /* NetworkHandler.m */,
);
path = Common;
sourceTree = "<group>";
Expand Down Expand Up @@ -418,6 +427,7 @@
E188EA121D78485900EBCA52 /* Tiny.m in Sources */,
E16437DD1D743A4E00CE8B7E /* AppBox.xcdatamodeld in Sources */,
E16437D71D743A4E00CE8B7E /* main.m in Sources */,
E1A3965D1E040C9E0065FC7F /* NetworkHandler.m in Sources */,
E16018F01DEC0BC200E3A377 /* DropboxViewController.m in Sources */,
E16437D41D743A4E00CE8B7E /* AppDelegate.m in Sources */,
E18DCB171DFE729300BD7F11 /* MailViewController.m in Sources */,
Expand Down
1 change: 1 addition & 0 deletions AppBox/AppBoxPrefixHeader.pch
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#import "Constants.h"
#import "XCProject.h"
#import "AppDelegate.h"
#import "NetworkHandler.h"


#endif /* AppBoxPrefixHeader_pch */
1 change: 1 addition & 0 deletions AppBox/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>

@interface AppDelegate : NSObject <NSApplicationDelegate, NSUserNotificationCenterDelegate>

Expand Down
26 changes: 25 additions & 1 deletion AppBox/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,30 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter];
[center setDelegate:self];
self.sessionLog = [[NSMutableString alloc] init];

//Start monitoring internet connection
[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
if (status == AFNetworkReachabilityStatusNotReachable){
[Common showAlertWithTitle:@"Error" andMessage:AFStringFromNetworkReachabilityStatus(status)];
}
}];
[[AFNetworkReachabilityManager sharedManager] startMonitoring];

//Check for update
[Common isNewVersionAvailableCompletion:^(bool available, NSURL *url) {
if (available){
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText: @"New Version Available - AppBox"];
[alert setInformativeText:@"A newer version of the \"AppBox\" is available. Do you want to update it? \n\n\n"];
[alert setAlertStyle:NSInformationalAlertStyle];
[alert setDelegate:self];
[alert addButtonWithTitle:@"YES"];
[alert addButtonWithTitle:@"NO"];
if ([alert runModal] == NSAlertFirstButtonReturn){
[[NSWorkspace sharedWorkspace] openURL:url];
}
}
}];
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
Expand All @@ -37,7 +61,7 @@ +(AppDelegate *)appDelegate{
}

-(void)addSessionLog:(NSString *)sessionLog{
[_sessionLog appendFormat: @"\n%@", sessionLog];
[_sessionLog appendFormat: @"\n\n%@ - %@",[NSDate date],sessionLog];
[[NSNotificationCenter defaultCenter] postNotificationName:SessionLogUpdated object:nil];
}

Expand Down
Loading

0 comments on commit 87a89f2

Please sign in to comment.