~ubuntu-branches/ubuntu/saucy/blam/saucy

« back to all changes in this revision

Viewing changes to src/UnreadNotification.cs

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Martín Nieto
  • Date: 2011-05-31 01:36:47 UTC
  • mto: (1.1.8 upstream) (2.2.5 sid)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: james.westby@ubuntu.com-20110531013647-dt9ij4zj9f9wg6uk
Import upstream version 1.8.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using Mono.Unix;
 
2
using System;
 
3
using Notifications;
 
4
 
 
5
namespace Imendio.Blam
 
6
{
 
7
    public class UnreadNotification
 
8
    {
 
9
 
 
10
        static Notification note = new Notification();
 
11
 
 
12
        public UnreadNotification()
 
13
        {
 
14
            note = new Notification();
 
15
        }
 
16
 
 
17
        public static void NotifyUnreadPosts(int unread, int new_items)
 
18
        {
 
19
            /* Same as for the tray icon tooltip */
 
20
            /* Total number of unread items */
 
21
            string str = string.Format (Catalog.GetPluralString ("{0} unread item", "{0} unread items", unread),
 
22
                                             unread);
 
23
            str += " ";
 
24
            /* Number of new (not-skipped-over) entries. Gets appended to previous string */
 
25
            str += string.Format(Catalog.GetPluralString("({0} new)", "({0} new)", new_items), new_items);
 
26
 
 
27
            note.IconName = "blam";
 
28
            note.Summary = Catalog.GetString("Feeds refreshed");
 
29
            note.Body = str;
 
30
            note.Urgency = Urgency.Normal;
 
31
            note.Show();
 
32
        }
 
33
    }
 
34
}