From 4c107904de335d23b8f7ab962c4e052945537bed Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 22 Mar 2011 00:30:26 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 42caf855ed6371b609cb372b49a7c45444fc18e6 Monotone-Revision: d4aaec9a2984bf8eb954d457c1dde92899b63a7a Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-03-22T00:30:26 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++ UI/MailerUI/UIxMailListActions.m | 56 ++++++++++++++++++------------- UI/WebServerResources/MailerUI.js | 4 +-- 3 files changed, 40 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b9d43eda..091316fea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,12 @@ function used to update the window title with respect to the currently selected mailbox. + * UI/WebServerResources/MailerUI.js (openMailbox): exchanged sort + arrows to match Thunderbird's GUI. + + * UI/MailerUI/UIxMailListActions.m (-imap4SortOrdering): when the + sort is not specified in the request, retrieve the user's previous sort. + 2011-03-20 Wolfgang Sourdeau * OpenChange/MAPIStoreCalendarMessage.m diff --git a/UI/MailerUI/UIxMailListActions.m b/UI/MailerUI/UIxMailListActions.m index 459f0bf74..ee59114e7 100644 --- a/UI/MailerUI/UIxMailListActions.m +++ b/UI/MailerUI/UIxMailListActions.m @@ -335,9 +335,6 @@ sort = [[context request] formValueForKey: @"sort"]; - if (![sort length]) - sort = [self defaultSortKey]; - return [sort uppercaseString]; } @@ -357,31 +354,42 @@ activeUser = [context activeUser]; clientObject = [self clientObject]; - module = [[[clientObject container] container] nameInContainer]; + module = @"Mail"; us = [activeUser userSettings]; moduleSettings = [us objectForKey: module]; - if ([sort isEqualToString: [self defaultSortKey]] && !asc) - { - if (moduleSettings) - { - [moduleSettings removeObjectForKey: @"SortingState"]; - [us synchronize]; - } - } - else + if ([sort length]) { - // Save the sorting state in the user settings - if (!moduleSettings) - { - moduleSettings = [NSMutableDictionary dictionary]; - [us setObject: moduleSettings forKey: module]; - } - [moduleSettings setObject: [NSArray arrayWithObjects: [sort lowercaseString], [NSString stringWithFormat: @"%d", (asc?1:0)], nil] - forKey: @"SortingState"]; - [us synchronize]; - } - + if ([sort isEqualToString: [self defaultSortKey]] && !asc) + { + if (moduleSettings) + { + [moduleSettings removeObjectForKey: @"SortingState"]; + [us synchronize]; + } + } + else + { + // Save the sorting state in the user settings + if (!moduleSettings) + { + moduleSettings = [NSMutableDictionary dictionary]; + [us setObject: moduleSettings forKey: module]; + } + [moduleSettings setObject: [NSArray arrayWithObjects: [sort lowercaseString], [NSString stringWithFormat: @"%d", (asc?1:0)], nil] + forKey: @"SortingState"]; + [us synchronize]; + } + } + else if (moduleSettings) + { + NSArray *sortState = [moduleSettings objectForKey: @"SortingState"]; + sort = [[sortState objectAtIndex: 0] uppercaseString]; + asc = [[sortState objectAtIndex: 1] boolValue]; + } + else + sort = [self defaultSortKey]; + // Construct and return the final IMAP ordering constraint if (!asc) sort = [@"REVERSE " stringByAppendingString: sort]; diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index 16a27c58f..a1867c3cd 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -735,9 +735,9 @@ function openMailbox(mailbox, reload) { var sortImage = createElement("img", "messageSortImage", "sortImage"); sortHeader.insertBefore(sortImage, sortHeader.firstChild); if (sorting["ascending"]) - sortImage.src = ResourcesURL + "/arrow-down.png"; - else sortImage.src = ResourcesURL + "/arrow-up.png"; + else + sortImage.src = ResourcesURL + "/arrow-down.png"; } }