From c85225384b4bce4cb38be6b4b8a4fb24777e6ddf Mon Sep 17 00:00:00 2001 From: mguessan Date: Thu, 23 Jun 2011 08:49:14 +0000 Subject: [PATCH] Improve message download progress logging, switch icon every 100KB git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1714 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/dav/DavExchangeSession.java | 4 ++-- src/java/davmail/exchange/ews/EWSMethod.java | 5 +++-- src/java/davmailmessages.properties | 4 +++- src/java/davmailmessages_fr.properties | 2 ++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/java/davmail/exchange/dav/DavExchangeSession.java b/src/java/davmail/exchange/dav/DavExchangeSession.java index d902012e..8e14eaf7 100644 --- a/src/java/davmail/exchange/dav/DavExchangeSession.java +++ b/src/java/davmail/exchange/dav/DavExchangeSession.java @@ -2579,8 +2579,8 @@ public class DavExchangeSession extends ExchangeSession { public int read(byte[] buffer, int offset, int length) throws IOException { int count = super.read(buffer, offset, length); totalCount += count; - if (totalCount - lastLogCount > 1024 * 1024) { - LOGGER.debug("Downloaded " + (totalCount / 1024) + " KBytes from " + method.getURI()); + if (totalCount - lastLogCount > 1024 * 128) { + DavGatewayTray.debug(new BundleMessage("LOG_DOWNLOAD_PROGRESS", String.valueOf(totalCount / 1024), method.getURI())); DavGatewayTray.switchIcon(); lastLogCount = totalCount; } diff --git a/src/java/davmail/exchange/ews/EWSMethod.java b/src/java/davmail/exchange/ews/EWSMethod.java index aad27344..a01dad24 100644 --- a/src/java/davmail/exchange/ews/EWSMethod.java +++ b/src/java/davmail/exchange/ews/EWSMethod.java @@ -18,6 +18,7 @@ */ package davmail.exchange.ews; +import davmail.BundleMessage; import davmail.exchange.XMLStreamUtil; import davmail.http.DavGatewayHttpClientFacade; import davmail.ui.tray.DavGatewayTray; @@ -1019,8 +1020,8 @@ public abstract class EWSMethod extends PostMethod { buffer[17] = '1'; } totalCount += count; - if (totalCount - lastLogCount > 1024 * 1024) { - LOGGER.debug("Downloaded " + (totalCount / 1024) + " KBytes"); + if (totalCount - lastLogCount > 1024 * 128) { + DavGatewayTray.debug(new BundleMessage("LOG_DOWNLOAD_PROGRESS", String.valueOf(totalCount / 1024), EWSMethod.this.getURI())); DavGatewayTray.switchIcon(); lastLogCount = totalCount; } diff --git a/src/java/davmailmessages.properties b/src/java/davmailmessages.properties index dd15260b..2cd5d8e5 100644 --- a/src/java/davmailmessages.properties +++ b/src/java/davmailmessages.properties @@ -132,6 +132,7 @@ LOG_UNABLE_TO_STORE_SETTINGS=Unable to store settings: LOG_UNSUPPORTED_REQUEST=Unsupported request: {0} LOG_INVALID_TIMEZONE=Invalid timezone: {0} LOG_ACCESS_FORBIDDEN=Access to {0} forbidden: {1} +LOG_DOWNLOAD_PROGRESS=Downloaded {0} KBytes from {1} UI_ABOUT=About... UI_ABOUT_DAVMAIL=About DavMail Gateway UI_ABOUT_DAVMAIL_AUTHOR=DavMail Gateway
By Mickaël Guessant

@@ -276,4 +277,5 @@ UI_CALDAV_EDIT_NOTIFICATIONS_HELP=Enable interactive Caldav edit notification wi LOG_SEARCH_RESULT=Found {0} item(s) UI_LOG_FILE_SIZE=Log file size: UI_SAVE_IN_SENT=SMTP save in sent: -UI_SAVE_IN_SENT_HELP=Save messages sent over SMTP in server Sent folder \ No newline at end of file +UI_SAVE_IN_SENT_HELP=Save messages sent over SMTP in server Sent folder +UI_CERTIFICATE_ALIAS_PROMPT=Select a certificate \ No newline at end of file diff --git a/src/java/davmailmessages_fr.properties b/src/java/davmailmessages_fr.properties index 11f174ca..9d768948 100644 --- a/src/java/davmailmessages_fr.properties +++ b/src/java/davmailmessages_fr.properties @@ -122,6 +122,7 @@ LOG_UNABLE_TO_SET_LOOK_AND_FEEL=Impossible de d LOG_UNABLE_TO_SET_SYSTEM_LOOK_AND_FEEL=Impossible de définir le style natif sur l''interface LOG_UNABLE_TO_STORE_SETTINGS=Impossible d''enregistrer la configuration LOG_UNSUPPORTED_REQUEST=Requête non supportée : {0} +LOG_DOWNLOAD_PROGRESS={0} KOctets téléchargés de {1} UI_ABOUT=A propos... UI_ABOUT_DAVMAIL=A propos de la Passerelle DavMail UI_ABOUT_DAVMAIL_AUTHOR=Passerelle DavMail
Par Mickaël Guessant

@@ -276,3 +277,4 @@ UI_CALDAV_EDIT_NOTIFICATIONS_HELP=Activer le fen LOG_SEARCH_RESULT={0} élément(s) trouvé(s) UI_SAVE_IN_SENT=SMTP copie dans Envoyés : UI_SAVE_IN_SENT_HELP=Créer une copie des messages envoyés via SMTP dans le dossier serveur "Envoyés" +UI_CERTIFICATE_ALIAS_PROMPT=Choisir un certificat \ No newline at end of file