Commit 0df966d4 authored by Florent D'Halluin's avatar Florent D'Halluin
Browse files

[yavgui] Catch exceptions when creating transitions.

* yavgui/src/g_vcsn_handler_internal.hxx: Do that.
parent 9dbd9bd1
2009-08-10 d-halluin <d-halluin@lrde.epita.fr>
[yavgui] Catch exceptions when creating transitions.
* yavgui/src/g_vcsn_handler_internal.hxx: Do that.
2009-08-10 d-halluin <d-halluin@lrde.epita.fr> 2009-08-10 d-halluin <d-halluin@lrde.epita.fr>
   
[yavgui] Improve transition creation. [yavgui] Improve transition creation.
......
...@@ -236,6 +236,12 @@ namespace gui ...@@ -236,6 +236,12 @@ namespace gui
{ {
using namespace vcsn::boolean_automaton; using namespace vcsn::boolean_automaton;
std::stringstream str;
htransition_t i;
try
{
// FIXME: Only for labels_are_series. // FIXME: Only for labels_are_series.
series_set_t s = automaton.series(); series_set_t s = automaton.series();
series_set_elt_t se = make_rat_exp(s.monoid().alphabet(), series_set_elt_t se = make_rat_exp(s.monoid().alphabet(),
...@@ -243,11 +249,17 @@ namespace gui ...@@ -243,11 +249,17 @@ namespace gui
*(s.monoid().representation()), *(s.monoid().representation()),
*(s.representation())); *(s.representation()));
htransition_t i = automaton.add_series_transition(src->index(), i = automaton.add_series_transition(src->index(),
dst->index(), dst->index(),
se); se);
}
catch (std::exception& e)
{
QMessageBox::critical(NULL, "Exception occured",
e.what ());
return;
}
std::stringstream str;
str << automaton.series_of(i); str << automaton.series_of(i);
GTransition* t = new GTransition(i, *src, *dst, GTransition* t = new GTransition(i, *src, *dst,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment