Salome HOME
NRI : Check if a component-username is already associated with a component-name.
[modules/kernel.git] / src / TOOLSGUI / ToolsGUI.cxx
1 using namespace std;
2 //  File      : ToolsGUI.cxx
3 //  Created   : Wed Nov 14 21:59:24 2001
4 //  Author    : Nicolas REJNERI
5 //  Project   : SALOME
6 //  Module    : TOOLSGUI
7 //  Copyright : Open CASCADE
8 //  $Header$
9
10 #include "ToolsGUI.h"
11 #include "ToolsGUI_CatalogGeneratorDlg.h"
12
13 #include "utilities.h"
14
15 #include <stdlib.h>
16
17 int ToolsGUI::runCommand(string & arg)
18
19   int res;
20   res = system(arg.c_str());
21  
22   if (res == -1)
23     MESSAGE("fork failed (system command result = 0x" << hex << res << ")" << dec) 
24   else
25     if (res == 217)
26       MESSAGE("shell exec failed (system command result = 0x" << hex << res << ")" << dec)
27         
28   return res;
29 }
30
31 bool ToolsGUI::OnGUIEvent(int theCommandID,  QAD_Desktop* parent)
32 {
33   QAD_Study* myActiveStudy = parent->getActiveStudy();
34   switch (theCommandID)
35     {
36     case 5102 :
37       {
38         ToolsGUI_CatalogGeneratorDlg* aDlg = new ToolsGUI_CatalogGeneratorDlg(parent);
39         aDlg->exec();
40         delete aDlg;
41         break;
42       }
43
44     default:
45       MESSAGE (" No command associated with this id = " << theCommandID )
46       break;
47     }
48   return true;
49 }
50
51 extern "C"
52 {
53   bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
54   {
55     //MESSAGE("ToolsGUI::OnGUIEvent "<< theCommandID);
56     return ToolsGUI::OnGUIEvent(theCommandID, parent);
57   }
58
59 }