Back to index

salome-gui  6.5.0
Public Member Functions | Private Attributes
RunBrowser Class Reference

Runs system command in separate thread. More...

Collaboration diagram for RunBrowser:
Collaboration graph

List of all members.

Public Member Functions

 RunBrowser (LightApp_Application *app, const QString &theApp, const QString &theParams, const QString &theHelpFile, const QString &theContext=QString())
virtual void run ()

Private Attributes

QString myApp
QString myParams
QString myHelpFile
QString myContext
int myStatus

Detailed Description

Runs system command in separate thread.

Definition at line 920 of file LightApp_Application.cxx.

Constructor & Destructor Documentation

RunBrowser::RunBrowser ( LightApp_Application app,
const QString &  theApp,
const QString &  theParams,
const QString &  theHelpFile,
const QString &  theContext = QString() 
) [inline]

Definition at line 923 of file LightApp_Application.cxx.

    : myApp( theApp ),
      myParams( theParams ),
      myContext( theContext ),
      myLApp( app )
    //For the external browser always specify 'file://' protocol,
    //because some WEB browsers (for example Mozilla Firefox) can't open local file without protocol.
    myHelpFile = QString("file://%1").arg( QFileInfo( theHelpFile ).canonicalFilePath() );

Member Function Documentation

virtual void RunBrowser::run ( ) [inline, virtual]

Definition at line 939 of file LightApp_Application.cxx.

    if ( !myApp.isEmpty() && !myHelpFile.isEmpty()) {
      QString aCommand = QString( "%1 %2 \"%3%4\"" ).arg( myApp, myParams, myHelpFile, myContext.isEmpty() ? QString("") : QString( "#%1" ).arg( myContext ) );

      QProcess* proc = new QProcess();

      proc->start( aCommand );
      if ( !proc->waitForStarted() ) {
        SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 );
        QString* msg = new QString( QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).arg( myApp, myHelpFile ) );
        ce2000->setData( msg );
        QApplication::postEvent( myLApp, ce2000 );

Member Data Documentation

QString RunBrowser::myApp [private]

Definition at line 957 of file LightApp_Application.cxx.

QString RunBrowser::myContext [private]

Definition at line 960 of file LightApp_Application.cxx.

QString RunBrowser::myHelpFile [private]

Definition at line 959 of file LightApp_Application.cxx.

Definition at line 962 of file LightApp_Application.cxx.

QString RunBrowser::myParams [private]

Definition at line 958 of file LightApp_Application.cxx.

int RunBrowser::myStatus [private]

Definition at line 961 of file LightApp_Application.cxx.

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