From 7acec88b97a1889a37c4753c325177ca5e656193 Mon Sep 17 00:00:00 2001 From: C Robert Date: Fri, 21 Aug 2009 14:25:42 +0000 Subject: [PATCH] Monotone-Parent: efb15318c83fe427840ce7814c65d5a7c2518a07 Monotone-Revision: 08fdc5d0a9471051564e0739b2dd3367c1e5143a Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-08-21T14:25:42 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++ UI/Contacts/UIxListView.h | 4 ++ UI/Contacts/UIxListView.m | 58 +++++++++++++++++++++++++ UI/Templates/ContactsUI/UIxListView.wox | 15 ++++++- 4 files changed, 80 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 19ef05e1b..f747412c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-08-21 Cyril Robert + + * UI/Contacts/UIxListView.m: Implementation, allows VLISTs to be displayed. + 2009-08-21 Wolfgang Sourdeau * Tests/webdavlib.py (WebDAVQuery.xpath_evaluate): new method to diff --git a/UI/Contacts/UIxListView.h b/UI/Contacts/UIxListView.h index efac5bced..40f43ab84 100644 --- a/UI/Contacts/UIxListView.h +++ b/UI/Contacts/UIxListView.h @@ -26,6 +26,10 @@ #import @interface UIxListView : UIxComponent +{ + NGVList *list; + id item; +} @end diff --git a/UI/Contacts/UIxListView.m b/UI/Contacts/UIxListView.m index 5998705e8..b23aa3bd5 100644 --- a/UI/Contacts/UIxListView.m +++ b/UI/Contacts/UIxListView.m @@ -20,8 +20,66 @@ * Boston, MA 02111-1307, USA. */ +#import +#import +#import +#import + #import "UIxListView.h" @implementation UIxListView + +- (NSString *) listName +{ + return [list fn]; +} + +- (BOOL) hasNickname +{ + return [list nickname] != nil; +} +- (NSString *) listNickname +{ + return [list nickname]; +} + +- (BOOL) hasDescription +{ + return [list description] != nil; +} +- (NSString *) listDescription +{ + return [list description]; +} + +- (NSArray *) components +{ + return [list cardReferences]; +} +- (NSString *) itemText +{ + NSString *rc; + + rc = [NSString stringWithFormat: @"%@ <%@>", [item fn], [item email]]; + + return rc; +} + +- (id ) defaultAction +{ + id rc; + + list = [[self clientObject] vList]; + //TODO: make sure references are valid + + if (list) + rc = self; + else + rc = [NSException exceptionWithHTTPStatus: 404 /* Not Found */ + reason: @"could not locate contact"]; + + return rc; +} + @end diff --git a/UI/Templates/ContactsUI/UIxListView.wox b/UI/Templates/ContactsUI/UIxListView.wox index 02bb02116..a3b7c1a28 100644 --- a/UI/Templates/ContactsUI/UIxListView.wox +++ b/UI/Templates/ContactsUI/UIxListView.wox @@ -9,4 +9,17 @@ className="UIxPageFrame" title="name" const:popup="YES" - >Unimplemented + > +

+ +

+
+ +
+
+
    + +
  • +
    +
+