See ChangeLog

Monotone-Parent: 0a4b114d2f6d275bb25991bd16c7f776c00ee233
Monotone-Revision: c8a36e926bc75ffc1d4206737365b76d6621e3ab

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-02-08T17:17:28
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2010-02-08 17:17:28 +00:00
parent f84de5a75e
commit fe8b465ddc
3 changed files with 58 additions and 10 deletions

View File

@ -1,5 +1,10 @@
2010-02-08 Francis Lachapelle <flachapelle@inverse.ca>
* UI/Contacts/UIxContactFoldersView.m (-verticalDragHandleStyle):
new method (was missing), borrowed from UIxCalMainView.m.
(-horizontalDragHandleStyle): idem.
(contactsListContentStyle): idem.
* UI/WebServerResources/ContactsUI.js (-onAddressBookRemove):
avoid selecting the personal addressbook prior to obtaining the
user's answer.

View File

@ -32,6 +32,7 @@
NSString *selectorComponentClass;
NSMutableDictionary *moduleSettings;
id currentFolder;
BOOL contextIsSetup;
}
- (NSArray *) contactFolders;

View File

@ -53,22 +53,34 @@
@implementation UIxContactFoldersView
- (id) init
{
if ((self = [super init]))
contextIsSetup = NO;
return self;
}
- (void) _setupContext
{
SOGoUser *activeUser;
NSString *module;
SOGoContactFolders *clientObject;
activeUser = [context activeUser];
clientObject = [self clientObject];
module = [clientObject nameInContainer];
us = [activeUser userSettings];
moduleSettings = [us objectForKey: module];
if (!moduleSettings)
moduleSettings = [NSMutableDictionary dictionary];
[us setObject: moduleSettings forKey: module];
if (!contextIsSetup)
{
activeUser = [context activeUser];
clientObject = [self clientObject];
module = [clientObject nameInContainer];
us = [activeUser userSettings];
moduleSettings = [us objectForKey: module];
if (!moduleSettings)
moduleSettings = [NSMutableDictionary dictionary];
[us setObject: moduleSettings forKey: module];
contextIsSetup = YES;
}
}
- (id <WOActionResults>) mailerContactsAction
@ -411,6 +423,36 @@
return ([currentFolder isKindOfClass: [SOGoContactSourceFolder class]]? @"remote" : @"local");
}
- (NSString *) verticalDragHandleStyle
{
NSString *vertical;
[self _setupContext];
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
return ((vertical && [vertical intValue] > 0) ? (id)[vertical stringByAppendingFormat: @"px"] : nil);
}
- (NSString *) horizontalDragHandleStyle
{
NSString *horizontal;
[self _setupContext];
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
return ((horizontal && [horizontal intValue] > 0) ? (id)[horizontal stringByAppendingFormat: @"px"] : nil);
}
- (NSString *) contactsListContentStyle
{
NSString *height;
[self _setupContext];
height = [moduleSettings objectForKey: @"DragHandleVertical"];
return ((height && [height intValue] > 0) ? [NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil);
}
- (WOResponse *) saveDragHandleStateAction
{
WORequest *request;