X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUPERVGUI%2FSUPERVGUI_Information.cxx;h=fe1c270a124d7b2a65f7d01306f9e92dcdddac72;hb=cbb0219fe6d6bf11f98f2306c2855fef1eaa2d44;hp=1151a7793f61d53da3e6708758631d2380062a7e;hpb=c472be64ad2486a50e224af7c02e34eefaca9304;p=modules%2Fsuperv.git diff --git a/src/SUPERVGUI/SUPERVGUI_Information.cxx b/src/SUPERVGUI/SUPERVGUI_Information.cxx index 1151a77..fe1c270 100644 --- a/src/SUPERVGUI/SUPERVGUI_Information.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Information.cxx @@ -88,7 +88,8 @@ SUPERVGUI_Information::SUPERVGUI_Information(SUPERV_CNode node, bool isReadOnly) compnameV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); compnameV->setMinimumSize( 200, 0 ); compnameV->setReadOnly( true/*isReadOnly*/ ); - compnameV->setText( SUPERV::FNode::_narrow(node)->GetComponentName() ); + compnameV->setText( QAD_Application::getDesktop()->getComponentUserName( + SUPERV::FNode::_narrow(node)->GetComponentName()) ); intnameL = new QLabel( tr( "INTERFACE_NAME_LBL" ), TopGroup ); intnameV = new QLineEdit( TopGroup ); @@ -146,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() ) ); }