]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to Qt4.
authormkr <mkr@opencascade.com>
Tue, 26 Jun 2007 10:58:37 +0000 (10:58 +0000)
committermkr <mkr@opencascade.com>
Tue, 26 Jun 2007 10:58:37 +0000 (10:58 +0000)
12 files changed:
src/Makefile.am
src/Session/SALOME_Session_Server.cxx
src/Session/SalomeApp_Engine_i.cxx
src/Session/Session_ServerCheck.cxx
src/Session/Session_ServerCheck.hxx
src/Session/Session_ServerLauncher.cxx
src/Session/Session_ServerLauncher.hxx
src/Session/Session_ServerThread.cxx
src/Session/Session_ServerThread.hxx
src/Session/Session_Session_i.cxx
src/Session/Session_Session_i.hxx
src/src.pro

index bb9403f44701cdf05d003800bbba68f7d284f199..10d3e60b5e66a23038ad17505123343b2a84ab6c 100755 (executable)
@@ -67,5 +67,5 @@ if GUI_ENABLE_CORBA
 # VSR: this is the original packages list
 #  SUBDIRS += TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
 # VSR: already migrated to Qt4 packages
-  SUBDIRS += TOOLSGUI SalomeApp
+  SUBDIRS += TOOLSGUI Session SalomeApp
 endif
index 8520c96d2d2ebbbfb64cfcb05a409eb5a9ff0499..acfb2ebfbc48414c7ec7116513a00547eebd6dba 100755 (executable)
 #include "Utils_ORB_INIT.hxx"
 #include "Utils_SINGLETON.hxx"
 #include "SALOME_NamingService.hxx"
-#include "SALOMETraceCollector.hxx"
 
-#include <iostream>
-#ifndef WIN32
-#include <unistd.h>
-#endif
-
-#include <qdir.h>
-#include <qfile.h>
-#include <qapplication.h>
-#include <qwaitcondition.h>
-#include <qregexp.h>
+#include <QDir>
+#include <QFile>
+#include <QApplication>
+#include <QMutex>
+#include <QWaitCondition>
+#include <QRegExp>
 
 #include "Utils_SALOME_Exception.hxx"
 #include "Utils_CorbaException.hxx"
-#include "SALOME_Event.hxx"
+#include "SALOME_Event.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_Session)
 #include CORBA_SERVER_HEADER(SALOMEDS)
 
 #include <utilities.h>
-#include "Session_Session_i.hxx"
 #include "Session_ServerLauncher.hxx"
 #include "Session_ServerCheck.hxx"
 
@@ -60,7 +54,6 @@
 #include "SUIT_Session.h"
 #include "SUIT_Application.h"
 #include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_ExceptionHandler.h"
 
@@ -131,11 +124,11 @@ QString salomeVersion()
   path += QString( "bin/salome/VERSION" );
 
   QFile vf( path );
-  if ( !vf.open( IO_ReadOnly ) )
+  if ( !vf.open( QIODevice::ReadOnly ) )
     return QString::null;
 
-  QString line;
-  vf.readLine( line, 1024 );
+  QString line( vf.readLine( 1024 ) );
+
   vf.close();
 
   if ( line.isEmpty() )
@@ -145,9 +138,9 @@ QString salomeVersion()
     line.remove( line.length() - 1, 1 );
 
   QString ver;
-  int idx = line.findRev( ":" );
+  int idx = line.lastIndexOf( ":" );
   if ( idx != -1 )
-    ver = line.mid( idx + 1 ).stripWhiteSpace();
+    ver = line.mid( idx + 1 ).trimmed();
 
   return ver;
 }
@@ -168,8 +161,8 @@ public:
       resMgr.loadLanguage( "LightApp",  "en" );
       resMgr.loadLanguage( "SalomeApp", "en" );
 
