From 9e0cdaabe04c96244498ea064e1ee9c4b9d68ab4 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 3 Aug 2006 21:32:53 +0000 Subject: [PATCH] Monotone-Parent: e2a484f8ca3b601174d5551461162d0e9e880aa5 Monotone-Revision: c4b57bd1cf368f4918027a1afcabf6f86bae1404 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-03T21:32:53 Monotone-Branch: ca.inverse.sogo --- UI/Contacts/UIxContactEditorBase.m | 27 +++++++++++++++++++++------ UI/Contacts/product.plist | 4 ++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/UI/Contacts/UIxContactEditorBase.m b/UI/Contacts/UIxContactEditorBase.m index 3d8872281..09d17f83b 100644 --- a/UI/Contacts/UIxContactEditorBase.m +++ b/UI/Contacts/UIxContactEditorBase.m @@ -183,8 +183,8 @@ return YES; } -- (id)defaultAction { - // TODO: very similiar to apt-editor (apt editor would need to use std names +- (void) initSnapshot +{ NSString *c; /* load iCalendar file */ @@ -195,7 +195,12 @@ [self setContentString:c]; [self loadValuesFromContentString:c]; - +} + +- (id)defaultAction { + // TODO: very similiar to apt-editor (apt editor would need to use std names + [self initSnapshot]; + return self; } @@ -203,6 +208,7 @@ /* this is overridden in the mail based contacts UI to redirect to tb.edit */ return @""; } + - (NSString *)editActionName { /* this is overridden in the mail based contacts UI to redirect to tb.edit */ return @"edit"; @@ -259,9 +265,18 @@ @"the specified object"]; } -- (id)testAction { - [self logWithFormat:@"test ..."]; - return self; +- (id) writeAction +{ + NSString *email, *url; + + [self initSnapshot]; + email = [snapshot objectForKey: @"mail"]; + url = ((email) + ? [NSString stringWithFormat: @"Mail/compose?mailto=%@", + email] + : @"Mail/compose"); + return + [self redirectToLocation: [self relativePathToUserFolderSubPath: url]]; } - (id)newAction { diff --git a/UI/Contacts/product.plist b/UI/Contacts/product.plist index c2e8b723a..727b5a5cc 100644 --- a/UI/Contacts/product.plist +++ b/UI/Contacts/product.plist @@ -58,10 +58,10 @@ pageName = "UIxContactEditor"; actionName = "save"; }; - test = { + write = { protectedBy = "View"; pageName = "UIxContactEditor"; - actionName = "test"; + actionName = "write"; }; }; };