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)
16 #include CORBA_CLIENT_HEADER(Logger)
18 #include "Utils_ORB_INIT.hxx"
19 #include "Utils_SINGLETON.hxx"
20 #include "SALOME_NamingService.hxx"
21 #include "utilities.h"
22 #include "LocalTraceCollector.hxx"
24 //! CORBA client for SALOME Session server : launch GUI
26 * SALOME_Session Loader launches a SALOME GUI on the SALOME session servant process
29 #include <qapplication.h>
30 #include "InquireServersQThread.h"
32 int main(int argc, char **argv)
34 CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ;
35 LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb);
36 //VRV: T2.4 - Trace management improvement
37 QApplication myQApp(argc, argv) ;
38 InquireServersGUI myIS;
39 myQApp.setMainWidget(&myIS);
40 ASSERT(QObject::connect(&myQApp, SIGNAL(lastWindowClosed()), &myQApp, SLOT(quit()) ) );
44 if (myIS.getExitStatus())
46 //VRV: T2.4 - Trace management improvement
50 SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
51 ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
54 CORBA::Object_var obj = NS.Resolve("/Kernel/Session");
56 SALOME::Session_var session = SALOME::Session::_narrow(obj) ;
57 ASSERT(! CORBA::is_nil(session));
58 MESSAGE("SALOME::Session::_narrow(obj)");
59 INFOS("Corba initialisation, Distant server");
61 // -------------------------------------------------------------
63 session->GetInterface() ;
65 // -------------------------------------------------------------
69 catch (ServiceUnreachable&)
71 INFOS("Caught exception: Naming Service Unreachable");
73 catch (CORBA::COMM_FAILURE&)
75 INFOS("Caught CORBA::SystemException CommFailure.");
77 catch (CORBA::SystemException&)
79 INFOS("Caught CORBA::SystemException.");
81 catch (CORBA::Exception&)
83 INFOS("Caught CORBA::Exception.");
87 INFOS("Caught unknown exception.");
90 INFOS("Normal Exit"); // without this trace, Splash remains on screen !