int pos_y;
int pos_x;
char *pkg_name;
+ char *widget_label;
char *content_info;
widget_size_type_e type;
double period;
int cluster_data_get_page_count();
void cluster_data_set_page_count(int count);
-void cluster_data_insert_widget(const char* pkg_name, const char* content_info, int type);
+void cluster_data_insert_widget(const char* pkg_name, const char *label, const char* content_info, int type);
void cluster_data_insert(widget_data_t *item);
void cluster_data_delete(widget_data_t *item);
void cluster_data_update(widget_data_t *item);
int type = *size;
free(size);
+
char *widget_id = strdup(widget->widget_id);
+ char *widget_label = strdup(widget->label);
cluster_view_set_state(VIEW_STATE_NORMAL);
- cluster_data_insert_widget(widget_id, NULL, type);
+ cluster_data_insert_widget(widget_id, widget_label, NULL, type);
free(widget_id);
+ free(widget_label);
}
static void __add_widget_get_size_by_type(int type, int *w, int *h)
* limitations under the License.
*/
#include <app_preference.h>
+#include <system_settings.h>
#include "cluster_data.h"
#include "cluster_db.h"
}
}
-void cluster_data_insert_widget(const char* pkg_name, const char* content_info, int type)
+void cluster_data_insert_widget(const char* pkg_name, const char *label, const char* content_info, int type)
{
widget_data_t *new_item = (widget_data_t *)malloc(sizeof(widget_data_t));
memset(new_item, 0, sizeof(widget_data_t));
new_item->pos_y = INIT_VALUE;
new_item->pos_x = INIT_VALUE;
new_item->pkg_name = strdup(pkg_name);
+ new_item->widget_label = strdup(label);
new_item->content_info = content_info == NULL ? NULL : strdup(content_info);
new_item->type = type;
new_item->period = 0.0;
* org.tizen.music-player.widget
* org.tizen.contacts-widget
*/
+ char *lang = NULL;
+ int ret = SYSTEM_SETTINGS_ERROR_NONE;
widget_data_t *new_item = (widget_data_t *)malloc(sizeof(widget_data_t));
memset(new_item, 0, sizeof(widget_data_t));
new_item->page_idx = 0;
new_item->pos_y = 0;
new_item->pos_x = 0;
new_item->pkg_name = strdup("org.tizen.calendar.widget");
+
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &lang);
+ if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
+ LOGE("SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE : fail");
+ lang = NULL;
+ }
+ eina_str_tolower(&lang);
+
+ Eina_Strbuf *lang_buf = eina_strbuf_new();
+ eina_strbuf_append_printf(lang_buf, "%s", lang);
+ eina_strbuf_replace_all(lang_buf, "_", "-");
+
+ new_item->widget_label = widget_service_get_name(new_item->pkg_name, eina_strbuf_string_get(lang_buf));
+ if (!new_item->widget_label || strlen(new_item->widget_label) == 0)
+ new_item->widget_label = strdup("calendar");
+
new_item->content_info = NULL;
new_item->type = WIDGET_SIZE_TYPE_4x4;
new_item->period = 0.0;
COL_POS_Y,
COL_POS_X,
COL_PKG_NAME,
+ COL_WIDGET_LABEL,
COL_CONTENT_INFO,
COL_TYPE,
COL_PERIOD,
y INTEGER default 0,\
x INTEGER default 0,\
pkgName TEXT,\
+ widgetLabel TEXT,\
content TEXT,\
type INTEGER default 0,\
period REAL default 0.0,\
y=%d,\
x=%d,\
pkgName='%s',\
+ widgetLabel='%s',\
content='%s',\
type=%d,\
period=%lf,\
y,\
x,\
pkgName,\
+ widgetLabel,\
content,\
type,\
period,\
- allow) VALUES(%d,%d, %d,'%s','%s',%d, '%lf',%d)"
+ allow) VALUES(%d, %d, %d, '%s', '%s', '%s', %d, '%lf', %d)"
#define SELECT_ITEM "SELECT * FROM clusters;"
item->pos_x = sqlite3_column_int(stmt, COL_POS_X);
str = (const char *) sqlite3_column_text(stmt, COL_PKG_NAME);
item->pkg_name = (!str || !strlen(str)) ? NULL : strdup(str);
+ str = (const char *) sqlite3_column_text(stmt, COL_WIDGET_LABEL);
+ item->widget_label = (!str || !strlen(str)) ? NULL : strdup(str);
str = (const char *) sqlite3_column_text(stmt, COL_CONTENT_INFO);
item->content_info = (!str || !strlen(str) || strncmp(str, "(null)", strlen("(null)")) == 0 ) ? NULL : strdup(str);
item->type = sqlite3_column_int(stmt, COL_TYPE);
item->pos_y,
item->pos_x,
item->pkg_name,
+ item->widget_label,
item->content_info,
item->type,
item->period,
item->pos_y,
item->pos_x,
item->pkg_name,
+ item->widget_label,
item->content_info,
item->type,
item->period,
info->is_access_obj = EINA_FALSE;
info->target = item->widget_layout;
info->parent = page_t->page_layout;
- info->name = strdup(item->pkg_name);
+ info->name = strdup(item->widget_label);
info->description = strdup(_("IDS_BR_BODY_DOUBLE_TAP_AND_HOLD_THEN_DRAG_TO_REORDER_TTS"));
info->role = ELM_ATSPI_ROLE_UNKNOWN;
info->clicked_cb = NULL;
{
Evas_Object *widget_layout;
- LOGD("pkg : %s , Content INfo : %s", widget_data->pkg_name, widget_data->content_info);
+ LOGD("pkg : %s , label: %s, Content INfo : %s", widget_data->pkg_name, widget_data->widget_label, widget_data->content_info);
widget_layout = elm_layout_add(parent);
elm_layout_file_set(widget_layout, util_get_res_file_path(EDJE_DIR"/widget.edj"), GROUP_WIDGET_LY);
evas_object_size_hint_weight_set(widget_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);