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> 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): * UI/WebServerResources/ContactsUI.js (-onAddressBookRemove):
avoid selecting the personal addressbook prior to obtaining the avoid selecting the personal addressbook prior to obtaining the
user's answer. user's answer.

View File

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

View File

@ -53,22 +53,34 @@
@implementation UIxContactFoldersView @implementation UIxContactFoldersView
- (id) init
{
if ((self = [super init]))
contextIsSetup = NO;
return self;
}
- (void) _setupContext - (void) _setupContext
{ {
SOGoUser *activeUser; SOGoUser *activeUser;
NSString *module; NSString *module;
SOGoContactFolders *clientObject; SOGoContactFolders *clientObject;
activeUser = [context activeUser]; if (!contextIsSetup)
clientObject = [self clientObject]; {
activeUser = [context activeUser];
module = [clientObject nameInContainer]; clientObject = [self clientObject];
us = [activeUser userSettings]; module = [clientObject nameInContainer];
moduleSettings = [us objectForKey: module];
if (!moduleSettings) us = [activeUser userSettings];
moduleSettings = [NSMutableDictionary dictionary]; moduleSettings = [us objectForKey: module];
[us setObject: moduleSettings forKey: module]; if (!moduleSettings)
moduleSettings = [NSMutableDictionary dictionary];
[us setObject: moduleSettings forKey: module];
contextIsSetup = YES;
}
} }
- (id <WOActionResults>) mailerContactsAction - (id <WOActionResults>) mailerContactsAction
@ -411,6 +423,36 @@
return ([currentFolder isKindOfClass: [SOGoContactSourceFolder class]]? @"remote" : @"local"); 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 - (WOResponse *) saveDragHandleStateAction
{ {
WORequest *request; WORequest *request;