From 026600472ebc423835f1cc236b2b4c935a544ccb Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 8 Feb 2010 16:11:37 +0000 Subject: [PATCH 1/4] See ChangeLog Monotone-Parent: 14183e9d9367b240b6e0585031a87772c952285a Monotone-Revision: 50e173285f95163a8c7af77f9550d24a75d046e5 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-02-08T16:11:37 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ UI/MailerUI/UIxMailListView.m | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 256421b53..0ad1c20c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-02-08 Francis Lachapelle + + * UI/MailerUI/UIxMailListView.m (-messageSize): improved + formatting of message size. + 2010-02-03 Wolfgang Sourdeau * UI/MainUI/SOGoRootPage.m (-_standardDefaultAction): add an diff --git a/UI/MailerUI/UIxMailListView.m b/UI/MailerUI/UIxMailListView.m index 5358165c1..404b25cc7 100644 --- a/UI/MailerUI/UIxMailListView.m +++ b/UI/MailerUI/UIxMailListView.m @@ -119,9 +119,13 @@ int size; size = [[message valueForKey: @"size"] intValue]; - - rc = [NSString stringWithFormat: @"%dK", size/1024]; - + if (size > 1024*1024) + rc = [NSString stringWithFormat: @"%.1f MB", (float) size/1024/1024]; + else if (size > 1024*100) + rc = [NSString stringWithFormat: @"%d KB", size/1024]; + else + rc = [NSString stringWithFormat: @"%.1f KB", (float) size/1024]; + return rc; } From 9fa26189c5aca28eb710998be9fbafb826a079e9 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 8 Feb 2010 16:12:12 +0000 Subject: [PATCH 2/4] Updated NEWS file Monotone-Parent: 50e173285f95163a8c7af77f9550d24a75d046e5 Monotone-Revision: 0c3748259db0825d5fe165f158e8663e4f885dc2 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-02-08T16:12:12 Monotone-Branch: ca.inverse.sogo --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 6a4039747..e0d6a4069 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ 1.2-2010XXXX (1.2.X) -------------------- - added CAS authentication support +- improved display of message size in webmail 1.2-20100125 (1.2.0) -------------------- From f84de5a75e5ddadd150fd2aa1e5fd084f587d173 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 8 Feb 2010 17:01:39 +0000 Subject: [PATCH 3/4] See ChangeLog Monotone-Parent: 0c3748259db0825d5fe165f158e8663e4f885dc2 Monotone-Revision: 0a4b114d2f6d275bb25991bd16c7f776c00ee233 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-02-08T17:01:39 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/WebServerResources/ContactsUI.js | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ad1c20c4..8d7fe7e46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-02-08 Francis Lachapelle + * UI/WebServerResources/ContactsUI.js (-onAddressBookRemove): + avoid selecting the personal addressbook prior to obtaining the + user's answer. + * UI/MailerUI/UIxMailListView.m (-messageSize): improved formatting of message size. diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 9518d774c..d880d78f4 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -680,7 +680,9 @@ function onAddressBookAdd(event) { function onFolderUnsubscribeCB(folderId) { var node = $(folderId); + node.deselect(); node.parentNode.removeChild(node); + var personal = $("/personal"); personal.selectElement(); onFolderSelectionChange(); @@ -740,7 +742,6 @@ function onAddressBookRemove(event) { var nodes = selector.getSelectedNodes(); if (nodes.length > 0) { var node = $(nodes[0]); - node.deselect(); var owner = node.getAttribute("owner"); if (owner == "nobody") { var label = getLabel("You cannot remove nor unsubscribe from a public addressbook."); @@ -750,9 +751,6 @@ function onAddressBookRemove(event) { var folderIdElements = node.getAttribute("id").split(":"); var abId = folderIdElements[0].substr(1); deletePersonalAddressBook(abId); - var personal = $("/personal"); - personal.selectElement(); - onFolderSelectionChange(); } else { var folderId = node.getAttribute("id"); @@ -796,12 +794,16 @@ function deletePersonalAddressBookCallback(http) { while (!done && i < children.length) { var currentFolderId = children[i].getAttribute("id").substr(1); if (currentFolderId == http.callbackData) { + children[i].deselect(); ul.removeChild(children[i]); done = true; } else i++; } + var personal = $("/personal"); + personal.selectElement(); + onFolderSelectionChange(); } document.deletePersonalABAjaxRequest = null; } From fe8b465ddc30520db0cdff9ecf9531327f6153e7 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 8 Feb 2010 17:17:28 +0000 Subject: [PATCH 4/4] 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 --- ChangeLog | 5 +++ UI/Contacts/UIxContactFoldersView.h | 1 + UI/Contacts/UIxContactFoldersView.m | 62 ++++++++++++++++++++++++----- 3 files changed, 58 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d7fe7e46..d002a86b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-02-08 Francis Lachapelle + * 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. diff --git a/UI/Contacts/UIxContactFoldersView.h b/UI/Contacts/UIxContactFoldersView.h index 945300d7b..d385c1adf 100644 --- a/UI/Contacts/UIxContactFoldersView.h +++ b/UI/Contacts/UIxContactFoldersView.h @@ -32,6 +32,7 @@ NSString *selectorComponentClass; NSMutableDictionary *moduleSettings; id currentFolder; + BOOL contextIsSetup; } - (NSArray *) contactFolders; diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index 2939b431a..8696e96b4 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -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 ) 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;