From 75a431eb53ed684e0d97d71618ac1ed303f35dfd Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 7 Nov 2011 12:32:22 +0000 Subject: [PATCH] * Fix case in Notification window group to match the new message notification * Try harder to report useful progress when both sending and receiving messages. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43209 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/mail/Notifier.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/servers/mail/Notifier.cpp b/src/servers/mail/Notifier.cpp index b6ce8dd30c..1de6aba0e9 100644 --- a/src/servers/mail/Notifier.cpp +++ b/src/servers/mail/Notifier.cpp @@ -42,7 +42,7 @@ DefaultNotifier::DefaultNotifier(const char* accountName, bool inbound, // Two windows for each acocunt : one for sending and the other for // receiving mails fNotification.SetMessageID(identifier); - fNotification.SetGroup(B_TRANSLATE("Mail Status")); + fNotification.SetGroup(B_TRANSLATE("Mail status")); fNotification.SetTitle(desc); app_info info; @@ -104,9 +104,15 @@ DefaultNotifier::ReportProgress(int bytes, int messages, const char* message) fSizeDone += bytes; if (fTotalSize > 0) fNotification.SetProgress(fSizeDone / (float)fTotalSize); - else { - // Likely we should set it as an INFORMATION_NOTIFICATION in that case, - // but this can't be done after object creation... + else if (fTotalItems > 0) { + // No size information available + // Report progress in terms of message count instead + + fNotification.SetProgress(fItemsDone / (float)fTotalITems); + } else { + // No message count information either + // TODO we should use a B_INFORMATION_NOTIFICATION here, but it is not + // possible to change the BNotification type after creating it... fNotification.SetProgress(0); }