-      myExtAppName = QObject::tr( "APP_NAME" ).stripWhiteSpace();
-      if ( myExtAppName == "APP_NAME" || myExtAppName.lower() == "salome" ) 
+      myExtAppName = QObject::tr( "APP_NAME" ).trimmed();
+      if ( myExtAppName == "APP_NAME" || myExtAppName.toLower() == "salome" ) 
         myExtAppName = "SalomeApp";
       myExtAppVersion = QObject::tr( "APP_VERSION" );
       if ( myExtAppVersion == "APP_VERSION" ) {
@@ -196,15 +189,15 @@ protected:
       
       QString fname = QFileInfo( _fname ).fileName();
       if( exp.exactMatch( fname ) ) {
-       QStringList vers = QStringList::split( ".", exp.cap( 1 ) );
+       QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts );
        int major=0, minor=0;
        major = vers[0].toInt();
        minor = vers[1].toInt();
-       if( vers_exp.search( vers[2] )==-1 )
+       if( vers_exp.indexIn( vers[2] )==-1 )
          return -1;
        int release = 0, dev1 = 0, dev2 = 0;
        release = vers_exp.cap( 1 ).toInt();
-       dev1 = vers_exp.cap( 2 )[ 0 ].latin1();
+       dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1();
        dev2 = vers_exp.cap( 3 ).toInt();
        
        int dev = dev1*100+dev2, id = major;
@@ -344,7 +337,7 @@ int main( int argc, char **argv )
       splash = QtxSplash::splash( px );
       // ...set splash text colors
       if ( !splashTextColors.isEmpty() ) {
-       QStringList colors = QStringList::split( "|", splashTextColors );
+       QStringList colors = splashTextColors.split( "|", QString::SkipEmptyParts );
        QColor c1, c2;
        if ( colors.count() > 0 ) c1 = QColor( colors[0] );
        if ( colors.count() > 1 ) c2 = QColor( colors[1] );
@@ -355,12 +348,12 @@ int main( int argc, char **argv )
       }
       // ...set splash progress colors
       if ( !splashProgressColors.isEmpty() ) {
-       QStringList colors = QStringList::split( "|", splashProgressColors );
+       QStringList colors = splashProgressColors.split( "|", QString::SkipEmptyParts );
        QColor c1, c2;
-       int gradType = QtxSplash::Vertical;
+       QtxSplash::GradientType gradType = QtxSplash::Vertical;
        if ( colors.count() > 0 ) c1 = QColor( colors[0] );
        if ( colors.count() > 1 ) c2 = QColor( colors[1] );
-       if ( colors.count() > 2 ) gradType = colors[2].toInt();
+       if ( colors.count() > 2 ) gradType = QtxSplash::GradientType( colors[2].toInt() );
        splash->setProgressColors( c1, c2, gradType );
       }
       // ...set splash text font
index 813270515dd0f660de88055b41baefb33e0d44ba..855cb8cf74402c0f5b3b62f74f1ada3aa11e6405 100644 (file)
@@ -30,8 +30,6 @@
 
 #include "SALOMEDS_Tool.hxx"
 
-#include "utilities.h"
-
 #include <iostream>
 
 using namespace std;
index 3642f040728cdb411eca65ea4d869de5abd6e26d..7a27b1f2a13ff6366cc846c3c6309ac619212f3f 100644 (file)
 #include "Utils_ORB_INIT.hxx"
 #include "Utils_SINGLETON.hxx"
 #include "SALOME_NamingService.hxx"
-#include "utilities.h"
 #include "OpUtil.hxx"
+#include "utilities.h"
+
+#include <QApplication> 
+#include <QMutex>
+#include <QWaitCondition>
 
 // Default settings
 const int __DEFAULT__ATTEMPTS__ = 300;      // number of checks attemtps
@@ -363,10 +367,10 @@ void Session_ServerCheck::run()
        ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
        NS.init_orb( orb );
        QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( GetHostname().c_str() );
-       CORBA::Object_var obj = NS.Resolve( containerName.latin1() );
+       CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
        Engines::Container_var FScontainer = Engines::Container::_narrow( obj );
        if ( !CORBA::is_nil( FScontainer ) ) {
-         MESSAGE( containerName.latin1() << " is found" );
+         MESSAGE( containerName.toLatin1().constData() << " is found" );
          FScontainer->ping();
          MESSAGE( "FactoryServer container was activated" );
          bOk = true;
@@ -414,10 +418,10 @@ void Session_ServerCheck::run()
        ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
        NS.init_orb( orb );
        QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( GetHostname().c_str() );
-       CORBA::Object_var obj = NS.Resolve( containerName.latin1() );
+       CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
        Engines::Container_var FSPcontainer = Engines::Container::_narrow( obj );
        if ( !CORBA::is_nil( FSPcontainer ) ) {
-         MESSAGE( containerName.latin1() << " is found" );
+         MESSAGE( containerName.toLatin1().constData() << " is found" );
          FSPcontainer->ping();
          MESSAGE("FactoryServerPy container was activated");
          bOk = true;
@@ -465,10 +469,10 @@ void Session_ServerCheck::run()
        ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
        NS.init_orb( orb );
        QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( GetHostname().c_str() );
-       CORBA::Object_var obj = NS.Resolve( containerName.latin1() );
+       CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
        Engines::Container_var SVcontainer = Engines::Container::_narrow( obj );
        if ( !CORBA::is_nil( SVcontainer ) ) {
-         MESSAGE( containerName.latin1() << " is found" );
+         MESSAGE( containerName.toLatin1().constData() << " is found" );
          SVcontainer->ping();
          MESSAGE("SuperVisionContainer container was activated");
          bOk = true;
index 8de6a6d41822d0f9421241aaa1b29b8ce185b8f5..9a65f436c20f7f3585273f90d587fa23bd2d4b2a 100644 (file)
@@ -24,8 +24,7 @@
 
 #include <SALOME_Session.hxx>
 
-#include <qthread.h> 
-#include <qapplication.h> 
+#include <QThread> 
 
 class QMutex;
 class QWaitCondition;
index 3909efc014a4faffe49104a16f1c95a7e20d81a8..bdf10d747c6e80b19a6b7af1f694a66b3a861af6 100755 (executable)
 //  $Header$
 
 #include "Session_ServerLauncher.hxx"
+#include "Session_ServerThread.hxx"
 
 #include "Utils_SALOME_Exception.hxx"
 #include "utilities.h"
+
+#include <QMutex>
+#include <QWaitCondition>
+
 using namespace std;
 /*! 
    default constructor not for use
index b3773adf10f1116230dc266b3f85a6188ddd54c4..6f0fede882def3a41b3218de73462b0e4cbc45e8 100755 (executable)
 
 #include <SALOME_Session.hxx>
 
-#include "Session_ServerThread.hxx"
-
 #include <CORBA.h> 
 #include <list>
 #include <vector>
 #include <string>
-#include <qthread.h>
-#include <qwaitcondition.h>
+#include <QThread>
 
 using namespace std;
 
@@ -55,6 +52,11 @@ inline ServArg::ServArg(int servType, int firstArg, int lastArg):
   _servType(servType),_firstArg(firstArg),_lastArg(lastArg)
 {}
 
+class Session_ServerThread;
+
+class QMutex;
+class QWaitCondition;
+
 class SESSION_EXPORT Session_ServerLauncher: public QThread
 {
 public:
index d5b5a64374c1c7700d68da97ab75b1bcf87bee6f..5bf7be1562655f708ceee78abf7741027d8b96fe 100755 (executable)
@@ -32,9 +32,9 @@
 
 #include "Session_ServerThread.hxx"
 
+#include "SALOME_NamingService.hxx"
 #include "SALOME_Container_i.hxx"
 #include "SALOME_ContainerManager.hxx"
-#include <SALOMEDSClient.hxx>
 #include <SALOMEDSClient_ClientFactory.hxx>
 #include "SALOME_ModuleCatalog_impl.hxx"
 #include "RegistryService.hxx"
@@ -51,6 +51,9 @@
 #include <cstdlib>
 #include <ctime>
 
+#include <QMutex>
+#include <QWaitCondition>
+
 using namespace std;
 
 const int Session_ServerThread::NB_SRV_TYP = 7;
index 04ded4d2ead238a241f946aae311d6e68869d168..146183da7897a69185a59dc087e6e3a36e007990 100755 (executable)
 #include <CORBA.h> 
 #include <string>
 
-#include "SALOME_NamingService.hxx"
-#include <qthread.h>
-
 using namespace std;
 
 void WaitForServerReadiness(string serverName);
 
+class SALOME_NamingService;
 
 class SESSION_EXPORT Session_ServerThread
 {
@@ -72,6 +70,8 @@ protected:
   SALOME_NamingService *  _NS;
 };
 
+class QMutex;
+class QWaitCondition;
 
 class SESSION_EXPORT Session_SessionThread : public Session_ServerThread
 {
index 81787737ebef0229b9b3f129bc86a245891c16b1..92ba94c4005c1284923b09a679d7935ed53bfb15 100755 (executable)
 #include "Session_Session_i.hxx"
 
 #include "SALOME_NamingService.hxx"
-#include "SALOME_Event.hxx"
+#include "SALOME_Event.h"
 
 #include "SUIT_Session.h"
-#include "SUIT_Application.h"
+//#include "SUIT_Application.h"
 #include "SUIT_Desktop.h"
+#include "SUIT_Study.h"
 
-#include <qapplication.h>
+//#include <QApplication>
+#include <QMutex>
+#include <QWaitCondition>
 
 // Open CASCADE Includes
 #include <OSD_SharedLibrary.hxx>
-#include <OSD_LoadMode.hxx>
 #include <OSD_Function.hxx>
 
 using namespace std;
@@ -155,12 +157,12 @@ void SALOME_Session_i::StopSession()
   Send a SALOME::StatSession structure (see idl) to the client
   (number of running studies and presence of GUI)
 */
-class QtLock
+/*class QtLock
 {
 public:
   QtLock() { if ( qApp ) qApp->lock(); }
   ~QtLock() { if ( qApp ) qApp->unlock(); }
-};
+};*/
 
 
 SALOME::StatSession SALOME_Session_i::GetStatSession()
@@ -170,7 +172,7 @@ SALOME::StatSession SALOME_Session_i::GetStatSession()
 
   _runningStudies = 0;
   {
-    QtLock lock;
+    //QtLock lock;
     _isGUI = SUIT_Session::session();
     if ( _isGUI && SUIT_Session::session()->activeApplication() )
       _runningStudies = SUIT_Session::session()->activeApplication()->getNbStudies();
index bfdee09a545bb6c224e89f169bd35007b2f0e9b3..fa7a224e41c0c4cedb20993a17b9315117d07198 100755 (executable)
 
 #include <SALOME_Session.hxx>
 
-#include <qthread.h> 
-
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include CORBA_SERVER_HEADER(SALOME_Session)
 class SALOME_NamingService;
 
+class QMutex;
+class QWaitCondition;
+
 class SESSION_EXPORT SALOME_Session_i:  public virtual POA_SALOME::Session,
                         public virtual PortableServer::ServantBase
 {
index a621136a915629ec1806c60c5efcbe6a08b206f4..9ef25127c14a6981966c3e8b218239a93ead124f 100644 (file)
@@ -25,6 +25,6 @@ SUBDIRS += SUPERVGraph
 SUBDIRS += Event
 SUBDIRS += LightApp
 SUBDIRS += ResExporter
-SUBDIRS += RegistryDisplay
 SUBDIRS += TOOLSGUI
+SUBDIRS += Session
 SUBDIRS += SalomeApp