* Add support for LTSP (Linux terminal service project).
authorHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Wed, 31 Mar 2010 16:32:03 +0000 (00:32 +0800)
committerHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Wed, 31 Mar 2010 16:32:03 +0000 (00:32 +0800)
* Remove unused files.
* Automatically generate po/LINGUAS from the result of `ls po/*.po`.
* Fix an error in fo.po.

configure.ac
lxsession-logout/gdm-logout-action.c [deleted file]
lxsession-logout/gdm-logout-action.h [deleted file]
lxsession-logout/lxsession-logout.c
po/LINGUAS [deleted file]
po/fo.po

index 409bf2d..557bdfd 100644 (file)
@@ -1,5 +1,5 @@
 AC_PREREQ([2.57])
-AC_INIT(lxsession,[0.4.3], [],lxsession)
+AC_INIT(lxsession,[0.4.4], [],lxsession)
 AM_INIT_AUTOMAKE()
 AC_PROG_INTLTOOL(, [no-xml])
 AM_MAINTAINER_MODE
@@ -49,13 +49,20 @@ AM_CONDITIONAL(USE_DBUS, test "$use_dbus" = "yes")
 AC_SUBST(DBUS_CFLAGS)
 AC_SUBST(DBUS_LIBS)
 
+# Generate po/LINGUAS on the fly rather than relying on translators
+# to maintain it manually. This also overcome the problem that Transifex
+# cannot add a language to po/LINGUAS if a new po file is submitted.
+rm -f $srcdir/po/LINGUAS
+for po_file in `ls $srcdir/po/*.po | sort`;
+do
+    lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
+    echo $lang >> $srcdir/po/LINGUAS
+done
+
 GETTEXT_PACKAGE=lxsession
-AM_GNU_GETTEXT_VERSION(0.14.1)
 AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
-
-ALL_LINGUAS="af ar cs da de es et eu fa fi fr gl hr hu id it ja ko lt ml ms nb nl nn pl ps pt pt_BR ru sk sl sv tr uk ur ur_PK vi zh_CN zh_TW"
 AM_GLIB_GNU_GETTEXT
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
 
 if test x"$enable_man" = x"yes"; then
        AC_PATH_PROG([XSLTPROC], [xsltproc])
diff --git a/lxsession-logout/gdm-logout-action.c b/lxsession-logout/gdm-logout-action.c
deleted file mode 100644 (file)
index 0e61820..0000000
+++ /dev/null
@@ -1,426 +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., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA.
- *
- * Authors:
- *      Raffaele Sandrini <rasa@gmx.ch>
- *      George Lebl <jirka@5z.com>
- *      Mark McLoughlin <mark@skynet.ie>
- */
-/*
- * 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 "/var/run/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,
-        NULL,
-        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;
-        }
-
-    if (g_file_test (GDM_PROTOCOL_SOCKET_PATH, G_FILE_TEST_EXISTS))
-      strcpy (addr.sun_path, GDM_PROTOCOL_SOCKET_PATH);
-    else
-      strcpy (addr.sun_path, "/tmp/.gdm_socket");
-
-    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;
-        }
-    g_free (response);
-
-        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);
-}
diff --git a/lxsession-logout/gdm-logout-action.h b/lxsession-logout/gdm-logout-action.h
deleted file mode 100644 (file)
index 6c827cf..0000000
+++ /dev/null
@@ -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., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 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 e247a91..a4183fc 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
+#include <gdk/gdkx.h>
 #include <glib/gi18n.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -31,6 +32,9 @@
 #include <string.h>
 #include <unistd.h>
 
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+
 #include "dbus-interface.h"
 
 /* Command parameters. */
@@ -65,7 +69,7 @@ typedef struct {
     int hibernate_HAL : 1;             /* Hibernate is available via HAL */
     int switch_user_GDM : 1;           /* Switch User is available via GDM */
     int switch_user_KDM : 1;           /* Switch User is available via KDM */
-
+    int ltsp : 1; /* under LTSP environment */
 } HandlerContext;
 
 static gboolean verify_running(char * display_manager, char * executable);
@@ -141,10 +145,24 @@ static void logout_clicked(GtkButton * button, HandlerContext * handler_context)
     gtk_main_quit();
 }
 
