yoz pushed a commit to branch master.

http://git.enlightenment.org/misc/entrance.git/commit/?id=f65d38be0f84574f32a88340e1c64b9ec0cc71ce

commit f65d38be0f84574f32a88340e1c64b9ec0cc71ce
Author: Michael Bouchaud <y...@efl.so>
Date:   Tue Dec 17 23:08:19 2013 +0100

    entrance: load history of user in every case
---
 src/bin/entrance_gui.c   |  1 -
 src/bin/entrance_login.c | 65 +++++++++++++++++++++++++++++++-----------------
 src/bin/entrance_login.h |  1 -
 3 files changed, 42 insertions(+), 25 deletions(-)

diff --git a/src/bin/entrance_gui.c b/src/bin/entrance_gui.c
index 2b5daef..b64acbf 100644
--- a/src/bin/entrance_gui.c
+++ b/src/bin/entrance_gui.c
@@ -760,7 +760,6 @@ _entrance_gui_user_sel_cb(void *data, Evas_Object *obj 
EINA_UNUSED, void *event_
    Entrance_Login *eu;
    eu = elm_object_item_data_get(event_info);
    entrance_login_login_set(data, eu->login);
-   entrance_login_session_set(data, eu->lsess);
 }
 
 static char *
diff --git a/src/bin/entrance_login.c b/src/bin/entrance_login.c
index 0fc9940..4ed1053 100644
--- a/src/bin/entrance_login.c
+++ b/src/bin/entrance_login.c
@@ -20,6 +20,7 @@ static void _login_password_unfocused_cb(void *data, 
Evas_Object *obj, void *eve
 static void _login_login_activated_cb(void *data, Evas_Object *obj, void 
*event);
 static char *_login_xsession_text_get(void *data, Evas_Object *obj, const char 
*part);
 static void _login_auth_cb(void *data, const char *user, Eina_Bool granted);
+static void _entrance_login_session_set(Evas_Object *widget, const char *name);
 
 static Entrance_Fill *_login_fill;
 
@@ -256,6 +257,23 @@ _login_input_event_cb(void *data, Evas_Object *obj 
EINA_UNUSED, Evas_Object *src
 static void
 _login_password_focused_cb(void *data, Evas_Object *obj EINA_UNUSED, void 
*event EINA_UNUSED)
 {
+   const Eina_List *users, *l;
+   Evas_Object *o;
+   const char *hostname;
+   Entrance_Login *eu;
+   LOGIN_GET(data);
+
+   users = entrance_gui_users_get();
+   o = elm_object_part_content_get(data, "entrance.login");
+   hostname = elm_entry_markup_to_utf8(elm_object_text_get(o));
+   EINA_LIST_FOREACH(users, l, eu)
+     {
+        if (!strcmp(eu->login, hostname))
+          {
+             _entrance_login_session_set(data, eu->lsess);
+             break;
+          }
+     }
    _login_password_catch(data, EINA_TRUE);
 }
 
@@ -345,6 +363,29 @@ _login_auth_cb(void *data, const char *user, Eina_Bool 
granted)
      }
 }
 
+static void
+_entrance_login_session_set(Evas_Object *widget, const char *name)
+{
+   Entrance_Xsession *sess;
+   const Eina_List *l = NULL;
+   LOGIN_GET(widget);
+   if (name)
+     {
+        EINA_LIST_FOREACH(entrance_gui_xsessions_get(), l, sess)
+          {
+             if ((sess->name) &&
+                 (!strcmp(sess->name, name)))
+               {
+                  break;
+               }
+          }
+     }
+   if (l)
+     login->session = sess;
+   _login_xsession_update(widget);
+}
+
+
 
 
////////////////////////////////////////////////////////////////////////////////
 
@@ -352,7 +393,7 @@ void
 entrance_login_init(void)
 {
    _login_fill = entrance_fill_new(NULL, _login_xsession_text_get,
-                                      NULL, NULL, NULL);
+                                   NULL, NULL, NULL);
 }
 
 void
@@ -438,28 +479,6 @@ entrance_login_login_set(Evas_Object *widget, const char 
*user)
 }
 
 void
-entrance_login_session_set(Evas_Object *widget, const char *name)
-{
-   Entrance_Xsession *sess;
-   const Eina_List *l = NULL;
-   LOGIN_GET(widget);
-   if (name)
-     {
-        EINA_LIST_FOREACH(entrance_gui_xsessions_get(), l, sess)
-          {
-             if ((sess->name) &&
-                 (!strcmp(sess->name, name)))
-               {
-                  break;
-               }
-          }
-     }
-   if (l)
-     login->session = sess;
-   _login_xsession_update(widget);
-}
-
-void
 entrance_login_open_session_set(Evas_Object *widget, Eina_Bool open_session)
 {
    Evas_Object *o;
diff --git a/src/bin/entrance_login.h b/src/bin/entrance_login.h
index ea9932d..032f8f0 100644
--- a/src/bin/entrance_login.h
+++ b/src/bin/entrance_login.h
@@ -8,7 +8,6 @@ void entrance_login_shutdown(void);
 Evas_Object *entrance_login_add(Evas_Object *win, Entrance_Login_Cb login_cb, 
void *data);
 void entrance_login_xsessions_populate(Evas_Object *widget, Eina_List 
*xsessions);
 void entrance_login_login_set(Evas_Object *widget, const char *user);
-void entrance_login_session_set(Evas_Object *widget, const char *user);
 void entrance_login_open_session_set(Evas_Object *obj, Eina_Bool open_session);
 void entrance_login_callback_set(Entrance_Login_Cb greater_cb, void *data);
 

-- 


Reply via email to