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)
|
, _toolInterrupt (false)
|
||||||
, _flags (0)
|
, _flags (0)
|
||||||
, _updateState (ExternalEmit)
|
, _updateState (ExternalEmit)
|
||||||
|
, _pyScriptName ()
|
||||||
{
|
{
|
||||||
setObjectName( "viewer" );
|
setObjectName( "viewer" );
|
||||||
menuBar()->setObjectName ( _getAbsWidgetPath("") );
|
menuBar()->setObjectName ( _getAbsWidgetPath("") );
|
||||||
|
@ -893,7 +894,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
void CellViewer::runScriptWidget ()
|
void CellViewer::runScriptWidget ()
|
||||||
{ ScriptWidget::runScript( this, getCell() ); }
|
{ ScriptWidget::runScript( this, _pyScriptName, getCell() ); }
|
||||||
|
|
||||||
|
|
||||||
string CellViewer::_getString () const
|
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 );
|
ScriptWidget* dialog = new ScriptWidget ( parent );
|
||||||
|
dialog->setScriptName( scriptName );
|
||||||
|
|
||||||
bool doRunScript = (dialog->exec() == Accepted);
|
bool doRunScript = (dialog->exec() == Accepted);
|
||||||
QString scriptName = dialog->getScriptName ();
|
scriptName = dialog->getScriptName ();
|
||||||
|
|
||||||
delete dialog;
|
delete dialog;
|
||||||
if (not doRunScript) return;
|
if (not doRunScript) return;
|
||||||
|
|
|
@ -193,7 +193,7 @@ namespace Hurricane {
|
||||||
bool _toolInterrupt;
|
bool _toolInterrupt;
|
||||||
unsigned int _flags;
|
unsigned int _flags;
|
||||||
UpdateState _updateState;
|
UpdateState _updateState;
|
||||||
|
QString _pyScriptName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,9 @@ namespace Hurricane {
|
||||||
class ScriptWidget : public QDialog {
|
class ScriptWidget : public QDialog {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
public:
|
public:
|
||||||
static void runScript ( QWidget* parent, Cell* );
|
static void runScript ( QWidget* parent, QString& scriptName, Cell* );
|
||||||
const QString getScriptName () const;
|
const QString getScriptName () const;
|
||||||
|
void setScriptName ( QString scriptName );
|
||||||
protected:
|
protected:
|
||||||
ScriptWidget ( QWidget* parent=NULL );
|
ScriptWidget ( QWidget* parent=NULL );
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in New Issue