Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/Makefile.am,v
retrieving revision 1.344
diff -u -p -r1.344 Makefile.am
--- Makefile.am	6 Jan 2005 11:57:10 -0000	1.344
+++ Makefile.am	10 Jan 2005 16:39:47 -0000
@@ -113,7 +113,6 @@ panel_sources =			\
 	panel-force-quit.c	\
 	panel-lockdown.c	\
 	panel-addto.c		\
-	gdm-logout-action.c	\
 	$(EGG_RECENT_FILES_C)	\
 	$(NULL)
 
@@ -159,7 +158,6 @@ panel_headers =			\
 	panel-force-quit.h	\
 	panel-lockdown.h	\
 	panel-addto.h		\
-	gdm-logout-action.h	\
 	$(EGG_RECENT_FILES_H)	\
 	$(NULL)
 
Index: gdm-logout-action.c
===================================================================
RCS file: gdm-logout-action.c
diff -N gdm-logout-action.c
--- gdm-logout-action.c	6 Jan 2005 11:57:10 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,392 +0,0 @@
-/*
- * gdm-protocol.c: GDM logout action protocol implementation
- *
- * Copyright (C) 2005 Raffaele Sandrini
- * Copyright (C) 2005 Red Hat, Inc.
- * Copyright (C) 2002, 2003 George Lebl
- * Copyright (C) 2001 Queen of England, 
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * Authors:
- *      Raffaele Sandrini <rasa@gmx.ch>
- *      George Lebl <jirka@5z.com>
- *      Mark McLoughlin <mark@skynet.ie>
- */
-
-#include <config.h>
-
-#include "gdm-logout-action.h"
-
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <time.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-#include <X11/Xauth.h>
-#include <gdk/gdk.h>
-
-#define GDM_PROTOCOL_UPDATE_INTERVAL 1 /* seconds */
-
-#define GDM_PROTOCOL_SOCKET_PATH "/tmp/.gdm_socket"
-
-#define GDM_PROTOCOL_MSG_CLOSE        "CLOSE"
-#define GDM_PROTOCOL_MSG_VERSION      "VERSION"
-#define GDM_PROTOCOL_MSG_AUTHENTICATE "AUTH_LOCAL"
-#define GDM_PROTOCOL_MSG_QUERY_ACTION "QUERY_LOGOUT_ACTION"
-#define GDM_PROTOCOL_MSG_SET_ACTION   "SET_LOGOUT_ACTION"
-
-#define GDM_ACTION_STR_NONE     "NONE"
-#define GDM_ACTION_STR_SHUTDOWN "HALT"
-#define GDM_ACTION_STR_REBOOT   "REBOOT"
-#define GDM_ACTION_STR_SUSPEND  "SUSPEND"
-
-typedef struct {
-        int fd;
-	char *auth_cookie;
-
-        GdmLogoutAction available_actions;
-        GdmLogoutAction current_actions;
-
-        time_t last_update;
-} GdmProtocolData;
-
-static GdmProtocolData gdm_protocol_data = {
-        0,
-        GDM_LOGOUT_ACTION_NONE,
-        GDM_LOGOUT_ACTION_NONE,
-        0
-};
-
-static char *
-gdm_send_protocol_msg (GdmProtocolData *data,
-                       const char      *msg)
-{
-        GString *retval;
-        char     buf[256];
-        char    *p;
-        int      len;
-
-        p = g_strconcat (msg, "\n", NULL);
-        if (write (data->fd, p, strlen (p)) < 0) {
-                g_free (p);
-
-                g_warning ("Failed to send message to GDM: %s",
-                           g_strerror (errno));
-                return NULL;
-        }
-        g_free (p);             
-
-        p = NULL;
-        retval = NULL;
-        while ((len = read (data->fd, buf, sizeof (buf) - 1)) > 0) {
-                buf[len] = '\0';
-
-                if (!retval)
-                        retval = g_string_new (buf);
-                else
-                        retval = g_string_append (retval, buf);
-
-                if ((p = strchr (retval->str, '\n')))
-                        break;
-        }
-
-        if (p) *p = '\0';
-        
-        return retval ? g_string_free (retval, FALSE) : NULL;
-}
-
-static char *
-get_display_number (void)
-{
-        const char *display_name;
-        char       *retval;
-        char       *p;
-                
-        display_name = gdk_display_get_name (gdk_display_get_default ());
-
-        p = strchr (display_name, ':');
-        if (!p)
-                return g_strdup ("0");
-
-        while (*p == ':') p++;
-
-        retval = g_strdup (p);
-
-        p = strchr (retval, '.');
-        if (p != NULL)
-                *p = '\0';
-
-        return retval;
-}
-
-static gboolean
-gdm_authenticate_connection (GdmProtocolData *data)
-{
-#define GDM_MIT_MAGIC_COOKIE_LEN 16
-
-        const char *xau_path;
-        FILE       *f;
-        Xauth      *xau;
-        char       *display_number;
-        gboolean    retval;
-
-        if (data->auth_cookie) {
-                char *msg;
-                char *response;
-
-                msg = g_strdup_printf (GDM_PROTOCOL_MSG_AUTHENTICATE " %s",
-                                       data->auth_cookie);
-                response = gdm_send_protocol_msg (data, msg);
-                g_free (msg);
- 
-                if (response && !strcmp (response, "OK")) {
-                        g_free (response);
-                        return TRUE;
-                } else {
-                        g_free (response);
-                        g_free (data->auth_cookie);
-                        data->auth_cookie = NULL;
-                }
-        }
-
-        if (!(xau_path = XauFileName ()))
-                return FALSE;
-
-        if (!(f = fopen (xau_path, "r")))
-                return FALSE;
-
-        retval = FALSE;
-        display_number = get_display_number ();
-
-        while ((xau = XauReadAuth (f))) {
-                char  buffer[40]; /* 2*16 == 32, so 40 is enough */
-                char *msg;
-                char *response;
-                int   i;
-
-                if (xau->family != FamilyLocal ||
-                    strncmp (xau->number, display_number, xau->number_length) ||
-                    strncmp (xau->name, "MIT-MAGIC-COOKIE-1", xau->name_length) ||
-                    xau->data_length != GDM_MIT_MAGIC_COOKIE_LEN) {
-                        XauDisposeAuth (xau);
-                        continue;
-                }
-                
-                for (i = 0; i < GDM_MIT_MAGIC_COOKIE_LEN; i++)
-                        g_snprintf (buffer + 2*i, 3, "%02x", (guint)(guchar)xau->data[i]);
-                
-                XauDisposeAuth (xau);
-                
-                msg = g_strdup_printf (GDM_PROTOCOL_MSG_AUTHENTICATE " %s", buffer);
-                response = gdm_send_protocol_msg (data, msg);
-                g_free (msg);
- 
-                if (response && !strcmp (response, "OK")) {
-			data->auth_cookie = g_strdup (buffer);
-                        g_free (response);
-                        retval = TRUE;
-                        break;
-                }
-
-                g_free (response);
-        }
-
-        g_free (display_number);
-        
-        fclose (f);
-
-        return retval;
-
-#undef GDM_MIT_MAGIC_COOKIE_LEN
-}
-
-static void
-gdm_shutdown_protocol_connection (GdmProtocolData *data)
-{
-        if (data->fd)
-                close (data->fd);
-        data->fd = 0;
-}
-
-static gboolean
-gdm_init_protocol_connection (GdmProtocolData *data)
-{
-        struct sockaddr_un  addr;
-        char               *response;
-
-        g_assert (data->fd <= 0);
-
-        data->fd = socket (AF_UNIX, SOCK_STREAM, 0);
-        if (data->fd < 0) {
-                g_warning ("Failed to create GDM socket: %s",
-                           g_strerror (errno));
-		gdm_shutdown_protocol_connection (data);
-                return FALSE;
-        }
-
-        strcpy (addr.sun_path, GDM_PROTOCOL_SOCKET_PATH);
-        addr.sun_family = AF_UNIX;
-
-        if (connect (data->fd, (struct sockaddr *) &addr, sizeof (addr)) < 0) {
-                g_warning ("Failed to establish a connection with GDM: %s",
-                           g_strerror (errno));
-		gdm_shutdown_protocol_connection (data);
-                return FALSE;
-        }
-
-        response = gdm_send_protocol_msg (data, GDM_PROTOCOL_MSG_VERSION);
-        if (!response || strncmp (response, "GDM ", strlen ("GDM ") != 0)) {
-                g_free (response);
-
-                g_warning ("Failed to get protocol version from GDM");
-		gdm_shutdown_protocol_connection (data);
-
-                return FALSE;
-        }
-
-        if (!gdm_authenticate_connection (data)) {
-                g_warning ("Failed to authenticate with GDM");
-		gdm_shutdown_protocol_connection (data);
-                return FALSE;
-        }
-
-        return TRUE;
-}
-
-static void
-gdm_parse_query_response (GdmProtocolData *data,
-                          const char      *response)
-{
-        char **actions;
-        int    i;
-
-        data->available_actions = GDM_LOGOUT_ACTION_NONE;
-        data->current_actions   = GDM_LOGOUT_ACTION_NONE;
-          
-        if (strncmp (response, "OK ", 3) != 0)
-                return;
-
-        response += 3;
-
-        actions = g_strsplit (response, ";", -1);
-        for (i = 0; actions[i]; i++) {
-                GdmLogoutAction  action = GDM_LOGOUT_ACTION_NONE;
-                gboolean         selected = FALSE;
-                char            *str = actions [i];
-                int              len;
-
-                len = strlen (str);
-                if (!len)
-                        continue;
-
-                if (str[len - 1] == '!') {
-                        selected = TRUE;
-                        str[len - 1] = '\0';
-                }
-
-                if (!strcmp (str, GDM_ACTION_STR_SHUTDOWN))
-                        action = GDM_LOGOUT_ACTION_SHUTDOWN;
-                else if (!strcmp (str, GDM_ACTION_STR_REBOOT))
-                        action = GDM_LOGOUT_ACTION_REBOOT;
-                else if (!strcmp (str, GDM_ACTION_STR_SUSPEND))
-                        action = GDM_LOGOUT_ACTION_SUSPEND;
-
-                data->available_actions |= action;
-                if (selected)
-                        data->current_actions |= action;
-        }
-
-        g_strfreev (actions);
-}
-
-static void
-gdm_update_logout_actions (GdmProtocolData *data)
-{
-        time_t  current_time;
-        char   *response;
-        
-        current_time = time (NULL);
-        if (current_time <= (data->last_update + GDM_PROTOCOL_UPDATE_INTERVAL))
-                return;
-        
-        data->last_update = current_time;
-                
-        if (!gdm_init_protocol_connection (data))
-                return;
-        
-        if ((response = gdm_send_protocol_msg (data, GDM_PROTOCOL_MSG_QUERY_ACTION))) {
-                gdm_parse_query_response (data, response);
-                g_free (response);
-        }
-
-        gdm_shutdown_protocol_connection (data);
-}
-
-gboolean
-gdm_supports_logout_action (GdmLogoutAction action)
-{
-        gdm_update_logout_actions (&gdm_protocol_data);
-
-        return (gdm_protocol_data.available_actions & action) != 0;
-}
-
-GdmLogoutAction
-gdm_get_logout_action (void)
-{
-        gdm_update_logout_actions (&gdm_protocol_data);
-        
-        return gdm_protocol_data.current_actions;
-}
-
-void
-gdm_set_logout_action (GdmLogoutAction action)
-{
-	char *action_str = NULL;
-        char *msg;
-        char *response;
-
-        if (!gdm_init_protocol_connection (&gdm_protocol_data))
-                return;
-
-        switch (action) {
-        case GDM_LOGOUT_ACTION_NONE:
-                action_str = GDM_ACTION_STR_NONE;
-                break;
-        case GDM_LOGOUT_ACTION_SHUTDOWN:
-                action_str = GDM_ACTION_STR_SHUTDOWN;
-                break;
-        case GDM_LOGOUT_ACTION_REBOOT:
-                action_str = GDM_ACTION_STR_REBOOT;
-                break;
-        case GDM_LOGOUT_ACTION_SUSPEND:
-                action_str = GDM_ACTION_STR_SUSPEND;
-                break;
-        }
-
-        msg = g_strdup_printf (GDM_PROTOCOL_MSG_SET_ACTION " %s", action_str);
-
-        response = gdm_send_protocol_msg (&gdm_protocol_data, msg);
-        
-        g_free (msg);
-        g_free (response);
-
-	gdm_protocol_data.last_update = 0;
-
-        gdm_shutdown_protocol_connection (&gdm_protocol_data);
-}
Index: gdm-logout-action.h
===================================================================
RCS file: gdm-logout-action.h
diff -N gdm-logout-action.h
--- gdm-logout-action.h	6 Jan 2005 11:57:10 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,51 +0,0 @@
-/*
- * gdm-logout-action.h: GDM logout action protocol implementation
- *
- * Copyright (C) 2005 Raffaele Sandrini
- * Copyright (C) 2005 Red Hat, Inc.
- * Copyright (C) 2002, 2003 George Lebl
- * Copyright (C) 2001 Queen of England, 
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * Authors:
- *      Raffaele Sandrini <rasa@gmx.ch>
- *      George Lebl <jirka@5z.com>
- *      Mark McLoughlin <mark@skynet.ie>
- */
-
-#ifndef __GDM_LOGOUT_ACTION_H__
-#define __GDM_LOGOUT_ACTION_H__
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-typedef enum {
-        GDM_LOGOUT_ACTION_NONE     = 0,
-        GDM_LOGOUT_ACTION_SHUTDOWN = 1 << 0,
-        GDM_LOGOUT_ACTION_REBOOT   = 1 << 1,
-        GDM_LOGOUT_ACTION_SUSPEND  = 1 << 2
-} GdmLogoutAction;
-
-gboolean gdm_supports_logout_action (GdmLogoutAction action);
-
-void            gdm_set_logout_action (GdmLogoutAction action);
-GdmLogoutAction gdm_get_logout_action (void);
-
-G_END_DECLS
-
-#endif /* __GDM_LOGOUT_ACTION_H__ */
Index: menu.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/menu.c,v
retrieving revision 1.732
diff -u -p -r1.732 menu.c
--- menu.c	9 Jan 2005 20:58:10 -0000	1.732
+++ menu.c	10 Jan 2005 16:39:47 -0000
@@ -1525,18 +1525,10 @@ create_main_menu (PanelWidget *panel)
 					       menuitem);
 	}
 
