#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "Main.h" #include "generic.h" //#include "gettext.h" Main::Main() : setted(false) {} Main::~Main() {} void Main::set_args(int a_argc, char ** a_argv, char ** a_enve) { if (setted) { return; } argc = a_argc; argv = a_argv; enve = a_enve; setted = true; } int Main::truemain(Main * Application, int argc, char ** argv, char ** enve) { int r; try { Application->set_args(argc, argv, enve); r = Application->startup(); } catch (Exit e) { r = e.GetCode(); } catch (GeneralException e) { Base::printm(M_ERROR, _("The application caused an exception: %s\n"), e.GetMsg()); return -1; } catch (...) { Base::printm(M_ERROR, _("The application caused an unknow exception\n")); return -1; } return r; }