]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkInterpreter.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkInterpreter.cxx
index 5b0c26e81faa4f9e18fe6f8c0ed279241de2b0e2..a6e4869da13ba3aa37898565273e3e165fe20cdc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/02/06 10:53:02 $
-  Version:   $Revision: 1.28 $
+  Date:      $Date: 2008/02/14 10:47:51 $
+  Version:   $Revision: 1.30 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -1083,26 +1083,52 @@ void Interpreter::Help(const std::vector<std::string>& words)
          try 
          {
             HelpPackage(words[1]);
+#ifdef _USE_WXWIDGETS_
+           if ( WxConsole::GetInstance() != 0 )
+             {
+               std::string url = 
+                 ConfigurationFile::GetInstance().Get_doc_path();
+               url += "/bbdoc/" + words[1] + "/index.html";
+               if (Utilities::FileExists(url)) 
+                 {
+                   WxConsole::GetInstance()->ShowHtmlPage(url);
+                 }
+             }
+#endif     
          }
          catch (bbtk::Exception f) 
          {
             try 
             {
-               HelpBlackBox(words[1]);
-            }
-           catch (bbtk::Exception g) 
-           {
-              try
-              {
-                 this->mExecuter->ShowRelations(words[1],"0","9999");
-              }
-              catch (bbtk::Exception h){
-                bbtkError("\""<<words[1].c_str()
-                          <<"\" is not a known command, package, black box type or black box name");
-              }
-           }
+             std::string package;
+             HelpBlackBox(words[1],package);
+#ifdef _USE_WXWIDGETS_
+              if ( WxConsole::GetInstance() != 0 )
+                {
+                  std::string url = 
+                    ConfigurationFile::GetInstance().Get_doc_path();
+                  url += "/bbdoc/" + package + "/index.html";
+                  if (Utilities::FileExists(url)) 
+                    {
+                      url += "#" + words[1];
+                      WxConsole::GetInstance()->ShowHtmlPage(url);
+                    }
+                }
+#endif     
+           }
+           catch (bbtk::Exception g) 
+             {
+               try
+                 {
+                   this->mExecuter->ShowRelations(words[1],"0","9999");
+                 }
+               catch (bbtk::Exception h){
+                 bbtkError("\""<<words[1].c_str()
+                           <<"\" is not a known command, package, black box type or black box name");
+               }
+             }
          }
-       }
+      }
     }
     else if (nbarg==2) 
     {
@@ -1138,44 +1164,9 @@ void Interpreter::Help(const std::vector<std::string>& words)
   /// Displays the Configuration
   void Interpreter::Config() const
   {
-    bbtkDebugMessageInc("Kernel",9,"Factory::Config"<<std::endl);
-    
-    ConfigurationFile cf = ConfigurationFile::GetInstance();
-    
-    const std::string config_xml_full_path      = cf.Get_config_xml_full_path();    
-    const std::string description               = cf.Get_description();
-    const std::string url                       = cf.Get_url();
-    const std::string data_path                 = cf.Get_data_path();
-    const std::string default_temp_dir          = cf.Get_default_temp_dir();    
-    const std::string file_separator            = cf.Get_file_separator();    
-    const std::vector<std::string>bbs_paths     = cf.Get_bbs_paths();
-    const std::vector<std::string>package_paths = cf.Get_package_paths();
-    
-    bbtkMessage("Help",1, "============="   << std::endl);           
-    bbtkMessage("Help",1, "Configuration"   << std::endl);
-    bbtkMessage("Help",1, "============="   << std::endl);
-    bbtkMessage("Help",1, "bbtk_config.xml   : [" << config_xml_full_path  << "]" << std::endl); 
-    bbtkMessage("Help",1, "Documentation Url : [" << url             << "]" << std::endl);
-    bbtkMessage("Help",1, "Data Path         : [" << data_path       << "]" << std::endl);
-    bbtkMessage("Help",1, "Default Temp-Dir  : [" << default_temp_dir << "]" << std::endl);
-    bbtkMessage("Help",1, "File Separator    : [" << file_separator  << "]" << std::endl);
-
-    std::vector<std::string>::const_iterator i;
-           
-    bbtkMessage("Help",1, "BBS Paths   " << std::endl);     
-    for (i = bbs_paths.begin(); i!=bbs_paths.end(); ++i )
-    {
-      bbtkMessage("Help",1,"--- ["<<*i<<"]"<<std::endl);
-    }    
-    
-    bbtkMessage("Help",1, "PACKAGE Paths : " << std::endl);     
-    for (i = package_paths.begin(); i!=package_paths.end(); ++i )
-    {
-      bbtkMessage("Help",1,"--- ["<<*i<<"]"<<std::endl);
-    }
-
-    bbtkDebugDecTab("Kernel",9);
+    ConfigurationFile::GetInstance().GetHelp(1);
   }  
+   //===================================================================    
 
   //=======================================================================
   /// Displays help on all the commands