gdm r5973 - in trunk: . daemon gui/simple-greeter



Author: halfline
Date: Sun Mar  9 21:47:27 2008
New Revision: 5973
URL: http://svn.gnome.org/viewvc/gdm?rev=5973&view=rev

Log:
2008-03-09  Ray Strode  <rstrode redhat com>

	* daemon/gdm-simple-slave.c (on_greeter_auto_login):
	* daemon/gdm-greeter-server.[ch]:
	(handle_begin_auto_login), (greeter_handle_child_message),
	(gdm_greeter_server_class_init):
	* gui/gdm-greeter-client.[ch]:
	(gdm_greeter_client_call_begin_auto_login):
	* gui/gdm-greeter-session.[ch]:
	(on_begin_auto_login):
	* gui/gdm-greeter-login-window.[ch]:
	(timed_login_timer), (on_login_button_clicked_answer_query),
	(on_user_chosen), (gdm_greeter_login_window_class_init):
	Rename "Timed Login" request on the slave to "Auto Login"
	since that's what it is.  All the delay logic happens in
	the greeter and the slave just logins in immediately after
	getting the request


Modified:
   trunk/ChangeLog
   trunk/daemon/gdm-greeter-server.c
   trunk/daemon/gdm-greeter-server.h
   trunk/daemon/gdm-simple-slave.c
   trunk/gui/simple-greeter/gdm-greeter-client.c
   trunk/gui/simple-greeter/gdm-greeter-client.h
   trunk/gui/simple-greeter/gdm-greeter-login-window.c
   trunk/gui/simple-greeter/gdm-greeter-login-window.h
   trunk/gui/simple-greeter/gdm-greeter-session.c

Modified: trunk/daemon/gdm-greeter-server.c
==============================================================================
--- trunk/daemon/gdm-greeter-server.c	(original)
+++ trunk/daemon/gdm-greeter-server.c	Sun Mar  9 21:47:27 2008
@@ -69,7 +69,7 @@
 };
 
 enum {
-        BEGIN_TIMED_LOGIN,
+        BEGIN_AUTO_LOGIN,
         BEGIN_VERIFICATION,
         BEGIN_VERIFICATION_FOR_USER,
         QUERY_ANSWER,
@@ -327,19 +327,29 @@
 }
 
 static DBusHandlerResult
-handle_begin_timed_login (GdmGreeterServer *greeter_server,
-                        DBusConnection   *connection,
-                        DBusMessage      *message)
+handle_begin_auto_login (GdmGreeterServer *greeter_server,
+                         DBusConnection   *connection,
+                         DBusMessage      *message)
 {
         DBusMessage *reply;
+        DBusError    error;
+        const char  *text;
 
-        g_debug ("GreeterServer: BeginTimedLogin");
+
+        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 ("GreeterServer: BeginAutoLogin for '%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 [BEGIN_TIMED_LOGIN], 0);
+        g_signal_emit (greeter_server, signals [BEGIN_AUTO_LOGIN], 0, text);
 
         return DBUS_HANDLER_RESULT_HANDLED;
 }
@@ -598,8 +608,8 @@
                 return handle_begin_verification (greeter_server, connection, message);
         } else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "BeginVerificationForUser")) {
                 return handle_begin_verification_for_user (greeter_server, connection, message);
-        } else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "BeginTimedLogin")) {
-                return handle_begin_timed_login (greeter_server, connection, message);
+        } else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "BeginAutoLogin")) {
+                return handle_begin_auto_login (greeter_server, connection, message);
         } else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "AnswerQuery")) {
                 return handle_answer_query (greeter_server, connection, message);
         } else if (dbus_message_is_method_call (message, GDM_GREETER_SERVER_DBUS_INTERFACE, "SelectSession")) {
@@ -1073,16 +1083,17 @@
                               g_cclosure_marshal_VOID__VOID,
                               G_TYPE_NONE,
                               0);