+static void change_root_property(GtkWidget* w, const char* prop_name, const char* value)
+{
+    GdkDisplay* dpy = gtk_widget_get_display(w);
+    GdkWindow* root = gtk_widget_get_root_window(w);
+    XChangeProperty(GDK_DISPLAY_XDISPLAY(dpy), GDK_WINDOW_XID(root),
+                      XInternAtom(GDK_DISPLAY_XDISPLAY(dpy), prop_name, False), XA_STRING, 8,
+                      PropModeReplace, value, strlen(value) + 1);
+}
+
 /* Handler for "clicked" signal on Shutdown button. */
 static void shutdown_clicked(GtkButton * button, HandlerContext * handler_context)
 {
-    if (handler_context->shutdown_ConsoleKit)
+    if (G_UNLIKELY(handler_context->ltsp))
+    {
+        change_root_property(GTK_WIDGET(button), "LTSP_LOGOUT_ACTION", "HALT");
+        kill(handler_context->lxsession_pid, SIGTERM);
+    }
+    else if (handler_context->shutdown_ConsoleKit)
         dbus_ConsoleKit_Stop();
     else if (handler_context->shutdown_HAL)
         dbus_HAL_Shutdown();
@@ -154,7 +172,12 @@ static void shutdown_clicked(GtkButton * button, HandlerContext * handler_contex
 /* Handler for "clicked" signal on Reboot button. */
 static void reboot_clicked(GtkButton * button, HandlerContext * handler_context)
 {
-    if (handler_context->reboot_ConsoleKit)
+    if (G_UNLIKELY(handler_context->ltsp))
+    {
+        change_root_property(GTK_WIDGET(button), "LTSP_LOGOUT_ACTION", "REBOOT");
+        kill(handler_context->lxsession_pid, SIGTERM);
+    }
+    else if (handler_context->reboot_ConsoleKit)
         dbus_ConsoleKit_Restart();
     else if (handler_context->reboot_HAL)
         dbus_HAL_Reboot();
@@ -368,6 +391,10 @@ int main(int argc, char * argv[])
         handler_context.switch_user_KDM = TRUE;
     }
 
+    /* LTSP support */
+    if (g_getenv("LTSP_CLIENT"))
+        handler_context.ltsp = TRUE;
+
     /* Make the button images accessible. */
     gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), PACKAGE_DATA_DIR "/lxsession/images");
 
@@ -462,7 +489,7 @@ int main(int argc, char * argv[])
         GtkWidget * shutdown_button = gtk_button_new_with_mnemonic(_("Sh_utdown"));
         GtkWidget * image = gtk_image_new_from_icon_name("system-shutdown", GTK_ICON_SIZE_BUTTON);
         gtk_button_set_image(GTK_BUTTON(shutdown_button), image);
-        gtk_button_set_alignment(GTK_BUTTON(shutdown_button), 0.0, 0.0);
+        gtk_button_set_alignment(GTK_BUTTON(shutdown_button), 0.0, 0.5);
         g_signal_connect(G_OBJECT(shutdown_button), "clicked", G_CALLBACK(shutdown_clicked), &handler_context);
         gtk_box_pack_start(GTK_BOX(controls), shutdown_button, FALSE, FALSE, 4);
     }
@@ -473,40 +500,40 @@ int main(int argc, char * argv[])
         GtkWidget * reboot_button = gtk_button_new_with_mnemonic(_("_Reboot"));
         GtkWidget * image = gtk_image_new_from_icon_name("gnome-session-reboot", GTK_ICON_SIZE_BUTTON);
         gtk_button_set_image(GTK_BUTTON(reboot_button), image);
-        gtk_button_set_alignment(GTK_BUTTON(reboot_button), 0.0, 0.0);
+        gtk_button_set_alignment(GTK_BUTTON(reboot_button), 0.0, 0.5);
         g_signal_connect(G_OBJECT(reboot_button), "clicked", G_CALLBACK(reboot_clicked), &handler_context);
         gtk_box_pack_start(GTK_BOX(controls), reboot_button, FALSE, FALSE, 4);
     }
 
     /* Create the Suspend button. */
-    if (handler_context.suspend_available)
+    if (handler_context.suspend_available && !handler_context.ltsp)
     {
         GtkWidget * suspend_button = gtk_button_new_with_mnemonic(_("_Suspend"));
         GtkWidget * image = gtk_image_new_from_icon_name("gnome-session-suspend", GTK_ICON_SIZE_BUTTON);
         gtk_button_set_image(GTK_BUTTON(suspend_button), image);
-        gtk_button_set_alignment(GTK_BUTTON(suspend_button), 0.0, 0.0);
+        gtk_button_set_alignment(GTK_BUTTON(suspend_button), 0.0, 0.5);
         g_signal_connect(G_OBJECT(suspend_button), "clicked", G_CALLBACK(suspend_clicked), &handler_context);
         gtk_box_pack_start(GTK_BOX(controls), suspend_button, FALSE, FALSE, 4);
     }
 
     /* Create the Hibernate button. */
