예제 #1
0
static void
_comic_chapter_item_update(Comic_Chapter_Item *cci, Comic_Chapter *cc, Eina_Bool force)
{
#define SET(VAR) \
    if (cc->VAR || force) \
      cci->VAR = cc->VAR

    cc->cci = cci;
    if (cci->cc && (cci->cc->provider->priority > cc->provider->priority))
      {
         if (!cci->name)
           {
              SET(name);
           }
         if (!cci->date)
           {
              SET(date);
           }
         if (cci->it)
           elm_genlist_item_update(cci->it);
         return;
      }
    //DBG("new cc for %g: %s", cc->number, cc->href);
    cci->cc = cc;
    SET(name);
    SET(date);
    if (cci->it)
      elm_genlist_item_update(cci->it);
}
예제 #2
0
static void
_update_entry(GHashTable *entry)
{
	Elm_Object_Item *glit;
	GVariant *val;

	val = g_hash_table_lookup(entry, "_item_all");
	if (val) {
		glit = (Elm_Object_Item *)GINT_TO_POINTER(g_variant_get_int32(val));
		elm_genlist_item_update(glit);
	}
	val = g_hash_table_lookup(entry, "_item_missed");
	if (val) {
		glit = (Elm_Object_Item *)GINT_TO_POINTER(g_variant_get_int32(val));
		elm_genlist_item_update(glit);
	}
	val = g_hash_table_lookup(entry, "_item_in");
	if (val) {
		glit = (Elm_Object_Item *)GINT_TO_POINTER(g_variant_get_int32(val));
		elm_genlist_item_update(glit);
	}
	val = g_hash_table_lookup(entry, "_item_out");
	if (val) {
		glit = (Elm_Object_Item *)GINT_TO_POINTER(g_variant_get_int32(val));
		elm_genlist_item_update(glit);
	}
}
int viewer_manager_item_radio_mode_set(void* object, Elm_Object_Item* item, VIEWER_ITEM_RADIO_MODES mode)
{
	__COMMON_FUNC_ENTER__;
	assertm_if(NULL == manager_object, "manager_object is NULL!!");
	assertm_if(NULL == item, "item is NULL!!");

	if (NULL == item) {
		INFO_LOG(COMMON_NAME_ERR, "item is NULL");
		return FALSE;
	}


	ug_genlist_data_t* gdata = (ug_genlist_data_t *) elm_object_item_data_get(item);
	if (NULL == gdata || NULL == gdata->device_info) {
		INFO_LOG(COMMON_NAME_ERR, "gdata or device_info is NULL");
		return FALSE;
	}

	if (gdata->radio_mode == mode) {
		INFO_LOG(UG_NAME_NORMAL, "[%s] is already in requested state", gdata->device_info->ssid);
		return FALSE;
	}

	INFO_LOG(UG_NAME_NORMAL, "[%s] AP Item State Transition from [%d] --> [%d]", gdata->device_info->ssid, gdata->radio_mode, mode);
	gdata->radio_mode = mode;
	if (gdata->device_info->ap_status_txt) {
		g_free(gdata->device_info->ap_status_txt);
		gdata->device_info->ap_status_txt = viewer_manager_get_device_status_txt(gdata->device_info, mode);
	}

	elm_genlist_item_update(item);

	__COMMON_FUNC_EXIT__;
	return TRUE;
}
static void
_contact_lookup(GError *error, GHashTable *contact, gpointer data)
{
	char *tmp;
	GVariant *gtmp;
	struct _recipient_pack *pack = (struct _recipient_pack *)data;

	if (error) {
		g_warning("Error will trying to resolve number: (%d) %s",
			  error->code, error->message);
		ui_utils_error_message_from_gerror_show(VIEW_PTR(*pack->view),
			D_("Error will trying to resolve number."), error);
		return;
	}
	if (!contact ) {
		g_debug("No contact found");
		return;
	}

	tmp = phoneui_utils_contact_display_name_get(contact);
	if (tmp) {
		g_hash_table_insert(pack->recipient, "Name",
				    g_variant_ref_sink(g_variant_new_string(tmp)));
		free(tmp);
	}
	gtmp = g_hash_table_lookup(contact, "Photo");
	if (gtmp) {
		g_hash_table_insert(pack->recipient, "Photo", g_variant_ref(gtmp));
	}
	if (pack->view->layout_recipients) {
		elm_genlist_item_update(pack->glit);
	}
}
예제 #5
0
파일: gui.c 프로젝트: shr-project/e-tasks
void det_page_done(void *data, Evas_Object *obj, void *event_info)
{
	char te_data[255], *task_entry;
	_Task *tsk = (_Task *)data;
	
	sprintf(te_data, "%s", (const char *)elm_entry_entry_get(entry));
	task_entry = strtok(te_data, "<");
	if(strcmp(task_entry, tsk->text)!=0) {
		sprintf(tsk->text, "%s", task_entry);
		WRITE = 1;
	}

	sprintf(te_data, "%s", (const char *)elm_entry_entry_get(note_entry));
	task_entry = strtok(te_data, "<");
	if(strcmp(task_entry, "Note") == 0) task_entry = "";
	if(strcmp(task_entry, tsk->note)!=0) {
		sprintf(tsk->note, "%s", task_entry);
		WRITE = 1;
	}
	
	if(WRITE) {
		WRITE = 0;
		update_record (tsk->no);
		Elm_Object_Item *item;
		item = (Elm_Object_Item *)elm_genlist_selected_item_get(list);
		if(item) elm_genlist_item_update(task_list[tsk->no]);
		last_rec = -1;
		item = elm_genlist_first_item_get(list);
		if(item) elm_genlist_item_selected_set(item ,1);
	}
	cat_win_del(det_page, NULL, NULL);
}
예제 #6
0
void view_main_update_group_title(gboolean is_bg_scan)
{
	Evas_Object *box = NULL;
	Evas_Object *main_list = NULL;

	if (list != NULL) {
		if (!is_bg_scan) {
			Elm_Object_Item *it = elm_genlist_first_item_get(list);

			while (it) {
				elm_object_item_disabled_set(it, EINA_TRUE);
				it = elm_genlist_item_next_get(it);
			}
		}

		elm_genlist_item_update(grouptitle);
	} else {
		box = elm_object_content_get(devpkr_app_state->popup);

		main_list = _create_genlist(box);
		view_main_add_group_title();
		elm_box_pack_start(box, main_list);

		evas_object_show(main_list);
		evas_object_show(box);

		wifi_devpkr_redraw();

		evas_object_show(devpkr_app_state->popup);
	}

	return;
}
static void _gl_bottom_sel_cb(void *data, Evas_Object *obj, void *event_info)
{
	__COMMON_FUNC_ENTER__;
	int ret = -1;
	int bottom_ret = (int)elm_check_state_get(obj);

	INFO_LOG(UG_NAME_NORMAL, "bottom state[%d] is different", bottom_ret);

	ret = wifi_setting_value_get(VCONFKEY_WIFI_ENABLE_QS);
	switch (ret) {
	case 1:
		if (wifi_setting_value_set(VCONFKEY_WIFI_ENABLE_QS, VCONFKEY_WIFI_QS_DISABLE) < 0) {
			ERROR_LOG(UG_NAME_NORMAL, "Failed to set vconf - VCONFKEY_WIFI_QS_DISABLE");
		}
		break;
	case 0:
		if (wifi_setting_value_set(VCONFKEY_WIFI_ENABLE_QS, VCONFKEY_WIFI_QS_ENABLE) < 0) {
			ERROR_LOG(UG_NAME_NORMAL, "Failed to set vconf - VCONFKEY_WIFI_QS_ENABLE");
		}
		break;
	default:
		ERROR_LOG(UG_NAME_NORMAL, "Failed to get vconf value - VCONFKEY_WIFI_ENABLE_QS");
		break;
	}

	ecore_idler_add( (Ecore_Task_Cb)_genlist_item_disable_later, manager_object->item_bottom);
	elm_genlist_item_update(manager_object->item_bottom);

	__COMMON_FUNC_EXIT__;
}
int viewer_manager_header_mode_set(HEADER_MODES mode)
{
	__COMMON_FUNC_ENTER__;

	assertm_if(NULL == manager_object, "NULL!!");
	assertm_if(NULL == manager_object->item_header, "NULL!!");
	assertm_if(HEADER_MODE_OFF > mode || HEADER_MODE_MAX <= mode, "Err!!");

	if (manager_object->header_mode == mode) {
		return FALSE;
	}

	DEBUG_LOG(UG_NAME_NORMAL, "Header mode changing from %d --> %d", manager_object->header_mode, mode);
	manager_object->header_mode = mode;
	if (manager_object->header_text) {
		g_free(manager_object->header_text);
	}

	switch (mode) {
	case HEADER_MODE_OFF:
	case HEADER_MODE_ON:
	case HEADER_MODE_CONNECTED:
	    viewer_manager_hidden_disable_set(FALSE);
	    viewer_manager_scan_button_set(EINA_TRUE);
	    manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi));
	    break;
	case HEADER_MODE_ACTIVATING:
	    viewer_manager_hidden_disable_set(TRUE);
	    manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Activating_WiFi));
	    break;
	case HEADER_MODE_DEACTIVATING:
	    viewer_manager_hidden_disable_set(TRUE);
	    manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Deactivating));
	    break;
	case HEADER_MODE_CONNECTING:
	case HEADER_MODE_DISCONNECTING:
	case HEADER_MODE_CANCEL_CONNECTING:
	case HEADER_MODE_SEARCHING:
	    viewer_manager_hidden_disable_set(TRUE);
	    manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi));
	    break;
	default:
	    assertm_if(TRUE, "Err!!");
	    break;
	}


	elm_genlist_item_update(manager_object->item_header);
	viewer_list_title_item_update();


  if (ug_app_state->ug_type == UG_VIEW_SETUP_WIZARD) {
	    viewer_manager_setup_wizard_button_controller(mode);
	}

	__COMMON_FUNC_EXIT__;

	return TRUE;
}
Elm_Object_Item* viewer_list_item_insert_after(Evas_Object* list,
			void* list_data,
			Elm_Object_Item *after,
			Evas_Smart_Cb callback_func,
			void* callback_data)
{

	Elm_Object_Item* ret = NULL;

	assertm_if(NULL == callback_data, "NULL!!");
	if (!list || !list_data) {
		assertm_if(NULL == list, "NULL!!");
		assertm_if(NULL == list_data, "NULL!!");
		return NULL;
	}

	ug_genlist_data_t* gdata = NULL;
	gdata = (ug_genlist_data_t*) g_malloc0(sizeof(ug_genlist_data_t));
	assertm_if(NULL == gdata, "NULL!!");

	gdata->device_info = (wifi_device_info_t *)list_data;
	gdata->radio_mode = VIEWER_ITEM_RADIO_MODE_OFF;

//	DEBUG_LOG(UG_NAME_NORMAL, "ssid[%s] image[%s]", gdata->device_info->ssid, gdata->device_info->ap_image_path);

	if (!after) {	/* If the after item is NULL then insert it as first item */
//		DEBUG_LOG(UG_NAME_NORMAL, "first added AP item!");
		after = grouptitle;
	}

	ret = elm_genlist_item_insert_after(
			list, /*obj*/
			&itc,/*itc*/
			gdata,/*data*/
			NULL,/*parent*/
			after, /*after than*/
			ELM_GENLIST_ITEM_NONE, /*flags*/
			callback_func,/*func*/
			callback_data);/*func_data*/

	if (!ret) {
		assertm_if(NULL == ret, "NULL!!");
		g_free(gdata->device_info->ap_image_path);
		g_free(gdata->device_info->ap_status_txt);
		g_free(gdata->device_info->ssid);
		g_free(gdata->device_info);
		g_free(gdata);
		return NULL;
	}
		
	container = g_slist_append(container, ret);
	DEBUG_LOG(UG_NAME_NORMAL,
			"* item add complete ssid:[%s] size:[%d]",
			gdata->device_info->ssid,
			viewer_list_item_size_get());

	elm_genlist_item_update(ret);
	return ret;
}
static void
_realize_cb(void *data, Evas_Object *o, void *event_info)
{
   Evas_Object *list = data;
   Elm_Object_Item *glit = elm_genlist_selected_item_get(list);
   if (!glit) return;

   elm_genlist_item_update(glit);
}
예제 #11
0
파일: float.c 프로젝트: drasich/joker
void property_float_update(
      PropertyValue* val,
      float value)
{
  memcpy(val->data, &value, sizeof value);
  elm_genlist_item_update(val->item);
  //eo_do(val->item_eo, jk_entry_value_set(value));
  jk_entry_value_set(val->item_eo, value);
}
int viewer_manager_hidden_disable_set(int mode)
{
	__COMMON_FUNC_ENTER__;
	assertm_if(NULL == manager_object->item_hidden_btn, "NULL!!");
	
	elm_object_item_disabled_set(manager_object->item_hidden_btn, mode);
	elm_genlist_item_update(manager_object->item_hidden_btn);

	__COMMON_FUNC_EXIT__;
	return TRUE;
}
예제 #13
0
파일: gui.c 프로젝트: shr-project/e-tasks
void save_button_clicked(void *data, Evas_Object *obj, void *event_info)
{
	char te_data[255], *task_entry;
	
	//get task no
	Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list);
	if (item) {
		_Task *tsk = (_Task *)elm_object_item_data_get(item);
		
		//get data from entry
		sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk));
		task_entry = strtok(te_data, "<");
		sprintf(tsk->text, "%s", task_entry);
		
		//save data to database
		update_record(tsk->no);
		elm_genlist_item_update(task_list[tsk->no]);
	}
	else { //add a new record with this data
		time_t curtime;
		struct tm *loctime;
		char dt[6], te_data[255], *task_entry;
		int i = total_tasks;

		total_tasks ++;
		
		//get the time
		curtime = time (NULL);
		loctime = localtime (&curtime);
		strftime(dt, 6, "%d-%m", loctime);

		Task[i].no = i;
		Task[i].cb = 0;
		if (dummy_pr) Task[i].pr = dummy_pr;
		else Task[i].pr = 1;
		//get entry data
		sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk));
		task_entry = strtok(te_data, "<");
		if (strcmp(task_entry, "") !=0) strcpy(Task[i].text, task_entry);
		else strcpy(Task[i].text, "Task");
		//set current date
		if (strcmp(dummy_date, "") != 0) strcpy(Task[i].date, dummy_date);
		else strcpy(Task[i].date, dt);
		if(strcmp(sel_category, " All Tasks ")==0) strcpy(Task[i].cat, "Personal");
		else strcpy(Task[i].cat, sel_category);
		task_list[i] = elm_genlist_item_append(list, &itc1, &Task[i], NULL, ELM_GENLIST_ITEM_NONE,
							 	 	NULL, NULL);
		last_rec = -1;
		//insert record
		insert_record(i);
		elm_genlist_item_selected_set(task_list[i], 1);
	}
}
예제 #14
0
static Eina_Bool _back_cb(void *data , Elm_Object_Item *item)
{
    DBG("test _back_cb()");
    oicappData *ad = data;

    elm_genlist_item_update(ad->itemConsumer);
    elm_genlist_item_update(ad->itemConsumerHost);
    elm_genlist_item_update(ad->itemConsumerTemp);
    elm_genlist_item_update(ad->itemConsumerHumid);
    elm_genlist_item_update(ad->itemConsumerUri);

    elm_object_item_disabled_set(ad->itemConsumer , EINA_FALSE);
    elm_object_item_disabled_set(ad->itemConsumerHost , EINA_TRUE);
    elm_object_item_disabled_set(ad->itemConsumerTemp , EINA_TRUE);
    elm_object_item_disabled_set(ad->itemConsumerHumid , EINA_TRUE);
    elm_object_item_disabled_set(ad->itemConsumerUri , EINA_TRUE);

    elm_exit();

    return EINA_FALSE;
}
Eina_Bool viewer_manager_genlist_item_update(Elm_Object_Item* item)
{
	__COMMON_FUNC_ENTER__;
	if (item == NULL) {
		__COMMON_FUNC_EXIT__;
		return EINA_FALSE;
	}
	
	elm_genlist_item_update(item);

	__COMMON_FUNC_EXIT__;
	return EINA_FALSE;
}
예제 #16
0
파일: gui.c 프로젝트: shr-project/e-tasks
void note_done(void *data, Evas_Object *obj, void *event_info)
{
	char tystr[255];
	//Evas_Object *en = data;
	
	Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list);
	_Task *tsk = (_Task *)elm_object_item_data_get(item);
	sprintf(tystr, "%s", elm_entry_entry_get(data));
	if (strcmp(tystr, "<br>") == 0) strcpy(tystr, "");
	strcpy(tsk->note, tystr);
	save_note(tystr, tsk->no);
	elm_genlist_item_update(item);
	cat_win_del (note_win, NULL, NULL);
}
static void _gl_header_sel_cb(void *data, Evas_Object *obj, void *event_info)
{
	__COMMON_FUNC_ENTER__;
	const HEADER_MODES header_mode = viewer_manager_header_mode_get();
	if (HEADER_MODE_ACTIVATING != header_mode && HEADER_MODE_DEACTIVATING != header_mode)
		power_control();

	ecore_idler_add( (Ecore_Task_Cb) _genlist_item_disable_later, manager_object->item_header);

	elm_genlist_item_update(manager_object->item_header);

	__COMMON_FUNC_EXIT__;
	return;
}
예제 #18
0
void view_main_item_state_set(wifi_ap_h ap, ITEM_CONNECTION_MODES state)
{
	__COMMON_FUNC_ENTER__;

	char *item_ssid = NULL;
	wifi_security_type_e sec_type;
	wlan_security_mode_type_t item_sec_mode;
	Elm_Object_Item* it = NULL;

	it = elm_genlist_first_item_get(list);
	if (!it ||
		!ap ||
		(WIFI_ERROR_NONE != wifi_ap_get_essid(ap, &item_ssid)) ||
		(WIFI_ERROR_NONE != wifi_ap_get_security_type(ap, &sec_type))) {
		ERROR_LOG(SP_NAME_NORMAL, "Invalid params");
		if(item_ssid != NULL) {
			g_free(item_ssid);
			item_ssid = NULL;
		}
		__COMMON_FUNC_EXIT__;
		return;
	}
	item_sec_mode = common_utils_get_sec_mode(sec_type);
	SECURE_INFO_LOG(SP_NAME_NORMAL, "item state set for AP[%s] with sec mode[%d]", item_ssid, item_sec_mode);
	while (it) {
		devpkr_gl_data_t *gdata = (devpkr_gl_data_t *)elm_object_item_data_get(it);
		if (gdata != NULL) {
			SECURE_INFO_LOG(SP_NAME_NORMAL, "gdata AP[%s] with sec mode[%d]",
					gdata->dev_info->ssid, gdata->dev_info->security_mode);
		}

		if (gdata && gdata->dev_info->security_mode == item_sec_mode &&
			!g_strcmp0(gdata->dev_info->ssid, item_ssid)) {
			if (gdata->connection_mode != state) {
				gdata->connection_mode = state;
				INFO_LOG(SP_NAME_NORMAL, "State transition from [%d] --> [%d]", view_main_state_get(), state);
				view_main_state_set(state);
				elm_genlist_item_update(it);
			}
			break;
		}

		it = elm_genlist_item_next_get(it);
	}
	g_free(item_ssid);
	__COMMON_FUNC_EXIT__;
	return;
}
예제 #19
0
void _gl_update_item(oicappData *ad , const char *title , Elm_Object_Item *item)
{
    oicappItemData *it_data;

    it_data = calloc(1 , sizeof(oicappItemData));
    if (NULL == it_data)
    {
        DBG("calloc failed!!!!");
        return;
    }
    it_data->title = title;
    it_data->ad = ad;

    elm_object_item_data_set(item , it_data);
    elm_genlist_item_update(item);
}
void Browser_Settings_Website_Setting::__application_cache_origin_get_cb(Eina_List* origins, void* user_data)
{
	BROWSER_LOGD("[%s]", __func__);
	Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)user_data;

	Eina_List *list = NULL;
	void *list_data = NULL;

	EINA_LIST_FOREACH(origins, list, list_data) {
		BROWSER_LOGD("list_data=%d", list_data);
		if (list_data) {
			Ewk_Security_Origin *origin = (Ewk_Security_Origin *)list_data;;
			BROWSER_LOGD("<<< host = [%s]", ewk_security_origin_host_get(origin));

			Eina_Bool duplicated = EINA_FALSE;
			for (int i = 0 ; i < website_setting->m_website_setting_list.size() ; i++) {
				if (!website_setting->m_website_setting_list[i]->url.empty()
				    && !strcmp(website_setting->m_website_setting_list[i]->url.c_str(), ewk_security_origin_host_get(origin))) {
					duplicated = EINA_TRUE;
					website_setting->m_website_setting_list[i]->storage = EINA_TRUE;
					website_setting->m_website_setting_list[i]->origin = origin;

					elm_genlist_item_update((Elm_Object_Item *)(website_setting->m_website_setting_list[i]->user_data));
					break;
				}
			}

			if (!duplicated) {
				website_setting_item *item = new(nothrow) website_setting_item;
				item->allow = EINA_FALSE;
				item->geolocation = EINA_FALSE;
				item->storage = EINA_TRUE;
				item->url = std::string(ewk_security_origin_host_get(origin));
				item->origin = origin;

				item->user_data = (void*)elm_genlist_item_append(website_setting->m_genlist, &website_setting->m_1_text_2_icon_item_class,
										item, NULL, ELM_GENLIST_ITEM_NONE,
										__item_selected_cb, website_setting);
				website_setting->m_website_setting_list.push_back(item);
			}
		}
	}