-	menuitem = menu_create_action_item (PANEL_ACTION_SHUTDOWN);
-	if (menuitem != NULL)
-		gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), menuitem);
-
-	menuitem = menu_create_action_item (PANEL_ACTION_REBOOT);
-	if (menuitem != NULL)
-		gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), menuitem);
-
 	menuitem = menu_create_action_item (PANEL_ACTION_LOGOUT);
 	if (menuitem != NULL)
 		gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), menuitem);
-	
+
 	return main_menu;
 }
 
Index: panel-action-button.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-action-button.c,v
retrieving revision 1.38
diff -u -p -r1.38 panel-action-button.c
--- panel-action-button.c	6 Jan 2005 12:54:23 -0000	1.38
+++ panel-action-button.c	10 Jan 2005 16:39:48 -0000
@@ -45,7 +45,6 @@
 #include "panel-run-dialog.h"
 #include "panel-a11y.h"
 #include "panel-lockdown.h"
-#include "gdm-logout-action.h"
 
 #define PANEL_ACTION_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_ACTION_BUTTON, PanelActionButtonPrivate))
 
@@ -74,8 +73,6 @@ static GConfEnumStringPair panel_action_
 	{ PANEL_ACTION_SEARCH,       "search"       },
 	{ PANEL_ACTION_SCREENSHOT,   "screenshot"   },
 	{ PANEL_ACTION_FORCE_QUIT,   "force-quit"   },