-    if (handler_context.hibernate_available)
+    if (handler_context.hibernate_available && !handler_context.ltsp)
     {
         GtkWidget * hibernate_button = gtk_button_new_with_mnemonic(_("_Hibernate"));
         GtkWidget * image = gtk_image_new_from_icon_name("gnome-session-hibernate", GTK_ICON_SIZE_BUTTON);
         gtk_button_set_image(GTK_BUTTON(hibernate_button), image);
-        gtk_button_set_alignment(GTK_BUTTON(hibernate_button), 0.0, 0.0);
+        gtk_button_set_alignment(GTK_BUTTON(hibernate_button), 0.0, 0.5);
         g_signal_connect(G_OBJECT(hibernate_button), "clicked", G_CALLBACK(hibernate_clicked), &handler_context);
         gtk_box_pack_start(GTK_BOX(controls), hibernate_button, FALSE, FALSE, 4);
     }
 
     /* Create the Switch User button. */
-    if (handler_context.switch_user_available)
+    if (handler_context.switch_user_available && !handler_context.ltsp)
     {
         GtkWidget * switch_user_button = gtk_button_new_with_mnemonic(_("S_witch User"));
         GtkWidget * image = gtk_image_new_from_icon_name("gnome-session-switch", GTK_ICON_SIZE_BUTTON);
         gtk_button_set_image(GTK_BUTTON(switch_user_button), image);
-        gtk_button_set_alignment(GTK_BUTTON(switch_user_button), 0.0, 0.0);
+        gtk_button_set_alignment(GTK_BUTTON(switch_user_button), 0.0, 0.5);
         g_signal_connect(G_OBJECT(switch_user_button), "clicked", G_CALLBACK(switch_user_clicked), &handler_context);
         gtk_box_pack_start(GTK_BOX(controls), switch_user_button, FALSE, FALSE, 4);
     }
@@ -515,13 +542,13 @@ int main(int argc, char * argv[])
     GtkWidget * logout_button = gtk_button_new_with_mnemonic(_("_Logout"));
     GtkWidget * image = gtk_image_new_from_icon_name("system-log-out", GTK_ICON_SIZE_BUTTON);
     gtk_button_set_image(GTK_BUTTON(logout_button), image);
-    gtk_button_set_alignment(GTK_BUTTON(logout_button), 0.0, 0.0);
+    gtk_button_set_alignment(GTK_BUTTON(logout_button), 0.0, 0.5);
     g_signal_connect(G_OBJECT(logout_button), "clicked", G_CALLBACK(logout_clicked), &handler_context);
     gtk_box_pack_start(GTK_BOX(controls), logout_button, FALSE, FALSE, 4);
 
     /* Create the Cancel button. */
     GtkWidget * cancel_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
-    gtk_button_set_alignment(GTK_BUTTON(cancel_button), 0.0, 0.0);
+    gtk_button_set_alignment(GTK_BUTTON(cancel_button), 0.0, 0.5);
     g_signal_connect(G_OBJECT(cancel_button), "clicked", G_CALLBACK(cancel_clicked), NULL);
     gtk_box_pack_start(GTK_BOX(controls), cancel_button, FALSE, FALSE, 4);
 
diff --git a/po/LINGUAS b/po/LINGUAS
deleted file mode 100644 (file)
index 6a458ba..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-af
-ar
-bg
-bn_IN
-ca
-cs
-da
-de
-el
-es
-es_VE
-et
-eu
-fa
-fi
-fr
-frp
-gl
-he
-hr
-hu
-id
-it
-ja
-ko
-lt
-ml
-ms
-nb
-nl
-nn
-pl
-ps
-pt
-pt_BR
-ru
-sk
-sl
-sr
-sv
-tr
-uk
-ur
-ur_PK
-vi
-zh_CN
-zh_TW
-
index 50ab76c..23e8d6b 100644 (file)
--- a/po/fo.po
+++ b/po/fo.po
@@ -41,7 +41,7 @@ msgstr ""
 #: ../lxsession-logout/main.c:354 ../lxsession-logout/main.c:365
 #, c-format
 msgid "Error: %s\n"
-msgstr "Villar: %s"
+msgstr "Villar: %s\n"
 
 #: ../lxsession-logout/main.c:354
 msgid "LXSession is not running."