summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-05-31 18:37:45 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-05-31 18:37:45 +0000
commitb307366d34b02f4c1d21e7afc439ead9063bd7b8 (patch)
treec5a2ab48ca505cc2793f15415dbfa5e37a58c66e
parentcc86c294958923fa28e88452ed6f99246a76aa2c (diff)
downloadgdm-b307366d34b02f4c1d21e7afc439ead9063bd7b8.tar.gz
add config keys for show/disable the sessions that are added in addition
2001-05-30 Havoc Pennington <hp@redhat.com> * daemon/gdm.h: add config keys for show/disable the sessions that are added in addition to those in /etc/X11/gdm/Sessions, so that admins can fully control the session list * config/gdm.conf.in: add abovementioned config keys * gui/gdmlogin.c (gdm_login_parse_config): honor these settings
-rw-r--r--ChangeLog10
-rw-r--r--config/gdm.conf.in3
-rw-r--r--daemon/gdm.h3
-rw-r--r--gui/gdmlogin.c160
4 files changed, 104 insertions, 72 deletions
diff --git a/ChangeLog b/ChangeLog
index 9aed0dfa..497566d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-05-30 Havoc Pennington <hp@redhat.com>
+
+ * daemon/gdm.h: add config keys for show/disable the sessions that
+ are added in addition to those in /etc/X11/gdm/Sessions, so that
+ admins can fully control the session list
+
+ * config/gdm.conf.in: add abovementioned config keys
+
+ * gui/gdmlogin.c (gdm_login_parse_config): honor these settings
+
Thu May 31 03:17:32 2001 George Lebl <jirka@5z.com>
* daemon/gdm.c: set euid/egid to 0 before verify check
diff --git a/config/gdm.conf.in b/config/gdm.conf.in
index 2eb658f5..392853c6 100644
--- a/config/gdm.conf.in
+++ b/config/gdm.conf.in
@@ -84,6 +84,9 @@ BackgroundScaleToFit=true
BackgroundColor=#007777
BackgroundRemoteOnlyColor=true
BackgroundProgram=
+ShowGnomeChooserSession=true
+ShowGnomeFailsafeSession=true
+ShowXtermFailsafeSession=true
[chooser]
DefaultHostImg=@EXPANDED_PIXMAPDIR@/nohost.png
diff --git a/daemon/gdm.h b/daemon/gdm.h
index 18697adb..078fdee2 100644
--- a/daemon/gdm.h
+++ b/daemon/gdm.h
@@ -190,6 +190,9 @@
#define GDM_KEY_SERVERS "servers"
+#define GDM_KEY_SHOW_GNOME_CHOOSER "greeter/ShowGnomeChooserSession=true"
+#define GDM_KEY_SHOW_GNOME_FAILSAFE "greeter/ShowGnomeFailsafeSession=true"
+#define GDM_KEY_SHOW_XTERM_FAILSAFE "greeter/ShowXtermFailsafeSession=true"
#define GDM_SESSION_FAILSAFE_GNOME "GDM_Failsafe.GNOME"
#define GDM_SESSION_FAILSAFE_XTERM "GDM_Failsafe.XTERM"
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
index 99045a80..5ac0d860 100644
--- a/gui/gdmlogin.c
+++ b/gui/gdmlogin.c
@@ -111,6 +111,10 @@ static gint GdmPositionX;
static gint GdmPositionY;
static gboolean GdmTitleBar;
+static gboolean GdmShowGnomeChooserSession;
+static gboolean GdmShowGnomeFailsafeSession;
+static gboolean GdmShowXtermFailsafeSession;
+
static GtkWidget *login;
static GtkWidget *label;
static GtkWidget *clock_label = NULL;
@@ -128,6 +132,8 @@ static GtkTooltips *tooltips;
static gboolean login_is_local = FALSE;
static gboolean used_defaults = FALSE;
+
+
GdkRectangle screen; /* this is an extern since it's used in gdmwm as well */
static GnomeIconList *browser;
@@ -766,6 +772,10 @@ gdm_login_parse_config (void)
GdmPositionX = gnome_config_get_int (GDM_KEY_POSITIONX);
GdmPositionY = gnome_config_get_int (GDM_KEY_POSITIONY);
+ GdmShowXtermFailsafeSession = gnome_config_get_bool (GDM_KEY_SHOW_XTERM_FAILSAFE);
+ GdmShowGnomeFailsafeSession = gnome_config_get_bool (GDM_KEY_SHOW_GNOME_FAILSAFE);
+ GdmShowGnomeChooserSession = gnome_config_get_bool (GDM_KEY_SHOW_GNOME_CHOOSER);
+
GdmTimedLoginEnable = gnome_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE);
if (GdmTimedLoginEnable) {
GdmTimedLogin = gnome_config_get_string (GDM_KEY_TIMED_LOGIN);
@@ -1280,33 +1290,35 @@ gdm_login_session_init (GtkWidget *menu)
"GNOME, into your current session."),
NULL);
- /* Add the chooser session, this one doesn't have a
- * script really, it's a fake, it runs the Gnome
- * script */
- /* For translators: This is the login that lets
- * users choose the specific gnome session they
- * want to use */
- item = gtk_radio_menu_item_new_with_label
- (sessgrp, _("Gnome Chooser"));
- gtk_tooltips_set_tip
- (tooltips, GTK_WIDGET (item),
- _("This session will log you into "
- "GNOME and it will let you choose which "
- "one of the GNOME sessions you want to "
- "use."),
- NULL);
- gtk_object_set_data (GTK_OBJECT (item),
- SESSION_NAME,
- GDM_SESSION_GNOME_CHOOSER);
-
- sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
- sessions = g_slist_append (sessions,
- g_strdup (GDM_SESSION_GNOME_CHOOSER));
- gtk_menu_append (GTK_MENU (menu), item);
- gtk_signal_connect (GTK_OBJECT (item), "activate",
- GTK_SIGNAL_FUNC (gdm_login_session_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
+ if (GdmShowGnomeChooserSession) {
+ /* Add the chooser session, this one doesn't have a
+ * script really, it's a fake, it runs the Gnome
+ * script */
+ /* For translators: This is the login that lets
+ * users choose the specific gnome session they
+ * want to use */
+ item = gtk_radio_menu_item_new_with_label
+ (sessgrp, _("Gnome Chooser"));
+ gtk_tooltips_set_tip
+ (tooltips, GTK_WIDGET (item),
+ _("This session will log you into "
+ "GNOME and it will let you choose which "
+ "one of the GNOME sessions you want to "
+ "use."),
+ NULL);
+ gtk_object_set_data (GTK_OBJECT (item),
+ SESSION_NAME,
+ GDM_SESSION_GNOME_CHOOSER);
+
+ sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ sessions = g_slist_append (sessions,
+ g_strdup (GDM_SESSION_GNOME_CHOOSER));
+ gtk_menu_append (GTK_MENU (menu), item);
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ GTK_SIGNAL_FUNC (gdm_login_session_handler),
+ NULL);
+ gtk_widget_show (GTK_WIDGET (item));
+ }
}
}
@@ -1330,52 +1342,56 @@ gdm_login_session_init (GtkWidget *menu)
defsess = g_strdup (GDM_SESSION_FAILSAFE_GNOME);
}
- /* For translators: This is the failsafe login when the user
- * can't login otherwise */
- item = gtk_radio_menu_item_new_with_label (sessgrp,
- _("Failsafe Gnome"));
- gtk_tooltips_set_tip (tooltips, GTK_WIDGET (item),
- _("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);
- gtk_object_set_data (GTK_OBJECT (item),
- SESSION_NAME, GDM_SESSION_FAILSAFE_GNOME);
-
- sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
- sessions = g_slist_append (sessions,
- g_strdup (GDM_SESSION_FAILSAFE_GNOME));
- gtk_menu_append (GTK_MENU (menu), item);
- gtk_signal_connect (GTK_OBJECT (item), "activate",
- GTK_SIGNAL_FUNC (gdm_login_session_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
-
- /* For translators: This is the failsafe login when the user
- * can't login otherwise */
- item = gtk_radio_menu_item_new_with_label (sessgrp,
- _("Failsafe xterm"));
- gtk_tooltips_set_tip (tooltips, GTK_WIDGET (item),
- _("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);
- gtk_object_set_data (GTK_OBJECT (item),
- SESSION_NAME, GDM_SESSION_FAILSAFE_XTERM);
-
- sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
- sessions = g_slist_append (sessions,
- g_strdup (GDM_SESSION_FAILSAFE_XTERM));
- gtk_menu_append (GTK_MENU (menu), item);
- gtk_signal_connect (GTK_OBJECT (item), "activate",
- GTK_SIGNAL_FUNC (gdm_login_session_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
+ if (GdmShowGnomeFailsafeSession) {
+ /* For translators: This is the failsafe login when the user
+ * can't login otherwise */
+ item = gtk_radio_menu_item_new_with_label (sessgrp,
+ _("Failsafe Gnome"));
+ gtk_tooltips_set_tip (tooltips, GTK_WIDGET (item),
+ _("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);
+ gtk_object_set_data (GTK_OBJECT (item),
+ SESSION_NAME, GDM_SESSION_FAILSAFE_GNOME);
+
+ sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ sessions = g_slist_append (sessions,
+ g_strdup (GDM_SESSION_FAILSAFE_GNOME));
+ gtk_menu_append (GTK_MENU (menu), item);
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ GTK_SIGNAL_FUNC (gdm_login_session_handler),
+ NULL);
+ gtk_widget_show (GTK_WIDGET (item));
+ }
+ if (GdmShowXtermFailsafeSession) {
+ /* For translators: This is the failsafe login when the user
+ * can't login otherwise */
+ item = gtk_radio_menu_item_new_with_label (sessgrp,
+ _("Failsafe xterm"));
+ gtk_tooltips_set_tip (tooltips, GTK_WIDGET (item),
+ _("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);
+ gtk_object_set_data (GTK_OBJECT (item),
+ SESSION_NAME, GDM_SESSION_FAILSAFE_XTERM);
+
+ sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ sessions = g_slist_append (sessions,
+ g_strdup (GDM_SESSION_FAILSAFE_XTERM));
+ gtk_menu_append (GTK_MENU (menu), item);
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ GTK_SIGNAL_FUNC (gdm_login_session_handler),
+ NULL);
+ gtk_widget_show (GTK_WIDGET (item));
+ }
+
if (defsess == NULL) {
defsess = g_strdup (GDM_SESSION_FAILSAFE_GNOME);
syslog (LOG_WARNING, _("No default session link found. Using Failsafe GNOME.\n"));