Commit b9562703 authored by Brian Cameron's avatar Brian Cameron Committed by Brian Cameron

Correct Makefile so that if CONSOLE_HELPER is set, we don't try to create

2005-05-03  Brian Cameron  <brian.cameron@sun.com>

        * Makefile.am: Correct Makefile so that if
          CONSOLE_HELPER is set, we don't try to create
          an /sbin/gdmsetup symlink to gdmsetup.  Now
          gdmsetup is already installed to /sbin always.
          Fixes #302319.
        * gui/gdmsetup.c: Fix sensitivity of the
          "Delete Theme" button.
        * daemon/gdm.h, gui/gdmlogin.c, gui/greeter/greeter.c:
          Now only set user/password entry to PAM_MAX_RESP_SIZE
          if HAVE_PAM is defined, otherwise set it to
          GDM_MAX_PASS set to 256 in daemon/gdm.h.  This
          allows gdm to be used on systems that do not have
          PAM.  Fixes #302228.
        * daemon/gdm.h, docs/C/gdm.xml, gui/gdmsetup.c,
          gui/greeter/greeter.c, gui/gdmsetup.glade,
          gui/gdmsetup-strings.c, config/gdm.conf.in:
          Now support random theme.  Fixes #302354.
        * gui/gdmcommon.c, gui/gdmlogin.c,
          gui/greeter/greeter_session.c, gui/Makefile.am,
          added gui/gdmsession.[ch]:  Support better
          sorting for session names.  Fixes #301818.
