| 652 | } |
| 653 | |
| 654 | static void removeCheatFromActive (GtkWidget * widget, cheat_win_t * cw) |
| 655 | { |
| 656 | int numListRows; |
| 657 | GList *selListRows, *tmpList; |
| 658 | GtkTreeModel *model = NULL; |
| 659 | GtkTreeSelection *treeSel; |
| 660 | |
| 661 | treeSel = |
| 662 | gtk_tree_view_get_selection (GTK_TREE_VIEW |
| 663 | (cw->actv_cheat_tree)); |
| 664 | |
| 665 | numListRows = gtk_tree_selection_count_selected_rows (treeSel); |
| 666 | |
| 667 | if (numListRows == 0) |
| 668 | { |
| 669 | return; |
| 670 | } |
| 671 | //printf("Number of Rows Selected: %i\n", numListRows ); |
| 672 | |
| 673 | selListRows = gtk_tree_selection_get_selected_rows (treeSel, &model); |
| 674 | |
| 675 | tmpList = selListRows; |
| 676 | |
| 677 | while (tmpList) |
| 678 | { |
| 679 | int depth; |
| 680 | int *indexArray; |
| 681 | GtkTreePath *path = (GtkTreePath *) tmpList->data; |
| 682 | |
| 683 | depth = gtk_tree_path_get_depth (path); |
| 684 | indexArray = gtk_tree_path_get_indices (path); |
| 685 | |
| 686 | if (depth > 0) |
| 687 | { |
| 688 | //GtkTreeIter iter; |
| 689 | FCEUI_DelCheat (indexArray[0]); |
| 690 | |
| 691 | //if ( gtk_tree_model_get_iter ( model, &iter, path ) ) |
| 692 | //{ |
| 693 | // gtk_tree_store_remove( actv_cheats_store, &iter ); |
| 694 | //} |
| 695 | } |
| 696 | |
| 697 | tmpList = tmpList->next; |
| 698 | } |
| 699 | |
| 700 | g_list_free_full (selListRows, (GDestroyNotify) gtk_tree_path_free); |
| 701 | |
| 702 | updateAllActvCheatLists (1); |
| 703 | } |
| 704 | |
| 705 | static void updateCheatList (GtkWidget * widget, cheat_win_t * cw) |
| 706 | { |
nothing calls this directly
no test coverage detected