Comment 26 for bug 1073397

Revision history for this message
Wayne Do Rego (waynebow) wrote :

I've made a few changes that seem to get some simple notifications going...

Add the following line:

    var lastMessanges = 0;

After:

    var pane = null;

Then add:

    if (lastMessanges < numMessanges) {
    lastMessanges = numMessanges
    if (lastMessanges == 1) {
     Unity.Notification.showNotification("Gmail", "You have " + lastMessanges + " unread message.", null);
     }
    if (lastMessanges > 1) {
     Unity.Notification.showNotification("Gmail", "You have " + lastMessanges + " unread messages.", null);
     }
    }
    lastMessanges = numMessanges

After:

    Unity.Launcher.setCount(Number(numMessanges));

The attached file contains the above changes as well as Fernando and Andrew's changes.

This my first attempt at Java Script so feedback would be most welcome!