diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/session-menu-mgr.c | 19 | ||||
-rw-r--r-- | src/session-service.c | 1 | ||||
-rw-r--r-- | src/webcredentials-mgr.c | 2 |
3 files changed, 20 insertions, 2 deletions
diff --git a/src/session-menu-mgr.c b/src/session-menu-mgr.c index 96fc2a0..1a66a44 100644 --- a/src/session-menu-mgr.c +++ b/src/session-menu-mgr.c @@ -33,6 +33,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "session-menu-mgr.h" #include "shared-names.h" #include "users-service-dbus.h" +#include "webcredentials-mgr.h" #define DEBUG_SHOW_ALL FALSE @@ -88,6 +89,8 @@ struct _SessionMenuMgr DbusmenuMenuitem * lock_mi; DbusmenuMenuitem * lock_switch_mi; DbusmenuMenuitem * guest_mi; + DbusmenuMenuitem * online_accounts_mi; + DbusmenuMenuitem * online_accounts_separator; DbusmenuMenuitem * logout_mi; DbusmenuMenuitem * suspend_mi; DbusmenuMenuitem * hibernate_mi; @@ -113,6 +116,7 @@ struct _SessionMenuMgr DBusUPower * upower_proxy; SessionDbus * session_dbus; UsersServiceDbus * users_dbus_facade; + WebcredentialsMgr * webcredentials_mgr; }; static SwitcherMode get_switcher_mode (SessionMenuMgr *); @@ -192,6 +196,9 @@ session_menu_mgr_init (SessionMenuMgr *mgr) G_CALLBACK(on_guest_logged_in_changed), mgr); init_upower_proxy (mgr); + + /* Online accounts menu item */ + mgr->webcredentials_mgr = webcredentials_mgr_new (); } static void @@ -212,6 +219,7 @@ session_menu_mgr_dispose (GObject *object) g_clear_object (&mgr->users_dbus_facade); g_clear_object (&mgr->top_mi); g_clear_object (&mgr->session_dbus); + g_clear_object (&mgr->webcredentials_mgr); g_slist_free (mgr->user_menuitems); mgr->user_menuitems = NULL; @@ -412,6 +420,10 @@ update_session_menuitems (SessionMenuMgr * mgr) gboolean v; GSettings * s = mgr->indicator_settings; + v = !mgr->greeter_mode; + mi_set_visible (mgr->online_accounts_mi, v); + mi_set_visible (mgr->online_accounts_separator, v); + v = !mgr->greeter_mode && !is_this_live_session() && !g_settings_get_boolean (mgr->lockdown_settings, "disable-log-out") @@ -463,6 +475,13 @@ build_session_menuitems (SessionMenuMgr* mgr) { DbusmenuMenuitem * mi; + mi = mgr->online_accounts_mi = + webcredentials_mgr_get_menu_item (mgr->webcredentials_mgr); + dbusmenu_menuitem_child_append (mgr->top_mi, mi); + + mi = mgr->online_accounts_separator = mi_new_separator (); + dbusmenu_menuitem_child_append (mgr->top_mi, mi); + mi = mgr->logout_mi = mi_new (_("Log Out\342\200\246")); dbusmenu_menuitem_child_append (mgr->top_mi, mi); g_signal_connect_swapped (mi, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, diff --git a/src/session-service.c b/src/session-service.c index 6d5a7f3..91bbccd 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -26,7 +26,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "config.h" -#include <locale.h> #include <unistd.h> #include <locale.h> diff --git a/src/webcredentials-mgr.c b/src/webcredentials-mgr.c index 8b44a95..17c3e46 100644 --- a/src/webcredentials-mgr.c +++ b/src/webcredentials-mgr.c @@ -97,7 +97,7 @@ webcredentials_mgr_init (WebcredentialsMgr *self) DBUSMENU_CLIENT_TYPES_DEFAULT); dbusmenu_menuitem_property_set (self->menu_item, DBUSMENU_MENUITEM_PROP_LABEL, - _("Web Accounts…")); + _("Online Accounts\342\200\246")); g_signal_connect (self->menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (on_menu_item_activated), |