summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2001-06-29 01:48:18 +0000
committerGeorge Lebl <jirka@src.gnome.org>2001-06-29 01:48:18 +0000
commitc92c15d34926ae918448dd1a87c5979d7520bec1 (patch)
treeac040c6e495be86d7a9d133ff8e85de88ecd6480 /gui
parent6700848d9a786e7888462b29ec75bc07cd83ddae (diff)
downloadgdm-c92c15d34926ae918448dd1a87c5979d7520bec1.tar.gz
Add two keys Broadcast and Hosts to the chooser configuration to allow
Thu Jun 28 18:48:56 2001 George Lebl <jirka@5z.com> * config/gdm.conf.in, gui/gdmconfig.(c|glade), gui/gdmchooser.c: Add two keys Broadcast and Hosts to the chooser configuration to allow more fine grained control as to what appears in the chooser. And to allow listing of hosts not reachable by broadcast. * doc/C/gdm.sgml: add docs for the above two keys * daemon/choose.c, daemon/gdm.[ch], daemon/slave.c, daemon/xdmcp.c: Fix a race with the daemon not getting the chooesr response in time. Also move the chooser page from system setup to expert * daemon/xdmcp.c: get all local interface addresses and use those for forward query in case we see only loopback as our address. This is useful if you do an indirect query to the local host and choose a remote server. xdm screws this case up, so we have one up on xdm here. * daemon/gdmlogin.c, daemon/gdmchooser.c, daemon/gdmwm.c: Fix some gdmwm issues. In the browser window allow Ctrl-F after selecting a face to finger that user and display the result, useful to check if you have new mail or whatnot. Also strip excluded users before checking to allow spaces in the Exclude list.
Diffstat (limited to 'gui')
-rw-r--r--gui/gdmchooser.c56
-rw-r--r--gui/gdmconfig-strings.c17
-rw-r--r--gui/gdmconfig.c4
-rw-r--r--gui/gdmconfig.glade528
-rw-r--r--gui/gdmlogin.c115
-rw-r--r--gui/gdmwm.c2
6 files changed, 458 insertions, 264 deletions
diff --git a/gui/gdmchooser.c b/gui/gdmchooser.c
index 83a2774a..ac6f3c45 100644
--- a/gui/gdmchooser.c
+++ b/gui/gdmchooser.c
@@ -68,10 +68,10 @@ static GdmChooserHost *gdm_chooser_host_alloc (const char *hostname, const char
static void gdm_chooser_decode_packet (void);
static void gdm_chooser_abort (const gchar *format, ...);
static void gdm_chooser_browser_update (void);
-static void gdm_chooser_xdmcp_init (const char **hosts);
+static void gdm_chooser_xdmcp_init (char **hosts);
static void gdm_chooser_host_dispose (GdmChooserHost *host);
static void gdm_chooser_choose_host (const gchar *hostname);
-static void gdm_chooser_add_hosts (const char **hosts);
+static void gdm_chooser_add_hosts (char **hosts);
static guint scan_time_handler = 0;
@@ -104,6 +104,8 @@ static gint GdmScanTime;
static gchar *GdmHostIconDir;
static gchar *GdmHostDefaultIcon;
static gchar *GdmGtkRC;
+static gchar *GdmHosts;
+static gboolean GdmBroadcast;
static GladeXML *chooser_app;
static GtkWidget *chooser, *manage, *rescan, *cancel;
@@ -308,7 +310,7 @@ gdm_chooser_xdmcp_discover (void)
static void
-gdm_chooser_xdmcp_init (const char **hosts)
+gdm_chooser_xdmcp_init (char **hosts)
{
static XdmcpHeader header;
gint sockopts = 1;
@@ -411,6 +413,21 @@ gdm_chooser_parse_config (void)
GdmIconMaxHeight = gnome_config_get_int (GDM_KEY_ICONHEIGHT);
GdmDebug = gnome_config_get_bool (GDM_KEY_DEBUG);
+ /* note that command line arguments will prevail over these */
+ GdmHosts = gnome_config_get_string (GDM_KEY_HOSTS);
+ GdmBroadcast = gnome_config_get_bool (GDM_KEY_BROADCAST);
+ /* if broadcasting, then append BROADCAST to hosts */
+ if (GdmBroadcast) {
+ if (gdm_string_empty (GdmHosts)) {
+ g_free (GdmHosts);
+ GdmHosts = "BROADCAST";
+ } else {
+ char *tmp = g_strconcat (GdmHosts, ",BROADCAST", NULL);
+ g_free (GdmHosts);
+ GdmHosts = tmp;
+ }
+ }
+
if (GdmScanTime < 1) GdmScanTime = 1;
if (GdmIconMaxWidth < 0) GdmIconMaxWidth = 128;
if (GdmIconMaxHeight < 0) GdmIconMaxHeight = 128;
@@ -784,7 +801,7 @@ gdm_chooser_choose_host (const char *hostname)
}
static void
-gdm_chooser_add_hosts (const char **hosts)
+gdm_chooser_add_hosts (char **hosts)
{
struct hostent *hostent;
struct sockaddr_in qa;
@@ -827,7 +844,7 @@ main (int argc, char *argv[])
{
char **fixedargv;
int fixedargc, i;
- const char **hosts;
+ char **hosts;
poptContext ctx;
const char *gdm_version;
@@ -888,22 +905,29 @@ main (int argc, char *argv[])
gdm_chooser_gui_init();
gdm_chooser_signals_init();
- hosts = poptGetArgs (ctx);
+ hosts = (char **)poptGetArgs (ctx);
+ /* when no hosts on the command line, take them from the config */
+ if (hosts == NULL ||
+ hosts[0] == NULL) {
+ int i;
+ hosts = g_strsplit (GdmHosts, ",", -1);
+ for (i = 0; hosts != NULL && hosts[i] != NULL; i++) {
+ g_strstrip (hosts[i]);
+ }
+ }
gdm_chooser_xdmcp_init (hosts);
poptFreeContext (ctx);
gtk_widget_show_now (chooser);
- if ( ! DOING_GDM_DEVELOPMENT) {
- /* can it ever happen that it'd be NULL here ??? */
- if (chooser->window != NULL) {
- gdm_wm_init (GDK_WINDOW_XWINDOW (chooser->window));
-
- /* Run the focus, note that this will work no matter what
- * since gdm_wm_init will set the display to the gdk one
- * if it fails */
- gdm_wm_focus_window (GDK_WINDOW_XWINDOW (chooser->window));
- }
+ /* can it ever happen that it'd be NULL here ??? */
+ if (chooser->window != NULL) {
+ gdm_wm_init (GDK_WINDOW_XWINDOW (chooser->window));
+
+ /* Run the focus, note that this will work no matter what
+ * since gdm_wm_init will set the display to the gdk one
+ * if it fails */
+ gdm_wm_focus_window (GDK_WINDOW_XWINDOW (chooser->window));
}
gtk_main();
diff --git a/gui/gdmconfig-strings.c b/gui/gdmconfig-strings.c
index 7928ed79..69f5e1b6 100644
--- a/gui/gdmconfig-strings.c
+++ b/gui/gdmconfig-strings.c
@@ -208,6 +208,17 @@ gchar *s = N_("The exact script details of a session\n"
"one from the list on the left.\n"
"");
gchar *s = N_("Login sessions");
+gchar *s = N_("Appearance");
+gchar *s = N_("Directory for host images: ");
+gchar *s = N_("Default host image:");
+gchar *s = N_("Refresh");
+gchar *s = N_("Scan every 'x' seconds: ");
+gchar *s = N_("Hosts");
+gchar *s = N_("Send a query to the local network and list all servers that respond");
+gchar *s = N_("Broadcast query");
+gchar *s = N_("Hosts to list: ");
+gchar *s = N_("Comma separated list of hostnames to list in the chooser (in addition to the broadcast above)");
+gchar *s = N_("Chooser");
gchar *s = N_("Debugging");
gchar *s = N_("Enable debugging output to be printed into the syslog. Useful for tracking down problems. But not so useful for normal usage as it can fill up your logs very quickly.");
gchar *s = N_("Enable debugging output");
@@ -236,12 +247,6 @@ gchar *s = N_("Localization");
gchar *s = N_("Select a file containing Locale information");
gchar *s = N_("Locale file: ");
gchar *s = N_("Environment");
-gchar *s = N_("Appearance");
-gchar *s = N_("Directory for host images: ");
-gchar *s = N_("Default host image:");
-gchar *s = N_("Refresh");
-gchar *s = N_("Scan every 'x' seconds: ");
-gchar *s = N_("Chooser");
gchar *s = N_("(C) 2001 Lee Mallabone");
gchar *s = N_("Configure the GNOME Display Manager.\n"
"Please submit any bugs or feature requests at http://bugzilla.gnome.org under the `gdm' product.");
diff --git a/gui/gdmconfig.c b/gui/gdmconfig.c
index 8b9e7d88..b6d74525 100644
--- a/gui/gdmconfig.c
+++ b/gui/gdmconfig.c
@@ -682,6 +682,8 @@ gdm_config_parse_most (gboolean factory)
gdm_entry_set("host_images_dir", gnome_config_get_string (GDM_KEY_HOSTDIR));
gdm_entry_set("default_host_image_file", gnome_config_get_string (GDM_KEY_HOST));
gdm_spin_set("refresh_interval", gnome_config_get_int(GDM_KEY_SCAN));
+ gdm_entry_set("chooser_hosts", gnome_config_get_string (GDM_KEY_HOSTS));
+ gdm_toggle_set("chooser_broadcast", gnome_config_get_bool (GDM_KEY_BROADCAST));
gdm_toggle_set("enable_debug", gnome_config_get_bool(GDM_KEY_DEBUG));
@@ -1092,6 +1094,8 @@ write_config (void)
gdm_entry_write("host_images_dir", GDM_KEY_HOSTDIR);
gdm_entry_write("default_host_image_file", GDM_KEY_HOST);
gdm_spin_write("refresh_interval", GDM_KEY_SCAN);
+ gdm_entry_write("chooser_hosts", GDM_KEY_HOSTS);
+ gdm_toggle_write("chooser_broadcast", GDM_KEY_BROADCAST);
gdm_toggle_write("enable_debug", GDM_KEY_DEBUG);
diff --git a/gui/gdmconfig.glade b/gui/gdmconfig.glade
index b4126da3..74a022cd 100644
--- a/gui/gdmconfig.glade
+++ b/gui/gdmconfig.glade
@@ -4675,6 +4675,311 @@ one from the list on the left.
<widget>
<class>GtkVBox</class>
+ <name>vbox4</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame6</name>
+ <border_width>3</border_width>
+ <label>Appearance</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox5</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox3</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label11</name>
+ <label>Directory for host images: </label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeFileEntry</class>
+ <name>fileentry1</name>
+ <history_id>host_images_dir</history_id>
+ <max_saved>10</max_saved>
+ <directory>True</directory>
+ <modal>True</modal>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GnomeEntry:entry</child_name>
+ <name>host_images_dir</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>changed</name>
+ <handler>can_apply_now</handler>
+ <last_modification_time>Tue, 21 Mar 2000 21:38:21 GMT</last_modification_time>
+ </signal>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label12</name>
+ <label>Default host image:</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomePixmapEntry</class>
+ <name>default_host_image_pentry</name>
+ <width>351</width>
+ <preview>True</preview>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GnomeFileEntry</class>
+ <child_name>GnomePixmapEntry:file-entry</child_name>
+ <name>entry1</name>
+ <history_id>host_image</history_id>
+ <max_saved>10</max_saved>
+ <directory>False</directory>
+ <modal>False</modal>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GnomeEntry:entry</child_name>
+ <name>default_host_image_file</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>changed</name>
+ <handler>can_apply_now</handler>
+ <last_modification_time>Tue, 21 Mar 2000 21:38:26 GMT</last_modification_time>
+ </signal>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame7</name>
+ <border_width>3</border_width>
+ <label>Refresh</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox2</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label10</name>
+ <label>Scan every 'x' seconds: </label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>refresh_interval</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>changed</name>
+ <handler>can_apply_now</handler>
+ <last_modification_time>Tue, 21 Mar 2000 21:38:31 GMT</last_modification_time>
+ </signal>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>4</value>
+ <lower>0</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame71</name>
+ <border_width>3</border_width>
+ <label>Hosts</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox72</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>chooser_broadcast</name>
+ <tooltip>Send a query to the local network and list all servers that respond</tooltip>
+ <can_focus>True</can_focus>
+ <label>Broadcast query</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox12</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label258</name>
+ <label>Hosts to list: </label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>chooser_hosts</name>
+ <tooltip>Comma separated list of hostnames to list in the chooser (in addition to the broadcast above)</tooltip>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label257</name>
+ <label>Chooser</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
<name>vbox70</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
@@ -5881,229 +6186,6 @@ one from the list on the left.
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
-
- <widget>
- <class>GtkVBox</class>
- <name>vbox4</name>
- <homogeneous>False</homogeneous>
- <spacing>0</spacing>
-
- <widget>
- <class>GtkFrame</class>
- <name>frame6</name>
- <border_width>3</border_width>
- <label>Appearance</label>
- <label_xalign>0</label_xalign>
- <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>True</fill>
- </child>
-
- <widget>
- <class>GtkVBox</class>
- <name>vbox5</name>
- <border_width>3</border_width>
- <homogeneous>False</homogeneous>
- <spacing>3</spacing>
-
- <widget>
- <class>GtkHBox</class>
- <name>hbox3</name>
- <homogeneous>False</homogeneous>
- <spacing>0</spacing>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
-
- <widget>
- <class>GtkLabel</class>
- <name>label11</name>
- <label>Directory for host images: </label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GnomeFileEntry</class>
- <name>fileentry1</name>
- <history_id>host_images_dir</history_id>
- <max_saved>10</max_saved>
- <directory>True</directory>
- <modal>True</modal>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
-
- <widget>
- <class>GtkEntry</class>
- <child_name>GnomeEntry:entry</child_name>
- <name>host_images_dir</name>
- <can_focus>True</can_focus>
- <signal>
- <name>changed</name>
- <handler>can_apply_now</handler>
- <last_modification_time>Tue, 21 Mar 2000 21:38:21 GMT</last_modification_time>
- </signal>
- <editable>True</editable>
- <text_visible>True</text_visible>
- <text_max_length>0</text_max_length>
- <text></text>
- </widget>
- </widget>
- </widget>
-
- <widget>
- <class>GtkLabel</class>
- <name>label12</name>
- <label>Default host image:</label>
- <justify>GTK_JUSTIFY_LEFT</justify>
- <wrap>False</wrap>
- <xalign>0</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>True</fill>
- </child>
- </widget>
-
- <widget>
- <class>GnomePixmapEntry</class>
- <name>default_host_image_pentry</name>
- <width>351</width>
- <preview>True</preview>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
-
- <widget>
- <class>GnomeFileEntry</class>
- <child_name>GnomePixmapEntry:file-entry</child_name>
- <name>entry1</name>
- <history_id>host_image</history_id>
- <max_saved>10</max_saved>
- <directory>False</directory>
- <modal>False</modal>
-
- <widget>
- <class>GtkEntry</class>
- <child_name>GnomeEntry:entry</child_name>
- <name>default_host_image_file</name>
- <can_focus>True</can_focus>
- <signal>
- <name>changed</name>
- <handler>can_apply_now</handler>
- <last_modification_time>Tue, 21 Mar 2000 21:38:26 GMT</last_modification_time>
- </signal>
- <editable>True</editable>
- <text_visible>True</text_visible>
- <text_max_length>0</text_max_length>
- <text></text>
- </widget>
- </widget>
- </widget>
- </widget>
- </widget>
-
- <widget>
- <class>GtkFrame</class>
- <name>frame7</name>
- <border_width>3</border_width>
- <label>Refresh</label>
- <label_xalign>0</label_xalign>
- <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>True</fill>
- </child>
-
- <widget>
- <class>GtkHBox</class>
- <name>hbox2</name>
- <border_width>3</border_width>
- <homogeneous>False</homogeneous>
- <spacing>0</spacing>
-
- <widget>
- <class>GtkLabel</class>
- <name>label10</name>
- <label>Scan every 'x' seconds: </label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkSpinButton</class>
- <name>refresh_interval</name>
- <can_focus>True</can_focus>
- <signal>
- <name>changed</name>
- <handler>can_apply_now</handler>
- <last_modification_time>Tue, 21 Mar 2000 21:38:31 GMT</last_modification_time>
- </signal>
- <climb_rate>1</climb_rate>
- <digits>0</digits>
- <numeric>False</numeric>
- <update_policy>GTK_UPDATE_ALWAYS</update_policy>
- <snap>False</snap>
- <wrap>False</wrap>
- <value>4</value>
- <lower>0</lower>
- <upper>999</upper>
- <step>1</step>
- <page>10</page>
- <page_size>10</page_size>
- <child>
- <padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
- </widget>
- </widget>
- </widget>
- </widget>
-
- <widget>
- <class>GtkLabel</class>
- <child_name>Notebook:tab</child_name>
- <name>label176</name>
- <label>Chooser</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xpad>0</xpad>
- <ypad>0</ypad>
- </widget>
</widget>
</widget>
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
index 483b250f..35ac1b8f 100644
--- a/gui/gdmlogin.c
+++ b/gui/gdmlogin.c
@@ -32,6 +32,7 @@
#include <ctype.h>
#include <signal.h>
#include <dirent.h>
+#include <locale.h>
#include <gdk/gdkx.h>
#include <X11/X.h>
#include <X11/Xlib.h>
@@ -160,6 +161,8 @@ static pid_t backgroundpid = 0;
static guint timed_handler_id = 0;
+static char *selected_browser_user = NULL;
+
/* This is true if session dir doesn't exist or is whacked out
* in some way or another */
static gboolean session_dir_whacked_out = FALSE;
@@ -2094,16 +2097,22 @@ gdm_login_browser_select (GtkWidget *widget, gint selected, GdkEvent *event)
case GDK_BUTTON_RELEASE:
user = g_list_nth_data (users, selected);
- if (user && user->login)
- gtk_entry_set_text (GTK_ENTRY (entry), user->login);
+ if (user && user->login) {
+ gtk_entry_set_text (GTK_ENTRY (entry), user->login);
+ g_free (selected_browser_user);
+ selected_browser_user = g_strdup (user->login);
+ }
break;
case GDK_2BUTTON_PRESS:
user = g_list_nth_data (users, selected);
- if (user && user->login)
- gtk_entry_set_text (GTK_ENTRY (entry), user->login);
+ if (user && user->login) {
+ gtk_entry_set_text (GTK_ENTRY (entry), user->login);
+ g_free (selected_browser_user);
+ selected_browser_user = g_strdup (user->login);
+ }
if (curuser == NULL)
curuser = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
@@ -2133,6 +2142,8 @@ gdm_login_browser_unselect (GtkWidget *widget, gint selected, GdkEvent *event)
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
gtk_entry_set_text (GTK_ENTRY (entry), "");
+ g_free (selected_browser_user);
+ selected_browser_user = NULL;
break;
default:
@@ -2427,6 +2438,66 @@ bin_exists (const char *command)
}
}
+static gboolean
+window_browser_event (GtkWidget *window, GdkEvent *event, gpointer data)
+{
+ switch (event->type) {
+ case GDK_KEY_PRESS:
+ if ((event->key.state & GDK_CONTROL_MASK) &&
+ (event->key.keyval == GDK_f ||
+ event->key.keyval == GDK_F) &&
+ selected_browser_user != NULL) {
+ GtkWidget *d, *less;
+ char *command;
+ d = gnome_dialog_new (_("Finger"),
+ GNOME_STOCK_BUTTON_OK,
+ NULL);
+ less = gnome_less_new ();
+ gtk_widget_show (less);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (d)->vbox),
+ less,
+ TRUE,
+ TRUE,
+ 0);
+
+ /* hack to make this be the size of a terminal */
+ gnome_less_set_fixed_font (GNOME_LESS (less), TRUE);
+ {
+ int i;
+ char buf[82];
+ GtkWidget *text = GTK_WIDGET (GNOME_LESS (less)->text);
+ GdkFont *font = GNOME_LESS (less)->font;
+ for (i = 0; i < 81; i++)
+ buf[i] = 'X';
+ buf[i] = '\0';
+ gtk_widget_set_usize
+ (text,
+ gdk_string_width (font, buf) + 30,
+ gdk_string_height (font, buf)*24+30);
+ }
+
+ command = g_strconcat ("finger ",
+ selected_browser_user,
+ NULL);
+ gnome_less_show_command (GNOME_LESS (less), command);
+
+ gtk_widget_grab_focus (GTK_WIDGET (less));
+
+ gtk_window_set_modal (GTK_WINDOW (d), TRUE);
+ gdm_wm_center_window (GTK_WINDOW (d));
+
+ gdm_wm_no_login_focus_push ();
+ gnome_dialog_run_and_close (GNOME_DIALOG (d));
+ gdm_wm_no_login_focus_pop ();
+ }
+ break;
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
static void
gdm_login_gui_init (void)
{
@@ -2448,6 +2519,11 @@ gdm_login_gui_init (void)
gtk_object_set_data_full (GTK_OBJECT (login), "login", login,
(GtkDestroyNotify) gtk_widget_unref);
gtk_window_set_title (GTK_WINDOW (login), _("GDM Login"));
+ /* connect for fingering */
+ if (GdmBrowser)
+ gtk_signal_connect (GTK_OBJECT (login), "event",
+ GTK_SIGNAL_FUNC (window_browser_event),
+ NULL);
accel = gtk_accel_group_new ();
gtk_window_add_accel_group (GTK_WINDOW (login), accel);
@@ -2963,6 +3039,7 @@ gdm_login_check_exclude (struct passwd *pwent)
excludes = g_strsplit (GdmExclude, ",", 0);
for (i=0 ; excludes[i] != NULL ; i++) {
+ g_strstrip (excludes[i]);
if (strcasecmp_no_locale (excludes[i],
pwent->pw_name) == 0) {
g_strfreev (excludes);
@@ -3248,7 +3325,8 @@ main (int argc, char *argv[])
gdm_version = g_getenv ("GDM_VERSION");
- if ((gdm_version == NULL ||
+ if ( ! DOING_GDM_DEVELOPMENT &&
+ (gdm_version == NULL ||
strcmp (gdm_version, VERSION) != 0) &&
gdm_string_empty (g_getenv ("GDM_IS_LOCAL"))) {
char *msg;
@@ -3271,10 +3349,13 @@ main (int argc, char *argv[])
gdm_wm_center_window (GTK_WINDOW (dialog));
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
return EXIT_SUCCESS;
}
- if (gdm_version == NULL) {
+ if ( ! DOING_GDM_DEVELOPMENT &&
+ gdm_version == NULL) {
char *msg;
GtkWidget *dialog;
@@ -3307,7 +3388,8 @@ main (int argc, char *argv[])
}
}
- if (strcmp (gdm_version, VERSION) != 0) {
+ if ( ! DOING_GDM_DEVELOPMENT &&
+ strcmp (gdm_version, VERSION) != 0) {
char *msg;
GtkWidget *dialog;
@@ -3424,16 +3506,14 @@ main (int argc, char *argv[])
gtk_widget_show_now (login);
- if ( ! DOING_GDM_DEVELOPMENT) {
- /* can it ever happen that it'd be NULL here ??? */
- if (login->window != NULL) {
- gdm_wm_init (GDK_WINDOW_XWINDOW (login->window));
-
- /* Run the focus, note that this will work no matter what
- * since gdm_wm_init will set the display to the gdk one
- * if it fails */
- gdm_wm_focus_window (GDK_WINDOW_XWINDOW (login->window));
- }
+ /* can it ever happen that it'd be NULL here ??? */
+ if (login->window != NULL) {
+ gdm_wm_init (GDK_WINDOW_XWINDOW (login->window));
+
+ /* Run the focus, note that this will work no matter what
+ * since gdm_wm_init will set the display to the gdk one
+ * if it fails */
+ gdm_wm_focus_window (GDK_WINDOW_XWINDOW (login->window));
}
if (session_dir_whacked_out) {
@@ -3486,7 +3566,6 @@ main (int argc, char *argv[])
gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
}
-
gtk_main ();
kill_thingies ();
diff --git a/gui/gdmwm.c b/gui/gdmwm.c
index 866ef423..0a0a14c7 100644
--- a/gui/gdmwm.c
+++ b/gui/gdmwm.c
@@ -1126,7 +1126,7 @@ gdm_wm_move_window_now (Window window, int x, int y)
trap_pop ();
}
- if (gw->shadow != None)
+ if (gw->deco != None)
XMoveWindow (wm_disp, gw->deco, x - 1, y - 1);
else
XMoveWindow (wm_disp, gw->win, x, y);