Back to index

salome-gui  6.5.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions
SALOME_ResourceMgr Class Reference

List of all members.

Public Member Functions

 SALOME_ResourceMgr (const QString &app, const QString &resVarTemplate)
QString version () const

Static Public Member Functions

static void initResourceMgr ()

Static Public Attributes

static QString myExtAppName = QString()
static QString myExtAppVersion = QString()

Protected Member Functions

QString userFileName (const QString &appName, const bool for_load) const
virtual long userFileId (const QString &_fname) const

Detailed Description

Definition at line 143 of file SALOME_Session_Server.cxx.


Constructor & Destructor Documentation

SALOME_ResourceMgr::SALOME_ResourceMgr ( const QString &  app,
const QString &  resVarTemplate 
) [inline]

Definition at line 146 of file SALOME_Session_Server.cxx.

                                                                          : SUIT_ResourceMgr( app, resVarTemplate )
  {
    setCurrentFormat( "xml" );
    setOption( "translators", QString( "%P_msg_%L.qm|%P_icons.qm|%P_images.qm" ) );
    setDefaultPixmap( QPixmap( pixmap_not_found_xpm ) );
  }

Member Function Documentation

static void SALOME_ResourceMgr::initResourceMgr ( ) [inline, static]

Definition at line 152 of file SALOME_Session_Server.cxx.

  {
    if ( myExtAppName.isNull() || myExtAppVersion.isNull() ) {
      SALOME_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) );
      resMgr.loadLanguage( "LightApp",  "en" );
      resMgr.loadLanguage( "SalomeApp", "en" );

      myExtAppName = QObject::tr( "APP_NAME" ).trimmed();
      if ( myExtAppName == "APP_NAME" || myExtAppName.toLower() == "salome" ) 
        myExtAppName = "SalomeApp";
      myExtAppVersion = QObject::tr( "APP_VERSION" );
      if ( myExtAppVersion == "APP_VERSION" ) {
        if ( myExtAppName != "SalomeApp" )
          myExtAppVersion = "";
        else myExtAppVersion = salomeVersion();
      }
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual long SALOME_ResourceMgr::userFileId ( const QString &  _fname) const [inline, protected, virtual]

Definition at line 179 of file SALOME_Session_Server.cxx.

  {
    long id = -1;
    if ( !myExtAppName.isEmpty() ) {
#ifdef WIN32
      QRegExp exp( QString( "%1\\.%2\\.([a-zA-Z0-9.]+)$" ).arg( myExtAppName ).arg( currentFormat() ) );
#else
      QRegExp exp( QString( "\\.%1rc\\.([a-zA-Z0-9.]+)$" ).arg( myExtAppName ) );
#endif
      QRegExp vers_exp( "^([0-9]+)([A-Za-z]?)([0-9]*)$" );
      
      QString fname = QFileInfo( _fname ).fileName();
      if( exp.exactMatch( fname ) ) {
        QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts );
        int major=0, minor=0;
        int release = 0, dev1 = 0, dev2 = 0;
       if ( vers.count() > 0 ) major = vers[0].toInt();
       if ( vers.count() > 1 ) minor = vers[1].toInt();
       if ( vers.count() > 2 ) {
         if( vers_exp.indexIn( vers[2] ) != -1 ) {
           release = vers_exp.cap( 1 ).toInt();
           dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1();
           dev2 = vers_exp.cap( 3 ).toInt();
         }
       }
        
        int dev = dev1*100+dev2;
       id = major;
        id*=100; id+=minor;
        id*=100; id+=release;
        id*=10000;
        if ( dev > 0 ) id+=dev-10000;
      }
    }
    return id;
  }
QString SALOME_ResourceMgr::userFileName ( const QString &  appName,
const bool  for_load 
) const [inline, protected]

Definition at line 173 of file SALOME_Session_Server.cxx.

  { 
    if ( version().isEmpty()  ) return ""; 
    return SUIT_ResourceMgr::userFileName( myExtAppName, for_load );
  }

Here is the call graph for this function:

QString SALOME_ResourceMgr::version ( ) const [inline]

Definition at line 170 of file SALOME_Session_Server.cxx.

{ return myExtAppVersion; }

Here is the caller graph for this function:


Member Data Documentation

QString SALOME_ResourceMgr::myExtAppName = QString() [static]

Definition at line 217 of file SALOME_Session_Server.cxx.

QString SALOME_ResourceMgr::myExtAppVersion = QString() [static]

Definition at line 218 of file SALOME_Session_Server.cxx.


The documentation for this class was generated from the following file: