/* Add or Update Contact details */ static void add_update_user(Db_Entry NewContact) { Db_Entry *entry; if (App.editing) { Db_Entry *contact; contact = elm_list_item_data_get(App.selection); /* Replace strings on memory */ eina_stringshare_replace(&(contact->Name), NewContact.Name); eina_stringshare_replace(&(contact->Email), NewContact.Email); eina_stringshare_replace(&(contact->Phone), NewContact.Phone); eina_stringshare_replace(&(contact->Street), NewContact.Street); eina_stringshare_replace(&(contact->Neighborhood), NewContact.Neighborhood); contact->Gender = NewContact.Gender; /* Update Elementary List */ elm_list_item_label_set(App.selection, NewContact.Name); } else { /* Add New Entry on DB */ entry = db_append(App._db, NewContact); elm_list_item_append(App.contactlist, entry->Name, NULL, NULL, NULL, entry); elm_list_go(App.contactlist); } }
/* Button "Delete" from Register Page */ static void delete_clicked (void *data, Evas_Object *obj, const char *emission, const char *source) { Db_Entry *contact; contact = elm_list_item_data_get(App.selection); elm_list_item_del(App.selection); db_remove(App._db, contact); elm_pager_content_promote(App.info.pager, App.info.pgMain); }
/* Button "Next" from Browse Page */ static void next_clicked (void *data, Evas_Object *obj, const char *emission, const char *source) { Db_Entry *Contact; Elm_List_Item *next; next = elm_list_item_next(App.selection); if (next) { App.selection = next; elm_list_item_selected_set(App.selection, EINA_TRUE); Contact = (Db_Entry*) elm_list_item_data_get(App.selection); load_values(Contact); } }
/* Button "Previous" from Browse Page */ static void previous_clicked (void *data, Evas_Object *obj, const char *emission, const char *source) { Db_Entry *Contact; Elm_List_Item *prev; prev = elm_list_item_prev(App.selection); if (prev) { App.selection = prev; elm_list_item_selected_set(App.selection, EINA_TRUE); Contact = (Db_Entry*) elm_list_item_data_get(App.selection); load_values(Contact); } }
/* Button "Edit" from Browse Page */ static void edit_clicked (void *data, Evas_Object *obj, const char *emission, const char *source) { Db_Entry *contact; elm_pager_content_promote(App.info.pager, App.info.pgRegister); contact = elm_list_item_data_get(App.selection); GET_ED_FROM_PAGE(pgRegister); entry_value_set(ed,"EntryName", contact->Name); entry_value_set(ed,"EntryEmail", contact->Email); entry_value_set(ed,"EntryPhone", contact->Phone); entry_value_set(ed,"EntryStreet", contact->Street); entry_value_set(ed,"EntryNeighborhood", contact->Neighborhood); radio_value_set(ed, "RadioGender", contact->Gender); button_show(ed,"BtnDelete"); App.editing = EINA_TRUE; }
void playlist_click_cb(void *data, Evas_Object *obj, void *event_info){ playlist_item *item; Elm_List_Item *it = elm_list_selected_item_get(obj); item = (playlist_item*) elm_list_item_data_get(it); cmd_jump_and_play((rockon_data*)data, item->pos); }