mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-23 04:15:26 +00:00
Mantis 139: dialog boxes of webcalendar
Monotone-Parent: fe1684747671de5019121d2155b79f89a2f376eb Monotone-Revision: 525ded69698841a7e49b579ace037c3eca060d31 Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-09-21T14:10:16 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user