-        signals [BEGIN_TIMED_LOGIN] =
-                g_signal_new ("begin-timed-login",
+        signals [BEGIN_AUTO_LOGIN] =
+                g_signal_new ("begin-auto-login",
                               G_OBJECT_CLASS_TYPE (object_class),
                               G_SIGNAL_RUN_FIRST,
-                              G_STRUCT_OFFSET (GdmGreeterServerClass, begin_timed_login),
+                              G_STRUCT_OFFSET (GdmGreeterServerClass, begin_auto_login),
                               NULL,
                               NULL,
-                              g_cclosure_marshal_VOID__VOID,
+                              g_cclosure_marshal_VOID__STRING,
                               G_TYPE_NONE,
-                              0);
+                              1,
+                              G_TYPE_STRING);
         signals [BEGIN_VERIFICATION_FOR_USER] =
                 g_signal_new ("begin-verification-for-user",
                               G_OBJECT_CLASS_TYPE (object_class),

Modified: trunk/daemon/gdm-greeter-server.h
==============================================================================
--- trunk/daemon/gdm-greeter-server.h	(original)
+++ trunk/daemon/gdm-greeter-server.h	Sun Mar  9 21:47:27 2008
@@ -45,7 +45,7 @@
 {
         GObjectClass   parent_class;
 
-        void (* begin_timed_login)          (GdmGreeterServer  *greeter_server);
+        void (* begin_auto_login)           (GdmGreeterServer  *greeter_server);
         void (* begin_verification)         (GdmGreeterServer  *greeter_server);
         void (* begin_verification_for_user)(GdmGreeterServer  *greeter_server,
                                              const char        *username);

Modified: trunk/daemon/gdm-simple-slave.c
==============================================================================
--- trunk/daemon/gdm-simple-slave.c	(original)
+++ trunk/daemon/gdm-simple-slave.c	Sun Mar  9 21:47:27 2008
@@ -611,29 +611,11 @@
 }
 
 static void
-on_greeter_begin_timed_login (GdmGreeterServer *greeter_server,
-                              GdmSimpleSlave   *slave)
+on_greeter_begin_auto_login (GdmGreeterServer *greeter_server,
+                             const char       *username,
+                             GdmSimpleSlave   *slave)
 {
-        char    *username;
-        gboolean enabled;
-        gboolean res;
-
-        g_debug ("GdmSimpleSlave: begin timed login");
-
-        enabled = FALSE;
-        res = gdm_settings_client_get_boolean (GDM_KEY_TIMED_LOGIN_ENABLE, &enabled);
-        if (! enabled) {
-                g_warning ("GdmSimpleSlave: timed login requested but disabled in configuration");
-                return;
-        }
-
-        username = NULL;
-        res = gdm_settings_client_get_string (GDM_KEY_TIMED_LOGIN_USER, &username);
-        if (username == NULL) {
-                g_warning ("GdmSimpleSlave: timed login requested but username not specified in configuration");
-                return;
-        }
-
+        g_debug ("GdmSimpleSlave: begin auto login for user '%s'", username);
         gdm_session_setup_for_user (GDM_SESSION (slave->priv->session),
                                     "gdm-autologin",
                                     username);
@@ -795,8 +777,8 @@
 
         slave->priv->greeter_server = gdm_greeter_server_new (display_id);
         g_signal_connect (slave->priv->greeter_server,
-                          "begin-timed-login",
-                          G_CALLBACK (on_greeter_begin_timed_login),
+                          "begin-auto-login",
+                          G_CALLBACK (on_greeter_begin_auto_login),
                           slave);
         g_signal_connect (slave->priv->greeter_server,
                           "begin-verification",

Modified: trunk/gui/simple-greeter/gdm-greeter-client.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-client.c	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-client.c	Sun Mar  9 21:47:27 2008
@@ -375,10 +375,11 @@
 }
 
 void
-gdm_greeter_client_call_begin_timed_login (GdmGreeterClient *client)
+gdm_greeter_client_call_begin_auto_login (GdmGreeterClient *client,
+                                          const char       *username)
 {
-        send_dbus_void_method (client->priv->connection,
-                               "BeginTimedLogin");
+        send_dbus_string_method (client->priv->connection,
+                                 "BeginAutoLogin", username);
 }
 
 void

Modified: trunk/gui/simple-greeter/gdm-greeter-client.h
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-client.h	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-client.h	Sun Mar  9 21:47:27 2008
@@ -88,7 +88,8 @@
 
 char *             gdm_greeter_client_call_get_display_id            (GdmGreeterClient *client);
 
-void               gdm_greeter_client_call_begin_timed_login         (GdmGreeterClient *client);
+void               gdm_greeter_client_call_begin_auto_login          (GdmGreeterClient *client,
+                                                                      const char       *username);
 void               gdm_greeter_client_call_begin_verification        (GdmGreeterClient *client);
 void               gdm_greeter_client_call_begin_verification_for_user (GdmGreeterClient *client,
                                                                         const char       *username);

Modified: trunk/gui/simple-greeter/gdm-greeter-login-window.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-login-window.c	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-login-window.c	Sun Mar  9 21:47:27 2008
@@ -136,7 +136,7 @@
 };
 
 enum {
-        BEGIN_TIMED_LOGIN,
+        BEGIN_AUTO_LOGIN,
         BEGIN_VERIFICATION,
         BEGIN_VERIFICATION_FOR_USER,
         QUERY_ANSWER,
@@ -263,8 +263,8 @@
         set_sensitive (login_window, FALSE);
         set_message (login_window, _("Automatically logging in..."));
 
-        g_debug ("GdmGreeterLoginWindow: emitting begin-timed_login");
-        g_signal_emit (login_window, signals[BEGIN_TIMED_LOGIN], 0);
+        g_debug ("GdmGreeterLoginWindow: emitting interactive");
+        g_signal_emit (login_window, signals[INTERACTIVE], 0);
         login_window->priv->timed_login_timeout_id = 0;
 
         return FALSE;
@@ -355,12 +355,12 @@
 
 static void
 on_login_button_clicked_timed_login (GtkButton             *button,
-                                   GdmGreeterLoginWindow *login_window)
+                                     GdmGreeterLoginWindow *login_window)
 {
         set_busy (login_window);
         set_sensitive (login_window, FALSE);
 
-        g_signal_emit (login_window, signals[BEGIN_TIMED_LOGIN], 0);
+        g_signal_emit (login_window, signals[INTERACTIVE], 0);
 }
 
 static void
@@ -1042,6 +1042,8 @@
         } else if (strcmp (user_name, GDM_USER_CHOOSER_USER_GUEST) == 0) {
                 /* FIXME: handle guest account stuff */
         } else if (strcmp (user_name, GDM_USER_CHOOSER_USER_AUTO) == 0) {
+                g_signal_emit (login_window, signals[BEGIN_AUTO_LOGIN], 0,
+                               login_window->priv->timed_login_username);
                 /* just wait for the user to select language and stuff */
                 set_log_in_button_mode (login_window, LOGIN_BUTTON_TIMED_LOGIN);
                 set_message (login_window, _("Select language and click Log In"));
@@ -1503,11 +1505,20 @@
         widget_class->size_request = gdm_greeter_login_window_size_request;
         widget_class->size_allocate = gdm_greeter_login_window_size_allocate;
 
-        signals [BEGIN_TIMED_LOGIN] =
-                g_signal_new ("begin-timed_login",
+        signals [BEGIN_AUTO_LOGIN] =
+                g_signal_new ("begin-auto-login",
                               G_TYPE_FROM_CLASS (object_class),
                               G_SIGNAL_RUN_LAST,
-                              G_STRUCT_OFFSET (GdmGreeterLoginWindowClass, begin_timed_login),
+                              G_STRUCT_OFFSET (GdmGreeterLoginWindowClass, begin_auto_login),
+                              NULL,
+                              NULL,
+                              g_cclosure_marshal_VOID__STRING,
+                              G_TYPE_NONE, 1, G_TYPE_STRING);
+        signals [BEGIN_VERIFICATION] =
+                g_signal_new ("begin-verification",
+                              G_TYPE_FROM_CLASS (object_class),
+                              G_SIGNAL_RUN_LAST,
+                              G_STRUCT_OFFSET (GdmGreeterLoginWindowClass, begin_verification),
                               NULL,
                               NULL,
                               g_cclosure_marshal_VOID__VOID,

Modified: trunk/gui/simple-greeter/gdm-greeter-login-window.h
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-login-window.h	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-login-window.h	Sun Mar  9 21:47:27 2008
@@ -46,7 +46,8 @@
         GtkWindowClass   parent_class;
 
         /* signals */
-        void (* begin_timed_login)           (GdmGreeterLoginWindow *login_window);
+        void (* begin_auto_login)            (GdmGreeterLoginWindow *login_window,
+                                              const char            *username);
         void (* begin_verification)          (GdmGreeterLoginWindow *login_window);
         void (* begin_verification_for_user) (GdmGreeterLoginWindow *login_window,
                                               const char            *username);

Modified: trunk/gui/simple-greeter/gdm-greeter-session.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-session.c	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-session.c	Sun Mar  9 21:47:27 2008
@@ -179,10 +179,12 @@
 }
 
 static void
-on_begin_timed_login (GdmGreeterLoginWindow *login_window,
-                    GdmGreeterSession     *session)
+on_begin_auto_login (GdmGreeterLoginWindow *login_window,
+                     const char            *username,
+                     GdmGreeterSession     *session)
 {
-        gdm_greeter_client_call_begin_timed_login (session->priv->client);
+        gdm_greeter_client_call_begin_auto_login (session->priv->client,
+                                                  username);
 }
 
 static void
@@ -307,8 +309,8 @@
                 session->priv->login_window = gdm_greeter_login_window_new (is_local);
 
                 g_signal_connect (session->priv->login_window,
-                                  "begin-timed-login",
-                                  G_CALLBACK (on_begin_timed_login),
+                                  "begin-auto-login",
+                                  G_CALLBACK (on_begin_auto_login),
                                   session);
                 g_signal_connect (session->priv->login_window,
                                   "begin-verification",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]