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
46 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
47 int getExitStatus() { return myExitStatus;}
48 //return count of inquired servers
49 int getInquiredServers() { return myServersCount; }
55 bool AskServer(int iteration, QString ** message);
56 bool pingServer(int iteration, QString& errMessage);
60 QGuardedPtr<InquireServersGUI> receiver;
63 //this variable is true if we are checking servers
65 //count of inquired servers
67 //how many times we should repeat attempt to get response from all needed for launching SALOME servers
69 //define delay time between two attempts in microseconds
71 //this strings' array contains messages for each server (e.g. "Loading: SALOMEDS_Server")
72 QString myMessages[8];
73 //exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
81 class InquireServersGUI : public QVBox
89 //returns arguments of QApplication
90 //they are needed for CORBA servers initialization
91 void getArgs( int& _argc, char *** _argv);
92 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
95 // bool withGUI() { return myGUI; }
96 // void withGUI(bool gui) { myGUI = gui; }
98 void setPixmap( QPixmap );
101 virtual void customEvent( QCustomEvent* );
104 InquireServersQThread* myThread;
105 QProgressBar* myPrgBar;
106 //this string contains description of currently asked server
109 QFrame* mySplashFrame;
114 void ClickOnCancel();