From a62cd61e0d1e73c9f8308b65f83c79cf86b999ca Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 25 Mar 2008 19:59:13 +0000 Subject: [PATCH] Monotone-Parent: 773965cc12e1e34ce72a11b7b25f3ff6e0dc7887 Monotone-Revision: c0da933d3e86c470a7d83491a010f1ba6edc3fcd Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-03-25T19:59:13 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 20 + NEWS | 3 + UI/Contacts/English.lproj/Localizable.strings | 2 + UI/Contacts/French.lproj/Localizable.strings | 3 +- UI/Contacts/German.lproj/Localizable.strings | 2 + UI/Contacts/UIxContactFoldersView.h | 1 - UI/Contacts/UIxContactFoldersView.m | 18 - UI/Contacts/UIxContactsListViewContainer.h | 6 + UI/Contacts/UIxContactsListViewContainer.m | 51 +++ UI/Contacts/product.plist | 5 - UI/MailerUI/UIxMailMainFrame.h | 5 +- UI/MailerUI/UIxMailMainFrame.m | 48 +- UI/MailerUI/product.plist | 5 - UI/Scheduler/UIxCalMainView.h | 5 +- UI/Scheduler/UIxCalMainView.m | 36 +- UI/Scheduler/product.plist | 5 - .../ContactsUI/UIxContactsListView.wox | 7 +- .../UIxContactsListViewContainer.wox | 19 +- UI/Templates/MailerUI/UIxMailMainFrame.wox | 14 + UI/Templates/SchedulerUI/UIxCalMainView.wox | 14 + UI/WebServerResources/ContactsUI.css | 11 +- UI/WebServerResources/ContactsUI.js | 418 +++++++++--------- UI/WebServerResources/MailerUI.css | 12 +- UI/WebServerResources/MailerUI.js | 28 +- UI/WebServerResources/SOGoDragHandles.js | 34 +- UI/WebServerResources/SchedulerUI.js | 267 +++++------ 26 files changed, 547 insertions(+), 492 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3bbda7cf9..ad734a859 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2008-03-25 Francis Lachapelle + + * UI/Scheduler/UIxCalMainView.m ([UIxCalMainView + -verticalDragHandleStyle]): CSS style wrt to position of drag + handle saved by current user. + ([UIxCalMainView -horizontalDragHandleStyle]): idem. + ([UIxCalMainView -eventsListViewStyle]): idem. + + * UI/Contacts/UIxContactsListViewContainer.m + ([UIxContactsListViewContainer -verticalDragHandleStyle]): CSS + style wrt to position of drag handle saved by current user. + ([UIxContactsListViewContainer -horizontalDragHandleStyle]): idem. + ([UIxContactsListViewContainer -contactsListContentStyle]): idem. + + * UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame + -verticalDragHandleStyle]): CSS style wrt to position of drag + handle saved by current user. + ([UIxMailMainFrame -horizontalDragHandleStyle]): idem. + ([UIxMailMainFrame -mailboxContentStyle]): idem. + 2008-03-18 Wolfgang Sourdeau * SoObjects/Appointments/SOGoAppointmentFolder.m diff --git a/NEWS b/NEWS index a8c5f6478..509dbe8b3 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ - pressing enter in the contact edition dialog will perform the creation/update operation - implemented more of the CalDAV specification for compatibility with Lightning 0.8 - added Italian translation, thanks to Marco Lertora +- improved restoration of drag hanldes state +- improved contextual menu handling of Address Book module +- fixed various bugs with Safari 3.1 0.9.0-20080208 (1.0 rc5) ------------------------ diff --git a/UI/Contacts/English.lproj/Localizable.strings b/UI/Contacts/English.lproj/Localizable.strings index 6762a87f0..0b2871c35 100644 --- a/UI/Contacts/English.lproj/Localizable.strings +++ b/UI/Contacts/English.lproj/Localizable.strings @@ -108,6 +108,8 @@ "Name of the Address Book" = "Name of the Address Book"; "Are you sure you want to delete the selected address book?" = "Are you sure you want to delete the selected address book?"; +"You cannot delete the selected contact(s)" += "You cannot delete the selected contact(s)."; "Address Book Name" = "Address Book Name"; diff --git a/UI/Contacts/French.lproj/Localizable.strings b/UI/Contacts/French.lproj/Localizable.strings index 9111b54ec..82f612d25 100644 --- a/UI/Contacts/French.lproj/Localizable.strings +++ b/UI/Contacts/French.lproj/Localizable.strings @@ -121,7 +121,8 @@ "Name of the Address Book" = "Nom du carnet d'adresses"; "Are you sure you want to delete the selected address book?" = "Voulez-vous vraiment supprimer le carnet d'adresses sélectionné ?"; - +"You cannot delete the selected contact(s)" += "Vous ne pouvez pas supprimer les contacts sélectionnés."; "Address Book Name" = "Nom du carnet d'adresses"; "You cannot subscribe to a folder that you own!" diff --git a/UI/Contacts/German.lproj/Localizable.strings b/UI/Contacts/German.lproj/Localizable.strings index 15debcc0d..d366fe5bf 100644 --- a/UI/Contacts/German.lproj/Localizable.strings +++ b/UI/Contacts/German.lproj/Localizable.strings @@ -112,6 +112,8 @@ "Name of the Address Book" = "Adressbuch-Name"; "Are you sure you want to delete the selected address book?" = "Wollen Sie wirklich das ausgewählte Adressbuch löschen?"; +"You cannot delete the selected contact(s)" += "Ausgewählte Karten können nicht gelöscht werden."; "Address Book Name" = "Adressbuch Name"; diff --git a/UI/Contacts/UIxContactFoldersView.h b/UI/Contacts/UIxContactFoldersView.h index 51f58b9d6..507b522d9 100644 --- a/UI/Contacts/UIxContactFoldersView.h +++ b/UI/Contacts/UIxContactFoldersView.h @@ -31,7 +31,6 @@ NSMutableDictionary *moduleSettings; } -- (WOResponse *) getDragHandlesStateAction; - (WOResponse *) saveDragHandleStateAction; @end diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index 964d3506b..97d143f36 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -269,24 +269,6 @@ // ? contactFolder : nil); // } -- (WOResponse *) getDragHandlesStateAction -{ - NSArray *dragHandles; - NSString *vertical, *horizontal; - - [self _setupContext]; - - vertical = [moduleSettings objectForKey: @"DragHandleVertical"]; - horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"]; - dragHandles = [[NSArray alloc] initWithObjects: - vertical ? vertical : @"", - horizontal ? horizontal : @"", - nil]; - - return [self responseWithStatus: 200 - andString: [dragHandles jsonRepresentation]]; -} - - (WOResponse *) saveDragHandleStateAction { WORequest *request; diff --git a/UI/Contacts/UIxContactsListViewContainer.h b/UI/Contacts/UIxContactsListViewContainer.h index eb0d72d87..c8488527c 100644 --- a/UI/Contacts/UIxContactsListViewContainer.h +++ b/UI/Contacts/UIxContactsListViewContainer.h @@ -33,6 +33,8 @@ { NSString *selectorComponentClass; id currentFolder; + NSUserDefaults *ud; + NSMutableDictionary *moduleSettings; } - (void) setCurrentFolder: (id) folder; @@ -43,6 +45,10 @@ - (NSString *) currentContactFolderOwner; - (NSString *) currentContactFolderName; +- (NSString *) verticalDragHandleStyle; +- (NSString *) horizontalDragHandleStyle; +- (NSString *) contactsListContentStyle; + @end #endif /* UIXCONTACTSLISTVIEWCONTAINERBASE_H */ diff --git a/UI/Contacts/UIxContactsListViewContainer.m b/UI/Contacts/UIxContactsListViewContainer.m index 23c2a5eb5..724ff867b 100644 --- a/UI/Contacts/UIxContactsListViewContainer.m +++ b/UI/Contacts/UIxContactsListViewContainer.m @@ -37,6 +37,27 @@ @implementation UIxContactsListViewContainer +- (void) _setupContext +{ + SOGoUser *activeUser; + NSString *module; + SOGoContactFolders *clientObject; + + activeUser = [context activeUser]; + clientObject = [[self clientObject] container]; + + module = [clientObject nameInContainer]; + + ud = [activeUser userSettings]; + moduleSettings = [ud objectForKey: module]; + if (!moduleSettings) + { + moduleSettings = [NSMutableDictionary new]; + [moduleSettings autorelease]; + } + [ud setObject: moduleSettings forKey: module]; +} + - (id) init { if ((self = [super init])) @@ -120,4 +141,34 @@ return [[self queryParameterForKey: @"popup"] boolValue]; } +- (NSString *) verticalDragHandleStyle +{ + NSString *vertical; + + [self _setupContext]; + vertical = [moduleSettings objectForKey: @"DragHandleVertical"]; + + return (vertical ? [vertical stringByAppendingFormat: @"px"] : nil); +} + +- (NSString *) horizontalDragHandleStyle +{ + NSString *horizontal; + + [self _setupContext]; + horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"]; + + return (horizontal ? [horizontal stringByAppendingFormat: @"px"] : nil); +} + +- (NSString *) contactsListContentStyle +{ + int height; + + [self _setupContext]; + height = [[moduleSettings objectForKey: @"DragHandleVertical"] intValue]; + + return (height ? [NSString stringWithFormat: @"%ipx", (height - 27)] : nil); +} + @end diff --git a/UI/Contacts/product.plist b/UI/Contacts/product.plist index 5b19b2f6e..8c06e706e 100644 --- a/UI/Contacts/product.plist +++ b/UI/Contacts/product.plist @@ -50,11 +50,6 @@ protectedBy = "View"; pageName = "UIxContactsUserFolders"; }; - dragHandlesState = { - protectedBy = ""; - pageName = "UIxContactFoldersView"; - actionName = "getDragHandlesState"; - }; saveDragHandleState = { protectedBy = "View"; pageName = "UIxContactFoldersView"; diff --git a/UI/MailerUI/UIxMailMainFrame.h b/UI/MailerUI/UIxMailMainFrame.h index a4f3dcc6b..922350fb1 100644 --- a/UI/MailerUI/UIxMailMainFrame.h +++ b/UI/MailerUI/UIxMailMainFrame.h @@ -31,9 +31,12 @@ NSMutableDictionary *moduleSettings; } -- (WOResponse *) getDragHandlesStateAction; - (WOResponse *) getFoldersStateAction; +- (NSString *) verticalDragHandleStyle; +- (NSString *) horizontalDragHandleStyle; +- (NSString *) mailboxContentStyle; + - (WOResponse *) saveDragHandleStateAction; - (WOResponse *) saveFoldersStateAction; diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index 40126f46d..dfd45ea48 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -163,24 +163,6 @@ return [self redirectToLocation: newLocation]; } -- (WOResponse *) getDragHandlesStateAction -{ - NSArray *dragHandles; - NSString *vertical, *horizontal; - - [self _setupContext]; - - vertical = [moduleSettings objectForKey: @"DragHandleVertical"]; - horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"]; - dragHandles = [[NSArray alloc] initWithObjects: - vertical ? vertical : @"", - horizontal ? horizontal : @"", - nil]; - - return [self responseWithStatus: 200 - andString: [dragHandles jsonRepresentation]]; -} - - (WOResponse *) getFoldersStateAction { NSString *expandedFolders; @@ -191,6 +173,36 @@ return [self responseWithStatus: 200 andString: expandedFolders]; } +- (NSString *) verticalDragHandleStyle +{ + NSString *vertical; + + [self _setupContext]; + vertical = [moduleSettings objectForKey: @"DragHandleVertical"]; + + return (vertical ? [vertical stringByAppendingFormat: @"px"] : nil); +} + +- (NSString *) horizontalDragHandleStyle +{ + NSString *horizontal; + + [self _setupContext]; + horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"]; + + return (horizontal ? [horizontal stringByAppendingFormat: @"px"] : nil); +} + +- (NSString *) mailboxContentStyle +{ + NSString *height; + + [self _setupContext]; + height = [moduleSettings objectForKey: @"DragHandleVertical"]; + + return (height ? [NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil); +} + - (WOResponse *) saveDragHandleStateAction { WORequest *request; diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index 4b10ad44d..733563beb 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -330,11 +330,6 @@ pageName = "UIxMailMainFrame"; actionName = "compose"; }; - dragHandlesState = { - protectedBy = "View"; - pageName = "UIxMailMainFrame"; - actionName = "getDragHandlesState"; - }; foldersState = { protectedBy = "View"; pageName = "UIxMailMainFrame"; diff --git a/UI/Scheduler/UIxCalMainView.h b/UI/Scheduler/UIxCalMainView.h index 3ebb2fe04..9cfe28b22 100644 --- a/UI/Scheduler/UIxCalMainView.h +++ b/UI/Scheduler/UIxCalMainView.h @@ -47,7 +47,10 @@ - (void) setYearMenuItem: (NSNumber *) aYearMenuItem; - (NSNumber *) yearMenuItem; -- (WOResponse *) getDragHandlesStateAction; +- (NSString *) verticalDragHandleStyle; +- (NSString *) horizontalDragHandleStyle; +- (NSString *) eventsListViewStyle; + - (WOResponse *) saveDragHandleStateAction; @end diff --git a/UI/Scheduler/UIxCalMainView.m b/UI/Scheduler/UIxCalMainView.m index 0739df961..d0939c643 100644 --- a/UI/Scheduler/UIxCalMainView.m +++ b/UI/Scheduler/UIxCalMainView.m @@ -124,22 +124,34 @@ static NSMutableArray *yearMenuItems = nil; return yearMenuItem; } -- (WOResponse *) getDragHandlesStateAction +- (NSString *) verticalDragHandleStyle { - NSArray *dragHandles; - NSString *vertical, *horizontal; + NSString *vertical; - [self _setupContext]; + [self _setupContext]; + vertical = [moduleSettings objectForKey: @"DragHandleVertical"]; + + return (vertical ? [vertical stringByAppendingFormat: @"px"] : nil); +} - vertical = [moduleSettings objectForKey: @"DragHandleVertical"]; - horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"]; - dragHandles = [[NSArray alloc] initWithObjects: - vertical != nil ? vertical : @"", - horizontal ? horizontal : @"", - nil]; +- (NSString *) horizontalDragHandleStyle +{ + NSString *horizontal; - return [self responseWithStatus: 200 - andString: [dragHandles jsonRepresentation]]; + [self _setupContext]; + horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"]; + + return (horizontal ? [horizontal stringByAppendingFormat: @"px"] : nil); +} + +- (NSString *) eventsListViewStyle +{ + NSString *height; + + [self _setupContext]; + height = [moduleSettings objectForKey: @"DragHandleVertical"]; + + return (height ? [NSString stringWithFormat: @"%ipx", ([height intValue] - 27)] : nil); } - (WOResponse *) saveDragHandleStateAction diff --git a/UI/Scheduler/product.plist b/UI/Scheduler/product.plist index 18a20e1aa..85db92f00 100644 --- a/UI/Scheduler/product.plist +++ b/UI/Scheduler/product.plist @@ -40,11 +40,6 @@ protectedBy = "View"; pageName = "UIxCalMainView"; }; - dragHandlesState = { - protectedBy = ""; - pageName = "UIxCalMainView"; - actionName = "getDragHandlesState"; - }; saveDragHandleState = { protectedBy = "View"; pageName = "UIxCalMainView"; diff --git a/UI/Templates/ContactsUI/UIxContactsListView.wox b/UI/Templates/ContactsUI/UIxContactsListView.wox index 0593bb3fb..e7ec45ebd 100644 --- a/UI/Templates/ContactsUI/UIxContactsListView.wox +++ b/UI/Templates/ContactsUI/UIxContactsListView.wox @@ -31,12 +31,7 @@ + var:contactid="currentContact.c_uid"> diff --git a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox index 31ccfc8c2..1520379e1 100644 --- a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox +++ b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox @@ -11,6 +11,22 @@ title="name" var:popup="isPopup"> + + + diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index cd847feba..a7f52e3e9 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -12,6 +12,20 @@ var textMailAccounts = ''; var textQuotaSupport = ''; +