Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Hermes
Summary Lists News SCM
authorAndrew Flegg <andrew@bleb.org>
Sun, 6 Jun 2010 20:02:25 +0000 (21:02 +0100)
committerAndrew Flegg <andrew@bleb.org>
Sun, 6 Jun 2010 20:02:25 +0000 (21:02 +0100)
out when "Clear" is pressed (also, make "Clear" work!)

package/src/org/maemo/hermes/engine/facebook/provider.py
package/src/org/maemo/hermes/gui/accountsdialogue.py

index 2ecd843..c88ecaa 100644 (file)
@@ -48,11 +48,8 @@ class Provider(org.maemo.hermes.engine.provider.Provider):
     def get_account_detail(self):
         """Return the email address associated with the user, if available."""
         
-#        if self.fb.users.getLoggedInUser() and self.fb.session_key:
-#            info = self.fb.users.getInfo([self.fb.uid], ['name'])
-#            return info['name']
-#        else:
-        return '---'
+        name = self._gc.get_string('/apps/maemo/hermes/facebook_user')
+        return name and name or _('Pending authorisation')
     
     
     # -----------------------------------------------------------------------
@@ -87,9 +84,10 @@ class Provider(org.maemo.hermes.engine.provider.Provider):
             if result == gtk.RESPONSE_CANCEL:
                 return None
             elif result == gtk.RESPONSE_OK:
-                self._gc.set_string('/apps/maemo/hermes/facebook_session_key', '')
-                self._gc.set_string('/apps/maemo/hermes/facebook_secret_key', '')
-                self._gc.set_string('/apps/maemo/hermes/facebook_uid', '')
+                self._gc.unset('/apps/maemo/hermes/facebook_session_key')
+                self._gc.unset('/apps/maemo/hermes/facebook_secret_key')
+                self._gc.unset('/apps/maemo/hermes/facebook_uid')
+                self._gc.unset('/apps/maemo/hermes/facebook_user')
             else:
                 break
     
@@ -139,3 +137,7 @@ class Provider(org.maemo.hermes.engine.provider.Provider):
         self._gc.set_string('/apps/maemo/hermes/facebook_session_key', session['session_key'])
         self._gc.set_string('/apps/maemo/hermes/facebook_secret_key', session['secret'])
         self._gc.set_string('/apps/maemo/hermes/facebook_uid', str(session['uid']))
+
+        info = self.fb.users.getInfo([self.fb.uid], ['name'])
+        self._gc.set_string('/apps/maemo/hermes/facebook_user', info[0]['name'])
+
index 2ee2c25..e154d31 100644 (file)
@@ -99,6 +99,7 @@ class AccountsDialogue:
 
         if enabled is not None:
             self.gconf.set_bool(use_key, enabled)
+            treeview.get_model().set_value(iter, 2, provider.get_account_detail())
             treeview.get_model().set_value(iter, 3, enabled and self.tick_icon or None)
 
 

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment