}
ad->popup = NULL;
}
+
+static void __error_popup_response_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ SETTING_TRACE_BEGIN;
+ retm_if(data == NULL, "Data parameter is NULL");
+ Setting_GenGroupItem_Data *list_item = data;
+ if (list_item->notify) {
+ evas_object_del(list_item->notify);
+ list_item->notify = NULL;
+ }
+}
+
static void __device_name_changed_cb(void *data, Evas_Object *obj)
{
retm_if(!data || !obj, "Data parameter is NULL");
int entry_len = safeStrLen(entry_str);
SETTING_TRACE("entry_str:[%s], lenght:%d", entry_str, entry_len);
+ SETTING_TRACE("maxLengthReachFlag:[%d], enterKeyPressFlag:%d", list_item->maxLengthReachFlag, list_item->enterKeyPressFlag);
+ /* show the popup if the text already reaches max length and the input character is not the enter key */
+ if (list_item->maxLengthReachFlag && list_item->enterKeyPressFlag == false) {
+ if (!list_item->notify) {
+ list_item->notify = setting_create_popup_without_btn(list_item, list_item->win_main,
+ NULL, _(EXCEED_LIMITATION_STR),
+ __error_popup_response_cb,
+ POPUP_INTERVAL, FALSE, FALSE);
+ elm_object_focus_set(list_item->eo_check, EINA_FALSE);
+ } else {
+ //postpone 2 seconds again
+ elm_popup_timeout_set(list_item->notify, POPUP_INTERVAL);
+ }
+ }
+ list_item->maxLengthReachFlag = false;
+ list_item->enterKeyPressFlag = false;
+
#if DEVNAME_BLOCK_SPACE
//block 'Space' key
if (entry_len > 0 && NULL != strstr(entry_str, " ")) {//cancel the effect of input 'space character'
}
}
+static void __max_len_reached(void *data, Evas_Object *obj, void *event_info)
+{
+ SETTING_TRACE_BEGIN;
+ retm_if(data == NULL, "Data parameter is NULL");
+ retm_if(!elm_object_focus_get(obj), "Entry is not focused");//notify only when entry is being focused on.
+
+ Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
+ list_item->maxLengthReachFlag = true;
+}
+
int setting_about_generate_genlist(void *data)
{
SETTING_TRACE_BEGIN;
ad->item_dev_name->isSinglelineFlag = 0;
ad->item_dev_name->start_change_cb = (setting_call_back_func)__entry_key_down_cb;
ad->item_dev_name->stop_change_cb = __entry_unfocus_cb;
+ ad->item_dev_name->maxlength_reached_cb = __max_len_reached;
ad->item_dev_name->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
if (ad->item_dev_name->limit_filter_data) {
* @todo isItemDisableFlag is required?
* @todo isSinglelineFlag is requred?
*/
-
-
-typedef struct Setting_GenGroupItem_Data Setting_GenGroupItem_Data;
-
-typedef struct Setting_GenGroupItem_Data {
+typedef struct _Setting_GenGroupItem_Data {
void **pBack;
double slider_max; /**< to swallow a slider */
setting_call_back_func start_change_cb;
setting_call_back_func stop_change_cb;
+ setting_call_back_func maxlength_reached_cb;
/* sound/vibration */
int belongs_to; /**< 1: slider belongs to sound group. 0: slider belongs to vibration group */
bool isFocusFlag;
bool isItemDisableFlag; /**< date/time UG only */
bool isSinglelineFlag;
+ bool maxLengthReachFlag;
+ bool enterKeyPressFlag;
int int_slp_setting_binded; /**< its relative vconf value must increase from 0, and step is 1. eg, 0, 1, 2, 3.. */
Elm_Entry_Filter_Limit_Size *limit_filter_data;
Eina_List* childs; /**< child nodes if this node has child nodes for handling radio buttons */
-};
+} Setting_GenGroupItem_Data;
typedef enum {
SETTING_VCONF_INT_TYPE = 0,
#ifndef __SETTING_COMMON_RESOURCE
#define __SETTING_COMMON_RESOURCE
+
+#define EXCEED_LIMITATION_STR "The content is too long."
+
#define SETTING_ICON_PATH_CFG "/usr/apps/org.tizen.setting/res/icons/"
#define SETTING_IMAGE_PATH_CFG "/usr/apps/org.tizen.setting/res/images/"
#define SETTING_OPEN_SOURCE_LICENSE_PATH "file:///opt/apps/org.tizen.setting/data/Open_Source_Announcement.html"
#include <Ecore_X.h>
#include <system_settings.h>
-#define EXCEED_LIMITATION_STR "The content is too long."
-
static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj, const char *part);
static char *_gl_Gendial_text_get(void *data, Evas_Object *obj, const char *part);
static void _gl_Gendial_del(void *data, Evas_Object *obj);
}
}
+
static void __entry_keydown(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
- ret_if(event_info == NULL);
+ retm_if(data == NULL, "Data parameter is NULL");
+ retm_if(event_info == NULL, "event_info is NULL");
+ Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
if(safeStrCmp(ev->key, "KP_Enter") == 0 //it is for Japanese keyboard to fix N_SE-10719
|| safeStrCmp(ev->key, "Return") == 0) //to disable the 'Enter' orginal function
{
SETTING_TRACE("ENTER %s ev->key:%s", __FUNCTION__, ev->key);
+ list_item->enterKeyPressFlag = true;
//hide the eraser button
//format like:xx<br/>
const char *entry_str = remove_first_substring(elm_entry_entry_get(obj), "<br/>");
elm_entry_cursor_end_set(obj);
setting_hide_input_pannel_cb(obj);
} else {
+ list_item->enterKeyPressFlag = false;
Evas_Object *entry_container = elm_object_parent_widget_get(obj);
if(safeStrLen(elm_entry_entry_get(obj)) > 0) {
elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
elm_entry_filter_limit_size,
item_data->limit_filter_data);
- evas_object_smart_callback_add(entry,
- "maxlength,reached",
- __max_len_reached,
- item_data);
-
+ if (item_data->maxlength_reached_cb) {
+ evas_object_smart_callback_add(entry,
+ "maxlength,reached",
+ item_data->maxlength_reached_cb,
+ item_data);
+ } else {
+ evas_object_smart_callback_add(entry,
+ "maxlength,reached",
+ __max_len_reached,
+ item_data);
+ }
}
if (item_data->stop_change_cb) {//invoked when stop focusing on
evas_object_smart_callback_add(entry,