summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2003-05-30 00:40:07 +0000
committerGeorge Lebl <jirka@src.gnome.org>2003-05-30 00:40:07 +0000
commitdcde0c5be1a7946846a98de7793d603d25a650eb (patch)
treec300a87c1e8126e83d91b5f1a912bfea77d0059e /gui
parent14092ec6c44ce101a606f61ffa0cf822dd7758af (diff)
downloadgdm-dcde0c5be1a7946846a98de7793d603d25a650eb.tar.gz
update the default config for the new chooser server flag by adding
Thu May 29 17:38:56 2003 George Lebl <jirka@5z.com> * config/gdm.conf.in: update the default config for the new chooser server flag by adding another example server setup and add ChooserButton key. Also use @X_SERVER@ for the terminal server setup * daemon/display.c, daemon/gdm.[ch], daemon/server.[ch], daemon/slave.c: Add a server "chooser=true" flag which will make the daemon run a chooser instead of a greeter. Also if the greeter returns with a DISPLAY_RUN_CHOOSER, then run the chooser for one session. Also add notification stuff for the ChooserButton option. Note that this doesn't need XDMCP to be running locally. * daemon/slave.c: if the chooser is closed exit with DISPLAY_REMANAGE * gui/gdmsetup.(c|glade): add the ChooserButton key * gui/gdmlogin.c, gui/greeter/greeter.c, gui/greeter/greeter_configuration.h, gui/greeter/greeter_item.c, gui/greeter/greeter_parser.c, gui/greeter/greeter_system.c: Add the "Run XDMCP chooser" button to the system menus here, and allow a chooser button in the greeter. * gui/greeter/greeter_system.c: Fix the second SUSPEND exit status usage to the suspend interrupt. Add toolips to the system menu radiobuttons (damnit these should not be radiobuttons! but I'm too lazy to change that now), also add mnemonics here
Diffstat (limited to 'gui')
-rw-r--r--gui/gdmlogin.c30
-rw-r--r--gui/gdmsetup-strings.c2
-rw-r--r--gui/gdmsetup.c3
-rw-r--r--gui/gdmsetup.glade21
-rw-r--r--gui/greeter/greeter.c8
-rw-r--r--gui/greeter/greeter_configuration.h1
-rw-r--r--gui/greeter/greeter_item.c7
-rw-r--r--gui/greeter/greeter_parser.c5
-rw-r--r--gui/greeter/greeter_system.c86
9 files changed, 135 insertions, 28 deletions
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
index a7b9500e..f7af1b01 100644
--- a/gui/gdmlogin.c
+++ b/gui/gdmlogin.c
@@ -90,6 +90,8 @@ static gint GdmIconMaxWidth;
static gboolean GdmQuiver;
static gboolean GdmSystemMenu;
static gboolean GdmSystemMenuReal;
+static gboolean GdmChooserButton;
+static gboolean GdmChooserButtonReal;
static gchar *GdmHalt;
static gchar *GdmReboot;
static gchar *GdmSuspend;
@@ -821,6 +823,15 @@ gdm_login_halt_handler (void)
}
static void
+gdm_login_use_chooser_handler (void)
+{
+ closelog();
+
+ kill_thingies ();
+ _exit (DISPLAY_RUN_CHOOSER);
+}
+
+static void
gdm_login_suspend_handler (void)
{
if (gdm_login_query (_("Are you sure you want to suspend the machine?"))) {
@@ -857,6 +868,7 @@ gdm_login_parse_config (void)
}
GdmQuiver = ve_config_get_bool (config, GDM_KEY_QUIVER);
GdmSystemMenuReal = GdmSystemMenu = ve_config_get_bool (config, GDM_KEY_SYSMENU);
+ GdmChooserButtonReal = GdmChooserButton = ve_config_get_bool (config, GDM_KEY_CHOOSER_BUTTON);
GdmHalt = ve_config_get_string (config, GDM_KEY_HALT);
GdmReboot = ve_config_get_string (config, GDM_KEY_REBOOT);
GdmSuspend = ve_config_get_string (config, GDM_KEY_SUSPEND);
@@ -932,6 +944,7 @@ gdm_login_parse_config (void)
if (ve_string_empty (g_getenv ("GDM_IS_LOCAL"))) {
GdmSystemMenuReal = FALSE;
GdmConfigAvailableReal = FALSE;
+ GdmChooserButtonReal = FALSE;
if (GdmBackgroundRemoteOnlyColor &&
GdmBackgroundType == GDM_BACKGROUND_IMAGE)
GdmBackgroundType = GDM_BACKGROUND_COLOR;
@@ -3013,6 +3026,22 @@ gdm_login_gui_init (void)
gboolean got_anything = FALSE;
menu = gtk_menu_new();
+
+ if (GdmChooserButtonReal) {
+ item = gtk_menu_item_new_with_mnemonic (_("Run _XDMCP Chooser"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ g_signal_connect (G_OBJECT (item), "activate",
+ G_CALLBACK (gdm_login_use_chooser_handler),
+ NULL);
+ gtk_widget_show (item);
+ gtk_tooltips_set_tip (tooltips, GTK_WIDGET (item),
+ _("Run an XDMCP chooser which will allow "
+ "you to log into available remote "
+ "machines, if there are any."),
+ NULL);
+ got_anything = TRUE;
+ }
+
if (GdmConfigAvailableReal &&
bin_exists (GdmConfigurator)) {
item = gtk_menu_item_new_with_mnemonic (_("_Configure the login manager..."));
@@ -3909,6 +3938,7 @@ gdm_reread_config (int sig, gpointer data)
! bool_same (config, GdmSystemMenu, GDM_KEY_SYSMENU) ||
! bool_same (config, GdmBrowser, GDM_KEY_BROWSER) ||
! bool_same (config, GdmConfigAvailable, GDM_KEY_CONFIG_AVAILABLE) ||
+ ! bool_same (config, GdmChooserButton, GDM_KEY_CHOOSER_BUTTON) ||
! bool_same (config, GdmTimedLoginEnable, GDM_KEY_TIMED_LOGIN_ENABLE)) {
/* Set busy cursor */
setup_cursor (GDK_WATCH);
diff --git a/gui/gdmsetup-strings.c b/gui/gdmsetup-strings.c
index bccb5206..f783842c 100644
--- a/gui/gdmsetup-strings.c
+++ b/gui/gdmsetup-strings.c
@@ -55,8 +55,10 @@ gchar *s = N_("Graphical greeter");
gchar *s = N_("Allow _root to login with GDM");
gchar *s = N_("Allow root to login r_emotely with GDM");
gchar *s = N_("Allow remote _timed logins");
+gchar *s = N_("Show the system menu. If not set, none of the system commands will be available (this includes reboot, shutdown, configure, chooser)");
gchar *s = N_("Show _system menu");
gchar *s = N_("Allow c_onfiguration from the login screen");
+gchar *s = N_("Allo_w running XDMCP chooser from the login screen");
gchar *s = N_("Always disallow TCP connections to _X server");
gchar *s = N_("Retry _delay (seconds) :");
gchar *s = N_("Options");
diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c
index 60b1d4e6..34371d71 100644
--- a/gui/gdmsetup.c
+++ b/gui/gdmsetup.c
@@ -1958,6 +1958,9 @@ setup_gui (void)
setup_notify_toggle ("config_available",
GDM_KEY_CONFIG_AVAILABLE,
GDM_KEY_CONFIG_AVAILABLE /* notify_key */);
+ setup_notify_toggle ("chooser_button",
+ GDM_KEY_CHOOSER_BUTTON,
+ GDM_KEY_CHOOSER_BUTTON /* notify_key */);
setup_notify_toggle ("disallow_tcp",
GDM_KEY_DISALLOWTCP,
GDM_KEY_DISALLOWTCP /* notify_key */);
diff --git a/gui/gdmsetup.glade b/gui/gdmsetup.glade
index 3a67961a..13dc3d53 100644
--- a/gui/gdmsetup.glade
+++ b/gui/gdmsetup.glade
@@ -333,8 +333,8 @@
<property name="ypad">0</property>
<property name="mnemonic_widget">autologin_entry</property>
<accessibility>
- <atkrelation target="autologin_entry" type="label-for"/>
<atkrelation target="autologin_combo" type="label-for"/>
+ <atkrelation target="autologin_entry" type="label-for"/>
</accessibility>
</widget>
<packing>
@@ -1551,6 +1551,7 @@ widget</property>
<child>
<widget class="GtkCheckButton" id="sysmenu">
<property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Show the system menu. If not set, none of the system commands will be available (this includes reboot, shutdown, configure, chooser)</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Show _system menu</property>
<property name="use_underline">True</property>
@@ -1585,6 +1586,24 @@ widget</property>
</child>
<child>
+ <widget class="GtkCheckButton" id="chooser_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Allo_w running XDMCP chooser from the login screen</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
<widget class="GtkCheckButton" id="disallow_tcp">
<property name="visible">True</property>
<property name="can_focus">True</property>
diff --git a/gui/greeter/greeter.c b/gui/greeter/greeter.c
index d0fbb6d6..1e43fa19 100644
--- a/gui/greeter/greeter.c
+++ b/gui/greeter/greeter.c
@@ -50,6 +50,7 @@ gchar *GdmSuspend = NULL;
gchar *GdmConfigurator = NULL;
gboolean GdmSystemMenu = TRUE;
gboolean GdmConfigAvailable = TRUE;
+gboolean GdmChooserButton = TRUE;
gboolean GdmTimedLoginEnable;
gboolean GdmUse24Clock;
gchar *GdmGlobalFaceDir;
@@ -111,6 +112,7 @@ greeter_parse_config (void)
GdmLocaleFile = ve_config_get_string (config, GDM_KEY_LOCFILE);
GdmSystemMenu = ve_config_get_bool (config, GDM_KEY_SYSMENU);
GdmConfigAvailable = ve_config_get_bool (config, GDM_KEY_CONFIG_AVAILABLE);
+ GdmChooserButton = ve_config_get_bool (config, GDM_KEY_CHOOSER_BUTTON);
GdmHalt = ve_config_get_string (config, GDM_KEY_HALT);
GdmReboot = ve_config_get_string (config, GDM_KEY_REBOOT);
GdmSuspend = ve_config_get_string (config, GDM_KEY_SUSPEND);
@@ -890,6 +892,12 @@ greeter_reread_config (int sig, gpointer data)
GdmConfigurator,
GDM_KEY_CONFIGURATOR) ||
! bool_same (config,
+ GdmConfigAvailable,
+ GDM_KEY_CONFIG_AVAILABLE) ||
+ ! bool_same (config,
+ GdmChooserButton,
+ GDM_KEY_CHOOSER_BUTTON) ||
+ ! bool_same (config,
GdmTimedLoginEnable,
GDM_KEY_TIMED_LOGIN_ENABLE) ||
! int_same (config,
diff --git a/gui/greeter/greeter_configuration.h b/gui/greeter/greeter_configuration.h
index 85ca2ae2..f35e2e6c 100644
--- a/gui/greeter/greeter_configuration.h
+++ b/gui/greeter/greeter_configuration.h
@@ -8,6 +8,7 @@ extern gboolean GdmShowXtermFailsafeSession;
extern gboolean GdmShowLastSession;
extern gboolean GdmSystemMenu;
extern gboolean GdmConfigAvailable;
+extern gboolean GdmChooserButton;
extern gchar *GdmHalt;
extern gchar *GdmReboot;
extern gchar *GdmSuspend;
diff --git a/gui/greeter/greeter_item.c b/gui/greeter/greeter_item.c
index fc413df9..ad30d431 100644
--- a/gui/greeter/greeter_item.c
+++ b/gui/greeter/greeter_item.c
@@ -216,11 +216,16 @@ greeter_item_is_visible (GreeterItemInfo *info)
! (info->show_modes & GREETER_ITEM_SHOW_REMOTE))
return FALSE;
- if ( ! GdmConfigAvailable &&
+ if (( ! GdmConfigAvailable || ! GdmSystemMenu) &&
info->show_type != NULL &&
strcmp (info->show_type, "config") == 0)
return FALSE;
+ if (( ! GdmChooserButton || ! GdmSystemMenu) &&
+ info->show_type != NULL &&
+ strcmp (info->show_type, "chooser") == 0)
+ return FALSE;
+
if ( ! GdmSystemMenu &&
info->show_type != NULL &&
strcmp (info->show_type, "system") == 0)
diff --git a/gui/greeter/greeter_parser.c b/gui/greeter/greeter_parser.c
index b85e6d74..e73435cc 100644
--- a/gui/greeter/greeter_parser.c
+++ b/gui/greeter/greeter_parser.c
@@ -937,6 +937,11 @@ parse_stock (xmlNodePtr node,
g_free (*translated_text);
*translated_text = g_strdup (_("_Quit"));
}
+ else if (g_ascii_strcasecmp (prop, "chooser") == 0)
+ {
+ g_free (*translated_text);
+ *translated_text = g_strdup (_("_XDMCP Chooser"));
+ }
else if (g_ascii_strcasecmp (prop, "caps-lock-warning") == 0)
{
g_free (*translated_text);
diff --git a/gui/greeter/greeter_system.c b/gui/greeter/greeter_system.c
index 262db9b9..9f299dd2 100644
--- a/gui/greeter/greeter_system.c
+++ b/gui/greeter/greeter_system.c
@@ -80,32 +80,23 @@ query_greeter_suspend_handler (void)
static void
greeter_reboot_handler (void)
{
- /*if (greeter_query (_("Are you sure you want to reboot the machine?"))) {*/
- closelog();
-
- _exit (DISPLAY_REBOOT);
- /*}*/
+ closelog();
+ _exit (DISPLAY_REBOOT);
}
static void
greeter_halt_handler (void)
{
- /* if (greeter_query (_("Are you sure you want to shut down the machine?"))) { */
- closelog();
-
- _exit (DISPLAY_HALT);
- /* } */
+ closelog();
+ _exit (DISPLAY_HALT);
}
static void
greeter_suspend_handler (void)
{
- /* if (greeter_query (_("Are you sure you want to suspend the machine?"))) { */
- closelog();
-
- _exit (DISPLAY_SUSPEND);
- /* } */
+ printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_SUSPEND);
+ fflush (stdout);
}
static void
@@ -125,6 +116,13 @@ greeter_config_handler (void)
fflush (stdout);
}
+static void
+greeter_chooser_handler (void)
+{
+ closelog();
+ _exit (DISPLAY_RUN_CHOOSER);
+}
+
static void
greeter_system_handler (GreeterItemInfo *info,
@@ -136,47 +134,74 @@ greeter_system_handler (GreeterItemInfo *info,
GtkWidget *suspend_radio = NULL;
GtkWidget *reboot_radio = NULL;
GtkWidget *config_radio = NULL;
+ GtkWidget *chooser_radio = NULL;
int ret;
GSList *radio_group = NULL;
+ static GtkTooltips *tooltips = NULL;
/* should never be allowed by the UI */
if ( ! GdmSystemMenu)
return;
dialog = gtk_dialog_new ();
+ if (tooltips == NULL)
+ tooltips = gtk_tooltips_new ();
if (working_command_exists (GdmHalt)) {
- halt_radio = gtk_radio_button_new_with_mnemonic (NULL,
- _("Shut down the computer"));
+ 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,
+ _("Shut _down the computer"));
group_radio = halt_radio;
+ gtk_tooltips_set_tip (tooltips, GTK_WIDGET (halt_radio),
+ _("Shut down your computer so that "
+ "you may turn it off."),
+ NULL);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
halt_radio,
FALSE, FALSE, 4);
gtk_widget_show (halt_radio);
}
+ if (working_command_exists (GdmReboot)) {
+ 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,
+ _("_Reboot the computer"));
+ group_radio = reboot_radio;
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ reboot_radio,
+ FALSE, FALSE, 4);
+ gtk_widget_show (reboot_radio);
+ }
+
if (working_command_exists (GdmSuspend)) {
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,
- _("Suspend the computer"));
+ _("Sus_pend the computer"));
group_radio = suspend_radio;
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
suspend_radio,
FALSE, FALSE, 4);
gtk_widget_show (suspend_radio);
}
-
- if (working_command_exists (GdmReboot)) {
+
+ if (GdmChooserButton) {
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,
- _("Reboot the computer"));
- group_radio = reboot_radio;
+ chooser_radio = gtk_radio_button_new_with_mnemonic (radio_group,
+ _("Run _XDMCP chooser"));
+ group_radio = chooser_radio;
+ gtk_tooltips_set_tip (tooltips, GTK_WIDGET (chooser_radio),
+ _("Run an XDMCP chooser which will allow "
+ "you to log into available remote "
+ "machines, if there are any."),
+ NULL);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- reboot_radio,
+ chooser_radio,
FALSE, FALSE, 4);
- gtk_widget_show (reboot_radio);
+ gtk_widget_show (chooser_radio);
}
if (GdmConfigAvailable &&
@@ -184,8 +209,12 @@ 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"));
+ _("_Configure the login manager"));
group_radio = config_radio;
+ gtk_tooltips_set_tip (tooltips, GTK_WIDGET (config_radio),
+ _("Configure GDM (this login manager). "
+ "This will require the root password."),
+ NULL);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
config_radio,
FALSE, FALSE, 4);
@@ -224,6 +253,8 @@ greeter_system_handler (GreeterItemInfo *info,
greeter_suspend_handler ();
else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (config_radio)))
greeter_config_handler ();
+ else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chooser_radio)))
+ greeter_chooser_handler ();
gtk_widget_destroy (dialog);
}
@@ -247,4 +278,7 @@ greeter_item_system_setup (void)
greeter_item_register_action_callback ("config_button",
(ActionFunc)greeter_config_handler,
NULL);
+ greeter_item_register_action_callback ("chooser_button",
+ (ActionFunc)greeter_chooser_handler,
+ NULL);
}