]> Creatis software - bbtk.git/blobdiff - kernel/appli/bbi/bbi.cxx
*** empty log message ***
[bbtk.git] / kernel / appli / bbi / bbi.cxx
index 39fcc08b5026c5cb737886af15636ab42d95f9a0..3a7368b4a4c4500a3207d06754cd9fb900076954 100644 (file)
@@ -14,6 +14,7 @@
 
 static const wxCmdLineEntryDesc cmdLineDesc[] =
 {
+  { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("Debug messages on (message All 9)") },
   { wxCMD_LINE_SWITCH, _T("c"), _T("command"), _T("turn to command line mode after file(s) processing") },
   { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"),   _T("be quiet") },
   { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("print help") },
@@ -41,6 +42,7 @@ public:
   int argc;
   std::vector<std::string> argv;
   bool command;
+  bool debug;
   bool quiet;
   bool help;
   bool graphical_dialog;
@@ -62,6 +64,7 @@ void wxBBIApp::OnInitCmdLine(wxCmdLineParser& parser)
 
 bool wxBBIApp::OnCmdLineParsed(wxCmdLineParser& parser)
 {
+  debug = ( parser.Found(_T("d")) );
   quiet = ( parser.Found(_T("q")) );
   help = ( parser.Found(_T("h")) );
   graphical_dialog = ( parser.Found(_T("g")) );
@@ -120,8 +123,11 @@ bool wxBBIApp::OnInit( )
   //See http://www.wxwindows.org/faqgtk.htm#locale
   setlocale(LC_NUMERIC, "C");
 #endif
+  
+  if (quiet) bbtk::MessageManager::SetMessageLevel("All",0);
+  if (debug) bbtk::MessageManager::SetMessageLevel("All",9);
+  
 
   bbtk::WxConsole *I = new bbtk::WxConsole(0,_T("bbi"),wxSize(600,400));
   SetTopWindow(I);  
   if (!no_command) I->Show(true);