-	{ PANEL_ACTION_SHUTDOWN,     "shutdown"     },
-	{ PANEL_ACTION_REBOOT,       "reboot"       },
 };
 
 /* Lock Screen
@@ -177,24 +174,6 @@ panel_action_logout (GtkWidget *widget)
 	recursion_guard--;
 }
 
-/* Shutdown
- */
-static void
-panel_action_shutdown (GtkWidget *widget)
-{
-	gdm_set_logout_action (GDM_LOGOUT_ACTION_SHUTDOWN);
-	panel_action_logout (widget);
-}
-
-/* Reboot
- */
-static void
-panel_action_reboot (GtkWidget *widget)
-{
-	gdm_set_logout_action (GDM_LOGOUT_ACTION_REBOOT);
-	panel_action_logout (widget);
-}
-
 /* Run Application
  */
 static void
@@ -326,28 +305,6 @@ static PanelAction actions [] = {
 		"ACTION:logout:NEW",
 		panel_action_logout, NULL, NULL,
 		panel_lockdown_get_disable_log_out
-	},
-	{
-		PANEL_ACTION_SHUTDOWN,
-		NULL,
-		"gnome-shutdown",
-		N_("Shut Down"),
-		N_("Log out of GNOME and shut down the computer"),
-		"gospanel-20",
-		"ACTION:shutdown:NEW",
-		panel_action_shutdown, NULL, NULL,
-		panel_lockdown_get_disable_shutdown
-	},
-	{
-		PANEL_ACTION_REBOOT,
-		NULL,
-		"gnome-reboot",
-		N_("Restart"),
-		N_("Log out of GNOME and reboot the computer"),
-		"gospanel-20",
-		"ACTION:reboot:NEW",
-		panel_action_reboot, NULL, NULL,
-		panel_lockdown_get_disable_reboot
 	},
 	{
 		PANEL_ACTION_RUN,
Index: panel-enums.h
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-enums.h,v
retrieving revision 1.6
diff -u -p -r1.6 panel-enums.h
--- panel-enums.h	6 Jan 2005 11:57:10 -0000	1.6
+++ panel-enums.h	10 Jan 2005 16:39:48 -0000
@@ -90,8 +90,6 @@ typedef enum {
         PANEL_ACTION_NONE = 0,
         PANEL_ACTION_LOCK,
         PANEL_ACTION_LOGOUT,
-        PANEL_ACTION_SHUTDOWN,
-        PANEL_ACTION_REBOOT,
         PANEL_ACTION_RUN,
         PANEL_ACTION_SEARCH,
         PANEL_ACTION_SCREENSHOT,
Index: panel-lockdown.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-lockdown.c,v
retrieving revision 1.2
diff -u -p -r1.2 panel-lockdown.c
--- panel-lockdown.c	6 Jan 2005 11:57:10 -0000	1.2
+++ panel-lockdown.c	10 Jan 2005 16:39:48 -0000
@@ -28,7 +28,6 @@
 
 #include <string.h>
 #include "panel-gconf.h"
-#include "gdm-logout-action.h"
 
 #define N_LISTENERS 6
 
@@ -48,8 +47,6 @@ typedef struct {
         guint   disable_command_line : 1;
         guint   disable_lock_screen : 1;
         guint   disable_log_out : 1;
-        guint   disable_shutdown : 1;
-        guint   disable_reboot : 1;
         guint   disable_force_quit : 1;
 
         GSList *disabled_applets;
@@ -350,20 +347,6 @@ panel_lockdown_get_disable_log_out (void
         g_assert (panel_lockdown.initialized != FALSE);
 
         return panel_lockdown.disable_log_out;
-}
-
-gboolean
-panel_lockdown_get_disable_shutdown (void)
-{
-        return (panel_lockdown_get_disable_log_out () ||
-        	!gdm_supports_logout_action (GDM_LOGOUT_ACTION_SHUTDOWN));
-}
-
-gboolean
-panel_lockdown_get_disable_reboot (void)
-{
-        return (panel_lockdown_get_disable_log_out () ||
-        	!gdm_supports_logout_action (GDM_LOGOUT_ACTION_REBOOT));
 }
 
 gboolean
Index: panel-lockdown.h
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-lockdown.h,v
retrieving revision 1.2
diff -u -p -r1.2 panel-lockdown.h
--- panel-lockdown.h	6 Jan 2005 11:57:10 -0000	1.2
+++ panel-lockdown.h	10 Jan 2005 16:39:48 -0000
@@ -37,8 +37,6 @@ gboolean panel_lockdown_get_locked_down 
 gboolean panel_lockdown_get_disable_command_line (void);
 gboolean panel_lockdown_get_disable_lock_screen  (void);
 gboolean panel_lockdown_get_disable_log_out      (void);
-gboolean panel_lockdown_get_disable_shutdown     (void);
-gboolean panel_lockdown_get_disable_reboot       (void);
 gboolean panel_lockdown_get_disable_force_quit   (void);
 
 gboolean panel_lockdown_is_applet_disabled (const char *iid);
Index: panel-menu-bar.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-menu-bar.c,v
retrieving revision 1.46
diff -u -p -r1.46 panel-menu-bar.c
--- panel-menu-bar.c	9 Jan 2005 20:58:10 -0000	1.46
+++ panel-menu-bar.c	10 Jan 2005 16:39:48 -0000
@@ -653,24 +653,6 @@ panel_menu_bar_append_desktop_menu (GtkW
 		}
 	}
 
-	item = menu_create_action_item (PANEL_ACTION_SHUTDOWN);
-	if (item != NULL) {
-		if (!separator_inserted) {
-			add_menu_separator (desktop_menu);
-			separator_inserted = TRUE;
-		}
-		gtk_menu_shell_append (GTK_MENU_SHELL (desktop_menu), item);
-	}
-
-	item = menu_create_action_item (PANEL_ACTION_REBOOT);
-	if (item != NULL) {
-		if (!separator_inserted) {
-			add_menu_separator (desktop_menu);
-			separator_inserted = TRUE;
-		}
-		gtk_menu_shell_append (GTK_MENU_SHELL (desktop_menu), item);
-	}
-
 	item = menu_create_action_item (PANEL_ACTION_LOGOUT);
 	if (item != NULL) {
 		if (!separator_inserted) {
