1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : InquireServersQThread.h
6 // Author : Vasily RUSYAEV
12 #include <qprogressbar.h>
14 #include <qguardedptr.h>
16 /**********************************************************
17 ** Class: InquireEvent
18 ** Descr: Contains QCustomEvents for posting to InquireServersQThread
20 ***********************************************************/
22 class InquireEvent : public QCustomEvent
26 enum myCustomEvents{ ProgressEvent = QEvent::User + 10, ProgressEventLabel, ProgressEventError };
28 InquireEvent( QEvent::Type type , void* data = 0 )
29 : QCustomEvent( type, data ) {}
32 type() == (QEvent::Type)ProgressEvent ?
33 delete ( int* )data() : delete ( QString* )data();
37 class InquireServersGUI;
39 class InquireServersQThread : public QThread
42 InquireServersQThread( InquireServersGUI* r );
43 virtual ~InquireServersQThread();
45 //the main loop of this thread
53 //return exit status: 0 - OK, >0 - BAD (some servers doesn't exists or user click cancel button)
54 int getExitStatus() { return myExitStatus;}
55 //return count of inquired servers
56 int getInquiredServers() { return myServersCount; }
62 bool AskServer(int iteration, QString ** message);
63 bool pingServer(int iteration, QString& errMessage);
67 QGuardedPtr<InquireServersGUI> receiver;
70 //this variable is true if we are checking servers
72 //count of inquired servers
74 //how many times we should repeat attempt to get response from all needed for launching SALOME servers
76 //define delay time between two attempts in microseconds
78 //this strings' array contains messages for each server (e.g. "Loading: SALOMEDS_Server")
79 QString myMessages[8];
80 //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
118 void ClickOnCancel();