X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUPERVGUI%2FSUPERVGUI_Information.cxx;h=fe1c270a124d7b2a65f7d01306f9e92dcdddac72;hb=ea7f29f75031ca13b9454f5e9ac73730f1f584eb;hp=5ee9b3c774e39ef2c527f0d5b1777b933e4a40b1;hpb=bae06cd3bdae2ac2acb878e96689b2ea283aad23;p=modules%2Fsuperv.git diff --git a/src/SUPERVGUI/SUPERVGUI_Information.cxx b/src/SUPERVGUI/SUPERVGUI_Information.cxx index 5ee9b3c..fe1c270 100644 --- a/src/SUPERVGUI/SUPERVGUI_Information.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Information.cxx @@ -147,18 +147,31 @@ SUPERVGUI_Information::SUPERVGUI_Information(SUPERV_CNode node, bool isReadOnly) 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() ) ); }