GroupButtonsLayout->setAlignment( Qt::AlignTop );
GroupButtonsLayout->setSpacing( 6 );
GroupButtonsLayout->setMargin( 11 );
-
- QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
- QPushButton* 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 );
+ // 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 );
+ }
TopLayout->addWidget( TopGroup, 0, 0 );
TopLayout->addWidget( GroupButtons, 1, 0 );
+ TopLayout->setRowStretch( 0, 1 );
+ TopLayout->setRowStretch( 1, 0 );
- connect( okB, SIGNAL( clicked() ), this, SLOT( okButton() ) );
connect( cancelB, SIGNAL( clicked() ), this, SLOT( koButton() ) );
}