parent b503fd1f
2005-05-03 Brian Cameron <brian.cameron@sun.com>
* Makefile.am: Correct Makefile so that if
CONSOLE_HELPER is set, we don't try to create
an /sbin/gdmsetup symlink to gdmsetup. Now
gdmsetup is already installed to /sbin always.
Fixes #302319.
* gui/gdmsetup.c: Fix sensitivity of the
"Delete Theme" button.
* daemon/gdm.h, gui/gdmlogin.c, gui/greeter/greeter.c:
Now only set user/password entry to PAM_MAX_RESP_SIZE
if HAVE_PAM is defined, otherwise set it to
GDM_MAX_PASS set to 256 in daemon/gdm.h. This
allows gdm to be used on systems that do not have
PAM. Fixes #302228.
* daemon/gdm.h, docs/C/gdm.xml, gui/gdmsetup.c,
gui/greeter/greeter.c, gui/gdmsetup.glade,
gui/gdmsetup-strings.c, config/gdm.conf.in:
Now support random theme. Fixes #302354.
* gui/gdmcommon.c, gui/gdmlogin.c,
gui/greeter/greeter_session.c, gui/Makefile.am,
added gui/gdmsession.[ch]: Support better
sorting for session names. Fixes #301818.
2005-04-26 Brian Cameron <brian.cameron@sun.com>
* gui/modules/AccessKeyMouseEvents.in: Now use more
......
......@@ -33,9 +33,6 @@ install-data-local: gdmsetup-security
if CONSOLE_HELPER
$(INSTALL_DATA) -D $(srcdir)/gdmsetup-pam $(DESTDIR)$(PAM_PREFIX)/pam.d/gdmsetup
$(INSTALL_DATA) -D gdmsetup-security $(DESTDIR)$(PAM_PREFIX)/security/console.apps/gdmsetup
$(INSTALL_DATA) -m 755 -d $(DESTDIR)$(sbindir)
mv -f $(DESTDIR)$(bindir)/gdmsetup $(DESTDIR)$(sbindir)
$(LN_S) @CONSOLE_HELPER@ $(DESTDIR)$(bindir)/gdmsetup
endif
DISTCLEANFILES = \
......
......@@ -236,15 +236,6 @@ Enable=false
# or mail details for some user, or some such.
#Willing=@EXPANDED_SYSCONFDIR@/gdm/Xwilling
# Run XDMCP sessions on a local proxy X server
#EnableProxy=false
# Proxy X server on which XDMCP session should be run
#ProxyXServer=@X_XNEST_PATH@/Xnest @X_XNEST_CONFIG_OPTIONS@ -geometry 768x576
#ProxyXServer=@X_SERVER_PATH@/Xdmx @X_CONFIG_OPTIONS@ -addremovescreens -norender -noglxproxy
# Command which enables the proxy X server to be reconnected
# to another backend display
#ProxyReconnect=@GDM_RECONNECT_PROXY@
[gui]
# The specific gtkrc file we use. It should be the full path to the gtkrc
# that we need. Unless you need a specific gtkrc that doesn't correspond to
......@@ -359,21 +350,8 @@ DefaultRemoteWelcome=true
# Program to run to draw the background in the standard greeter. Perhaps
# something like an xscreensaver hack or some such.
#BackgroundProgram=
# If this is true then the background program is run always, otherwise
# if this is true then the background program is run always, otherwise
# it is only run when the BackgroundType is 0 (None)
#BackgroundProgramInitialDelay=30
# The background program will be started after at least that many
# seconds of inactivity. Note that in the current implementation, the actual
# delay could be twice as long as the one specified here in the worst case.
# Basically GDM checks from time to time if there was activity and runs
# the program if there was none.
#RestartBackgroundProgram=true
# If set the background program will be restarted when it has exited, after
# the delay described below has elapsed. This option can be useful when you
# wish to run a screen saver program when no user is using the machine.
#BackgroundProgramRestartDelay=30
# The background program will be restarted after at least that many seconds
# of inactivity.
#RunBackgroundProgramAlways=false
# Show the Failsafe sessions. These are much MUCH nicer (focus for xterm for
# example) and more failsafe then those supplied by scripts so distros should
......@@ -393,9 +371,14 @@ DefaultRemoteWelcome=true
# for instance in console, xdm and ssh.
#UseInvisibleInEntry=false
# These two keys are for the new greeter. Circles is the standard
# shipped theme
# shipped theme. If you want gdm to select a random theme from a list
# then provide a list that is delimited by /: to the GraphicalThemes key and
# set GraphicalThemeRand to true. Otherwise use GraphicalTheme and specify
# just one theme.
#GraphicalTheme=circles
#GraphicalThemes=circles/:happygnome
GraphicalThemeDir=@EXPANDED_DATADIR@/gdm/themes/
GraphicalThemeRand=false
# If InfoMsgFile points to a file, the greeter will display the contents of the
# file in a modal dialog box before the user is allowed to log in.
#InfoMsgFile=
......
......@@ -26,6 +26,9 @@
#include <netinet/in.h>
#include <time.h>
#define GDM_MAX_PASS 256 /* Define a value for password length. Glibc
* leaves MAX_PASS undefined. */
#define STX 0x2 /* Start of txt */
#define BEL 0x7 /* Bell, used to interrupt login for
* say timed login or something similar */
......@@ -124,6 +127,10 @@ enum {
#define GDM_INTERRUPT_THEME 'H'
#define GDM_INTERRUPT_CANCEL 'X'
/* List delimiter for config file lists */
#define GDM_DELIMITER_MODULES ":"
#define GDM_DELIMITER_THEMES "/:"
/* The dreaded miscellaneous category */
#define FIELD_SIZE 256
#define PIPE_SIZE 4096
......@@ -273,6 +280,8 @@ enum {
#define GDM_KEY_ENTRY_CIRCLES "greeter/UseCirclesInEntry=false"
#define GDM_KEY_ENTRY_INVISIBLE "greeter/UseInvisibleInEntry=false"
#define GDM_KEY_GRAPHICAL_THEME "greeter/GraphicalTheme=circles"
#define GDM_KEY_GRAPHICAL_THEMES "greeter/GraphicalThemes=circles"
#define GDM_KEY_GRAPHICAL_THEME_RAND "greeter/GraphicalThemeRand=false"
#define GDM_KEY_GRAPHICAL_THEME_DIR "greeter/GraphicalThemeDir=" EXPANDED_DATADIR "/gdm/themes/"
#define GDM_KEY_INFO_MSG_FILE "greeter/InfoMsgFile="
......
......@@ -2477,6 +2477,35 @@ XKeepsCrashing
</listitem>
</varlistentry>
<varlistentry>
<term>GraphicalThemes</term>
<listitem>
<synopsis>GraphicalThemes=circles</synopsis>
<para>
The graphical themes that the Themed Greeter should use is the
Mode is set on Random Themes. This is a "/:" delimited list.
It should refer to a directory in the theme directory set by
<filename>GraphicalThemeDir</filename>. This is only used if
<filename>GraphicalThemeRand</filename> is set to true.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>GraphicalThemeRand</term>
<listitem>
<synopsis>GraphicalThemeRand=false</synopsis>
<para>
Whether the graphical greeter will use Only One Theme or Random
Theme mode. Only One Theme mode uses themes listed by
<filename>GraphicalTheme</filename>, Random Themes mode uses
themes listed by <filename>GraphicalThemes</filename>. A value
of false sets greeter to use Only One Theme mode, a value of
true sets the greeter to use Random Theme mode.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>GraphicalThemeDir</term>
<listitem>
......
......@@ -63,6 +63,8 @@ libgdmcommon_a_SOURCES = \
gdmlanguages.h \
gdmuser.c \
gdmuser.h \
gdmsession.c \
gdmsession.h \
misc.c \
misc.h \
gdmcommon.c \
......
......@@ -360,3 +360,4 @@ gdm_setup_blinking_entry (GtkWidget *entry)
entries = g_slist_prepend (entries, eb);
}
......@@ -50,5 +50,6 @@ void gdm_kill_thingies (void);
void gdm_setup_blinking (void);
void gdm_setup_blinking_entry (GtkWidget *entry);
gint gdm_session_sort_func (const char *a, const char *b);
#endif /* GDM_COMMON_H */
......@@ -40,13 +40,20 @@
#include <X11/XKBlib.h>
#include <pwd.h>
#include <sys/utsname.h>
#if HAVE_PAM
#include <security/pam_appl.h>
#define PW_ENTRY_SIZE PAM_MAX_RESP_SIZE
#else
#define PW_ENTRY_SIZE GDM_MAX_PASS
#endif
#include <viciousui.h>
#include "gdm.h"
#include "gdmuser.h"
#include "gdmcommon.h"
#include "gdmsession.h"
#include "gdmwm.h"
#include "gdmlanguages.h"
#include "gdmcommon.h"
......@@ -104,7 +111,6 @@ enum {
};
static gchar *GdmGtkRC;
static gchar *GdmSessionDir;
static gchar *GdmDefaultSession;
static gchar *GdmLocaleFile;
static gchar *GdmGlobalFaceDir;
static gchar *GdmDefaultFace;
......@@ -131,6 +137,7 @@ static gboolean GdmUseInvisibleInEntry;
static gint GdmFlexiReapDelayMinutes;
/* FIXME: Should move everything to externs and move reading to gdmcommon.c */
gchar *GdmDefaultSession;
gchar *GdmInfoMsgFile;
gchar *GdmInfoMsgFont;
gboolean GdmSoundOnLoginReady;
......@@ -166,7 +173,7 @@ static GtkWidget *icon_win = NULL;
static GtkWidget *sessmenu;
static GtkWidget *langmenu;
static GtkTooltips *tooltips;
static GHashTable *sessnames;
GHashTable *sessnames;
static gboolean login_is_local = FALSE;
static gboolean used_defaults = FALSE;
......@@ -176,7 +183,7 @@ static GtkTreeModel *browser_model;
static GdkPixbuf *defface;
/* Eew. Loads of global vars. It's hard to be event controlled while maintaining state */
static GSList *sessions = NULL;
static GList *sessions = NULL;
static GSList *languages = NULL;
static GList *users = NULL;
static GList *users_string = NULL;
......@@ -1011,7 +1018,7 @@ gdm_login_parse_config (void)
static gboolean
gdm_login_list_lookup (GSList *l, const gchar *data)
{
GSList *list = l;
GList *list = l;
if (list == NULL || data == NULL)
return FALSE;
......@@ -1034,23 +1041,6 @@ gdm_login_list_lookup (GSList *l, const gchar *data)
return FALSE;
}
static const char *
session_name (const char *name)
{
const char *nm;
/* eek */
if G_UNLIKELY (name == NULL)
return "(null)";
nm = g_hash_table_lookup (sessnames, name);
if (nm != NULL)
return nm;
else
return name;
}
static void
gdm_login_session_lookup (const gchar* savedsess)
{
......@@ -1089,8 +1079,8 @@ gdm_login_session_lookup (const gchar* savedsess)
"installed on this machine.\n"
"Do you wish to make %s the default for "
"future sessions?"),
session_name (savedsess),
session_name (defsess));
gdm_session_name (savedsess),
gdm_session_name (defsess));
savesess = gdm_common_query (msg, FALSE /* markup */,
_("Make _Default"), _("Just _Log In"), TRUE);
g_free (msg);
......@@ -1116,9 +1106,9 @@ gdm_login_session_lookup (const gchar* savedsess)
"setting is %s.\nDo you wish "
"to make %s the default for "
"future sessions?"),
session_name (session),
session_name (savedsess),
session_name (session));
gdm_session_name (session),
gdm_session_name (savedsess),
gdm_session_name (session));
savesess = gdm_common_query (msg, FALSE /* markup */,
_("Make _Default"), _("Just For _This Session"), TRUE);
} else if (strcmp (session, defsess) != 0 &&
......@@ -1136,8 +1126,8 @@ gdm_login_session_lookup (const gchar* savedsess)
"run the 'switchdesk' utility\n"
"(System->Desktop Switching Tool from "
"the panel menu)."),
session_name (session),
session_name (session));
gdm_session_name (session),
gdm_session_name (session));
gdm_common_message (msg);
}
savesess = GTK_RESPONSE_NO;
......@@ -1393,7 +1383,7 @@ gdm_login_session_handler (GtkWidget *widget)
cursess = g_object_get_data (G_OBJECT (widget), SESSION_NAME);
s = g_strdup_printf (_("%s session selected"), session_name (cursess));
s = g_strdup_printf (_("%s session selected"), gdm_session_name (cursess));
gtk_label_set_text (GTK_LABEL (msg), s);
g_free (s);
......@@ -1401,11 +1391,12 @@ gdm_login_session_handler (GtkWidget *widget)
login_window_resize (FALSE /* force */);
}
static void
gdm_login_session_init (GtkWidget *menu)
{
GSList *sessgrp = NULL;
GdmSession *session = NULL;
GList *tmp;
GtkWidget *item;
DIR *sessdir;
struct dirent *dent;
......@@ -1413,6 +1404,8 @@ gdm_login_session_init (GtkWidget *menu)
int num = 1;
int i;
char **vec;
char *label;
char *name;
gboolean some_dir_exists = FALSE;
cursess = NULL;
......@@ -1441,8 +1434,28 @@ gdm_login_session_init (GtkWidget *menu)
}
sessnames = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (sessnames, GDM_SESSION_FAILSAFE_GNOME, _("Failsafe GNOME"));
g_hash_table_insert (sessnames, GDM_SESSION_FAILSAFE_XTERM, _("Failsafe xterm"));
if (GdmShowGnomeFailsafeSession) {
session = g_new0 (GdmSession, 1);
session->name = g_strdup (_("Failsafe _Gnome"));
session->comment = g_strdup (_("This is a failsafe session that will log you "
"into GNOME. No startup scripts will be read "
"and it is only to be used when you can't log "
"in otherwise. GNOME will use the 'Default' "
"session."));
g_hash_table_insert (sessnames, g_strdup (GDM_SESSION_FAILSAFE_GNOME), session);
}
if (GdmShowXtermFailsafeSession) {
session = g_new0 (GdmSession, 1);
session->name = g_strdup (_("Failsafe _Terminal"));
session->comment = g_strdup (_("This is a failsafe session that will log you "
"into a terminal. No startup scripts will be read "
"and it is only to be used when you can't log "
"in otherwise. To exit the terminal, "
"type 'exit'."));
g_hash_table_insert (sessnames, g_strdup (GDM_SESSION_FAILSAFE_XTERM), session);
}
vec = g_strsplit (GdmSessionDir, ":", -1);
for (i = 0; vec != NULL && vec[i] != NULL; i++) {
......@@ -1465,10 +1478,8 @@ gdm_login_session_init (GtkWidget *menu)
while (dent != NULL) {
VeConfig *cfg;
char *exec;
char *name;
char *comment;
char *s;
char *label;
char *tryexec;
char *ext;
......@@ -1491,7 +1502,9 @@ gdm_login_session_init (GtkWidget *menu)
g_free (s);
if (ve_config_get_bool (cfg, "Desktop Entry/Hidden=false")) {
g_hash_table_insert (sessnames, g_strdup (dent->d_name), "foo");
session = g_new0 (GdmSession, 1);
session->name = "foo";
g_hash_table_insert (sessnames, g_strdup (dent->d_name), session);
ve_config_destroy (cfg);
dent = readdir (sessdir);
continue;
......@@ -1501,7 +1514,10 @@ gdm_login_session_init (GtkWidget *menu)
if ( ! ve_string_empty (tryexec)) {
char *full = g_find_program_in_path (tryexec);
if (full == NULL) {
g_hash_table_insert (sessnames, g_strdup (dent->d_name), "foo");
session = g_new0 (GdmSession, 1);
session->name = "foo";
g_hash_table_insert (sessnames, g_strdup (dent->d_name),
session);
g_free (tryexec);
ve_config_destroy (cfg);
dent = readdir (sessdir);
......@@ -1518,7 +1534,9 @@ gdm_login_session_init (GtkWidget *menu)
ve_config_destroy (cfg);
if G_UNLIKELY (ve_string_empty (exec) || ve_string_empty (name)) {
g_hash_table_insert (sessnames, g_strdup (dent->d_name), "foo");
session = g_new0 (GdmSession, 1);
session->name = "foo";
g_hash_table_insert (sessnames, g_strdup (dent->d_name), session);
g_free (exec);
g_free (name);
g_free (comment);
......@@ -1526,31 +1544,6 @@ gdm_login_session_init (GtkWidget *menu)
continue;
}
if (num < 10)
label = g_strdup_printf ("_%d. %s", num, name);
else
label = g_strdup (name);
num ++;
item = gtk_radio_menu_item_new_with_mnemonic (sessgrp, label);
g_free (label);
g_object_set_data_full (G_OBJECT (item),
SESSION_NAME,
g_strdup (dent->d_name),
(GDestroyNotify) g_free);
if ( ! ve_string_empty (comment))
gtk_tooltips_set_tip
(tooltips, GTK_WIDGET (item), comment, NULL);
sessgrp = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
sessions = g_slist_append (sessions, g_strdup (dent->d_name));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (gdm_login_session_handler),
NULL);
gtk_widget_show (GTK_WIDGET (item));
/* if we found the default session */
if ( ! ve_string_empty (GdmDefaultSession) &&
strcmp (dent->d_name, GdmDefaultSession) == 0) {
......@@ -1575,11 +1568,12 @@ gdm_login_session_init (GtkWidget *menu)
}
g_hash_table_insert (sessnames, g_strdup (dent->d_name), name);
session = g_new0 (GdmSession, 1);
session->name = name;
session->comment = comment;
g_hash_table_insert (sessnames, g_strdup (dent->d_name), session);
g_free (exec);
g_free (comment);
dent = readdir (sessdir);
}
......@@ -1591,66 +1585,75 @@ gdm_login_session_init (GtkWidget *menu)
/* Check that session dir is readable */
if G_UNLIKELY ( ! some_dir_exists) {
syslog (LOG_ERR, _("%s: Session directory %s not found!"), "gdm_login_session_init", ve_sure_string (GdmSessionDir));
syslog (LOG_ERR, _("%s: Session directory %s not found!"),
"gdm_login_session_init", ve_sure_string (GdmSessionDir));
GdmShowXtermFailsafeSession = TRUE;
session_dir_whacked_out = TRUE;
}
if G_UNLIKELY (sessions == NULL) {
if G_UNLIKELY (g_hash_table_size (sessnames) == 0) {
syslog (LOG_WARNING, _("Yikes, nothing found in the session directory."));
session_dir_whacked_out = TRUE;
GdmShowXtermFailsafeSession = TRUE;
defsess = g_strdup (GDM_SESSION_FAILSAFE_GNOME);
}
if (GdmShowGnomeFailsafeSession) {
/* For translators: This is the failsafe login when the user
* can't login otherwise */
item = gtk_radio_menu_item_new_with_mnemonic (sessgrp,
_("Failsafe _GNOME"));
gtk_tooltips_set_tip (tooltips, GTK_WIDGET (item),
_("This is a failsafe session that will log you "
session = g_new0 (GdmSession, 1);
session->name = g_strdup (_("Failsafe _Gnome"));
session->comment = g_strdup (_("This is a failsafe session that will log you "
"into GNOME. No startup scripts will be read "
"and it is only to be used when you can't log "
"in otherwise. GNOME will use the 'Default' "
"session."),
NULL);
g_object_set_data (G_OBJECT (item),
SESSION_NAME, GDM_SESSION_FAILSAFE_GNOME);
sessgrp = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
sessions = g_slist_append (sessions,
g_strdup (GDM_SESSION_FAILSAFE_GNOME));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (gdm_login_session_handler),
NULL);
gtk_widget_show (GTK_WIDGET (item));
"session."));
g_hash_table_insert (sessnames, g_strdup (GDM_SESSION_FAILSAFE_GNOME), session);
}
if (GdmShowXtermFailsafeSession) {
/* For translators: This is the failsafe login when the user
* can't login otherwise */
item = gtk_radio_menu_item_new_with_mnemonic (sessgrp,
_("Failsafe _Terminal"));
gtk_tooltips_set_tip (tooltips, GTK_WIDGET (item),
_("This is a failsafe session that will log you "
session = g_new0 (GdmSession, 1);
session->name = g_strdup (_("Failsafe _Terminal"));
session->comment = g_strdup (_("This is a failsafe session that will log you "
"into a terminal. No startup scripts will be read "
"and it is only to be used when you can't log "
"in otherwise. To exit the terminal, "
"type 'exit'."),
NULL);
g_object_set_data (G_OBJECT (item),
SESSION_NAME, GDM_SESSION_FAILSAFE_XTERM);
"type 'exit'."));
g_hash_table_insert (sessnames, g_strdup (GDM_SESSION_FAILSAFE_XTERM), session);
}
/* Convert to list (which is unsorted) */
g_hash_table_foreach (sessnames, (GHFunc) gdm_session_list_from_hash_table_func, &sessions);
/* Prioritize and sort the list */
sessions = g_list_sort (sessions, (GCompareFunc) gdm_session_sort_func);
for (tmp = sessions; tmp != NULL; tmp = tmp->next) {
GdmSession *session;
char *file;
file = (char *) tmp->data;
session = g_hash_table_lookup (sessnames, file);
if (num < 10 &&
(strcmp (file, GDM_SESSION_FAILSAFE_GNOME) != 0) &&
(strcmp (file, GDM_SESSION_FAILSAFE_XTERM) != 0))
label = g_strdup_printf ("_%d. %s", num, session->name);
else
label = g_strdup (session->name);
num ++;
item = gtk_radio_menu_item_new_with_mnemonic (sessgrp, label);
g_free (label);
g_object_set_data_full (G_OBJECT (item), SESSION_NAME,
g_strdup (file), (GDestroyNotify) g_free);
if ( ! ve_string_empty (session->comment))
gtk_tooltips_set_tip
(tooltips, GTK_WIDGET (item), session->comment, NULL);
sessgrp = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
sessions = g_slist_append (sessions,
g_strdup (GDM_SESSION_FAILSAFE_XTERM));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (gdm_login_session_handler),
NULL);
G_CALLBACK (gdm_login_session_handler), NULL);
gtk_widget_show (GTK_WIDGET (item));
}
......@@ -2151,7 +2154,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
gtk_widget_show (GTK_WIDGET (label));
gtk_entry_set_text (GTK_ENTRY (entry), "");
gtk_entry_set_max_length (GTK_ENTRY (entry), PAM_MAX_RESP_SIZE);
gtk_entry_set_max_length (GTK_ENTRY (entry), PW_ENTRY_SIZE);
gtk_entry_set_visibility (GTK_ENTRY (entry), TRUE);
gtk_widget_set_sensitive (entry, TRUE);
gtk_widget_set_sensitive (ok_button, TRUE);
......@@ -2183,7 +2186,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
gtk_widget_show (GTK_WIDGET (label));
gtk_entry_set_text (GTK_ENTRY (entry), "");
gtk_entry_set_max_length (GTK_ENTRY (entry), PAM_MAX_RESP_SIZE);
gtk_entry_set_max_length (GTK_ENTRY (entry), PW_ENTRY_SIZE);
gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
gtk_widget_set_sensitive (entry, TRUE);
gtk_widget_set_sensitive (ok_button, TRUE);
......@@ -3219,7 +3222,6 @@ gdm_login_gui_init (void)
}
/* this will make the logo always left justified */
/* HERE */
logo_frame = gtk_alignment_new (0, 0.10, 0, 0);
gtk_widget_show (logo_frame);
......@@ -3307,7 +3309,7 @@ gdm_login_gui_init (void)
gtk_entry_set_invisible_char (GTK_ENTRY (entry), 0);
else if (GdmUseCirclesInEntry)
gtk_entry_set_invisible_char (GTK_ENTRY (entry), 0x25cf);
gtk_entry_set_max_length (GTK_ENTRY (entry), 32);
gtk_entry_set_max_length (GTK_ENTRY (entry), PW_ENTRY_SIZE);
gtk_widget_set_size_request (entry, 250, -1);
gtk_widget_ref (entry);
g_object_set_data_full (G_OBJECT (login), "entry", entry,
......
/* GDM - The GNOME Display Manager
* Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
*
* This file Copyright (c) 2003 George Lebl
* - Common routines for the greeters.
*
* 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
*/
#include <vicious.h>
#include "gdm.h"
#include "gdmsession.h"
extern gchar *GdmDefaultSession;
extern GHashTable *sessnames;
/* Note: A lot of the session setup logic is identical in gdmlogin and
gdmgreeter. This is a start at getting the two to use common logic,
but more needs to be done.
*/
gint
gdm_session_sort_func (const char *a, const char *b)
{
/* Put default and GNOME sessions at the top */
if (strcmp (a, ve_sure_string (GdmDefaultSession)) == 0)
return -1;
if (strcmp (b, ve_sure_string (GdmDefaultSession)) == 0)
return 1;
if (strcmp (a, "default.desktop") == 0)
return -1;
if (strcmp (b, "default.desktop") == 0)
return 1;
if (strcmp (a, "gnome.desktop") == 0)
return -1;
if (strcmp (b, "gnome.desktop") == 0)
return 1;
/* put failsafe sessions on the bottom */
if (strcmp (b, GDM_SESSION_FAILSAFE_XTERM) == 0)
return -1;
if (strcmp (a, GDM_SESSION_FAILSAFE_XTERM) == 0)
return 1;
if (strcmp (b, GDM_SESSION_FAILSAFE_GNOME) == 0)
return -1;
if (strcmp (a, GDM_SESSION_FAILSAFE_GNOME) == 0)
return 1;
/* put everything else in the middle in alphabetical order */
return strcmp (a, b);
}
const char *
gdm_session_name (const char *name)
{
GdmSession *session;
/* eek */
if G_UNLIKELY (name == NULL)
return "(null)";
session = g_hash_table_lookup (sessnames, name);
if (session != NULL && !ve_string_empty (session->name))
return session->name;
else
return name;
}
void
gdm_session_list_from_hash_table_func (const char *key, const char *value,
GList **sessions)
{
*sessions = g_list_prepend (*sessions, g_strdup (key));
}
/* GDM - The Gnome Display Manager
* Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
*
* This file Copyright (c) 2003 George Lebl
* - Common routines for the greeters.
*
* 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
*/
#ifndef GDM_SESSION_H
#define GDM_SESSION_H
#include <vicious.h>
#include "misc.h"
typedef struct {
char *name;
char *comment;
} GdmSession;
gint gdm_session_sort_func (const char *a, const char *b);
const char * gdm_session_name (const char *name);
void gdm_session_list_from_hash_table_func (const char *key,
const char *value,
GList **sessions);
#endif /* GDM_SESSION_H */
......@@ -12,9 +12,7 @@ gchar *s = N_("_Remote: ");
gchar *s = N_("_Welcome string: ");
gchar *s = N_("Re_mote welcome string (%n = hostname): ");
gchar *s = N_("String to be shown in the greeter as welcome. You can insert %n in here and it will be replaced by the name of your computer.");
gchar *s = N_("*");
gchar *s = N_("String to be shown in the greeter for people logging in remotely with XDMCP. You can insert %n in here and it will be replaced by the name of your computer.");
gchar *s = N_("*");
gchar *s = N_("Always use 24 hour cloc_k format");
gchar *s = N_("GTK+ Greeter");
gchar *s = N_("Themed Greeter");
......@@ -51,6 +49,9 @@ gchar *s = N_("_Only color on remote displays");
gchar *s = N_("_Background color: ");
gchar *s = N_("Pick a color");
gchar *s = N_("_2 GTK+ Greeter");
gchar *s = N_("_Mode:");
gchar *s = N_("Only One Theme");
gchar *s = N_("Random Theme");
gchar *s = N_("Preview:");
gchar *s = N_("No screenshot available");
gchar *s = N_("Description:");
......@@ -67,14 +68,12 @@ gchar *s = N_("_Show choosable user images (Face Browser)");
gchar *s = N_("_Include All Users");