Adding turning off the led on initial tab load
authorepage <eopage@byu.net>
Sun, 16 Aug 2009 01:33:38 +0000 (01:33 +0000)
committerepage <eopage@byu.net>
Sun, 16 Aug 2009 01:33:38 +0000 (01:33 +0000)
git-svn-id: file:///svnroot/gc-dialer/trunk@392 c39d3808-3fe2-4d86-a59f-b7f623ee9f21

src/dc_glade.py
src/gc_views.py
src/null_views.py

index 58ce0fa..0d86b80 100755 (executable)
@@ -680,14 +680,18 @@ class Dialcentral(object):
        def _on_notebook_switch_page(self, notebook, page, pageIndex):
                self._reset_tab_refresh()
                if pageIndex == self.RECENT_TAB:
-                       self._recentViews[self._selectedBackendId].update()
+                       didRecentUpdate = self._recentViews[self._selectedBackendId].update()
                elif pageIndex == self.MESSAGES_TAB:
-                       self._messagesViews[self._selectedBackendId].update()
+                       didMessagesUpdate = self._messagesViews[self._selectedBackendId].update()
                elif pageIndex == self.CONTACTS_TAB:
                        self._contactsViews[self._selectedBackendId].update()
                elif pageIndex == self.ACCOUNT_TAB:
                        self._accountViews[self._selectedBackendId].update()
 
+               if didRecentUpdate or didMessagesUpdate:
+                       if self._ledHandler is not None:
+                               self._ledHandler.off()
+
        def _set_tab_refresh(self, *args):
                pageIndex = self._notebook.get_current_page()
                child = self._notebook.get_nth_page(pageIndex)
index 7f5d1f2..94a202e 100644 (file)
@@ -645,9 +645,10 @@ class AccountInfo(object):
 
        def update(self, force = False):
                if not force and self._isPopulated:
-                       return
+                       return False
                self._populate_callback_combo()
                self.set_account_number(self._backend.get_account_number())
+               return True
 
        def clear(self):
                self._callbackCombo.get_child().set_text("")
@@ -840,8 +841,9 @@ class RecentCallsView(object):
 
        def update(self, force = False):
                if not force and self._isPopulated:
-                       return
+                       return False
                self._updateSink.send(())
+               return True
 
        def clear(self):
                self._isPopulated = False
@@ -987,8 +989,9 @@ class MessagesView(object):
 
        def update(self, force = False):
                if not force and self._isPopulated:
-                       return
+                       return False
                self._updateSink.send(())
+               return True
 
        def clear(self):
                self._isPopulated = False
@@ -1153,8 +1156,9 @@ class ContactsView(object):
 
        def update(self, force = False):
                if not force and self._isPopulated:
-                       return
+                       return False
                self._updateSink.send(())
+               return True
 
        def clear(self):
                self._isPopulated = False
index 33413cb..2412688 100644 (file)
@@ -87,7 +87,7 @@ class AccountInfo(object):
 
        @staticmethod
        def update():
-               pass
+               return False
 
        @staticmethod
        def clear():
@@ -119,7 +119,7 @@ class RecentCallsView(object):
                pass
 
        def update(self):
-               pass
+               return False
 
        @staticmethod
        def clear():
@@ -151,7 +151,7 @@ class MessagesView(object):
                pass
 
        def update(self):
-               pass
+               return False
 
        @staticmethod
        def clear():
@@ -183,7 +183,7 @@ class ContactsView(object):
                self._booksSelectionBox.set_sensitive(True)
 
        def update(self):
-               pass
+               return False
 
        @staticmethod
        def clear():