Skip to content

Commit

Permalink
Final touch-ups!
Browse files Browse the repository at this point in the history
  • Loading branch information
n0shake committed May 1, 2016
1 parent 5f73b4d commit 0d88969
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 9 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,26 @@
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]"
moduleName = "">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]"
moduleName = "Foundation"
usesParentBreakpointCondition = "Yes"
offsetFromSymbolStart = "0">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
showNonLocalizedStrings = "YES">
showNonLocalizedStrings = "YES"
region = "DE">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand Down
2 changes: 2 additions & 0 deletions Clocker/Appearance Tab/CLAppearanceViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ - (IBAction)displayModeChanged:(id)sender
{
sharedDelege.floatingWindow = [CLFloatingWindowController sharedFloatingWindow];
[sharedDelege.floatingWindow showWindow:nil];
[sharedDelege.floatingWindow.mainTableview reloadData];
[sharedDelege.floatingWindow startWindowTimer];
[NSApp activateIgnoringOtherApps:YES];
}
else
Expand Down
4 changes: 4 additions & 0 deletions Clocker/ApplicationDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
{
self.floatingWindow = [CLFloatingWindowController sharedFloatingWindow];
[self.floatingWindow showWindow:nil];
[self.floatingWindow.mainTableview reloadData];
[self.floatingWindow startWindowTimer];

[NSApp activateIgnoringOtherApps:YES];
}

Expand Down Expand Up @@ -177,6 +180,7 @@ - (IBAction)togglePanel:(id)sender
{
self.floatingWindow = [CLFloatingWindowController sharedFloatingWindow];
[self.floatingWindow showWindow:nil];
[self.floatingWindow startWindowTimer];
[NSApp activateIgnoringOtherApps:YES];
return;
}
Expand Down
6 changes: 5 additions & 1 deletion Clocker/Floating Window/CLFloatingWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
#import <Cocoa/Cocoa.h>
#import "CLParentPanelController.h"

@interface CLFloatingWindowController : CLParentPanelController <NSTableViewDataSource>
@interface CLFloatingWindowController : CLParentPanelController <NSTableViewDataSource, NSWindowDelegate>

@property (strong, nonatomic) NSTimer *floatingWindowTimer;

+ (instancetype)sharedFloatingWindow;
- (void)updatePanelColor;
- (void)startWindowTimer;


@end
23 changes: 23 additions & 0 deletions Clocker/Floating Window/CLFloatingWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ -(NSView*)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *
cell.customName.stringValue = [dataObject formatStringShouldContainCity:YES];

NSNumber *displayFutureSlider = [[NSUserDefaults standardUserDefaults] objectForKey:CLDisplayFutureSliderKey];

if ([displayFutureSlider isEqualToNumber:[NSNumber numberWithInteger:1]])
{
self.futureSlider.hidden = YES;
Expand Down Expand Up @@ -299,6 +300,28 @@ - (void)removeContextHelpForSlider
[NSApp postEvent:newEvent atStart:NO];
}

-(void)windowWillClose:(NSNotification *)notification
{
self.futureSliderValue = 0;

if (self.floatingWindowTimer)
{
[self.floatingWindowTimer invalidate];
self.floatingWindowTimer = nil;
}
}

- (void)startWindowTimer
{
if (!self.floatingWindowTimer)
{
self.floatingWindowTimer = [NSTimer scheduledTimerWithTimeInterval:2.0
target:self
selector:@selector(updateTime) userInfo:nil
repeats:YES];
}
}

- (void)updatePanelColor
{
[super updatePanelColor];
Expand Down
8 changes: 1 addition & 7 deletions Clocker/Model/CLTimezoneData.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ - (NSString *)getLocalCurrentDate
}

- (NSString *)compareSystemDate:(NSString *)systemDate toTimezoneDate:(NSString *)date
{
NSParameterAssert(systemDate);
NSParameterAssert(date);

{
NSDateFormatter *formatter = [NSDateFormatter new];
formatter.dateFormat = [NSDateFormatter dateFormatFromTemplate:@"MM/dd/yyyy"
options:0
Expand All @@ -230,9 +227,6 @@ - (NSString *)compareSystemDate:(NSString *)systemDate toTimezoneDate:(NSString
NSDate *localDate = [formatter dateFromString:systemDate];
NSDate *timezoneDate = [formatter dateFromString:date];

NSAssert(localDate != nil, @"Local date cannot be nil");
NSAssert(timezoneDate != nil, @"Local date cannot be nil");

// Specify which units we would like to use
NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
NSInteger weekday = [calendar component:NSCalendarUnitWeekday fromDate:localDate];
Expand Down

0 comments on commit 0d88969

Please sign in to comment.