1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : InquireServersQThread.h
6 // Author : Vasily RUSYAEV
12 #include <qguardedptr.h>
15 #include <SALOME_WNT.hxx>
17 #define SALOME_WNT_EXPORT
20 /**********************************************************
21 ** Class: InquireEvent
22 ** Descr: Contains QCustomEvents for posting to InquireServersQThread
24 ***********************************************************/
25 class SALOME_WNT_EXPORT InquireEvent : public QCustomEvent
29 enum myCustomEvents{ ProgressEvent = QEvent::User + 10, ProgressEventLabel, ProgressEventError };
31 InquireEvent( QEvent::Type type , void* data = 0 )
32 : QCustomEvent( type, data ) {}
35 type() == (QEvent::Type)ProgressEvent ?
36 delete ( int* )data() : delete ( QString* )data();
40 class InquireServersGUI;
42 class SALOME_WNT_EXPORT InquireServersQThread : public QThread
45 InquireServersQThread( InquireServersGUI* r );
46 virtual ~InquireServersQThread();
48 //the main loop of this thread
52 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
53 int getExitStatus() { return myExitStatus;}
54 //return count of inquired servers
55 int getInquiredServers() { return myServersCount; }
61 bool AskServer(int iteration, QString ** message);
62 bool pingServer(int iteration, QString& errMessage);
66 QGuardedPtr<InquireServersGUI> receiver;
69 //this variable is true if we are checking servers
71 //count of inquired servers
73 //how many times we should repeat attempt to get response from all needed for launching SALOME servers
75 //define delay time between two attempts in microseconds
77 //this strings' array contains messages for each server (e.g. "Loading: SALOMEDS_Server")
78 QString myMessages[8];
79 //exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
87 class SALOME_WNT_EXPORT InquireServersGUI : public QVBox
95 //returns arguments of QApplication
96 //they are needed for CORBA servers initialization
97 void getArgs( int& _argc, char *** _argv);
98 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
101 // bool withGUI() { return myGUI; }
102 // void withGUI(bool gui) { myGUI = gui; }
104 void setPixmap( QPixmap );
107 virtual void customEvent( QCustomEvent* );
110 InquireServersQThread* myThread;
111 QProgressBar* myPrgBar;
112 //this string contains description of currently asked server
115 QFrame* mySplashFrame;
120 void ClickOnCancel();