don't seqcomp sequences that are too small
[mussa.git] / qui / SubanalysisWindow.cpp
index 1ecbcbca28d80b40c7f12b6b63e5c54507716e1e..6d5f3ce99e80277181d02150c7492f22fcb3dba8 100644 (file)
@@ -4,6 +4,7 @@
 #include "mussa_exceptions.hpp"
 #include "alg/mussa.hpp"
 
+#include <QMessageBox>
 #include <QVBoxLayout>
 #include <QHBoxLayout>
 #include <QGridLayout>
@@ -94,13 +95,20 @@ void SubanalysisWindow::run()
     m->append_sequence(itor->getSelectedSequence());
   }
 
-  m->set_window(window->value());
-  m->set_threshold(threshold->value());
-  m->analyze();
-  MussaWindow *mw = new MussaWindow(m);
-  mw->show();
-  model.clear();
-  hide();
+  try {
+    m->set_window(window->value());
+    m->set_threshold(threshold->value());
+    m->analyze();
+    MussaWindow *mw = new MussaWindow(m);
+    mw->show();
+    model.clear();
+    hide();
+  } catch(mussa_error e) {
+    QMessageBox::critical(this,
+                          "Mussa Subanalysis Error",
+                          QString(e.what()),
+                          QMessageBox::Ok, 0, 0);
+  }
 }
 
 void SubanalysisWindow::modelUpdated(const QModelIndex&, int, int )