diff --git a/ChangeLog b/ChangeLog index 0a550aae2..e03ad66ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-21 Cyril Robert + + * UI/Scheduler/UIxCalMainActions.m (displayNameForUrl:): The calendar's + display name is extracted from the URL for web calendars. + * UI/Scheduler/UIxCalendarProperties.m (webCalendarURL, isWebCalendar): + Added new methods to display a web calendar's url in the properties dialog. + 2009-09-21 Ludovic Marcotte * Updated the contact import text to be more diff --git a/UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings b/UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings index 1d37e6a36..9508e8ddd 100644 --- a/UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings +++ b/UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Tarefa Confidencial)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Scheduler/Czech.lproj/Localizable.strings b/UI/Scheduler/Czech.lproj/Localizable.strings index d1528fc64..1efb9117d 100644 --- a/UI/Scheduler/Czech.lproj/Localizable.strings +++ b/UI/Scheduler/Czech.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Důvěrný úkol)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Scheduler/Dutch.lproj/Localizable.strings b/UI/Scheduler/Dutch.lproj/Localizable.strings index 6b9e47397..ae926a3f0 100644 --- a/UI/Scheduler/Dutch.lproj/Localizable.strings +++ b/UI/Scheduler/Dutch.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Vertrouwelijke taak)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 164e09b80..83a62899e 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Confidential task)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Scheduler/French.lproj/Localizable.strings b/UI/Scheduler/French.lproj/Localizable.strings index 883f45f03..2aa732df1 100644 --- a/UI/Scheduler/French.lproj/Localizable.strings +++ b/UI/Scheduler/French.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Tâche confidentielle)"; "Subscribe to a web calendar..." = "S'inscrire à un agenda en ligne..."; "URL of the Calendar" = "URL de l'agenda"; +"Web Calendar" = "Calendrier web"; diff --git a/UI/Scheduler/German.lproj/Localizable.strings b/UI/Scheduler/German.lproj/Localizable.strings index 748fa87bb..32da31e3b 100644 --- a/UI/Scheduler/German.lproj/Localizable.strings +++ b/UI/Scheduler/German.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Vertrauliche Aufgabe)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Scheduler/Hungarian.lproj/Localizable.strings b/UI/Scheduler/Hungarian.lproj/Localizable.strings index 5befa1405..c7ca806dc 100644 --- a/UI/Scheduler/Hungarian.lproj/Localizable.strings +++ b/UI/Scheduler/Hungarian.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Bizalmas feladat)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Scheduler/Italian.lproj/Localizable.strings b/UI/Scheduler/Italian.lproj/Localizable.strings index 6df62ce78..1d2dab9f6 100644 --- a/UI/Scheduler/Italian.lproj/Localizable.strings +++ b/UI/Scheduler/Italian.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Attività confidenziale)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Scheduler/Russian.lproj/Localizable.strings b/UI/Scheduler/Russian.lproj/Localizable.strings index 5b1e2233e..a810e916c 100644 --- a/UI/Scheduler/Russian.lproj/Localizable.strings +++ b/UI/Scheduler/Russian.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Confidential task)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Scheduler/Spanish.lproj/Localizable.strings b/UI/Scheduler/Spanish.lproj/Localizable.strings index 72dd3b398..caefb71ab 100644 --- a/UI/Scheduler/Spanish.lproj/Localizable.strings +++ b/UI/Scheduler/Spanish.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Tarea confidencial)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Scheduler/UIxCalMainActions.m b/UI/Scheduler/UIxCalMainActions.m index 24ae6ac95..675ae5678 100644 --- a/UI/Scheduler/UIxCalMainActions.m +++ b/UI/Scheduler/UIxCalMainActions.m @@ -42,7 +42,7 @@ WOResponse *response; SOGoWebAppointmentFolder *folder; NSURL *url; - NSString *name; + NSString *name, *displayName; NSMutableDictionary *rc; int imported = 0; @@ -53,7 +53,8 @@ url = [NSURL URLWithString: [r formValueForKey: @"url"]]; if (url) { - [[self clientObject] newFolderWithName: @"Web Calendar" + displayName = [self displayNameForUrl: [r formValueForKey: @"url"]]; + [[self clientObject] newFolderWithName: displayName nameInContainer: &name]; [self saveUrl: url forCalendar: name]; folder = [[self clientObject] lookupName: name @@ -65,7 +66,7 @@ if (imported >= 0) { - [rc setObject: @"Web Calendar" forKey: @"displayname"]; + [rc setObject: displayName forKey: @"displayname"]; [rc setObject: name forKey: @"name"]; } else @@ -82,6 +83,20 @@ return response; } +- (NSString *) displayNameForUrl: (NSString *) calendarURL +{ + NSString *rc, *tmp; + + tmp = [calendarURL lastPathComponent]; + if (tmp) + rc = [tmp stringByDeletingSuffix: @".ics"]; + else + rc = [self labelForKey: @"Web Calendar"]; + + + return rc; +} + - (void) saveUrl: (NSURL *) calendarURL forCalendar: (NSString *) calendarName { diff --git a/UI/Scheduler/UIxCalendarProperties.m b/UI/Scheduler/UIxCalendarProperties.m index f0ed11b70..0e484d610 100644 --- a/UI/Scheduler/UIxCalendarProperties.m +++ b/UI/Scheduler/UIxCalendarProperties.m @@ -172,6 +172,31 @@ [calendar setShowCalendarTasks: new]; } +- (NSString *) webCalendarURL +{ + NSUserDefaults *settings; + NSMutableDictionary *calendarSettings; + NSMutableDictionary *webCalendars; + NSString *rc; + + settings = [[context activeUser] userSettings]; + calendarSettings = [settings objectForKey: @"Calendar"]; + + if (calendarSettings) + { + webCalendars = [calendarSettings objectForKey: @"WebCalendars"]; + if (webCalendars) + rc = [webCalendars objectForKey: [calendar nameInContainer]]; + } + + return rc; +} + +- (BOOL) isWebCalendar +{ + return ([self webCalendarURL] != nil); +} + - (BOOL) shouldTakeValuesFromRequest: (WORequest *) request inContext: (WOContext*) context { diff --git a/UI/Scheduler/Welsh.lproj/Localizable.strings b/UI/Scheduler/Welsh.lproj/Localizable.strings index 6c8c86781..93ce2883b 100644 --- a/UI/Scheduler/Welsh.lproj/Localizable.strings +++ b/UI/Scheduler/Welsh.lproj/Localizable.strings @@ -536,3 +536,4 @@ vtodo_class2 = "(Tasg gyhoeddus)"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; +"Web Calendar" = "Web Calendar"; diff --git a/UI/Templates/SchedulerUI/UIxCalendarProperties.wox b/UI/Templates/SchedulerUI/UIxCalendarProperties.wox index 8e76c2c10..c3674d932 100644 --- a/UI/Templates/SchedulerUI/UIxCalendarProperties.wox +++ b/UI/Templates/SchedulerUI/UIxCalendarProperties.wox @@ -23,6 +23,12 @@ class="textField" var:value="calendarName" /> +
+