1 #include <qapplication.h>
4 #include <qprogressbar.h>
7 /**********************************************************
9 ** Descr: Contains QCustomEvents for posting to InquireServersQThread
11 ***********************************************************/
13 class InquireEvent : public QCustomEvent
17 enum myCustomEvents{ ProgressEvent = QEvent::User + 10, ProgressEventLabel, ProgressEventError };
19 InquireEvent( QEvent::Type type , void* data = 0 )
20 : QCustomEvent( type, data ) {}
23 type() == (QEvent::Type)ProgressEvent ?
24 delete ( int* )data() : delete ( QString* )data();
28 class InquireServersGUI;
30 class InquireServersQThread : public QThread
33 InquireServersQThread( InquireServersGUI* r );
35 //the main loop of this thread
43 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
44 int getExitStatus() { return myExitStatus;}
45 //return count of inquired servers
46 int getInquiredServers() { return myServersCount; }
52 bool AskServer(int iteration, QString ** message);
53 bool pingServer(int iteration, QString& errMessage);
57 InquireServersGUI* receiver;
60 //this variable is true if we are checking servers
62 //count of inquired servers
64 //how many times we should repeat attempt to get response from all needed for launching SALOME servers
66 //define delay time between two attempts in microseconds
68 //this strings' array contains messages for each server (e.g. "Loading: SALOMEDS_Server")
69 QString myMessages[8];
70 //exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
75 class InquireServersGUI : public QVBox
83 //returns arguments of QApplication
84 //they are needed for CORBA servers initialization
85 void getArgs( int& _argc, char *** _argv);
86 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
90 virtual void customEvent( QCustomEvent* );
91 virtual void closeEvent ( QCloseEvent * );
94 InquireServersQThread* myThread;
95 QProgressBar* myPrgBar;
96 //this string contains description of currently asked server
101 void ClickOnCancel();