[gnumeric] Solver: propagate error messages.



commit 8a11f5fbd062f9ef0372f97aa8b7c80c27c558ae
Author: Morten Welinder <terra gnome org>
Date:   Tue May 5 22:15:07 2015 -0400

    Solver: propagate error messages.

 src/dialogs/ChangeLog       |    5 +++++
 src/dialogs/dialog-solver.c |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index f4b8c80..a792135 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-05  Morten Welinder  <terra gnome org>
+
+       * dialog-solver.c (run_solver): If starting the solver fails, let
+       the user know why.
+
 2015-05-04  Morten Welinder  <terra gnome org>
 
        * dialog-solver.c (cb_notify_result): Rate-limit actual updates to
diff --git a/src/dialogs/dialog-solver.c b/src/dialogs/dialog-solver.c
index 1cfd1a9..3d3a859 100644
--- a/src/dialogs/dialog-solver.c
+++ b/src/dialogs/dialog-solver.c
@@ -750,7 +750,10 @@ run_solver (SolverState *state, GnmSolverParameters *param)
                go_cmd_context_set_sensitive (GO_CMD_CONTEXT (state->wbcg), TRUE);
                state->run.in_main--;
                ok = gnm_solver_has_solution (sol);
+       } else if (err) {
+               gnm_solver_set_reason (sol, err->message);
        }
+       g_clear_error (&err);
 
        remove_objective_value_source (state);
        remove_timer_source (state);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]