From 52bcec0fead12196f0f5b319b753657a9afe5742 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 17 Sep 2008 19:44:11 +0000 Subject: [PATCH] Monotone-Parent: 18351673f3b02540c95a8695b70dd0067da408d5 Monotone-Revision: 36de46e421cb49879d5821734892284e4035c708 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-09-17T19:44:11 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++ UI/MailerUI/Dutch.lproj/Localizable.strings | 3 +- UI/MailerUI/English.lproj/Localizable.strings | 3 +- UI/MailerUI/French.lproj/Localizable.strings | 3 +- UI/MailerUI/German.lproj/Localizable.strings | 3 +- UI/MailerUI/Italian.lproj/Localizable.strings | 3 +- UI/MailerUI/Spanish.lproj/Localizable.strings | 3 +- UI/MailerUI/UIxMailAccountActions.m | 17 ++- UI/Templates/MailerUI/UIxMailMainFrame.wox | 8 +- UI/WebServerResources/MailerUI.css | 54 ++++++++++ UI/WebServerResources/MailerUI.js | 101 ++++++++---------- 11 files changed, 140 insertions(+), 64 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b9f39cc1..fecf7e16a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-17 Francis Lachapelle + + * UI/MailerUI/UIxMailAccountActions.m ([WOResponse + -listMailboxesAction]): also returns the inbox quota, wrapped in a + new dictionary with keys "mailboxes" and "quotas". + 2008-09-17 Wolfgang Sourdeau * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject diff --git a/UI/MailerUI/Dutch.lproj/Localizable.strings b/UI/MailerUI/Dutch.lproj/Localizable.strings index 878679130..07ebd6572 100644 --- a/UI/MailerUI/Dutch.lproj/Localizable.strings +++ b/UI/MailerUI/Dutch.lproj/Localizable.strings @@ -199,7 +199,8 @@ = "Weet u zeker dat u deze map wilt verplaatsen naar de prullenbak"; "Operation failed" = "Operatie mislukt."; -"quotasFormat" = "Quota: %{0} van %{1} KB gebruikt; %{2}%"; +"Quota" = "Quota"; +"quotasFormat" = "%{0} van %{1} KB gebruikt (%{2}%)"; "Please select a message." = "Selecteer een bericht."; "Please select a message to print." = "Selecteer een bericht om af te drukken."; diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index 0d484d02c..c6f0b46a2 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -215,7 +215,8 @@ = "Do you really want to move this folder into the trash ?"; "Operation failed" = "Operation failed"; -"quotasFormat" = "Quotas: %{0} used on %{1} Kb; %{2}%"; +"Quota" = "Quota"; +"quotasFormat" = "%{0} used on %{1} Kb (%{2}%)"; "Please select a message." = "Please select a message."; "Please select a message to print." = "Please select a message to print."; diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index 75117f549..abea0aa1c 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -216,7 +216,8 @@ = "Voulez-vous vraiment déplacer le dossier sélectionné dans la corbeille?"; "Operation failed" = "L'opération a échoué."; -"quotasFormat" = "Quotas: %{0} Ko utilisés sur %{1}; %{2}%"; +"Quota" = "Quota"; +"quotasFormat" = "%{0} Ko utilisés sur %{1} (%{2}%)"; "Please select a message." = "Veuillez sélectionner un message."; "Please select a message to print." = "Veuillez sélectionner un message à imprimer."; diff --git a/UI/MailerUI/German.lproj/Localizable.strings b/UI/MailerUI/German.lproj/Localizable.strings index 8b92a793f..31591f448 100644 --- a/UI/MailerUI/German.lproj/Localizable.strings +++ b/UI/MailerUI/German.lproj/Localizable.strings @@ -198,7 +198,8 @@ = "Wollen Sie diesen Ordner wirklich in den Papierkorb verschieben?"; "Operation failed" = "L'opération a échoué."; -"quotasFormat" = "Quota: %{0} von %{1} KB verwendet; %{2}%"; +"Quota" = "Quota"; +"quotasFormat" = "%{0} von %{1} KB verwendet (%{2}%)"; "Please select a message." = "Sie müssen eine Nachricht auswählen."; "Please select a message to print." = "Sie müssen eine Nachricht zum Drucken auswählen."; diff --git a/UI/MailerUI/Italian.lproj/Localizable.strings b/UI/MailerUI/Italian.lproj/Localizable.strings index ecf0164fb..51862543c 100644 --- a/UI/MailerUI/Italian.lproj/Localizable.strings +++ b/UI/MailerUI/Italian.lproj/Localizable.strings @@ -222,7 +222,8 @@ = "Sei sicuro di voler spostare la cartella nel cestino ?"; "Operation failed" = "Operazione non riuscita"; -"quotasFormat" = "Spazio usato: %{0} su %{1} Kb; %{2}%"; +"Quota" = "Spazio usato"; +"quotasFormat" = "%{0} su %{1} Kb (%{2}%)"; "Please select a message." = "Per favore seleziona un messaggio."; "Please select a message to print." = "Per favore seleziona un messaggio da stampare."; diff --git a/UI/MailerUI/Spanish.lproj/Localizable.strings b/UI/MailerUI/Spanish.lproj/Localizable.strings index f0eb1407e..6a42a0002 100644 --- a/UI/MailerUI/Spanish.lproj/Localizable.strings +++ b/UI/MailerUI/Spanish.lproj/Localizable.strings @@ -218,7 +218,8 @@ = "¿Seguro que desea mover la carpeta a la papelera?"; "Operation failed" = "Operación fallida"; -"quotasFormat" = "Quotas: %{0} de %{1} Kb usados ; %{2}%"; +"Quota" = "Quotas"; +"quotasFormat" = "%{0} de %{1} Kb usados (%{2}%)"; "Please select a message." = "Seleccione un mensaje primero."; "Please select a message to print." = "Seleccione el mensaje que desea imprimir."; diff --git a/UI/MailerUI/UIxMailAccountActions.m b/UI/MailerUI/UIxMailAccountActions.m index f53bff49e..1752390fc 100644 --- a/UI/MailerUI/UIxMailAccountActions.m +++ b/UI/MailerUI/UIxMailAccountActions.m @@ -28,6 +28,7 @@ #import #import #import +#import #import #import @@ -121,9 +122,14 @@ - (WOResponse *) listMailboxesAction { + id infos; SOGoMailAccount *co; + SOGoMailFolder *inbox; + NGImap4Client *client; NSEnumerator *rawFolders; NSArray *folders; + NSDictionary *data; + NSString *inboxName; WOResponse *response; co = [self clientObject]; @@ -131,10 +137,19 @@ rawFolders = [[co allFolderPaths] objectEnumerator]; folders = [self _jsonFolders: rawFolders]; + // Retrieve INBOX quota + inbox = [co inboxFolderInContext: context]; + inboxName = [NSString stringWithFormat: @"/%@", [inbox relativeImap4Name]]; + client = [[inbox imap4Connection] client]; + infos = [client getQuotaRoot: [inbox relativeImap4Name]]; + + data = [NSDictionary dictionaryWithObjectsAndKeys: folders, @"mailboxes", + [[infos objectForKey: @"quotas"] objectForKey: inboxName], @"quotas", + nil]; response = [self responseWithStatus: 200]; [response setHeader: @"text/plain; charset=utf-8" forKey: @"content-type"]; - [response appendContentString: [folders jsonRepresentation]]; + [response appendContentString: [data jsonRepresentation]]; return response; } diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index a7f52e3e9..96dc58464 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -10,7 +10,6 @@ const:jsFiles="dtree.js,MailerUI+dTree.js">