From: jfa Date: Fri, 22 Jun 2007 09:29:57 +0000 (+0000) Subject: NPAL16383: Web browser problem. X-Git-Tag: T_MULTIPR_INDUS_2007-07-23~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=07efa4b8eae814e88cc2a175f03f262139e9e2cb;p=modules%2Fgui.git NPAL16383: Web browser problem. --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index e570efc00..ed241088e 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -934,11 +934,12 @@ void LightApp_Application::updateCommandsStatus() \class RunBrowser Runs system command in separate thread */ -class RunBrowser: public QThread { +class RunBrowser: public QThread +{ public: - - RunBrowser( LightApp_Application* app, QString theApp, QString theParams, QString theHelpFile, QString theContext=NULL): - myApp(theApp), myParams(theParams), + RunBrowser (LightApp_Application* app, QString theApp, QString theParams, + QString theHelpFile, QString theContext=NULL) + : myApp(theApp), myParams(theParams), #ifdef WIN32 myHelpFile("file://" + theHelpFile + theContext), #else @@ -946,30 +947,35 @@ public: #endif myStatus(0), myLApp( app ) -{ -}; + { + }; virtual void run() { QString aCommand; - if ( !myApp.isEmpty()) + if (!myApp.isEmpty()) + { + //aCommand.sprintf("%s %s %s",myApp.latin1(),myParams.latin1(),myHelpFile.latin1()); + + //QProcess* proc = new QProcess(); + //proc->addArgument( aCommand ); + + QProcess* proc = new QProcess(); + proc->addArgument( myApp ); + if (!myParams.isEmpty()) proc->addArgument( myParams ); + proc->addArgument( myHelpFile ); + //myStatus = system(aCommand); + + //if(myStatus != 0) + if(!proc->start()) { - aCommand.sprintf("%s %s %s",myApp.latin1(),myParams.latin1(),myHelpFile.latin1()); - - QProcess* proc = new QProcess(); - proc->addArgument( aCommand ); - //myStatus = system(aCommand); - - //if(myStatus != 0) - if(!proc->start()) - { - QCustomEvent* ce2000 = new QCustomEvent( 2000 ); - QString* msg = new QString( QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").arg(myApp).arg(myHelpFile) ); - ce2000->setData( msg ); - postEvent( myLApp, ce2000 ); - } + QCustomEvent* ce2000 = new QCustomEvent( 2000 ); + QString* msg = new QString( QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").arg(myApp).arg(myHelpFile) ); + ce2000->setData( msg ); + postEvent( myLApp, ce2000 ); } + } } private: