2 //=============================================================================
3 // File : SALOME_Session_Loader.cxx
4 // Created : jeu jun 21 07:37:59 CEST 2001
5 // Author : Paul RASCLE, EDF
7 // Copyright : EDF 2001
9 //=============================================================================
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 //VRVcd: T2.4 - Trace management improvement
46 CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ;
48 SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
49 ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
52 CORBA::Object_var obj = NS.Resolve("/Kernel/Session");
54 SALOME::Session_var session = SALOME::Session::_narrow(obj) ;
55 ASSERT(! CORBA::is_nil(session));
56 MESSAGE("SALOME::Session::_narrow(obj)");
57 INFOS("Corba initialisation, Distant server");
59 // -------------------------------------------------------------
61 session->GetInterface() ;
63 // -------------------------------------------------------------
67 catch (ServiceUnreachable&)
69 INFOS("Caught exception: Naming Service Unreachable");
71 catch (CORBA::COMM_FAILURE&)
73 INFOS("Caught CORBA::SystemException CommFailure.");
75 catch (CORBA::SystemException&)
77 INFOS("Caught CORBA::SystemException.");
79 catch (CORBA::Exception&)
81 INFOS("Caught CORBA::Exception.");
85 INFOS("Caught unknown exception.");