[Last character show in password feature]
authorshilpa singh <shilpa.singh@samsung.com>
Tue, 12 Oct 2010 11:33:56 +0000 (20:33 +0900)
committershilpa singh <shilpa.singh@samsung.com>
Tue, 12 Oct 2010 11:33:56 +0000 (20:33 +0900)
src/lib/Elementary.h.in
src/lib/elm_config.c
src/lib/elm_entry.c
src/lib/elm_priv.h

index e9bfe97..29cd89b 100644 (file)
@@ -793,7 +793,7 @@ extern "C" {
    EAPI Eina_Bool    elm_entry_single_line_get(const Evas_Object *obj);
    EAPI void         elm_entry_password_set(Evas_Object *obj, Eina_Bool password);
    EAPI Eina_Bool    elm_entry_password_get(const Evas_Object *obj);
-   EAPI void         elm_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character);
+   EINA_DEPRECATED EAPI void         elm_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character);
 
    EAPI void         elm_entry_entry_set(Evas_Object *obj, const char *entry);
    EAPI const char  *elm_entry_entry_get(const Evas_Object *obj);
@@ -1743,7 +1743,7 @@ extern "C" {
    EAPI void         elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v);
    EAPI void         elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
    EAPI void         elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes);
-   EAPI void         elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character);
+   EINA_DEPRECATED EAPI void         elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character);
 
    EAPI void         elm_scrolled_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled);
    EAPI void         elm_scrolled_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout);
index a18b4af..93655e5 100644 (file)
@@ -284,6 +284,7 @@ _desc_init(void)
    EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "fps", fps, EET_T_DOUBLE);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "theme", theme, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "modules", modules, EET_T_STRING);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "password_show_last_character", password_show_last_character, EET_T_INT);
 }
 
 static void
@@ -471,6 +472,7 @@ _config_load(void)
    _elm_config->fps = 60.0;
    _elm_config->theme = eina_stringshare_add("default");
    _elm_config->modules = NULL;
+   _elm_config->password_show_last_character = 0;
 }
 static void
 _config_update(void)
@@ -645,6 +647,8 @@ _env_get(void)
    s = getenv("ELM_FINGER_SIZE");
    if (s) _elm_config->finger_size = atoi(s);
 
+   s = getenv("ELM_PASSWORD_SHOW_LAST_CHARACTER");
+   if (s) _elm_config->password_show_last_character = atoi(s);
    s = getenv("ELM_FPS");
    if (s) _elm_config->fps = atof(s);
    if (_elm_config->fps < 1.0) _elm_config->fps = 1.0;
index 5538a6f..aaf5837 100644 (file)
@@ -849,8 +849,11 @@ _getbase(Evas_Object *obj)
    if (!wd) return "base";
    if (wd->editable)
      {
-       if((wd->password)&&(wd->show_last_character)) return "custom-password"; 
-       else if(wd->password) return "base-password";
+        if (wd->password) 
+          {
+             if (wd->show_last_character) return "custom-password";
+             else return "base-password";
+          }
        else
          {
             if (wd->single_line) return "base-single";
@@ -864,8 +867,11 @@ _getbase(Evas_Object *obj)
      }
    else
      {
-       if((wd->password)&&(wd->show_last_character)) return "custom-password"; 
-       else if(wd->password) return "base-password";
+        if (wd->password) 
+          {
+             if (wd->show_last_character) return "custom-password";
+             else return "base-password";
+          }
        else
          {
             if (wd->single_line) return "base-single-noedit";
@@ -2183,10 +2189,11 @@ elm_entry_password_set(Evas_Object *obj, Eina_Bool password)
    if (!wd) return;
    if (wd->password == password) return;
    wd->password = password;
-   wd->show_last_character = EINA_FALSE;
    wd->single_line = EINA_TRUE;
    wd->linewrap = EINA_FALSE;
    wd->char_linewrap = EINA_FALSE;
+   if (_elm_config->password_show_last_character)
+     wd->show_last_character = EINA_TRUE;
    t = eina_stringshare_add(elm_entry_entry_get(obj));
    _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
    elm_entry_entry_set(obj, t);
index 330e39f..3d2e1f7 100644 (file)
@@ -116,6 +116,7 @@ struct _Elm_Config
    int input_panel_enable;
    int autocapital_allow;
    int autoperiod_allow;   
+   int          password_show_last_character;
 };
 
 struct _Elm_Module