Enlightenment CVS committal Author : xcomputerman Project : e17 Module : apps/entrance
Dir : e17/apps/entrance/src/client Modified Files: entrance_config.c entrance_config.h entrance_session.c Log Message: Support for automatically selecting the previous user. Last I checked, I still have the final say whether a patch gets accepted or not. Thank you Phuah for your contribution. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- entrance_config.c 16 Aug 2005 04:03:27 -0000 1.30 +++ entrance_config.c 7 Nov 2005 18:10:41 -0000 1.31 @@ -40,6 +40,9 @@ ecore_config_int_default("/entrance/autologin/mode", 0); ecore_config_string_default("/entrance/autologin/user", ""); + ecore_config_int_default("/entrance/presel/mode", 1); + ecore_config_string_default("/entrance/presel/prevuser", ""); + ecore_config_int_default("/entrance/user/remember", 1); ecore_config_int_default("/entrance/user/remember_n", 5); ecore_config_int_default("/entrance/user/count", 0); @@ -89,6 +92,9 @@ e->autologin.mode = ecore_config_int_get("/entrance/autologin/mode"); e->autologin.username = ecore_config_string_get("/entrance/autologin/user"); + e->presel.mode = ecore_config_int_get("/entrance/presel/mode"); + e->presel.prevuser = ecore_config_string_get("/entrance/presel/prevuser"); + e->users.remember = ecore_config_int_get("/entrance/user/remember"); e->users.remember_n = ecore_config_int_get("/entrance/user/remember_n"); @@ -419,6 +425,16 @@ ecore_config_file_save(file); } +void +entrance_config_prevuser_save(const char *user, const char *file) +{ + char buf[PATH_MAX]; + + snprintf(buf, PATH_MAX, "/entrance/presel/prevuser"); + ecore_config_string_set(buf, user); + ecore_config_file_save(file); +} + #if 0 int main(int argc, char *argv[]) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- entrance_config.h 16 Aug 2005 04:03:27 -0000 1.17 +++ entrance_config.h 7 Nov 2005 18:10:41 -0000 1.18 @@ -22,6 +22,9 @@ #define ENTRANCE_AUTOLOGIN_DEFAULT 1 #define ENTRANCE_AUTOLOGIN_THEME 2 +#define ENTRANCE_PRESEL_NONE 0 +#define ENTRANCE_PRESEL_PREV 1 + /** * This contains all of the configuration options that the system can set */ @@ -118,6 +121,13 @@ int mode; } autologin; + struct { + char *prevuser; + /** + * 0 = off, 1 = presel previous + */ + int mode; + } presel; }; typedef struct _Entrance_Config Entrance_Config; @@ -127,6 +137,7 @@ void entrance_config_free(Entrance_Config * e); void entrance_config_prepend_recent_user(Entrance_Config * e, char *str); void entrance_config_user_list_save(Entrance_Config * e, const char *file); +void entrance_config_prevuser_save(const char *user, const char *file); int entrance_config_save(Entrance_Config * e, const char *file); #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -3 -r1.77 -r1.78 --- entrance_session.c 4 Nov 2005 07:51:00 -0000 1.77 +++ entrance_session.c 7 Nov 2005 18:10:41 -0000 1.78 @@ -2,6 +2,7 @@ #include "entrance_session.h" #include <Ecore_Config.h> #include <Esmart/Esmart_Container.h> +#include <Esmart/Esmart_Text_Entry.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> @@ -173,6 +174,13 @@ { case ENTRANCE_AUTOLOGIN_NONE: ecore_evas_show(e->ee); + if (e->config->presel.mode==ENTRANCE_PRESEL_PREV && strlen(e->config->presel.prevuser)) { + Evas_Object *oo = evas_object_name_find(evas_object_evas_get(e->edje), "entrance.entry.user"); + if (oo) { + esmart_text_entry_text_set(oo, e->config->presel.prevuser); + entrance_session_user_set(e, e->config->presel.prevuser); + } + } break; case ENTRANCE_AUTOLOGIN_DEFAULT: if ((eu = @@ -429,6 +437,8 @@ _entrance_session_user_list_fix(e); + entrance_config_prevuser_save(e->auth->user, e->db); + /* avoid doubling up pam handles before the fork */ pwent = struct_passwd_dup(e->auth->pw); entrance_auth_free(e->auth); ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs