New button to reset Calendar categories

Also added default colors to categories.
This commit is contained in:
Francis Lachapelle
2018-09-07 21:38:31 -04:00
parent 2be5edde94
commit 9ddb65a07a
6 changed files with 61 additions and 26 deletions
+21
View File
@@ -1212,6 +1212,27 @@ static NSArray *reminderValues = nil;
return [uniqueAddressesList componentsJoinedByString: @", "];
}
//
// Used by templates
//
- (NSString *) defaultCalendarCategoriesColors
{
NSArray *labels, *colors;
NSMutableDictionary *defaultCategoriesColors;
unsigned int i;
labels = [[self labelForKey: @"calendar_category_labels"] componentsSeparatedByString: @","];
colors = [[[SOGoSystemDefaults sharedSystemDefaults] calendarCategoriesColors] allValues];
defaultCategoriesColors = [NSMutableDictionary dictionary];
for (i = 0; i < [colors count]; i++)
{
[defaultCategoriesColors setObject: [colors objectAtIndex: i]
forKey: [labels objectAtIndex: i]];
}
return [defaultCategoriesColors jsonRepresentation];
}
//
// Used by templates
//