Created a window for address book properties and add the cardDav URL

This commit is contained in:
Alexandre Cloutier
2014-05-15 14:44:31 -04:00
parent d58184af15
commit 07445eb069
12 changed files with 468 additions and 147 deletions
+11 -1
View File
@@ -146,7 +146,7 @@
"You cannot delete the card of \"%{0}\"."
= "You cannot delete the card of \"%{0}\".";
"Address Book Name" = "Address Book Name";
"You cannot subscribe to a folder that you own!"
= "You cannot subscribe to a folder that you own.";
@@ -205,3 +205,13 @@
"A total of %{0} cards were imported in the addressbook." = "A total of %{0} cards were imported in the addressbook.";
"Reload" = "Reload";
/* Properties window */
"Address Book Name:" = "Address Book Name:";
"Public Access" = "Public Access";
"Links to this Address Book" = "Links to this Address Book";
"Authenticated User Access" = "Authenticated User Access";
"CardDAV URL: " = "CardDAV URL: ";
"OK" = "OK";
"Cancel" = "Cancel";
+3 -2
View File
@@ -22,8 +22,9 @@ ContactsUI_OBJC_FILES = \
UIxListEditor.m \
UIxContactsListActions.m \
UIxContactFoldersView.m \
UIxContactFolderActions.m
UIxContactFolderActions.m \
UIxContactFolderProperties.m
ContactsUI_RESOURCE_FILES += \
product.plist \
+35
View File
@@ -0,0 +1,35 @@
/* UIxContactFolderProperties.h - this file is part of SOGo
*
* Copyright (C) 2008-2014 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import <SOGoUI/UIxComponent.h>
@class NSString;
@class SOGoContactGCSFolder;
@interface UIxContactFolderProperties : UIxComponent
{
SOGoContactGCSFolder *addressBook;
NSString *baseCardDAVURL, *basePublicCardDAVURL;
}
- (NSString *) addressBookName;
@end
+93
View File
@@ -0,0 +1,93 @@
/* UIxContactFolderProperties.m - this file is part of SOGo
*
* Copyright (C) 2008-2014 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import "UIxContactFolderProperties.h"
@implementation UIxContactFolderProperties
- (id) init
{
if ((self = [super init]))
{
addressBook = [self clientObject];
baseCardDAVURL = nil;
basePublicCardDAVURL = nil;
}
return self;
}
- (void) dealloc
{
[baseCardDAVURL release];
[basePublicCardDAVURL release];
[super dealloc];
}
- (NSString *) addressBookName
{
return [addressBook displayName];
}
- (NSString *) _baseCardDAVURL
{
NSString *davURL;
if (!baseCardDAVURL)
{
davURL = [[addressBook realDavURL] absoluteString];
if ([davURL hasSuffix: @"/"])
baseCardDAVURL = [davURL substringToIndex: [davURL length] - 1];
else
baseCardDAVURL = davURL;
[baseCardDAVURL retain];
}
return baseCardDAVURL;
}
- (NSString *) cardDavURL
{
return [NSString stringWithFormat: @"%@/", [self _baseCardDAVURL]];
}
- (NSString *) _basePublicCardDAVURL
{
NSString *davURL;
if (!basePublicCardDAVURL)
{
davURL = [[addressBook publicDavURL] absoluteString];
if ([davURL hasSuffix: @"/"])
basePublicCardDAVURL = [davURL substringToIndex: [davURL length] - 1];
else
basePublicCardDAVURL = davURL;
[basePublicCardDAVURL retain];
}
return basePublicCardDAVURL;
}
- (NSString *) publicCardDavURL
{
return [NSString stringWithFormat: @"%@/", [self _basePublicCardDAVURL]];
}
@end
+4
View File
@@ -118,6 +118,10 @@
pageName = "UIxContactsUserRightsEditor";
actionName = "saveUserRights";
};
properties = {
protectedBy = "View";
pageName = "UIxContactFolderProperties";
};
};
};