diff options
| author | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-12-01 18:04:43 +0000 |
|---|---|---|
| committer | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-12-01 18:04:43 +0000 |
| commit | 388f2f1b847fcade8b92efc3e535656bd7b19668 (patch) | |
| tree | a88e1075e82962e4e0c003a134a00815db5fd0c3 /gui | |
| parent | 278576b49022ce759121c38a05dc0dfe9a4b0f8b (diff) | |
| download | pcsxr-388f2f1b847fcade8b92efc3e535656bd7b19668.tar.gz | |
Cheat toggling.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@81603 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/Cheat.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/gui/Cheat.c b/gui/Cheat.c index 01aab2b1..4eeef198 100644 --- a/gui/Cheat.c +++ b/gui/Cheat.c @@ -275,14 +275,29 @@ static void OnCheatListDlg_DelClicked(GtkWidget *widget, gpointer user_data) { // rather than regenerating the whole list } -static void OnCheatListDlg_EnableToggled(GtkWidget *widget, gchar *path, gpointer user_data) { - int i = atoi(path); +static void OnCheatListDlg_EnableToggled(GtkCellRendererToggle *cell, gchar *path_str, gpointer user_data) { + GtkWidget *widget; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + gboolean fixed; + + widget = gtk_builder_get_object (builder, "GtkCList_Cheat"); + model = gtk_tree_view_get_model (GTK_TREE_VIEW(widget)); + path = gtk_tree_path_new_from_string (path_str); + + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get (model, &iter, 0, &fixed, -1); + fixed ^= 1; + + int i = atoi(path_str); assert(i >= 0 && i < NumCheats); - Cheats[i].Enabled ^= 1; + + Cheats[i].Enabled = fixed; - LoadCheatListItems(i); // FIXME: should modify it in the list directly - // rather than regenerating the whole list + gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, fixed, -1); + gtk_tree_path_free (path); } static void OnCheatListDlg_OpenClicked(GtkWidget *widget, gpointer user_data) { |
