Commit 80f50bd7 authored by Joseph Mirabel's avatar Joseph Mirabel

Handle hpp exceptions.

parent 97a26221
......@@ -15,6 +15,7 @@
#include <gepetto/gui/windows-manager.hh>
#include <gepetto/gui/omniorb/url.hh>
#include <gepetto/gui/action-search-bar.hh>
#include <gepetto/gui/safeapplication.hh>
#include <omniORB4/CORBA.h>
......@@ -40,6 +41,22 @@ namespace hpp {
typedef gepetto::viewer::Configuration OsgConfiguration_t;
typedef gepetto::gui::ActionSearchBar ActionSearchBar;
class HppExceptionCatch : public gepetto::gui::SlotExceptionCatch
{
public:
bool safeNotify (QApplication* app, QObject* receiver, QEvent* e)
{
try {
return impl_notify (app, receiver, e);
} catch (const hpp::Error& e) {
qDebug () << e.msg.in();
MainWindow* main = MainWindow::instance();
if (main != NULL) main->logError (e.msg.in());
}
return false;
}
};
HppWidgetsPlugin::JointElement::JointElement (
const std::string& n, const std::string& prefix,
const hpp::Names_t& bns, JointTreeItem* i, bool updateV)
......@@ -71,6 +88,9 @@ namespace hpp {
void HppWidgetsPlugin::init()
{
gepetto::gui::SafeApplication* app = dynamic_cast<gepetto::gui::SafeApplication*>(QApplication::instance());
if (app) app->addAsLeaf(new HppExceptionCatch);
openConnection();
gepetto::gui::MainWindow* main = gepetto::gui::MainWindow::instance ();
......
Markdown is supported
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