예제 #21
0
파일: gui.c 프로젝트: shr-project/e-tasks
 void task_select(void *data, Evas_Object *obj, void *event_info)
{
	char tystr[2];
	char te_data[255], *task_entry;
	Elm_Object_Item *item;
	_Task *tsk=NULL;

	//for entries, get entry data and check agianst previous task text, date
	//if changed - write
	if (last_rec != -1) { //cater for initial null data
		sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk));
		task_entry = strtok(te_data, "<");
		tsk = (_Task *)elm_object_item_data_get(task_list[last_rec]);
		if (strcmp(task_entry, tsk->text) != 0) {
			sprintf(tsk->text, "%s", task_entry);
			WRITE = 1;
		}
	}
	
	if (WRITE == 1) {
		elm_genlist_item_update(task_list[last_rec]);
		update_record(tsk->no);
		WRITE = 0;
	}
	
	Evas_Object *li = data;
	item = (Elm_Object_Item *)elm_genlist_selected_item_get(li);
	tsk = (_Task *)elm_object_item_data_get(item);
	last_rec = tsk->no;
	elm_object_text_set(cat_bt, tsk->cat);
	sprintf(tystr, "%d", tsk->pr);
	elm_object_text_set(pr_bt, tystr);
	elm_object_text_set(date_bt, tsk->date);
	elm_entry_entry_set(tk, tsk->text);
	if (strcmp(tsk->text, "Task") == 0) elm_entry_select_all(tk);
}
void viewer_list_title_item_update()
{
	elm_genlist_item_update(grouptitle);
}