void
sp_view_mgr_pop_view_content(Sp_View_Manager *view_mgr, bool pop_to_first)
{
	startfunc;
	MP_CHECK(view_mgr);
	MP_CHECK(view_mgr->navi);

	GList *last = g_list_last(view_mgr->view_history);
	MP_CHECK(last);
	Sp_View_Data *view_data = last->data;
	MP_CHECK(view_data);

	if (pop_to_first) {
		Elm_Object_Item *bottom_item = elm_naviframe_bottom_item_get(view_mgr->navi);
		if (bottom_item)
			elm_naviframe_item_pop_to(bottom_item);

		while(view_data && view_data->index > 0) {
			SAFE_FREE(view_data);
			view_mgr->view_history = g_list_delete_link(view_mgr->view_history, last);
			last = g_list_last(view_mgr->view_history);
			if (last)
				view_data = last->data;
		}
	} else {
		elm_naviframe_item_pop(view_mgr->navi);
		IF_FREE(view_data);
		view_mgr->view_history = g_list_delete_link(view_mgr->view_history, last);
	}

	if (g_list_length(view_mgr->view_history) == 0) {
		g_list_free(view_mgr->view_history);
		view_mgr->view_history = NULL;
	}
}
void Browser_Settings_Website_Setting::__back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
	BROWSER_LOGD("[%s]", __func__);

	if (elm_naviframe_bottom_item_get(m_navi_bar)
	    != elm_naviframe_top_item_get(m_navi_bar))
		elm_naviframe_item_pop(m_navi_bar);
}
Exemplo n.º 3
0
PREFIX value ml_elm_naviframe_bottom_item_get(value v_obj)
{
        Elm_Object_Item* it = elm_naviframe_bottom_item_get(
                (Evas_Object*) v_obj);
        if(it == NULL) return Val_int(0);
        value v = caml_alloc(1, 0);
        Store_field(v, 0, (value) it);
        return v;
}
void Add_To_Most_Visited_Sites_View::__cancel_button_clicked_cb(void *data, Evas_Object *obj,
										void *event_info)
{
	BROWSER_LOGD("[%s]", __func__);
	if (!data)
		return;
	Add_To_Most_Visited_Sites_View *add_to_most_visited_sites_view = NULL;
	add_to_most_visited_sites_view = (Add_To_Most_Visited_Sites_View *)data;

	if (elm_naviframe_bottom_item_get(m_navi_bar) != elm_naviframe_top_item_get(m_navi_bar))
		elm_naviframe_item_pop(m_navi_bar);
}
Exemplo n.º 5
0
uib_view_context* initialize() {
	memset(&g_uib_device_info, 0x00, sizeof(uib_device_info_st));
	uib_util_get_device_info(&g_uib_device_info);
	window_obj* win_obj = uib_views_get_instance()->create_window_obj();
        uib_util_rotation_set(win_obj->win, e_rotation_fullSensor);
	uib_view_context* vc = uib_views_get_instance()->startup_view_create(win_obj);
	Evas_Object* nf = win_obj->app_naviframe;
	Elm_Object_Item* nf_it = elm_naviframe_bottom_item_get(nf);

	eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, nf_hw_back_cb, vc);
	evas_object_show(nf);
	elm_naviframe_item_pop_cb_set(nf_it, nf_root_it_pop_cb, win_obj->win);

	elm_app_base_scale_set(g_uib_device_info.base_scale);
	evas_object_smart_callback_add(win_obj->win, "delete,request", win_del_request_cb, NULL);
	return vc;
}
Eina_Bool Add_To_Most_Visited_Sites_View::_save_button_clicked(void)
{
	BROWSER_LOGD("[%s]", __func__);
	Evas_Object *entry = br_elm_editfield_entry_get(m_url_edit_field);
	char* url = _trim(elm_entry_markup_to_utf8(elm_entry_entry_get(entry)));
	if (!url || !strlen(url)) {
		show_msg_popup(BR_STRING_EMPTY);
		return EINA_FALSE;
	}

	std::string full_url = std::string(url);

	if (_has_url_sheme(url)) {
		char *token = strstr(url, BROWSER_URL_SCHEME_CHECK);
		if (token && strlen(token) == 3) {
			/* If input url has only sheme such as 'http://', 'https://' */
			show_msg_popup(BR_STRING_EMPTY);
			return EINA_FALSE;
		}
	} else
		full_url = std::string(BROWSER_HTTP_SCHEME) + std::string(url);

	if (m_most_visited_sites->m_selected_item->url && strlen(m_most_visited_sites->m_selected_item->url)) {
		if (!strcmp(full_url.c_str(), m_most_visited_sites->m_selected_item->url)) {
			/* If the url is not changed in case of modify speed dial item. */
			if (elm_naviframe_bottom_item_get(m_navi_bar)
			    != elm_naviframe_top_item_get(m_navi_bar))
				elm_naviframe_item_pop(m_navi_bar);
			return EINA_FALSE;
		}
	}

	std::string history_id;
	history_id = m_most_visited_sites->m_most_visited_sites_db->get_history_id_by_url(full_url.c_str());

	char *screen_shot_path = NULL;
	if (history_id.empty())
		screen_shot_path = strdup("default_noscreenshot");
	else
		screen_shot_path = strdup(history_id.c_str());

	if (!screen_shot_path) {
		BROWSER_LOGE("strdup failed");
		return EINA_FALSE;
	}

	int index = 0;
	Elm_Object_Item *it = elm_gengrid_first_item_get(m_most_visited_sites->m_gengrid);
	do {
		if (it == m_most_visited_sites->m_selected_item->item)
			break;
		index++;
	} while (it = elm_gengrid_item_next_get(it));

	if (!m_most_visited_sites->m_most_visited_sites_db->save_most_visited_sites_item(index, full_url.c_str(),
						full_url.c_str(), screen_shot_path)) {
		BROWSER_LOGE("save_most_visited_sites_item failed");
		return EINA_FALSE;
	}

	free(screen_shot_path);

	if (!m_most_visited_sites->_reload_items()) {
		BROWSER_LOGE("m_most_visited_sites->_reload_items failed");
		return EINA_FALSE;
	}

	return EINA_TRUE;
}