Commit 8cb6adfa authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Add SelectHostname to greeter interface. For use with xdmcp host choosers.

2007-09-05  William Jon McCann  <mccann@jhu.edu>

	* daemon/gdm-greeter-server.c: (handle_select_hostname),
	(greeter_handle_child_message), (do_introspect),
	(gdm_greeter_server_class_init):
	* daemon/gdm-greeter-server.h:
	Add SelectHostname to greeter interface.  For use
	with xdmcp host choosers.


svn path=/branches/mccann-gobject/; revision=5227
parent c759901d
2007-09-05 William Jon McCann <mccann@jhu.edu>
* daemon/gdm-greeter-server.c: (handle_select_hostname),
(greeter_handle_child_message), (do_introspect),
(gdm_greeter_server_class_init):
* daemon/gdm-greeter-server.h:
Add SelectHostname to greeter interface. For use
with xdmcp host choosers.
2007-09-04 William Jon McCann <mccann@jhu.edu>
* daemon/gdm-session-worker.c (gdm_session_worker_verify_user):
......
......@@ -72,6 +72,7 @@ enum {
enum {
QUERY_ANSWER,
SESSION_SELECTED,
HOSTNAME_SELECTED,
LANGUAGE_SELECTED,
USER_SELECTED,
CANCELLED,
......@@ -253,8 +254,8 @@ handle_answer_query (GdmGreeterServer *greeter_server,
static DBusHandlerResult
handle_select_session (GdmGreeterServer *greeter_server,
DBusConnection *connection,
DBusMessage *message)
DBusConnection *connection,
DBusMessage *message)
{
DBusMessage *reply;
DBusError error;
......@@ -278,6 +279,33 @@ handle_select_session (GdmGreeterServer *greeter_server,
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
handle_select_hostname (GdmGreeterServer *greeter_server,
DBusConnection *connection,
DBusMessage *message)
{
DBusMessage *reply;
DBusError error;
const char *text;
dbus_error_init (&error);
if (! dbus_message_get_args (message, &error,
DBUS_TYPE_STRING, &text,
DBUS_TYPE_INVALID)) {
g_warning ("ERROR: %s", error.message);
}
g_debug ("SelectHostname: %s", text);
reply = dbus_message_new_method_return (message);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
g_signal_emit (greeter_server, signals [HOSTNAME_SELECTED], 0, text);
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult
handle_select_language (GdmGreeterServer *greeter_server,
DBusConnection *connection,
......@@ -359,6 +387,8 @@ greeter_handle_child_message (DBusConnection *connection,
return handle_answer_query (greeter_server, connection, message);
} else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "SelectSession")) {
return handle_select_session (greeter_server, connection, message);
} else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "HostnameSession")) {
return handle_select_hostname (greeter_server, connection, message);
} else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "SelectSession")) {
return handle_select_language (greeter_server, connection, message);
} else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "SelectUser")) {
......@@ -405,6 +435,9 @@ do_introspect (DBusConnection *connection,
" <method name=\"SelectUser\">\n"
" <arg name=\"text\" direction=\"in\" type=\"s\"/>\n"
" </method>\n"
" <method name=\"SelectHostname\">\n"
" <arg name=\"text\" direction=\"in\" type=\"s\"/>\n"
" </method>\n"
" <method name=\"Cancel\">\n"
" </method>\n"
" <signal name=\"Info\">\n"
......@@ -781,6 +814,17 @@ gdm_greeter_server_class_init (GdmGreeterServerClass *klass)
G_TYPE_NONE,
1,
G_TYPE_STRING);
signals [HOSTNAME_SELECTED] =
g_signal_new ("hostname-selected",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GdmGreeterServerClass, hostname_selected),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING);
signals [LANGUAGE_SELECTED] =
g_signal_new ("language-selected",
G_OBJECT_CLASS_TYPE (object_class),
......
......@@ -49,6 +49,8 @@ typedef struct
const char *text);
void (* session_selected) (GdmGreeterServer *greeter_server,
const char *name);
void (* hostname_selected) (GdmGreeterServer *greeter_server,
const char *hostname);
void (* language_selected) (GdmGreeterServer *greeter_server,
const char *name);
void (* user_selected) (GdmGreeterServer *greeter_server,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment