In ScriptWidget, keep the name of the script between two calls.
This commit is contained in:
parent
0f1775a77c
commit
de401b13d9
|
@ -112,6 +112,7 @@ namespace Hurricane {
|
|||
, _toolInterrupt (false)
|
||||
, _flags (0)
|
||||
, _updateState (ExternalEmit)
|
||||
, _pyScriptName ()
|
||||
{
|
||||
setObjectName( "viewer" );
|
||||
menuBar()->setObjectName ( _getAbsWidgetPath("") );
|
||||
|
@ -893,7 +894,7 @@ namespace Hurricane {
|
|||
|
||||
|
||||
void CellViewer::runScriptWidget ()
|
||||
{ ScriptWidget::runScript( this, getCell() ); }
|
||||
{ ScriptWidget::runScript( this, _pyScriptName, getCell() ); }
|
||||
|
||||
|
||||
string CellViewer::_getString () const
|
||||
|
|
|
@ -91,11 +91,19 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
void ScriptWidget::runScript ( QWidget* parent, Cell* cell )
|
||||
void ScriptWidget::setScriptName ( QString scriptName )
|
||||
{
|
||||
return _lineEdit->setText( scriptName );
|
||||
}
|
||||
|
||||
|
||||
void ScriptWidget::runScript ( QWidget* parent, QString& scriptName, Cell* cell )
|
||||
{
|
||||
ScriptWidget* dialog = new ScriptWidget ( parent );
|
||||
bool doRunScript = (dialog->exec() == Accepted);
|
||||
QString scriptName = dialog->getScriptName ();
|
||||
dialog->setScriptName( scriptName );
|
||||
|
||||
bool doRunScript = (dialog->exec() == Accepted);
|
||||
scriptName = dialog->getScriptName ();
|
||||
|
||||
delete dialog;
|
||||
if (not doRunScript) return;
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace Hurricane {
|
|||
bool _toolInterrupt;
|
||||
unsigned int _flags;
|
||||
UpdateState _updateState;
|
||||
|
||||
QString _pyScriptName;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -30,8 +30,9 @@ namespace Hurricane {
|
|||
class ScriptWidget : public QDialog {
|
||||
Q_OBJECT;
|
||||
public:
|
||||
static void runScript ( QWidget* parent, Cell* );
|
||||
static void runScript ( QWidget* parent, QString& scriptName, Cell* );
|
||||
const QString getScriptName () const;
|
||||
void setScriptName ( QString scriptName );
|
||||
protected:
|
||||
ScriptWidget ( QWidget* parent=NULL );
|
||||
protected:
|
||||
|
|
Loading…
Reference in New Issue