bigboard r7307 - in trunk/bigboard/stocks: google_calendar mail



Author: marinaz
Date: Mon Apr 21 21:25:11 2008
New Revision: 7307
URL: http://svn.gnome.org/viewvc/bigboard?rev=7307&view=rev

Log:
Make sure we display "Login to Google" buttons if we don't have any Google-enabled accounts. This change fixes the situation when GConf contains some Google-enabled emails when the bigboard loads, but these e-mails are no longer returned by the server.


Modified:
   trunk/bigboard/stocks/google_calendar/CalendarStock.py
   trunk/bigboard/stocks/mail/MailStock.py

Modified: trunk/bigboard/stocks/google_calendar/CalendarStock.py
==============================================================================
--- trunk/bigboard/stocks/google_calendar/CalendarStock.py	(original)
+++ trunk/bigboard/stocks/google_calendar/CalendarStock.py	Mon Apr 21 21:25:11 2008
@@ -765,7 +765,7 @@
             self.__have_response_for_last_fetch = None
             _logger.debug("Adding login button")
             self.__box.remove_all() 
-            if self._login_button.get_property("text") == google_stock.CHECKING_LOGIN_STRING:
+            if self._login_button.get_property("text") == google_stock.CHECKING_LOGIN_STRING and len(self.googles) > 0:
                 error = hippo.CanvasText(text=google_stock.FAILED_TO_LOGIN_STRING, size_mode=hippo.CANVAS_SIZE_WRAP_WORD)
                 self.__box.append(error) 
             self._login_button.set_property("text", google_stock.LOGIN_TO_GOOGLE_STRING) 

Modified: trunk/bigboard/stocks/mail/MailStock.py
==============================================================================
--- trunk/bigboard/stocks/mail/MailStock.py	(original)
+++ trunk/bigboard/stocks/mail/MailStock.py	Mon Apr 21 21:25:11 2008
@@ -189,7 +189,9 @@
         self.__update_email_box(username, password)
    
     def remove_google_data(self, gobj):
-        if self.__current_gobj == gobj: 
+        # sometimes we don't even get the self.__current_gobj because the polling task didn't start, so 
+        # if all self.googles are removed, we should make sure to have the "Login to Google" button showing 
+        if self.__current_gobj == gobj or len(self.googles) == 0: 
             self._box.remove_all()
             self._login_button.set_property('text', google_stock.LOGIN_TO_GOOGLE_STRING) 
             self._box.append(self._login_button)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]