diff options
author | Russ Allbery <rra@debian.org> | 2008-04-05 11:49:47 -0700 |
---|---|---|
committer | Russ Allbery <rra@debian.org> | 2008-04-05 11:49:47 -0700 |
commit | fe15fa62fee6fe5e5f09e2ad6156be97e2b4f357 (patch) | |
tree | adea8d5c43b20a8fb47f3f83d2032c2e46cb5b52 /gtktheory.c | |
parent | a7b397b9cba0433df7783403a153767f918af350 (diff) |
Imported Upstream version 0.9.0
Diffstat (limited to 'gtktheory.c')
-rw-r--r-- | gtktheory.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/gtktheory.c b/gtktheory.c index 3326b52..31c1877 100644 --- a/gtktheory.c +++ b/gtktheory.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: gtktheory.c,v 1.44 2008/02/03 15:37:36 c_anthon Exp $ + * $Id: gtktheory.c,v 1.46 2008/03/12 22:56:34 Superfly_Jon Exp $ */ #include "config.h" @@ -581,36 +581,37 @@ PlyClicked( GtkWidget *pw, theorywidget *ptw ) { int *pi = (int *) g_object_get_data( G_OBJECT( pw ), "ply" ); int f = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( pw ) ); cubeinfo ci; - float aarRates[ 2 ][ 2 ]; + decisionData dd; #if defined (REDUCTION_CODE) evalcontext ec = { FALSE, 0, 0, TRUE, 0.0 }; #else evalcontext ec = { FALSE, 0, FALSE, TRUE, 0.0 }; #endif - float arOutput[ NUM_OUTPUTS ]; int i, j; if ( !f ) return; GetMatchStateCubeInfo ( &ci, &ms ); - TheoryGetValues( ptw, &ci, aarRates ); + TheoryGetValues( ptw, &ci, dd.aarRates ); ec.nPlies = *pi; - ProgressStart( _("Evaluating gammon percentages" ) ); - if ( getCurrentGammonRates ( aarRates, arOutput, msBoard(), - &ci, &ec ) < 0 ) { - ProgressEnd(); + + dd.pboard = msBoard(); + dd.pci = &ci; + dd.pec = &ec; + + if (RunAsyncProcess((AsyncFun)asyncGammonRates, &dd, _("Evaluating gammon percentages")) != ASR_OK) + { fInterrupt = FALSE; - return; + return; } - ProgressEnd(); for ( i = 0; i < 2; ++i ) for ( j = 0; j < 2; ++j ) gtk_adjustment_set_value ( GTK_ADJUSTMENT ( ptw->aapwRates[ i ][ j ] ), - aarRates[ i ][ j ] * 100.0f ); + dd.aarRates[ i ][ j ] * 100.0f ); TheoryUpdated( NULL, ptw ); @@ -995,15 +996,11 @@ GTKShowTheory ( const int fActivePage ) { /* show dialog */ - gtk_widget_show_all( pwDialog ); - ResetTheory ( NULL, ptw ); TheoryUpdated ( NULL, ptw ); gtk_notebook_set_page ( GTK_NOTEBOOK ( pwNotebook ), fActivePage ? 2 /* prices */ : 0 /* market */ ); - GTKDisallowStdin(); - gtk_main(); - GTKAllowStdin(); + GTKRunDialog(pwDialog); } |