From cde9919d53e85c76a9d26989ef3f23df640973cd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 4 Jan 2010 10:10:38 -0600 Subject: Trying to clean these two up for getting ready to merge. --- src/session-service.c | 5 ++++ src/users-service.c | 68 --------------------------------------------------- 2 files changed, 5 insertions(+), 68 deletions(-) (limited to 'src') diff --git a/src/session-service.c b/src/session-service.c index a91170f..7acaef5 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -7,6 +7,7 @@ Copyright 2009 Canonical Ltd. Authors: Ted Gould Christoph Korn + Cody Russell This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published @@ -35,12 +36,15 @@ with this program. If not, see . #include "gtk-dialog/gconf-helper.h" +#include "users-service-dbus.h" #include "lock-helper.h" #define DKP_ADDRESS "org.freedesktop.DeviceKit.Power" #define DKP_OBJECT "/org/freedesktop/DeviceKit/Power" #define DKP_INTERFACE "org.freedesktop.DeviceKit.Power" +#define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch" + static DbusmenuMenuitem * root_menuitem = NULL; static GMainLoop * mainloop = NULL; static DBusGProxy * dkp_main_proxy = NULL; @@ -243,6 +247,7 @@ show_dialog (DbusmenuMenuitem * mi, gchar * type) provides in the UI. It also connects them to the callbacks. */ static void create_items (DbusmenuMenuitem * root) { + logout_mi = dbusmenu_menuitem_new(); if (supress_confirmations()) { dbusmenu_menuitem_property_set(logout_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out")); diff --git a/src/users-service.c b/src/users-service.c index 0297f01..32f2fc6 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -1,44 +1,3 @@ -/* - * A small wrapper utility to load indicators and put them as menu items - * into the gnome-panel using it's applet interface. - * - * Copyright 2009 Canonical Ltd. - * - * Authors: - * Ted Gould - * Cody Russell - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3, as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranties of - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - *with this program. If not, see . - */ - -#include - -#include - -#include - -#include -#include - -#include -#include - -#include "dbus-shared-names.h" -#include "users-service-dbus.h" -#include "lock-helper.h" - -#define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch" - typedef struct _ActivateData ActivateData; struct _ActivateData { @@ -273,29 +232,6 @@ create_items (DbusmenuMenuitem *root, int main (int argc, char ** argv) { - g_type_init(); - - /* Setting up i18n and gettext. Apparently, we need - all of these. */ - setlocale (LC_ALL, ""); - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - textdomain (GETTEXT_PACKAGE); - - session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); - bus_proxy = dbus_g_proxy_new_for_name (session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); - GError * error = NULL; - guint nameret = 0; - - if (!org_freedesktop_DBus_request_name(bus_proxy, INDICATOR_USERS_DBUS_NAME, 0, &nameret, &error)) { - g_error("Unable to call to request name"); - return 1; - } - - if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { - g_error("Unable to get name"); - return 1; - } - g_idle_add(lock_screen_setup, NULL); lock_screen_gdm_cb_set(gdm_settings_change); @@ -318,9 +254,5 @@ main (int argc, char ** argv) G_CALLBACK (user_removed), root_menuitem); - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return 0; } -- cgit v1.2.3