1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : SUPERVGUI_BrowseNodeDlg.cxx
8 // Author : Vitaly SMETANNIKOV
12 #include "SUPERVGUI_BrowseNodeDlg.h"
13 #include "SUPERVGUI_Node.h"
14 #include "SUPERVGUI_CanvasNode.h"
15 #include "SUPERVGUI_Port.h"
16 #include "SUPERVGUI_CanvasPort.h"
17 #include "SUPERVGUI.h"
20 #include <qlineedit.h>
21 #include <qpushbutton.h>
23 #include <qgroupbox.h>
24 #include <qvalidator.h>
29 SUPERVGUI_PortField::SUPERVGUI_PortField( QWidget* theParent, SUPERV_Port thePort ) {
31 myIsEditable = myPort->IsInput() && ( !myPort->IsLinked() );
33 QString aLabelTxt(myPort->Name());
35 SUPERV_CNode aNode = myPort->Node();
36 SALOME_ModuleCatalog::Service* aService = aNode->Service();
37 SALOME_ModuleCatalog::ListOfServicesParameter aList;
38 aList = (myPort->IsInput())? aService->ServiceinParameter : aService->ServiceoutParameter;
39 for (int i = 0; i < aList.length(); i++) {
40 SALOME_ModuleCatalog::ServicesParameter* aParam = &(aList[i]);
41 if (aLabelTxt == aParam->Parametername) {
42 aLabelTxt += QString(" (") + QString(aParam->Parametertype) + QString(")");
47 aLabelTxt += QString(":");
48 myLabel = new QLabel(aLabelTxt, theParent );
50 myValue = new QLineEdit( theParent );
51 myLabel->setBuddy( myValue );
53 myValue->setReadOnly( !myIsEditable );
54 QPalette aPalette = myValue->palette();
55 aPalette.setInactive(aPalette.disabled());
56 aPalette.setActive(aPalette.disabled());
57 myValue->setPalette(aPalette);
59 myValue->installEventFilter( this );
63 * Sets value from text edit control to engine of port
65 bool SUPERVGUI_PortField::setNewValue() {
66 if ( !myIsEditable ) return false;
68 QString aTxt = myValue->text();
69 if ( aTxt.isNull() || aTxt.isEmpty() ) return false;
71 if ( aTxt.find( "Unknown" ) < 0 ) {
72 //cout<<" ===> Set new value!"<<endl;
73 return myPort->Input( Supervision.getEngine()->StringValue( aTxt ) );
81 bool SUPERVGUI_PortField::eventFilter( QObject* o, QEvent* e )
84 if ( e->type() == QEvent::FocusIn ) {
88 return QObject::eventFilter( o, e );
93 * Constructor (SUPERVGUI_Node)
95 SUPERVGUI_BrowseNodeDlg::SUPERVGUI_BrowseNodeDlg( SUPERVGUI_Node* theNode )
96 : QDialog( theNode, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
105 * Constructor (SUPERVGUI_CanvasNode)
107 SUPERVGUI_BrowseNodeDlg::SUPERVGUI_BrowseNodeDlg( SUPERVGUI_CanvasNode* theNode )
108 : QDialog( QAD_Application::getDesktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
111 myNodeCanvas = theNode;
116 void SUPERVGUI_BrowseNodeDlg::init()
119 setSizeGripEnabled( true );
120 myPortsList.setAutoDelete( true );
122 SUPERV_CNode aEngine;
124 aEngine = myNode->getEngine();
126 aEngine = myNodeCanvas->getEngine();
128 mySelection = SALOME_Selection::Selection( Supervision.getActiveStudy()->getSelection() );
129 // mySelection->ClearIObjects();
131 setName( "SUPERVGUI_BrowseNodeDlg" );
132 setCaption( tr( "TIT_BROWSENODE" ) + aEngine->Name() );
134 QGridLayout* aBaseLayout = new QGridLayout( this );
135 aBaseLayout->setMargin( 11 ); aBaseLayout->setSpacing( 6 );
137 QGroupBox* aInBox = new QGroupBox( 2, Qt::Horizontal, "Input", this );
138 aInBox->setMargin( 11 );
139 aBaseLayout->addWidget( aInBox, 0, 0 );
141 QGroupBox* aOutBox = new QGroupBox( 2, Qt::Horizontal, "Output", this);
142 aOutBox->setMargin( 11 );
143 aBaseLayout->addWidget( aOutBox, 0, 1 );
145 myIsEditable = false;
148 SUPERV_Ports ports = aEngine->Ports();
149 int n = ports->length();
151 for ( int i = 0; i < n; i++ ) {
152 if ( ports[i]->IsInput() ) {
153 if ( !ports[i]->IsGate() ) { // not a gate
154 SUPERVGUI_PortField* aField = new SUPERVGUI_PortField( aInBox, ports[i] );
155 if ( aField->isEditable() ) myIsEditable = true;
156 myPortsList.append( aField );
157 if ( !myActiveField )
158 myActiveField = aField;
159 connect( aField, SIGNAL( activated() ), this, SLOT( onFieldActivated() ) );
164 if ( !ports[i]->IsGate() ) { // not a gate
165 myPortsList.append( new SUPERVGUI_PortField( aOutBox, ports[i] ) );
171 QGroupBox* aBtnBox = new QGroupBox( this );
172 aBtnBox->setColumnLayout( 0, Qt::Vertical );
173 aBtnBox->layout()->setSpacing( 0 );
174 aBtnBox->layout()->setMargin( 0 );
176 QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
177 aBtnLayout->setAlignment( Qt::AlignTop );
178 aBtnLayout->setSpacing( 6 );
179 aBtnLayout->setMargin( 11 );
181 if ( myIsEditable ) {
182 QLabel* aInfoLab = new QLabel( tr( "ENTER_OR_SELECT_LBL" ), this );
183 aBaseLayout->addMultiCellWidget( aInfoLab, 1, 1, 0, 1 );
185 QPushButton* aOkBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
186 connect( aOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
187 aBtnLayout->addWidget( aOkBtn );
188 aBaseLayout->addMultiCellWidget( aBtnBox, 2, 2, 0, 1 );
190 aBaseLayout->addMultiCellWidget( aBtnBox, 1, 1, 0, 1 );
192 aBtnLayout->addStretch();
193 QPushButton* aCancelBtn = new QPushButton( myIsEditable ? tr( "BUT_CANCEL" ) : tr( "BUT_CLOSE" ), aBtnBox );
194 aBtnLayout->addWidget( aCancelBtn );
195 connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
198 aBtnLayout->addStretch();
200 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
202 myNode->getMain()->lockedGraph(true);
204 myNodeCanvas->getMain()->lockedGraph(true);
210 SUPERVGUI_BrowseNodeDlg::~SUPERVGUI_BrowseNodeDlg() {
214 * Set current values of editable ports
216 void SUPERVGUI_BrowseNodeDlg::setValues() {
217 SUPERVGUI_PortField* aField;
218 for ( aField = myPortsList.first(); aField; aField = myPortsList.next() ) {
224 * Set inputed values of editable ports and then closes and destroys dialog
226 void SUPERVGUI_BrowseNodeDlg::accept() {
227 if ( myIsEditable ) {
228 SUPERVGUI_PortField* aField;
229 for ( aField = myPortsList.first(); aField; aField = myPortsList.next() ) {
230 aField->setNewValue();
235 myNodeCanvas->sync();
236 myNodeCanvas->getMain()->getCanvas()->update();
240 myNode->getMain()->lockedGraph(false);
242 myNodeCanvas->getMain()->lockedGraph(false);
249 * Closes and destroys dialog
251 void SUPERVGUI_BrowseNodeDlg::reject() {
253 myNode->getMain()->lockedGraph(false);
255 myNodeCanvas->getMain()->lockedGraph(false);
261 * Update current values on show event
263 void SUPERVGUI_BrowseNodeDlg::showEvent( QShowEvent* theEvent ) {
265 QDialog::showEvent( theEvent );
269 * Slot, called when field is focused
271 void SUPERVGUI_BrowseNodeDlg::onFieldActivated()
273 SUPERVGUI_PortField* aField = (SUPERVGUI_PortField*)sender();
274 myActiveField = (aField->isEditable())? aField : 0;
280 * Slot, called when selection is changed
282 void SUPERVGUI_BrowseNodeDlg::onSelectionChanged()
284 if ( myActiveField ) {
285 if( mySelection->IObjectCount() == 1 ) {
286 Handle( SALOME_InteractiveObject ) anIO = mySelection->firstIObject();
287 if ( anIO->hasEntry() ) {
288 SALOMEDS::SObject_var aObj = Supervision.getActiveStudy()->
289 getStudyDocument()->FindObjectID( anIO->getEntry() );
291 SALOMEDS::GenericAttribute_var anAttr;
292 SALOMEDS::AttributeIOR_var anIOR;
293 Standard_CString ior = "";
295 if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
296 anIOR = SALOMEDS::AttributeIOR::_narrow( anAttr );
297 ior = anIOR->Value();
300 ior = aObj->GetStudy()->ConvertObjectToIOR( aObj );
302 myActiveField->setData( ior );
309 * Constructor (SUPERVGUI_PortIn)
311 SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_PortIn* thePort )
312 : QDialog( thePort, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
322 * Constructor (SUPERVGUI_PortInESNode)
324 SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_PortInESNode* thePort )
325 : QDialog( thePort, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
328 myPortESNode = thePort;
335 * Constructor (SUPERVGUI_CanvasPort)
337 SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_CanvasPort* thePort )
338 : QDialog( QAD_Application::getDesktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
342 myPortCanvas = thePort;
347 void SUPERVGUI_GetValueDlg::init()
350 setSizeGripEnabled( true );
352 mySelection = SALOME_Selection::Selection( Supervision.getActiveStudy()->getSelection() );
353 // mySelection->ClearIObjects();
355 setName( "SUPERVGUI_GetValueDlg" );
356 setCaption( tr( "TIT_SETVALUE_PORT" ) );
358 QGridLayout* aBaseLayout = new QGridLayout( this );
359 aBaseLayout->setMargin( 11 ); aBaseLayout->setSpacing( 6 );
361 QGroupBox* aBox = new QGroupBox( this );
362 aBox->setColumnLayout( 0, Qt::Vertical );
363 aBox->layout()->setSpacing( 0 ); aBox->layout()->setMargin( 0 );
364 QGridLayout* aBoxLayout = new QGridLayout( aBox->layout() );
365 aBoxLayout->setAlignment( Qt::AlignTop );
366 aBoxLayout->setSpacing( 6 ); aBoxLayout->setMargin( 11 );
367 aBaseLayout->addWidget( aBox, 0, 0 );
368 aBox->setMinimumWidth( 200 );
370 QLabel* aInfoLab = new QLabel( tr( "ENTER_OR_SELECT_LBL" ), aBox );
371 QFont fnt = aInfoLab->font(); fnt.setBold( true ); aInfoLab->setFont( fnt );
372 aBoxLayout->addMultiCellWidget( aInfoLab, 0, 0, 0, 1 );
375 aEngine = myPort->getPort();
376 else if (myPortESNode != 0)
377 aEngine = myPortESNode->getPort();
379 aEngine = myPortCanvas->getEngine();
381 myField = new SUPERVGUI_PortField( aBox, aEngine );
382 bool myIsEditable = myField->isEditable();
383 aBoxLayout->addWidget( myField->myLabel, 1, 0 );
384 aBoxLayout->addWidget( myField->myValue, 1, 1 );
386 QGroupBox* aBtnBox = new QGroupBox( this );
387 aBtnBox->setColumnLayout( 0, Qt::Vertical );
388 aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
389 QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
390 aBtnLayout->setAlignment( Qt::AlignTop );
391 aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
393 aBaseLayout->addWidget( aBtnBox, 1, 0 );
395 if ( myIsEditable ) {
396 myOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
397 connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
398 aBtnLayout->addWidget( myOKBtn );
401 aBtnLayout->addStretch();
402 myCancelBtn = new QPushButton( myIsEditable ? tr( "BUT_CANCEL" ) : tr( "BUT_CLOSE" ), aBtnBox );
403 aBtnLayout->addWidget( myCancelBtn );
404 connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
407 aBtnLayout->addStretch();
409 myField->updateGUI();
410 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
412 myPort->getMain()->lockedGraph(true);
413 else if (myPortESNode != 0)
414 myPortESNode->getMain()->lockedGraph(true);
416 myPortCanvas->getMain()->lockedGraph(true);
422 SUPERVGUI_GetValueDlg::~SUPERVGUI_GetValueDlg() {
426 * Set entered value into port and then closes and destroys dialog
428 void SUPERVGUI_GetValueDlg::accept() {
429 if ( myField->setNewValue() ) {
433 else if (myPortESNode != 0)
434 myPortESNode->sync();
436 myPortCanvas->sync();
437 myPortCanvas->getMain()->getCanvas()->update();
441 if ( QMessageBox::warning( QAD_Application::getDesktop(),
442 tr( "ERROR" ), tr( "MSG_CANT_SETVAL" ),
443 QMessageBox::Retry, QMessageBox::Abort) == QMessageBox::Retry )
448 myPort->getMain()->lockedGraph(false);
449 else if (myPortESNode != 0)
450 myPortESNode->getMain()->lockedGraph(false);
452 myPortCanvas->getMain()->lockedGraph(false);
458 * Closes and destroys dialog
460 void SUPERVGUI_GetValueDlg::reject() {
462 myPort->getMain()->lockedGraph(false);
463 else if (myPortESNode != 0)
464 myPortESNode->getMain()->lockedGraph(false);
466 myPortCanvas->getMain()->lockedGraph(false);
472 * Slot, called when selection is changed
474 void SUPERVGUI_GetValueDlg::onSelectionChanged()
476 if( mySelection->IObjectCount() == 1 ) {
477 Handle( SALOME_InteractiveObject ) anIO = mySelection->firstIObject();
478 if ( anIO->hasEntry() ) {
479 SALOMEDS::SObject_var aObj = Supervision.getActiveStudy()->
480 getStudyDocument()->FindObjectID( anIO->getEntry() );
482 SALOMEDS::GenericAttribute_var anAttr;
483 SALOMEDS::AttributeIOR_var anIOR;
484 Standard_CString ior = "";
486 if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
487 anIOR = SALOMEDS::AttributeIOR::_narrow( anAttr );
488 ior = anIOR->Value();
491 ior = aObj->GetStudy()->ConvertObjectToIOR( aObj );
493 myField->setData( ior );
500 // ----------------------------
502 // ----------------------------
504 SUPERVGUI_StreamInDlg::SUPERVGUI_StreamInDlg(SUPERVGUI_StreamPortIn* thePort)
505 :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
512 SUPERVGUI_StreamInDlg::SUPERVGUI_StreamInDlg(SUPERVGUI_CanvasStreamPortIn* thePort)
513 :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
516 myPortCanvas = thePort;
520 void SUPERVGUI_StreamInDlg::init()
522 setSizeGripEnabled( true );
523 setCaption( tr( "MSG_STREAM_DLG_TIT" ) );
525 QVBoxLayout* TopLayout = new QVBoxLayout( this, 11, 6 );
527 QFrame* aCtrlPane = new QFrame(this);
528 QGridLayout* aCtrlLayout = new QGridLayout( aCtrlPane, 4, 10 );
531 QLabel* aSchemaLbl = new QLabel(tr("MSG_STREAM_SCHEMA"),aCtrlPane);
532 aCtrlLayout->addWidget(aSchemaLbl, 0, 0);
534 mySchemaCombo = new QComboBox(aCtrlPane, "SchemaBox" );
535 mySchemaCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
536 mySchemaCombo->insertItem("SCHENULL");
537 mySchemaCombo->insertItem("TI");
538 mySchemaCombo->insertItem("TF");
539 mySchemaCombo->insertItem("DELTA");
540 aCtrlLayout->addWidget(mySchemaCombo, 0, 1);
543 QLabel* aInterLbl = new QLabel(tr("MSG_STREAM_INTER"),aCtrlPane);
544 aCtrlLayout->addWidget(aInterLbl, 1, 0);
546 myInterCombo = new QComboBox(aCtrlPane, "InterBox" );
547 myInterCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
548 myInterCombo->insertItem("INTERNULL");
549 myInterCombo->insertItem("L0");
550 myInterCombo->insertItem("L1");
551 aCtrlLayout->addWidget(myInterCombo, 1, 1);
554 QLabel* aExtraLbl = new QLabel(tr("MSG_STREAM_EXTRA"),aCtrlPane);
555 aCtrlLayout->addWidget(aExtraLbl, 2, 0);
557 myExterCombo = new QComboBox(aCtrlPane, "ExtraBox" );
558 myExterCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
559 myExterCombo->insertItem("EXTRANULL");
560 myExterCombo->insertItem("E0");
561 myExterCombo->insertItem("E1");
562 aCtrlLayout->addWidget(myExterCombo, 2, 1);
564 TopLayout->addWidget( aCtrlPane );
567 QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
568 GroupButtons->setColumnLayout(0, Qt::Vertical );
569 GroupButtons->layout()->setSpacing( 0 );
570 GroupButtons->layout()->setMargin( 0 );
571 QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
572 GroupButtonsLayout->setAlignment( Qt::AlignTop );
573 GroupButtonsLayout->setSpacing( 5 );
574 GroupButtonsLayout->setMargin( 8 );
576 QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
577 QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
579 GroupButtonsLayout->addWidget( okB, 0, 0 );
580 GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
581 GroupButtonsLayout->addWidget( cancelB, 0, 2 );
583 TopLayout->addWidget( GroupButtons );
585 connect( okB, SIGNAL( clicked() ), this, SLOT( accept() ) );
586 connect( cancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
590 void SUPERVGUI_StreamInDlg::setData() {
591 SUPERV::KindOfSchema aSchema;
592 SUPERV::KindOfInterpolation aInterpolat;
593 SUPERV::KindOfExtrapolation aExtrapolat;
596 myPort->getStreamPort()->Params(aSchema, aInterpolat, aExtrapolat);
598 myPortCanvas->getStreamEngine()->Params(aSchema, aInterpolat, aExtrapolat);
600 mySchemaCombo->setCurrentItem((int)aSchema);
601 myInterCombo->setCurrentItem((int)aInterpolat);
602 myExterCombo->setCurrentItem((int)aExtrapolat);
605 void SUPERVGUI_StreamInDlg::accept() {
607 myPort->getStreamPort()->SetParams((SUPERV::KindOfSchema) mySchemaCombo->currentItem(),
608 (SUPERV::KindOfInterpolation) myInterCombo->currentItem(),
609 (SUPERV::KindOfExtrapolation) myExterCombo->currentItem());
611 myPortCanvas->getStreamEngine()->SetParams((SUPERV::KindOfSchema) mySchemaCombo->currentItem(),
612 (SUPERV::KindOfInterpolation) myInterCombo->currentItem(),
613 (SUPERV::KindOfExtrapolation) myExterCombo->currentItem());
618 //-------------------------------------------------------------------------
619 SUPERVGUI_StreamOutDlg::SUPERVGUI_StreamOutDlg(SUPERVGUI_StreamPortOut* thePort)
620 :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
626 SUPERVGUI_StreamOutDlg::SUPERVGUI_StreamOutDlg(SUPERVGUI_CanvasStreamPortOut* thePort)
627 :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
630 myPortCanvas = thePort;
634 void SUPERVGUI_StreamOutDlg::init()
636 setSizeGripEnabled( true );
637 setCaption( tr( "MSG_STREAM_DLG_TIT" ) );
639 QVBoxLayout* TopLayout = new QVBoxLayout( this, 11, 6 );
641 QFrame* aCtrlPane = new QFrame(this);
642 QGridLayout* aCtrlLayout = new QGridLayout( aCtrlPane, 4, 10 );
644 QLabel* aLbl = new QLabel(tr("MSG_STREAM_LEVEL"),aCtrlPane);
645 aCtrlLayout->addWidget(aLbl, 0, 0);
647 myValEdit = new QLineEdit( aCtrlPane, "ValEdit" );
648 myValEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
649 myValEdit->setValidator( new QIntValidator(this) );
650 SUPERV_StreamPort aEngine;
652 aEngine = myPort->getStreamPort();
654 aEngine = myPortCanvas->getStreamEngine();
655 myValEdit->setText(QString("%1").arg(aEngine->NumberOfValues()));
656 aCtrlLayout->addWidget(myValEdit, 0, 1);
657 TopLayout->addWidget( aCtrlPane );
660 QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
661 GroupButtons->setColumnLayout(0, Qt::Vertical );
662 GroupButtons->layout()->setSpacing( 0 );
663 GroupButtons->layout()->setMargin( 0 );
664 QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
665 GroupButtonsLayout->setAlignment( Qt::AlignTop );
666 GroupButtonsLayout->setSpacing( 5 );
667 GroupButtonsLayout->setMargin( 8 );
669 QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
670 QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
672 GroupButtonsLayout->addWidget( okB, 0, 0 );
673 GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
674 GroupButtonsLayout->addWidget( cancelB, 0, 2 );
676 TopLayout->addWidget( GroupButtons );
678 connect( okB, SIGNAL( clicked() ), this, SLOT( accept() ) );
679 connect( cancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
682 void SUPERVGUI_StreamOutDlg::accept() {
684 QString aStr = myValEdit->text();
686 aRes = aStr.toLong();
688 myPort->getStreamPort()->SetNumberOfValues(aRes);
690 myPortCanvas->getStreamEngine()->SetNumberOfValues(aRes);