summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2004-08-03 23:36:15 +0000
committerGeorge Lebl <jirka@src.gnome.org>2004-08-03 23:36:15 +0000
commit04b22532589a31781cb5549789d4ba1a15f9d727 (patch)
treeb16205d42b60e321cedbdbfab911a5491fd63e22
parent6b55367d51ff14773aed22242172c11619f905c9 (diff)
downloadgdm-04b22532589a31781cb5549789d4ba1a15f9d727.tar.gz
"fix" #148349 by adding French (Belgium), French (Switzerland), German
Tue Aug 03 16:29:08 2004 George Lebl <jirka@5z.com> * gui/gdmlanguages.c: "fix" #148349 by adding French (Belgium), French (Switzerland), German (Austria), German (Switzerland) to the translation matrix applying the patch. Patch from Christian Rose * config/locale.alias: add de_AT, de_CH, fr_BE, fr_CH * gui/gdmlanguages.c: normalize english names, patch mostly from Christian Rose, #148350 * gui/gdmlanguages.c: fix #148356 by including a native version of Azerbaijani language name * gui/gdmlanguages.c: fix #148486 by including native name for Gujarati * gui/gdmlanguages.c: fix #148373 by fixing the greek language string * gui/gdmlanguages.c: add en_DK just to have the translation, but don't add it to config/locale.alias * configure.in: fixing #148042 by settings GETTEXT_PACKAGE to gdm * gui/greeter/greeter_system.c: fix #147800 by changing the shortcut for configure from c to g * gui/greeter/greeter.c, gui/greeter/greeter_configuration.c, gui/greeter/greeter_system.c, gui/greeter/greeter_canvas_item.c: Fix #147940 by actually checking if the command exists and not just for NULLs, then disabeling Halt,Suspend or Reboot is really as simple as "RebootCommand=" as it is for gdmlogin * gui/gdmlogin.c, gui/gdmsetup.c, gui/gdmwm.c, gui/gdmcommon.c, gui/gdmchooser.c, gui/greeter/greeter_item.c, gui/greeter/greeter_action_language.c: fix some compiler warnings * daemon/gdm.c: Fix #144076, 144077, the request denied errors that are printed to syslog now just give the request by real name instead of making it look like part of the sentence and so it all makes more sense. * daemon/verify-pam.c: fix some compiler warnings
-rw-r--r--ChangeLog46
-rw-r--r--config/locale.alias12
-rw-r--r--configure.in2
-rw-r--r--daemon/gdm.c14
-rw-r--r--daemon/verify-pam.c16
-rw-r--r--gui/gdmchooser.c1
-rw-r--r--gui/gdmcommon.h2
-rw-r--r--gui/gdmlanguages.c24
-rw-r--r--gui/gdmlogin.c17
-rw-r--r--gui/gdmsetup.c5
-rw-r--r--gui/gdmwm.c4
-rw-r--r--gui/greeter/greeter.c9
-rw-r--r--gui/greeter/greeter_action_language.c5
-rw-r--r--gui/greeter/greeter_canvas_item.c1
-rw-r--r--gui/greeter/greeter_configuration.h4
-rw-r--r--gui/greeter/greeter_item.c8
-rw-r--r--gui/greeter/greeter_system.c38
-rw-r--r--gui/misc.c14
-rw-r--r--gui/misc.h3
19 files changed, 152 insertions, 73 deletions
diff --git a/ChangeLog b/ChangeLog
index d4d8f815..ef1a6610 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,49 @@
+Tue Aug 03 16:29:08 2004 George Lebl <jirka@5z.com>
+
+ * gui/gdmlanguages.c: "fix" #148349 by adding French (Belgium),
+ French (Switzerland), German (Austria), German (Switzerland)
+ to the translation matrix applying the patch. Patch from
+ Christian Rose
+
+ * config/locale.alias: add de_AT, de_CH, fr_BE, fr_CH
+
+ * gui/gdmlanguages.c: normalize english names, patch mostly from
+ Christian Rose, #148350
+
+ * gui/gdmlanguages.c: fix #148356 by including a native version of
+ Azerbaijani language name
+
+ * gui/gdmlanguages.c: fix #148486 by including native name for
+ Gujarati
+
+ * gui/gdmlanguages.c: fix #148373 by fixing the greek language string
+
+ * gui/gdmlanguages.c: add en_DK just to have the translation, but
+ don't add it to config/locale.alias
+
+ * configure.in: fixing #148042 by settings GETTEXT_PACKAGE to gdm
+
+ * gui/greeter/greeter_system.c: fix #147800 by changing the shortcut
+ for configure from c to g
+
+ * gui/greeter/greeter.c, gui/greeter/greeter_configuration.c,
+ gui/greeter/greeter_system.c, gui/greeter/greeter_canvas_item.c:
+ Fix #147940 by actually checking if the command exists and not just
+ for NULLs, then disabeling Halt,Suspend or Reboot is really as
+ simple as "RebootCommand=" as it is for gdmlogin
+
+ * gui/gdmlogin.c, gui/gdmsetup.c, gui/gdmwm.c, gui/gdmcommon.c,
+ gui/gdmchooser.c, gui/greeter/greeter_item.c,
+ gui/greeter/greeter_action_language.c:
+ fix some compiler warnings
+
+ * daemon/gdm.c: Fix #144076, 144077, the request denied errors
+ that are printed to syslog now just give the request by real name
+ instead of making it look like part of the sentence and so it
+ all makes more sense.
+
+ * daemon/verify-pam.c: fix some compiler warnings
+
Fri Jul 02 Arvind Samptur <arvind.samptur@wipro.com>
* configure.in: Define a macro to set the xserver options
diff --git a/config/locale.alias b/config/locale.alias
index d53fcbb7..0bca5f0c 100644
--- a/config/locale.alias
+++ b/config/locale.alias
@@ -32,16 +32,20 @@ Croatian hr_HR.UTF-8,hr_HR
Czech cs_CZ.UTF-8,cs_CZ
Danish da_DK.UTF-8,da_DK
Dutch nl_NL.UTF-8,nl_NL
-English(American) en_US.UTF-8,en_US
-English(Australian) en_AU.UTF-8,en_AU
-English(British) en_GB.UTF-8,en_GB
-English(Canadian) en_CA.UTF-8,en_CA
+English(USA) en_US.UTF-8,en_US
+English(Australia) en_AU.UTF-8,en_AU
+English(UK) en_GB.UTF-8,en_GB
+English(Canada) en_CA.UTF-8,en_CA
English(Ireland) en_IE.UTF-8,en_IE
Estonian et_EE.UTF-8,et_EE
Finnish fi_FI.UTF-8,fi_FI
French fr_FR.UTF-8,fr_FR
+French(Belgium) fr_BE.UTF-8,fr_BE
+French(Switzerland) fr_CH.UTF-8,fr_CH
Galician gl_ES.UTF-8,gl_ES
German de_DE.UTF-8,de_DE
+German(Austria) de_AT.UTF-8,de_AT
+German(Switzerland) de_CH.UTF-8,de_CH
Greek el_GR.UTF-8,el_GR
Gujarati gu_IN.UTF-8,gu_IN
Hebrew he_IL.UTF-8,he_IL
diff --git a/configure.in b/configure.in
index 4464e4de..3bbd04b0 100644
--- a/configure.in
+++ b/configure.in
@@ -139,7 +139,7 @@ else
fi
dnl ## Language Support
-GETTEXT_PACKAGE=gdm-2.6
+GETTEXT_PACKAGE=gdm
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
AC_SUBST(GETTEXT_PACKAGE)
diff --git a/daemon/gdm.c b/daemon/gdm.c
index ed5a6884..5b03d302 100644
--- a/daemon/gdm.c
+++ b/daemon/gdm.c
@@ -3524,7 +3524,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
/* Only allow locally authenticated connections */
if ( ! (gdm_connection_get_user_flags (conn) &
GDM_SUP_FLAG_AUTHENTICATED)) {
- gdm_info (_("Flexible server request denied: "
+ gdm_info (_("FLEXI_XSERVER request denied: "
"Not authenticated"));
gdm_connection_write (conn,
"ERROR 100 Not authenticated\n");
@@ -3543,7 +3543,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
/* Only allow locally authenticated connections */
if ( ! (gdm_connection_get_user_flags (conn) &
GDM_SUP_FLAG_AUTHENTICATED)) {
- gdm_info (_("Flexible server request denied: "
+ gdm_info (_("FLEXI_XSERVER request denied: "
"Not authenticated"));
gdm_connection_write (conn,
"ERROR 100 Not authenticated\n");
@@ -3687,7 +3687,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
if ( ! (gdm_connection_get_user_flags (conn) &
GDM_SUP_FLAG_AUTHENTICATED) ||
disp == NULL) {
- gdm_info (_("Query logout action request denied: "
+ gdm_info (_("QUERY_LOGOUT_ACTION request denied: "
"Not authenticated"));
gdm_connection_write (conn,
"ERROR 100 Not authenticated\n");
@@ -3745,7 +3745,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
GDM_SUP_FLAG_AUTHENTICATED) ||
disp == NULL ||
! disp->logged_in) {
- gdm_info (_("Set logout action request denied: "
+ gdm_info (_("SET_LOGOUT_ACTION request denied: "
"Not authenticated"));
gdm_connection_write (conn,
"ERROR 100 Not authenticated\n");
@@ -3800,7 +3800,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
GDM_SUP_FLAG_AUTHENTICATED) ||
disp == NULL ||
! disp->logged_in) {
- gdm_info (_("Set logout action request denied: "
+ gdm_info (_("SET_LOGOUT_ACTION request denied: "
"Not authenticated"));
gdm_connection_write (conn,
"ERROR 100 Not authenticated\n");
@@ -3845,7 +3845,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
/* Only allow locally authenticated connections */
if ( ! (gdm_connection_get_user_flags (conn) &
GDM_SUP_FLAG_AUTHENTICATED)) {
- gdm_info (_("Query vt request denied: "
+ gdm_info (_("QUERY_VT request denied: "
"Not authenticated"));
gdm_connection_write (conn,
"ERROR 100 Not authenticated\n");
@@ -3872,7 +3872,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
/* Only allow locally authenticated connections */
if ( ! (gdm_connection_get_user_flags (conn) &
GDM_SUP_FLAG_AUTHENTICATED)) {
- gdm_info (_("Query vt request denied: "
+ gdm_info (_("QUERY_VT request denied: "
"Not authenticated"));
gdm_connection_write (conn,
"ERROR 100 Not authenticated\n");
diff --git a/daemon/verify-pam.c b/daemon/verify-pam.c
index 7792e5a3..51ec9880 100644
--- a/daemon/verify-pam.c
+++ b/daemon/verify-pam.c
@@ -131,6 +131,7 @@ gdm_verify_pam_conv (int num_msg, const struct pam_message **msg,
int i;
char *s;
struct pam_response *reply = NULL;
+ const void *p;
const char *login;
if (pamh == NULL)
@@ -152,8 +153,10 @@ gdm_verify_pam_conv (int num_msg, const struct pam_message **msg,
/* Here we set the login if it wasn't already set,
* this is kind of anal, but this way we guarantee that
* the greeter always is up to date on the login */
- if (pam_get_item (pamh, PAM_USER, (const void **)&login) == PAM_SUCCESS ||
+ if (pam_get_item (pamh, PAM_USER, &p) == PAM_SUCCESS ||
tmp_PAM_USER != NULL) {
+ login = (const char *)p;
+
/* FIXME: this is a HACK HACK HACK, for some reason needed */
if (tmp_PAM_USER != NULL)
login = tmp_PAM_USER;
@@ -462,6 +465,7 @@ gdm_verify_user (GdmDisplay *d,
gboolean local)
{
gint pamerr;
+ const void *p;
char *login;
struct passwd *pwent;
gboolean error_msg_given;
@@ -588,8 +592,7 @@ authenticate_again:
g_free (login);
login = NULL;
- if ((pamerr = pam_get_item (pamh, PAM_USER, (const void **)&login))
- != PAM_SUCCESS) {
+ if ((pamerr = pam_get_item (pamh, PAM_USER, &p)) != PAM_SUCCESS) {
login = NULL;
/* is not really an auth problem, but it will
pretty much look as such, it shouldn't really
@@ -598,7 +601,7 @@ authenticate_again:
gdm_error (_("Couldn't authenticate user"));
goto pamerr;
}
- login = g_strdup (login);
+ login = g_strdup ((const char *)p);
/* kind of anal, the greeter likely already knows, but it could have
been changed */
gdm_slave_greeter_ctl_no_ret (GDM_SETLOGIN, login);
@@ -806,6 +809,7 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display,
{
gint pamerr = 0;
struct passwd *pwent;
+ const void *p;
const char *after_login;
int null_tok = 0;
@@ -857,8 +861,7 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display,
goto setup_pamerr;
}
- if ((pamerr = pam_get_item (pamh, PAM_USER, (const void **)&after_login))
- != PAM_SUCCESS) {
+ if ((pamerr = pam_get_item (pamh, PAM_USER, &p)) != PAM_SUCCESS) {
/* is not really an auth problem, but it will
pretty much look as such, it shouldn't really
happen */
@@ -868,6 +871,7 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display,
_("Authentication failed"));
goto setup_pamerr;
}
+ after_login = (const char *)p;
if (after_login != NULL /* should never be */ &&
strcmp (after_login, login) != 0) {
diff --git a/gui/gdmchooser.c b/gui/gdmchooser.c
index 390dadd7..60febb23 100644
--- a/gui/gdmchooser.c
+++ b/gui/gdmchooser.c
@@ -53,6 +53,7 @@
#include "gdm.h"
#include "misc.h"
#include "gdmwm.h"
+#include "gdmcommon.h"
static gboolean RUNNING_UNDER_GDM = FALSE;
diff --git a/gui/gdmcommon.h b/gui/gdmcommon.h
index b02cf2a5..7684bf83 100644
--- a/gui/gdmcommon.h
+++ b/gui/gdmcommon.h
@@ -24,6 +24,8 @@
#include <vicious.h>
+#include "misc.h"
+
void gdm_common_show_info_msg (void);
void gdm_common_message (const gchar *msg);
void gdm_common_abort (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
diff --git a/gui/gdmlanguages.c b/gui/gdmlanguages.c
index e17e807b..af89010a 100644
--- a/gui/gdmlanguages.c
+++ b/gui/gdmlanguages.c
@@ -58,7 +58,7 @@ static Language languages [] = {
/*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|Arabic (Lebanon)"), "ar_LB", NULL, 0 },
/*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Azerbaijani"), "az_AZ", NULL, 0 },
+ { N_("A-M|Azerbaijani"), "az_AZ", "Azərbaycanca", 0 },
/*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|Basque"), "eu_ES", "Euskara", 0 },
/*Note translate the A-M to the A-M you used in the group label */
@@ -88,29 +88,39 @@ static Language languages [] = {
/*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|English"), "en", "English", 0 },
/*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (American)"), "en_US", "American English", 0 },
+ { N_("A-M|English (USA)"), "en_US", "American English", 0 },
/*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (Australian)"), "en_AU", "Australian English", 0 },
+ { N_("A-M|English (Australia)"), "en_AU", "Australian English", 0 },
/*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (British)"), "en_GB", "British English", 0 },
+ { N_("A-M|English (UK)"), "en_GB", "British English", 0 },
/*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (Canadian)"), "en_CA", "Canadian English", 0 },
+ { N_("A-M|English (Canada)"), "en_CA", "Canadian English", 0 },
/*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|English (Ireland)"), "en_IE", "Irish English", 0 },
/*Note translate the A-M to the A-M you used in the group label */
+ { N_("A-M|English (Danmark)"), "en_IE", "Danish English", 0 },
+ /*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|Estonian"), "et_EE", "Eesti", 0 },
/*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|Finnish"), "fi_FI", "Suomi", 0 },
/*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|French"), "fr_FR", "Français", 0 },
/*Note translate the A-M to the A-M you used in the group label */
+ { N_("A-M|French (Belgium)"), "fr_BE", "Français (Belgique)", 0 },
+ /*Note translate the A-M to the A-M you used in the group label */
+ { N_("A-M|French (Switzerland)"), "fr_CH", "Français (Suisse)", 0 },
+ /*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|Galician"), "gl_ES", "Galego", 0 },
/*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|German"), "de_DE", "Deutsch", 0 },
/*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Greek"), "el_GR", "ελληνικά", 0 },
+ { N_("A-M|German (Austria)"), "de_AT", "Deutsch (Österreich)", 0 },
+ /*Note translate the A-M to the A-M you used in the group label */
+ { N_("A-M|German (Switzerland)"), "de_CH", "Deutsch (Schweiz)", 0 },
+ /*Note translate the A-M to the A-M you used in the group label */
+ { N_("A-M|Greek"), "el_GR", "Ελληνικά", 0 },
/*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Gujarati"), "gu_IN", NULL, 0 },
+ { N_("A-M|Gujarati"), "gu_IN", "ગુજરાતી", 0 },
/*Note translate the A-M to the A-M you used in the group label */
{ N_("A-M|Hebrew"), "he_IL", "עברית", 0 },
/*Note translate the A-M to the A-M you used in the group label */
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
index 9b3fc9fe..f571e32e 100644
--- a/gui/gdmlogin.c
+++ b/gui/gdmlogin.c
@@ -2539,17 +2539,6 @@ bin_exists (const char *command)
}
static gboolean
-working_command_exists (const char *commands)
-{
- char *command = ve_get_first_working_command
- (commands, TRUE /* only_existance */);
- if (command == NULL)
- return FALSE;
- g_free (command);
- return TRUE;
-}
-
-static gboolean
window_browser_event (GtkWidget *window, GdkEvent *event, gpointer data)
{
switch (event->type) {
@@ -2759,7 +2748,7 @@ gdm_login_gui_init (void)
got_anything = TRUE;
}
- if (working_command_exists (GdmReboot)) {
+ if (gdm_working_command_exists (GdmReboot)) {
item = gtk_menu_item_new_with_mnemonic (_("_Reboot"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
@@ -2772,7 +2761,7 @@ gdm_login_gui_init (void)
got_anything = TRUE;
}
- if (working_command_exists (GdmHalt)) {
+ if (gdm_working_command_exists (GdmHalt)) {
item = gtk_menu_item_new_with_mnemonic (_("Shut _Down"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
@@ -2786,7 +2775,7 @@ gdm_login_gui_init (void)
got_anything = TRUE;
}
- if (working_command_exists (GdmSuspend)) {
+ if (gdm_working_command_exists (GdmSuspend)) {
item = gtk_menu_item_new_with_mnemonic (_("_Suspend"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c
index 867ed627..a9743dd8 100644
--- a/gui/gdmsetup.c
+++ b/gui/gdmsetup.c
@@ -2568,6 +2568,7 @@ get_sensitivity (void)
static Atom atom = 0;
Display *disp = gdk_x11_get_default_xdisplay ();
Window root = gdk_x11_get_default_root_xwindow ();
+ unsigned char *datac;
gulong *data;
gulong nitems_return;
gulong bytes_after_return;
@@ -2586,9 +2587,11 @@ get_sensitivity (void)
&type_returned, &format_returned,
&nitems_return,
&bytes_after_return,
- (unsigned char **)&data) != Success)
+ &datac) != Success)
return TRUE;
+ data = (gulong *)datac;
+
if (format_returned != 32 ||
data[0] == 0) {
XFree (data);
diff --git a/gui/gdmwm.c b/gui/gdmwm.c
index c437879f..5ea36cef 100644
--- a/gui/gdmwm.c
+++ b/gui/gdmwm.c
@@ -600,6 +600,7 @@ static gboolean
has_deco (Window win)
{
static Atom hints_atom = None;
+ unsigned char *foo;
MotifWmHints *hints;
Atom type;
gint format;
@@ -618,7 +619,8 @@ has_deco (Window win)
hints_atom, 0,
sizeof (MotifWmHints) / sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
- &bytes_after, (guchar **)&hints);
+ &bytes_after, &foo);
+ hints = (MotifWmHints *)foo;
if (type != None &&
hints != NULL &&
diff --git a/gui/greeter/greeter.c b/gui/greeter/greeter.c
index ba73642a..e8247d91 100644
--- a/gui/greeter/greeter.c
+++ b/gui/greeter/greeter.c
@@ -52,6 +52,10 @@ gchar *GdmHalt = NULL;
gchar *GdmReboot = NULL;
gchar *GdmSuspend = NULL;
gchar *GdmConfigurator = NULL;
+gboolean GdmHaltFound = FALSE;
+gboolean GdmRebootFound = FALSE;
+gboolean GdmSuspendFound = FALSE;
+gboolean GdmConfiguratorFound = FALSE;
gboolean GdmSystemMenu = TRUE;
gboolean GdmConfigAvailable = TRUE;
gboolean GdmChooserButton = TRUE;
@@ -148,6 +152,11 @@ greeter_parse_config (void)
GdmInfoMsgFile = ve_config_get_string (config, GDM_KEY_INFO_MSG_FILE);
GdmInfoMsgFont = ve_config_get_string (config, GDM_KEY_INFO_MSG_FONT);
+ GdmHaltFound = gdm_working_command_exists (GdmHalt);
+ GdmRebootFound = gdm_working_command_exists (GdmReboot);
+ GdmSuspendFound = gdm_working_command_exists (GdmSuspend);
+ GdmConfiguratorFound = gdm_working_command_exists (GdmConfigurator);
+
GdmWelcome = ve_config_get_translated_string (config, greeter_Welcome_key);
/* A hack! */
if (strcmp (ve_sure_string (GdmWelcome), "Welcome") == 0) {
diff --git a/gui/greeter/greeter_action_language.c b/gui/greeter/greeter_action_language.c
index 4408a398..76d0382f 100644
--- a/gui/greeter/greeter_action_language.c
+++ b/gui/greeter/greeter_action_language.c
@@ -188,6 +188,7 @@ greeter_action_language (GreeterItemInfo *info,
if (dialog == NULL)
{
+ GtkWidget **tmp_p;
GtkWidget *swindow;
GtkWidget *label;
char *s;
@@ -207,7 +208,9 @@ greeter_action_language (GreeterItemInfo *info,
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_OK);
- g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer *) &dialog);
+ /* evil gcc warnings */
+ tmp_p = &dialog;
+ g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer *)tmp_p);
s = g_strdup_printf ("<span size=\"x-large\" weight=\"bold\">%s</span>",
_("Select a language for your session to use:"));
label = gtk_label_new (s);
diff --git a/gui/greeter/greeter_canvas_item.c b/gui/greeter/greeter_canvas_item.c
index 2e62fc82..56ee2932 100644
--- a/gui/greeter/greeter_canvas_item.c
+++ b/gui/greeter/greeter_canvas_item.c
@@ -8,6 +8,7 @@
#include "vicious.h"
#include "gdm.h"
+#include "gdmcommon.h"
#include "greeter.h"
#include "greeter_item.h"
#include "greeter_events.h"
diff --git a/gui/greeter/greeter_configuration.h b/gui/greeter/greeter_configuration.h
index 79df729b..f8894e68 100644
--- a/gui/greeter/greeter_configuration.h
+++ b/gui/greeter/greeter_configuration.h
@@ -12,6 +12,10 @@ extern gchar *GdmHalt;
extern gchar *GdmReboot;
extern gchar *GdmSuspend;
extern gchar *GdmConfigurator;
+extern gboolean GdmHaltFound;
+extern gboolean GdmRebootFound;
+extern gboolean GdmSuspendFound;
+extern gboolean GdmConfiguratorFound;
extern gchar *GdmSessionDir;
extern gchar *GdmDefaultSession;
extern gchar *GdmDefaultLocale;
diff --git a/gui/greeter/greeter_item.c b/gui/greeter/greeter_item.c
index a8b31fbb..e5ce1d2b 100644
--- a/gui/greeter/greeter_item.c
+++ b/gui/greeter/greeter_item.c
@@ -295,7 +295,7 @@ greeter_item_is_visible (GreeterItemInfo *info)
! (info->show_modes & GREETER_ITEM_SHOW_REMOTE))
return FALSE;
- if (( ! GdmConfigAvailable || ! GdmSystemMenu) &&
+ if (( ! GdmConfigAvailable || ! GdmSystemMenu || ! GdmConfiguratorFound) &&
info->show_type != NULL &&
strcmp (info->show_type, "config") == 0)
return FALSE;
@@ -310,15 +310,15 @@ greeter_item_is_visible (GreeterItemInfo *info)
strcmp (info->show_type, "system") == 0)
return FALSE;
- if (( ! GdmSystemMenu || GdmHalt == NULL) &&
+ if (( ! GdmSystemMenu || ! GdmHaltFound) &&
info->show_type != NULL &&
strcmp (info->show_type, "halt") == 0)
return FALSE;
- if (( ! GdmSystemMenu || GdmReboot == NULL) &&
+ if (( ! GdmSystemMenu || ! GdmRebootFound) &&
info->show_type != NULL &&
strcmp (info->show_type, "reboot") == 0)
return FALSE;
- if (( ! GdmSystemMenu || GdmSuspend == NULL) &&
+ if (( ! GdmSystemMenu || ! GdmSuspendFound) &&
info->show_type != NULL &&
strcmp (info->show_type, "suspend") == 0)
return FALSE;
diff --git a/gui/greeter/greeter_system.c b/gui/greeter/greeter_system.c
index 96f4e3fa..a03f80bc 100644
--- a/gui/greeter/greeter_system.c
+++ b/gui/greeter/greeter_system.c
@@ -39,17 +39,6 @@ bin_exists (const char *command)
}
}
-static gboolean
-working_command_exists (const char *commands)
-{
- char *command = ve_get_first_working_command
- (commands, TRUE /* only_existance */);
- if (command == NULL)
- return FALSE;
- g_free (command);
- return TRUE;
-}
-
static void
query_greeter_reboot_handler (void)
{
@@ -132,7 +121,6 @@ greeter_system_append_system_menu (GtkWidget *menu)
{
GtkWidget *w, *sep;
static GtkTooltips *tooltips = NULL;
- gboolean add_reboot, add_halt, add_suspend;
/* should never be allowed by the UI */
if ( ! GdmSystemMenu ||
@@ -170,17 +158,13 @@ greeter_system_append_system_menu (GtkWidget *menu)
NULL);
}
- add_reboot = working_command_exists (GdmReboot);
- add_halt = working_command_exists (GdmHalt);
- add_suspend = working_command_exists (GdmSuspend);
-
- if (add_reboot || add_halt || add_suspend) {
+ if (GdmRebootFound || GdmHaltFound || GdmSuspendFound) {
sep = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), sep);
gtk_widget_show (sep);
}
- if (add_reboot) {
+ if (GdmRebootFound) {
w = gtk_menu_item_new_with_mnemonic (_("_Reboot"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
gtk_widget_show (GTK_WIDGET (w));
@@ -192,7 +176,7 @@ greeter_system_append_system_menu (GtkWidget *menu)
NULL);
}
- if (add_halt) {
+ if (GdmHaltFound) {
w = gtk_menu_item_new_with_mnemonic (_("Shut _Down"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
gtk_widget_show (GTK_WIDGET (w));
@@ -205,7 +189,7 @@ greeter_system_append_system_menu (GtkWidget *menu)
NULL);
}
- if (add_suspend) {
+ if (GdmSuspendFound) {
w = gtk_menu_item_new_with_mnemonic (_("Sus_pend"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
gtk_widget_show (GTK_WIDGET (w));
@@ -218,8 +202,10 @@ greeter_system_append_system_menu (GtkWidget *menu)
}
}
-static gboolean radio_button_press_event(GtkWidget *widget, GdkEventButton *event,
- gpointer data)
+static gboolean
+radio_button_press_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer data)
{
if (event->type == GDK_2BUTTON_PRESS) {
gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
@@ -289,7 +275,7 @@ greeter_system_handler (GreeterItemInfo *info,
vbox,
TRUE, TRUE, 0);
- if (working_command_exists (GdmHalt)) {
+ if (GdmHaltFound) {
if (group_radio != NULL)
radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
halt_radio = gtk_radio_button_new_with_mnemonic (radio_group,
@@ -307,7 +293,7 @@ greeter_system_handler (GreeterItemInfo *info,
gtk_widget_show (halt_radio);
}
- if (working_command_exists (GdmReboot)) {
+ if (GdmRebootFound) {
if (group_radio != NULL)
radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
reboot_radio = gtk_radio_button_new_with_mnemonic (radio_group,
@@ -321,7 +307,7 @@ greeter_system_handler (GreeterItemInfo *info,
gtk_widget_show (reboot_radio);
}
- if (working_command_exists (GdmSuspend)) {
+ if (GdmSuspendFound) {
if (group_radio != NULL)
radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
suspend_radio = gtk_radio_button_new_with_mnemonic (radio_group,
@@ -359,7 +345,7 @@ greeter_system_handler (GreeterItemInfo *info,
if (group_radio != NULL)
radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
config_radio = gtk_radio_button_new_with_mnemonic (radio_group,
- _("_Configure the login manager"));
+ _("Confi_gure the login manager"));
group_radio = config_radio;
gtk_tooltips_set_tip (tooltips, GTK_WIDGET (config_radio),
_("Configure GDM (this login manager). "
diff --git a/gui/misc.c b/gui/misc.c
index 922a1b73..259be1b0 100644
--- a/gui/misc.c
+++ b/gui/misc.c
@@ -21,6 +21,8 @@
#include <libgnomeui/libgnomeui.h>
#include <glade/glade.h>
+#include <vicious.h>
+
#include "misc.h"
#define INDEX_FILE1 "index.theme"
@@ -98,4 +100,16 @@ gdm_set_theme (const char *theme_name)
g_free (font_name);
}
+gboolean
+gdm_working_command_exists (const char *commands)
+{
+ char *command = ve_get_first_working_command
+ (commands, TRUE /* only_existance */);
+ if (command == NULL)
+ return FALSE;
+ g_free (command);
+ return TRUE;
+}
+
+
/* EOF */
diff --git a/gui/misc.h b/gui/misc.h
index 55d61c70..ba352841 100644
--- a/gui/misc.h
+++ b/gui/misc.h
@@ -19,7 +19,8 @@
#ifndef MISC_H
#define MISC_H
-void gdm_set_theme (const char *theme_name);
+void gdm_set_theme (const char *theme_name);
+gboolean gdm_working_command_exists (const char *commands);
#endif /* MISC_H */