Browse Source

You can now add the same place multiple times.

v1.4.1
Abhishek Banthia 8 years ago
parent
commit
dd8b7547c4
  1. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  2. 18
      Clocker/Preferences/CLPreferencesViewController.m

BIN
Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

18
Clocker/Preferences/CLPreferencesViewController.m

@ -411,6 +411,8 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
{
CLTimezoneData *dataObject = self.filteredArray[self.availableTimezoneTableView.selectedRow];
/*
[self.selectedTimeZones enumerateObjectsUsingBlock:^(NSData * _Nonnull encodedData, NSUInteger idx, BOOL * _Nonnull stop) {
@ -435,6 +437,8 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
}];
*/
if (self.messageLabel.stringValue.length == 0)
{
@ -511,8 +515,6 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
- (IBAction)removeFromFavourites:(id)sender
{
NSMutableArray *itemsToRemove = [NSMutableArray array];
if (self.timezoneTableView.selectedRow == -1)
{
return;
@ -530,12 +532,10 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
}
[itemsToRemove addObject:self.selectedTimeZones[idx]];
[self.selectedTimeZones removeObjectAtIndex:idx];
}];
[self.selectedTimeZones removeObjectsInArray:itemsToRemove];
NSMutableArray *newDefaults = [[NSMutableArray alloc] initWithArray:self.selectedTimeZones];
[[NSUserDefaults standardUserDefaults] setObject:newDefaults forKey:CLDefaultPreferenceKey];
@ -644,11 +644,11 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
}
-(BOOL)tableView:(NSTableView *)tableView acceptDrop:(id<NSDraggingInfo>)info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)dropOperation
-(BOOL)tableView:(NSTableView *)tableView acceptDrop:(id<NSDraggingInfo>)info row:(NSInteger)destinationRow dropOperation:(NSTableViewDropOperation)dropOperation
{
if (row == self.selectedTimeZones.count)
if (destinationRow == self.selectedTimeZones.count)
{
row--;
destinationRow--;
}
NSPasteboard *pBoard = [info draggingPasteboard];
@ -657,7 +657,7 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
NSIndexSet *rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData:data];
[self.selectedTimeZones exchangeObjectAtIndex:rowIndexes.firstIndex withObjectAtIndex:row];
[self.selectedTimeZones exchangeObjectAtIndex:rowIndexes.firstIndex withObjectAtIndex:destinationRow];
[[NSUserDefaults standardUserDefaults] setObject:self.selectedTimeZones forKey:CLDefaultPreferenceKey];

Loading…
Cancel
Save