Modifies the Voicemail notifications GUI so that it would also display the number of urgent voicemail messages. Patch by Tom Denham

cusax-fix
Emil Ivov 13 years ago
parent d735b29331
commit a626039f66

@ -486,6 +486,8 @@ service.gui.VIEW_HISTORY=View &history
service.gui.VIEW_SMILEYS=View &smileys
service.gui.VIEW_TOOLBAR=View &toolbar
service.gui.VIEW_SIMPLE_CHAT_THEME=Simple chat theme view
service.gui.VOICEMAIL_NEW_URGENT_OLD_RECEIVED={0} new ({1} urgent) and {2} old messages
service.gui.VOICEMAIL_NEW_URGENT_RECEIVED={0} new ({1} urgent) messages
service.gui.VOICEMAIL_NEW_OLD_RECEIVED={0} new and {1} old messages
service.gui.VOICEMAIL_NEW_RECEIVED={0} new messages
service.gui.VOICEMAIL_OLD_RECEIVED={0} old messages

@ -76,6 +76,11 @@ public class NotificationContact
*/
private UIContactDetail notificationDetail;
/**
* The count of unread urgent messages attached to this notification.
*/
private int unreadUrgentMessageCount = 0;
/**
* The count of unread messages attached to this notification.
*/
@ -161,13 +166,30 @@ public String getDisplayDetails()
ResourceManagementService resources = GuiActivator.getResources();
if (unreadMessageCount > 0 && readMessageCount > 0)
if ((unreadUrgentMessageCount > 0) &&
(unreadMessageCount > 0) &&
(readMessageCount > 0))
{
displayDetails = resources.getI18NString(
"service.gui.VOICEMAIL_NEW_URGENT_OLD_RECEIVED",
new String[]{ Integer.toString(unreadMessageCount),
Integer.toString(unreadUrgentMessageCount),
Integer.toString(readMessageCount)});
}
else if ((unreadMessageCount > 0) && (readMessageCount > 0))
{
displayDetails = resources.getI18NString(
"service.gui.VOICEMAIL_NEW_OLD_RECEIVED",
new String[]{ Integer.toString(unreadMessageCount),
Integer.toString(readMessageCount)});
}
else if ((unreadUrgentMessageCount > 0) && (unreadMessageCount > 0))
{
displayDetails = resources.getI18NString(
"service.gui.VOICEMAIL_NEW_URGENT_RECEIVED",
new String[]{ Integer.toString(unreadMessageCount),
Integer.toString(unreadUrgentMessageCount)});
}
else if (unreadMessageCount > 0)
{
displayDetails = resources.getI18NString(
@ -406,6 +428,28 @@ public void setMessageAccount(String messageAccount)
= new MessageWaitingDetail(protocolProvider, messageAccount);
}
/**
* Sets the number of urgent unread messages, this notification is about.
*
* @param count the number of urgent unread messages, this notification is
* about
*/
public void setUnreadUrgentMessageCount(int count)
{
this.unreadUrgentMessageCount = count;
}
/**
* Returns the number of urgent unread messages, this notification is
* about.
*
* @return the number of urgent unread messages, this notification is about
*/
public int getUrgentUnreadMessageCount()
{
return unreadUrgentMessageCount;
}
/**
* Sets the number of unread messages, this notification is about.
*

@ -278,6 +278,8 @@ public void messageWaitingNotify(MessageWaitingEvent event)
}
contact.setMessageAccount(event.getAccount());
contact.setUnreadUrgentMessageCount(
event.getUnreadUrgentMessages());
contact.setUnreadMessageCount(event.getUnreadMessages());
contact.setReadMessageCount(event.getReadMessages());

Loading…
Cancel
Save