- GroupButtonsLayout->addWidget( okB, 0, 0 );
- GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
- GroupButtonsLayout->addWidget( cancelB, 0, 2 );
+ // fix for PAL6904: when isReadOnly is set ON (the dataflow was imported) then only "CLOSE" button
+ // should be present instead of 2 buttons OK and Cancel.
+ QPushButton* cancelB;
+ if ( !isReadOnly || node->IsFactory() ) {
+ /*added node->IsFactory() because only for Factory nodes we ALWAYS have editable "Container" field */
+ QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
+ connect( okB, SIGNAL( clicked() ), this, SLOT( okButton() ) );
+ cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
+ GroupButtonsLayout->addWidget( okB, 0, 0 );
+ GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
+ GroupButtonsLayout->addWidget( cancelB, 0, 2 );
+ }
+ else {
+ cancelB = new QPushButton( tr( "BUT_CLOSE" ), GroupButtons );
+ GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 0 );
+ GroupButtonsLayout->addWidget( cancelB, 0, 1 );
+ GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 2 );
+ }