<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -115,11 +115,25 @@ class ApplicationController &lt; OSX::NSObject
   
   #todo
   def updateMenuBarCount(notification = nil)
-    if GNPreferences.sharedInstance.showUnreadCount? &amp;&amp; @mail_count &amp;&amp; @mail_count &gt; 0
-      @status_item.setTitle(@mail_count)
+    msgCount = messageCount
+    if GNPreferences.sharedInstance.showUnreadCount? &amp;&amp; msgCount &gt; 0
+      @status_item.setTitle(msgCount)
     else
       @status_item.setTitle('')
     end
+    
+    if msgCount &gt; 0
+      @status_item.setToolTip(
+        msgCount == 1 ? NSLocalizedString(&quot;Unread Message&quot;) % msgCount :
+          NSLocalizedString(&quot;Unread Messages&quot;) % msgCount
+      )
+      @status_item.setImage(@mail_icon)
+      @status_item.setAlternateImage(@mail_alter_icon)
+    else
+      @status_item.setToolTip(&quot;&quot;)
+      @status_item.setImage(@app_icon)
+      @status_item.setAlternateImage(@app_alter_icon)
+    end
   end
   
   def accountAdded(notification)
@@ -142,6 +156,14 @@ class ApplicationController &lt; OSX::NSObject
     checker = checkerForGuid(notification.userInfo[:guid])
     checker.cleanupAndQuit
     @checkers.delete(checker)
+    updateMenuBarCount
+  end
+  
+  def accountChecking(notification)
+    #account = accountForGuid(notification.userInfo[:guid])
+    @status_item.setToolTip(NSLocalizedString(&quot;Checking Mail&quot;))
+    @status_item.setImage(@check_icon)
+    @status_item.setAlternateImage(@check_alter_icon)
   end
   
   def	updateAccountMenuItem(notification)
@@ -153,11 +175,13 @@ class ApplicationController &lt; OSX::NSObject
     end
     
     if account.enabled?
+      #todo messages
       
       msgItem = menuItem.submenu.addItemWithTitle_action_keyEquivalent_(&quot;Last checked: #{notification.userInfo[:checkedAt]}&quot;, nil, &quot;&quot;)
       msgItem.enabled = false
     end
   
+    updateMenuBarCount
     return
     #todo
 		#new messages
@@ -249,6 +273,13 @@ class ApplicationController &lt; OSX::NSObject
       GNAccountMenuUpdateNotification,
       nil
     )
+    
+    center.addObserver_selector_name_object(
+      self,
+      &quot;accountChecking&quot;,
+      GNCheckingAccountNotification,
+      nil
+    )
   end
   
   def registerGrowl
@@ -285,7 +316,7 @@ class ApplicationController &lt; OSX::NSObject
   end
   
   def messageCount
-    @checkers.sum { |c| c.messageCount }
+    @checkers.inject(0) { |n, c| n + c.messageCount }
   end
   
   def setupMenu</diff>
      <filename>ApplicationController.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,7 @@ GNAccountAddedNotification = &quot;GNAccountAddedNotification&quot;
 GNAccountRemovedNotification = &quot;GNAccountRemovedNotification&quot;
 GNAccountChangedNotification = &quot;GNAccountChangedNotification&quot;
 GNAccountMenuUpdateNotification = &quot;GNAccountMenuUpdateNotification&quot;
+GNCheckingAccountNotification = &quot;GNCheckingAccountNotification&quot;
 
 
 PrefsToolbarItemAccounts = &quot;prefsToolbarItemAccounts&quot;</diff>
      <filename>Constants.rb</filename>
    </modified>
    <modified>
      <diff>@@ -61,9 +61,13 @@ class GNChecker &lt; OSX::NSObject
       fn = @pipe.fileHandleForReading
       nc.addObserver_selector_name_object(self, 'checkResult', NSFileHandleReadToEndOfFileCompletionNotification, fn)
       
+      NSNotificationCenter.defaultCenter.postNotificationName_object_userInfo(GNCheckingAccountNotification, self, :guid =&gt; @account.guid)
+
       @checker.launch
       
       fn.readToEndOfFileInBackgroundAndNotify
+    else
+      notifyMenuUpdate
     end
   end
   
@@ -83,11 +87,11 @@ class GNChecker &lt; OSX::NSObject
 			)
 		)
     #todo, cache result, send notification
-    notify(@account.username, &quot;todo&quot;)
     should_notify = true
+    notifyMenuUpdate
     
-    if should_notify
-      NSNotificationCenter.defaultCenter.postNotificationName_object_userInfo(GNAccountMenuUpdateNotification, self, :guid =&gt; @account.guid, :checkedAt =&gt; checkedAt)
+    if should_notify &amp;&amp; @account.growl
+      notify(@account.username, &quot;todo&quot;)
     end
 		if should_notify &amp;&amp; @account.sound != GNSound::SOUND_NONE &amp;&amp; sound = NSSound.soundNamed(@account.sound)
 			sound.play
@@ -98,6 +102,10 @@ class GNChecker &lt; OSX::NSObject
     @checkedAt ? @checkedAt.strftime(&quot;%I:%M%p&quot;) : &quot;NA&quot;
   end
   
+  def notifyMenuUpdate
+    NSNotificationCenter.defaultCenter.postNotificationName_object_userInfo(GNAccountMenuUpdateNotification, self, :guid =&gt; @account.guid, :checkedAt =&gt; checkedAt)
+  end
+  
   def notify(title, desc)
 		Growl::Notifier.sharedInstance.notify('new_messages', title, desc, :click_context =&gt; title)
 	end</diff>
      <filename>GNChecker.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>414ab3e538a849c546a44a51bbebb5ae068c5f59</id>
    </parent>
  </parents>
  <author>
    <name>James Chen</name>
    <email>ashchan@gmail.com</email>
  </author>
  <url>http://github.com/ashchan/gmail-notifr/commit/26f836120175d6ff5ac2381233766ed2edc3943f</url>
  <id>26f836120175d6ff5ac2381233766ed2edc3943f</id>
  <committed-date>2009-08-27T08:17:11-07:00</committed-date>
  <authored-date>2009-08-27T08:17:11-07:00</authored-date>
  <message>menu bar icons status</message>
  <tree>ba3a75d6d30ec8c8086b77a52d88a1b0824378bb</tree>
  <committer>
    <name>James Chen</name>
    <email>ashchan@gmail.com</email>
  </committer>
</commit>
