/* Called when a key is pressed while the tree is focused: * we use this to delete the selected rows if "DEL" is pressed */ static Etk_Bool _etk_test_tree_key_down_cb(Etk_Object *object, Etk_Event_Key_Down *event, void *data) { Etk_Tree *tree; Etk_Tree_Row *r; if (!(tree = ETK_TREE(object))) return ETK_FALSE; if (strcmp(event->keyname, "Delete") == 0) { /* We walk through all the rows of the tree, and we delete those which are selected. * Note that we can safely manipulate "r" with etk_tree_row_walk_next(), even if it * has been deleted with etk_tree_row_delete(), because etk_tree_row_delete() just * marks the row as deleted, but the row is not effectively deleted immediately */ for (r = etk_tree_first_row_get(tree); r; r = etk_tree_row_walk_next(r, ETK_TRUE)) { if (etk_tree_row_is_selected(r)) etk_tree_row_delete(r); } return ETK_TRUE; } return ETK_FALSE; }
static void message_list_view_message_deleted_callback(struct MessageListViewData *data) { // TODO: Reload list instead of deleting the selected message data->selected_row = etk_tree_selected_row_get(data->tree); if (data->selected_row != NULL) { etk_tree_row_delete(data->selected_row); } }
void bootpanel_remove_interface(char* interface, boot_panel* pnl) { EXALT_ASSERT_RETURN_VOID(pnl!=NULL); EXALT_ASSERT_RETURN_VOID(interface!=NULL); Etk_Tree_Row* row; row = bootpanel_findrow(interface,pnl); if(row) etk_tree_row_delete(row); }
Etk_Bool _data_del_button_click_cb(Etk_Button *button, void *data) { const char *name; Etk_Tree_Row *row, *next_row; name = etk_entry_text_get(ETK_ENTRY(UI_DataNameEntry)); if (!name) return ETK_TRUE; row = etk_tree_selected_row_get(ETK_TREE(UI_DataList)); next_row = etk_tree_row_next_get(row); edje_edit_data_del(edje_o, name); etk_tree_row_delete(row); if (!next_row) next_row = etk_tree_last_row_get(ETK_TREE(UI_DataList)); etk_tree_row_select(next_row); return ETK_TRUE; }
/*Location related functions*/ static void _etk_layout_location_delete_confirm_cb(Etk_Object * object, void *data) { entropy_gui_component_instance* instance = data; entropy_layout_gui* gui = instance->data; Etk_Tree_Row* row = gui->delete_row; Entropy_Config_Structure* structure; Ecore_List* row_refs = NULL; _layout_etk_row_structure_plugin* ref; if (row) { structure = ecore_hash_get(_etk_layout_row_reference, row); row_refs = ecore_hash_get(_etk_layout_structure_plugin_reference, structure); if (row_refs) { while ( (ref = ecore_list_first_remove(row_refs))) { etk_tree_row_delete(ref->row); IF_FREE(ref); } ecore_list_destroy(row_refs); ecore_hash_remove(_etk_layout_structure_plugin_reference, structure); } entropy_config_standard_structure_remove(structure); } }
void mainWindow_eth_cb(exalt_ethernet* eth, int action, void* user_data) {/*{{{*/ char wireless_img[] = PACKAGE_DATA_DIR ICONS_WIRELESS_ACTIVATE; char wireless_img_not_activate[] = PACKAGE_DATA_DIR ICONS_WIRELESS_NOT_ACTIVATE; char eth_img[] = PACKAGE_DATA_DIR ICONS_ETHERNET_ACTIVATE; char eth_img_not_activate[] = PACKAGE_DATA_DIR ICONS_ETHERNET_NOT_ACTIVATE; main_window* win = (main_window*) user_data; if(action == EXALT_ETH_CB_NEW) { char* img; if(exalt_eth_is_wireless(eth)) { if(exalt_eth_is_activate(eth) && exalt_wireless_raddiobutton_ison(exalt_eth_get_wireless(eth))) img = wireless_img; else img = wireless_img_not_activate; } else if(exalt_eth_is_activate(eth)) img = eth_img; else img = eth_img_not_activate; etk_tree_row_append(ETK_TREE(win->eth_list), NULL, win->eth_col0,img,NULL,exalt_eth_get_name(eth) , NULL); } else if(action == EXALT_ETH_CB_REMOVE) { Etk_Tree_Row* row; row = mainWindow_findrow(win, eth); if(row) etk_tree_row_delete(row); } else if(action == EXALT_ETH_CB_ACTIVATE || EXALT_ETH_CB_DEACTIVATE || EXALT_ETH_CB_WIRELESS_RADIO_ON || EXALT_ETH_CB_WIRELESS_RADIO_OFF) { Etk_Tree_Row *row; row = mainWindow_findrow(win, eth); if(row) { if(exalt_eth_is_wireless(eth)) { short radio; radio = exalt_wireless_raddiobutton_ison(exalt_eth_get_wireless(eth)); if(radio && exalt_eth_is_activate(eth)) etk_tree_row_fields_set(row, 0, win->eth_col0,wireless_img,NULL,exalt_eth_get_name(eth), NULL); else etk_tree_row_fields_set(row, 0, win->eth_col0,wireless_img_not_activate,NULL,exalt_eth_get_name(eth), NULL); } else if(exalt_eth_is_activate(eth)) etk_tree_row_fields_set(row, 0, win->eth_col0,eth_img,NULL,exalt_eth_get_name(eth), NULL); else etk_tree_row_fields_set(row, 0, win->eth_col0,eth_img_not_activate,NULL,exalt_eth_get_name(eth), NULL); } //update the panel eth_panel* pnl = win->eth_panel; if(pnl->eth == eth) ethpanel_set_eth(pnl,eth); //update the wireless panel wireless_panel* wpnl = win->wireless_panel; if(wpnl->eth == eth) wirelesspanel_set_eth(wpnl,eth); } }/*}}}*/