1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : InquireServersQThread.h
6 // Author : Vasily RUSYAEV
12 #include <qguardedptr.h>
14 /**********************************************************
15 ** Class: InquireEvent
16 ** Descr: Contains QCustomEvents for posting to InquireServersQThread
18 ***********************************************************/
19 class InquireEvent : public QCustomEvent
23 enum myCustomEvents{ ProgressEvent = QEvent::User + 10, ProgressEventLabel, ProgressEventError };
25 InquireEvent( QEvent::Type type , void* data = 0 )
26 : QCustomEvent( type, data ) {}
29 type() == (QEvent::Type)ProgressEvent ?
30 delete ( int* )data() : delete ( QString* )data();
34 class InquireServersGUI;
36 class InquireServersQThread : public QThread
39 InquireServersQThread( InquireServersGUI* r );
40 virtual ~InquireServersQThread();
42 //the main loop of this thread
50 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
51 int getExitStatus() { return myExitStatus;}
52 //return count of inquired servers
53 int getInquiredServers() { return myServersCount; }
59 bool AskServer(int iteration, QString ** message);
60 bool pingServer(int iteration, QString& errMessage);
64 QGuardedPtr<InquireServersGUI> receiver;
67 //this variable is true if we are checking servers
69 //count of inquired servers
71 //how many times we should repeat attempt to get response from all needed for launching SALOME servers
73 //define delay time between two attempts in microseconds
75 //this strings' array contains messages for each server (e.g. "Loading: SALOMEDS_Server")
76 QString myMessages[8];
77 //exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
85 class InquireServersGUI : public QVBox
93 //returns arguments of QApplication
94 //they are needed for CORBA servers initialization
95 void getArgs( int& _argc, char *** _argv);
96 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
99 // bool withGUI() { return myGUI; }
100 // void withGUI(bool gui) { myGUI = gui; }
102 void setPixmap( QPixmap );
105 virtual void customEvent( QCustomEvent* );
106 virtual void closeEvent ( QCloseEvent * );
109 InquireServersQThread* myThread;
110 QProgressBar* myPrgBar;
111 //this string contains description of currently asked server
114 QFrame* mySplashFrame;
119 void ClickOnCancel();