From: eap Date: Mon, 21 May 2007 10:16:18 +0000 (+0000) Subject: NPAL15963 (Problem with option -u (--execute) of runSalome). X-Git-Tag: T15881~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7b2f965eb70ddcb508db687f22145dd0ab412427;p=modules%2Fgui.git NPAL15963 (Problem with option -u (--execute) of runSalome). void PythonConsole_PyEditor::exec( const QString& command ) - setText( command + "\n" ); - handleReturn(); + // Let events creating a study end before script execution starts + setText( command /*+ "\n"*/ ); + //handleReturn(); + qApp->postEvent( this, new QKeyEvent(QEvent::KeyPress,Key_Return,13,Qt::NoButton )); --- diff --git a/src/PythonConsole/PythonConsole_PyEditor.cxx b/src/PythonConsole/PythonConsole_PyEditor.cxx index c48c534fd..cdc4bb78e 100755 --- a/src/PythonConsole/PythonConsole_PyEditor.cxx +++ b/src/PythonConsole/PythonConsole_PyEditor.cxx @@ -158,9 +158,12 @@ void PythonConsole_PyEditor::exec( const QString& command ) _currentPrompt = READY_PROMPT; _buf.truncate(0); _isInHistory = false; - setText( "\n" + _currentPrompt); - setText( command + "\n" ); - handleReturn(); + setText( "\n" + _currentPrompt); + // PAL15963 (Problem with option -u (--execute) of runSalome). + // Let events creating a study end before script execution starts + setText( command /*+ "\n"*/ ); + //handleReturn(); + qApp->postEvent( this, new QKeyEvent(QEvent::KeyPress,Key_Return,13,Qt::NoButton )); } void PythonConsole_PyEditor::execAndWait( const QString& command )