Ticket #106: logout.patch

File logout.patch, 1013 bytes (added by askvictor, 14 years ago)

Patch for /usr/share/sugar/shell/view/home/favoritesview.py to allow logout

  • favoritesview.py

    old new class _MyIcon(MyIcon): 
    425425        palette.menu.append(item)
    426426        item.show()
    427427
     428        item = MenuItem(_('Logout'), 'system-logout') #system logout icon doesn't exist!
     429        item.connect('activate', self._logout_activate_cb)
     430        palette.menu.append(item)
     431        item.show()
     432
    428433        if not self._profile.is_registered():
    429434            self.register_menu = MenuItem(_('Register'), 'media-record')
    430435            palette.menu.append(self.register_menu)
    class _MyIcon(MyIcon): 
    439444    def _shutdown_activate_cb(self, menuitem):
    440445        session_manager = get_session_manager()
    441446        session_manager.shutdown()
     447
     448    def _logout_activate_cb(self, menuitem):
     449        session_manager = get_session_manager()
     450        session_manager.logout()
    442451       
    443452    def get_toplevel(self):
    444453        return hippo.get_canvas_for_item(self).get_toplevel()