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 return myPort->Input( Supervision.getEngine()->StringValue( aTxt ) );
80 bool SUPERVGUI_PortField::eventFilter( QObject* o, QEvent* e )
83 if ( e->type() == QEvent::FocusIn ) {
87 return QObject::eventFilter( o, e );
92 * Constructor (SUPERVGUI_Node)
94 SUPERVGUI_BrowseNodeDlg::SUPERVGUI_BrowseNodeDlg( SUPERVGUI_Node* theNode )
95 : QDialog( theNode, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
104 * Constructor (SUPERVGUI_CanvasNode)
106 SUPERVGUI_BrowseNodeDlg::SUPERVGUI_BrowseNodeDlg( SUPERVGUI_CanvasNode* theNode )
107 : QDialog( QAD_Application::getDesktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
110 myNodeCanvas = theNode;
115 void SUPERVGUI_BrowseNodeDlg::init()
118 setSizeGripEnabled( true );
119 myPortsList.setAutoDelete( true );
121 SUPERV_CNode aEngine;
123 aEngine = myNode->getEngine();
125 aEngine = myNodeCanvas->getEngine();
127 mySelection = SALOME_Selection::Selection( Supervision.getActiveStudy()->getSelection() );
128 // mySelection->ClearIObjects();
130 setName( "SUPERVGUI_BrowseNodeDlg" );
131 setCaption( tr( "TIT_BROWSENODE" ) + aEngine->Name() );
133 QGridLayout* aBaseLayout = new QGridLayout( this );
134 aBaseLayout->setMargin( 11 ); aBaseLayout->setSpacing( 6 );
136 QGroupBox* aInBox = new QGroupBox( 2, Qt::Horizontal, "Input", this );
137 aInBox->setMargin( 11 );
138 aBaseLayout->addWidget( aInBox, 0, 0 );
140 QGroupBox* aOutBox = new QGroupBox( 2, Qt::Horizontal, "Output", this);
141 aOutBox->setMargin( 11 );
142 aBaseLayout->addWidget( aOutBox, 0, 1 );
144 myIsEditable = false;
147 SUPERV_Ports ports = aEngine->Ports();
148 int n = ports->length();
150 for ( int i = 0; i < n; i++ ) {
151 if ( ports[i]->IsInput() ) {
152 if ( !ports[i]->IsGate() ) { // not a gate
153 SUPERVGUI_PortField* aField = new SUPERVGUI_PortField( aInBox, ports[i] );
154 if ( aField->isEditable() ) myIsEditable = true;
155 myPortsList.append( aField );
156 if ( !myActiveField )
157 myActiveField = aField;
158 connect( aField, SIGNAL( activated() ), this, SLOT( onFieldActivated() ) );
163 if ( !ports[i]->IsGate() ) { // not a gate
164 myPortsList.append( new SUPERVGUI_PortField( aOutBox, ports[i] ) );
170 QGroupBox* aBtnBox = new QGroupBox( this );
171 aBtnBox->setColumnLayout( 0, Qt::Vertical );
172 aBtnBox->layout()->setSpacing( 0 );
173 aBtnBox->layout()->setMargin( 0 );
175 QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
176 aBtnLayout->setAlignment( Qt::AlignTop );
177 aBtnLayout->setSpacing( 6 );
178 aBtnLayout->setMargin( 11 );
180 if ( myIsEditable ) {
181 QLabel* aInfoLab = new QLabel( tr( "ENTER_OR_SELECT_LBL" ), this );
182 aBaseLayout->addMultiCellWidget( aInfoLab, 1, 1, 0, 1 );
184 QPushButton* aOkBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
185 connect( aOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
186 aBtnLayout->addWidget( aOkBtn );
187 aBaseLayout->addMultiCellWidget( aBtnBox, 2, 2, 0, 1 );
189 aBaseLayout->addMultiCellWidget( aBtnBox, 1, 1, 0, 1 );
191 aBtnLayout->addStretch();
192 QPushButton* aCancelBtn = new QPushButton( myIsEditable ? tr( "BUT_CANCEL" ) : tr( "BUT_CLOSE" ), aBtnBox );
193 aBtnLayout->addWidget( aCancelBtn );
194 connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
197 aBtnLayout->addStretch();
199 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
201 myNode->getMain()->lockedGraph(true);
203 myNodeCanvas->getMain()->lockedGraph(true);
209 SUPERVGUI_BrowseNodeDlg::~SUPERVGUI_BrowseNodeDlg() {
213 * Set current values of editable ports
215 void SUPERVGUI_BrowseNodeDlg::setValues() {
216 SUPERVGUI_PortField* aField;
217 for ( aField = myPortsList.first(); aField; aField = myPortsList.next() ) {
223 * Set inputed values of editable ports and then closes and destroys dialog
225 void SUPERVGUI_BrowseNodeDlg::accept() {
226 if ( myIsEditable ) {
227 SUPERVGUI_PortField* aField;
228 for ( aField = myPortsList.first(); aField; aField = myPortsList.next() ) {
229 aField->setNewValue();
234 myNodeCanvas->sync();
235 myNodeCanvas->getMain()->getCanvas()->update();
239 myNode->getMain()->lockedGraph(false);
241 myNodeCanvas->getMain()->lockedGraph(false);
248 * Closes and destroys dialog
250 void SUPERVGUI_BrowseNodeDlg::reject() {
252 myNode->getMain()->lockedGraph(false);
254 myNodeCanvas->getMain()->lockedGraph(false);
260 * Update current values on show event
262 void SUPERVGUI_BrowseNodeDlg::showEvent( QShowEvent* theEvent ) {
264 QDialog::showEvent( theEvent );
268 * Slot, called when field is focused
270 void SUPERVGUI_BrowseNodeDlg::onFieldActivated()
272 SUPERVGUI_PortField* aField = (SUPERVGUI_PortField*)sender();
273 myActiveField = (aField->isEditable())? aField : 0;
279 * Slot, called when selection is changed
281 void SUPERVGUI_BrowseNodeDlg::onSelectionChanged()
283 if ( myActiveField ) {
284 if( mySelection->IObjectCount() == 1 ) {
285 Handle( SALOME_InteractiveObject ) anIO = mySelection->firstIObject();
286 if ( anIO->hasEntry() ) {
287 SALOMEDS::SObject_var aObj = Supervision.getActiveStudy()->
288 getStudyDocument()->FindObjectID( anIO->getEntry() );
290 SALOMEDS::GenericAttribute_var anAttr;
291 SALOMEDS::AttributeIOR_var anIOR;
292 Standard_CString ior = "";
294 if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
295 anIOR = SALOMEDS::AttributeIOR::_narrow( anAttr );
296 ior = anIOR->Value();
299 ior = aObj->GetStudy()->ConvertObjectToIOR( aObj );
301 myActiveField->setData( ior );
308 * Constructor (SUPERVGUI_PortIn)
310 SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_PortIn* thePort )
311 : QDialog( thePort, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
321 * Constructor (SUPERVGUI_PortInESNode)
323 SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_PortInESNode* thePort )
324 : QDialog( thePort, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
327 myPortESNode = thePort;
334 * Constructor (SUPERVGUI_CanvasPort)
336 SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_CanvasPort* thePort )
337 : QDialog( QAD_Application::getDesktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
341 myPortCanvas = thePort;
346 void SUPERVGUI_GetValueDlg::init()
349 setSizeGripEnabled( true );
351 mySelection = SALOME_Selection::Selection( Supervision.getActiveStudy()->getSelection() );
352 // mySelection->ClearIObjects();
354 setName( "SUPERVGUI_GetValueDlg" );
355 setCaption( tr( "TIT_SETVALUE_PORT" ) );
357 QGridLayout* aBaseLayout = new QGridLayout( this );
358 aBaseLayout->setMargin( 11 ); aBaseLayout->setSpacing( 6 );
360 QGroupBox* aBox = new QGroupBox( this );
361 aBox->setColumnLayout( 0, Qt::Vertical );
362 aBox->layout()->setSpacing( 0 ); aBox->layout()->setMargin( 0 );
363 QGridLayout* aBoxLayout = new QGridLayout( aBox->layout() );
364 aBoxLayout->setAlignment( Qt::AlignTop );
365 aBoxLayout->setSpacing( 6 ); aBoxLayout->setMargin( 11 );
366 aBaseLayout->addWidget( aBox, 0, 0 );
367 aBox->setMinimumWidth( 200 );
369 QLabel* aInfoLab = new QLabel( tr( "ENTER_OR_SELECT_LBL" ), aBox );
370 QFont fnt = aInfoLab->font(); fnt.setBold( true ); aInfoLab->setFont( fnt );
371 aBoxLayout->addMultiCellWidget( aInfoLab, 0, 0, 0, 1 );
374 aEngine = myPort->getPort();
375 else if (myPortESNode != 0)
376 aEngine = myPortESNode->getPort();
378 aEngine = myPortCanvas->getEngine();
380 myField = new SUPERVGUI_PortField( aBox, aEngine );
381 bool myIsEditable = myField->isEditable();
382 aBoxLayout->addWidget( myField->myLabel, 1, 0 );
383 aBoxLayout->addWidget( myField->myValue, 1, 1 );
385 QGroupBox* aBtnBox = new QGroupBox( this );
386 aBtnBox->setColumnLayout( 0, Qt::Vertical );
387 aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
388 QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
389 aBtnLayout->setAlignment( Qt::AlignTop );
390 aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
392 aBaseLayout->addWidget( aBtnBox, 1, 0 );
394 if ( myIsEditable ) {
395 myOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
396 connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
397 aBtnLayout->addWidget( myOKBtn );
400 aBtnLayout->addStretch();
401 myCancelBtn = new QPushButton( myIsEditable ? tr( "BUT_CANCEL" ) : tr( "BUT_CLOSE" ), aBtnBox );
402 aBtnLayout->addWidget( myCancelBtn );
403 connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
406 aBtnLayout->addStretch();
408 myField->updateGUI();
409 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
411 myPort->getMain()->lockedGraph(true);
412 else if (myPortESNode != 0)
413 myPortESNode->getMain()->lockedGraph(true);
415 myPortCanvas->getMain()->lockedGraph(true);
421 SUPERVGUI_GetValueDlg::~SUPERVGUI_GetValueDlg() {
425 * Set entered value into port and then closes and destroys dialog
427 void SUPERVGUI_GetValueDlg::accept() {
428 if ( myField->setNewValue() ) {
432 else if (myPortESNode != 0)
433 myPortESNode->sync();
435 myPortCanvas->sync();
436 myPortCanvas->getMain()->getCanvas()->update();
440 if ( QMessageBox::warning( QAD_Application::getDesktop(),
441 tr( "ERROR" ), tr( "MSG_CANT_SETVAL" ),
442 QMessageBox::Retry, QMessageBox::Abort) == QMessageBox::Retry )
447 myPort->getMain()->lockedGraph(false);
448 else if (myPortESNode != 0)
449 myPortESNode->getMain()->lockedGraph(false);
451 myPortCanvas->getMain()->lockedGraph(false);
457 * Closes and destroys dialog
459 void SUPERVGUI_GetValueDlg::reject() {
461 myPort->getMain()->lockedGraph(false);
462 else if (myPortESNode != 0)
463 myPortESNode->getMain()->lockedGraph(false);
465 myPortCanvas->getMain()->lockedGraph(false);
471 * Slot, called when selection is changed
473 void SUPERVGUI_GetValueDlg::onSelectionChanged()
475 if( mySelection->IObjectCount() == 1 ) {
476 Handle( SALOME_InteractiveObject ) anIO = mySelection->firstIObject();
477 if ( anIO->hasEntry() ) {
478 SALOMEDS::SObject_var aObj = Supervision.getActiveStudy()->
479 getStudyDocument()->FindObjectID( anIO->getEntry() );
481 SALOMEDS::GenericAttribute_var anAttr;
482 SALOMEDS::AttributeIOR_var anIOR;
483 Standard_CString ior = "";
485 if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
486 anIOR = SALOMEDS::AttributeIOR::_narrow( anAttr );
487 ior = anIOR->Value();
490 ior = aObj->GetStudy()->ConvertObjectToIOR( aObj );
492 myField->setData( ior );
499 // ----------------------------
501 // ----------------------------
503 SUPERVGUI_StreamInDlg::SUPERVGUI_StreamInDlg(SUPERVGUI_StreamPortIn* thePort)
504 :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
511 SUPERVGUI_StreamInDlg::SUPERVGUI_StreamInDlg(SUPERVGUI_CanvasStreamPortIn* thePort)
512 :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
515 myPortCanvas = thePort;
519 void SUPERVGUI_StreamInDlg::init()
521 setSizeGripEnabled( true );
522 setCaption( tr( "MSG_STREAM_DLG_TIT" ) );
524 QVBoxLayout* TopLayout = new QVBoxLayout( this, 11, 6 );
526 QFrame* aCtrlPane = new QFrame(this);
527 QGridLayout* aCtrlLayout = new QGridLayout( aCtrlPane, 4, 10 );
530 QLabel* aSchemaLbl = new QLabel(tr("MSG_STREAM_SCHEMA"),aCtrlPane);
531 aCtrlLayout->addWidget(aSchemaLbl, 0, 0);
533 mySchemaCombo = new QComboBox(aCtrlPane, "SchemaBox" );
534 mySchemaCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
535 mySchemaCombo->insertItem("SCHENULL");
536 mySchemaCombo->insertItem("TI");
537 mySchemaCombo->insertItem("TF");
538 mySchemaCombo->insertItem("DELTA");
539 aCtrlLayout->addWidget(mySchemaCombo, 0, 1);
542 QLabel* aInterLbl = new QLabel(tr("MSG_STREAM_INTER"),aCtrlPane);
543 aCtrlLayout->addWidget(aInterLbl, 1, 0);
545 myInterCombo = new QComboBox(aCtrlPane, "InterBox" );
546 myInterCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
547 myInterCombo->insertItem("INTERNULL");
548 myInterCombo->insertItem("L0");
549 myInterCombo->insertItem("L1");
550 aCtrlLayout->addWidget(myInterCombo, 1, 1);
553 QLabel* aExtraLbl = new QLabel(tr("MSG_STREAM_EXTRA"),aCtrlPane);
554 aCtrlLayout->addWidget(aExtraLbl, 2, 0);
556 myExterCombo = new QComboBox(aCtrlPane, "ExtraBox" );
557 myExterCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
558 myExterCombo->insertItem("EXTRANULL");
559 myExterCombo->insertItem("E0");
560 myExterCombo->insertItem("E1");
561 aCtrlLayout->addWidget(myExterCombo, 2, 1);
563 TopLayout->addWidget( aCtrlPane );
566 QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
567 GroupButtons->setColumnLayout(0, Qt::Vertical );
568 GroupButtons->layout()->setSpacing( 0 );
569 GroupButtons->layout()->setMargin( 0 );
570 QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
571 GroupButtonsLayout->setAlignment( Qt::AlignTop );
572 GroupButtonsLayout->setSpacing( 5 );
573 GroupButtonsLayout->setMargin( 8 );
575 QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
576 QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
578 GroupButtonsLayout->addWidget( okB, 0, 0 );
579 GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
580 GroupButtonsLayout->addWidget( cancelB, 0, 2 );
582 TopLayout->addWidget( GroupButtons );
584 connect( okB, SIGNAL( clicked() ), this, SLOT( accept() ) );
585 connect( cancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
589 void SUPERVGUI_StreamInDlg::setData() {
590 SUPERV::KindOfSchema aSchema;
591 SUPERV::KindOfInterpolation aInterpolat;
592 SUPERV::KindOfExtrapolation aExtrapolat;
595 myPort->getStreamPort()->Params(aSchema, aInterpolat, aExtrapolat);
597 myPortCanvas->getStreamEngine()->Params(aSchema, aInterpolat, aExtrapolat);
599 mySchemaCombo->setCurrentItem((int)aSchema);
600 myInterCombo->setCurrentItem((int)aInterpolat);
601 myExterCombo->setCurrentItem((int)aExtrapolat);
604 void SUPERVGUI_StreamInDlg::accept() {
606 myPort->getStreamPort()->SetParams((SUPERV::KindOfSchema) mySchemaCombo->currentItem(),
607 (SUPERV::KindOfInterpolation) myInterCombo->currentItem(),
608 (SUPERV::KindOfExtrapolation) myExterCombo->currentItem());
610 myPortCanvas->getStreamEngine()->SetParams((SUPERV::KindOfSchema) mySchemaCombo->currentItem(),
611 (SUPERV::KindOfInterpolation) myInterCombo->currentItem(),
612 (SUPERV::KindOfExtrapolation) myExterCombo->currentItem());
617 //-------------------------------------------------------------------------
618 SUPERVGUI_StreamOutDlg::SUPERVGUI_StreamOutDlg(SUPERVGUI_StreamPortOut* thePort)
619 :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
625 SUPERVGUI_StreamOutDlg::SUPERVGUI_StreamOutDlg(SUPERVGUI_CanvasStreamPortOut* thePort)
626 :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
629 myPortCanvas = thePort;
633 void SUPERVGUI_StreamOutDlg::init()
635 setSizeGripEnabled( true );
636 setCaption( tr( "MSG_STREAM_DLG_TIT" ) );
638 QVBoxLayout* TopLayout = new QVBoxLayout( this, 11, 6 );
640 QFrame* aCtrlPane = new QFrame(this);
641 QGridLayout* aCtrlLayout = new QGridLayout( aCtrlPane, 4, 10 );
643 QLabel* aLbl = new QLabel(tr("MSG_STREAM_LEVEL"),aCtrlPane);
644 aCtrlLayout->addWidget(aLbl, 0, 0);
646 myValEdit = new QLineEdit( aCtrlPane, "ValEdit" );
647 myValEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
648 myValEdit->setValidator( new QIntValidator(this) );
649 SUPERV_StreamPort aEngine;
651 aEngine = myPort->getStreamPort();
653 aEngine = myPortCanvas->getStreamEngine();
654 myValEdit->setText(QString("%1").arg(aEngine->NumberOfValues()));
655 aCtrlLayout->addWidget(myValEdit, 0, 1);
656 TopLayout->addWidget( aCtrlPane );
659 QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
660 GroupButtons->setColumnLayout(0, Qt::Vertical );
661 GroupButtons->layout()->setSpacing( 0 );
662 GroupButtons->layout()->setMargin( 0 );
663 QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
664 GroupButtonsLayout->setAlignment( Qt::AlignTop );
665 GroupButtonsLayout->setSpacing( 5 );
666 GroupButtonsLayout->setMargin( 8 );
668 QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
669 QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
671 GroupButtonsLayout->addWidget( okB, 0, 0 );
672 GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
673 GroupButtonsLayout->addWidget( cancelB, 0, 2 );
675 TopLayout->addWidget( GroupButtons );
677 connect( okB, SIGNAL( clicked() ), this, SLOT( accept() ) );
678 connect( cancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
681 void SUPERVGUI_StreamOutDlg::accept() {
683 QString aStr = myValEdit->text();
685 aRes = aStr.toLong();
687 myPort->getStreamPort()->SetNumberOfValues(aRes);
689 myPortCanvas->getStreamEngine()->SetNumberOfValues(aRes);