1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : SALOME_Session_loader.cxx
6 // Author : Paul RASCLE, EDF
11 /*! \file SALOME_Session_loader.cxx
14 #include <SALOMEconfig.h>
15 #include CORBA_CLIENT_HEADER(SALOME_Session)
17 #include "Utils_ORB_INIT.hxx"
18 #include "Utils_SINGLETON.hxx"
19 #include "SALOME_NamingService.hxx"
20 #include "utilities.h"
22 //! CORBA client for SALOME Session server : launch GUI
24 * SALOME_Session Loader launches a SALOME GUI on the SALOME session servant process
27 #include <qapplication.h>
28 #include "InquireServersQThread.h"
30 int main(int argc, char **argv)
32 //VRV: T2.4 - Trace management improvement
33 QApplication myQApp(argc, argv) ;
34 InquireServersGUI myIS;
35 myQApp.setMainWidget(&myIS);
36 ASSERT(QObject::connect(&myQApp, SIGNAL(lastWindowClosed()), &myQApp, SLOT(quit()) ) );
40 if (myIS.getExitStatus())
42 //VRV: T2.4 - Trace management improvement
45 CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ;
47 SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
48 ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
51 CORBA::Object_var obj = NS.Resolve("/Kernel/Session");
53 SALOME::Session_var session = SALOME::Session::_narrow(obj) ;
54 ASSERT(! CORBA::is_nil(session));
55 MESSAGE("SALOME::Session::_narrow(obj)");
56 INFOS("Corba initialisation, Distant server");
58 // -------------------------------------------------------------
60 session->GetInterface() ;
62 // -------------------------------------------------------------
66 catch (ServiceUnreachable&)
68 INFOS("Caught exception: Naming Service Unreachable");
70 catch (CORBA::COMM_FAILURE&)
72 INFOS("Caught CORBA::SystemException CommFailure.");
74 catch (CORBA::SystemException&)
76 INFOS("Caught CORBA::SystemException.");
78 catch (CORBA::Exception&)
80 INFOS("Caught CORBA::Exception.");
84 INFOS("Caught unknown exception.");