X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUPERVGUI%2FSUPERVGUI_Service.cxx;h=9d9c9d27d673c1f7401c3e4f1f88b1571ab627a3;hb=HEAD;hp=0c9f5424aacb68934ad4e455b83f4e937ec11872;hpb=ddb3b13cd63d457776a9b9e443b877c293cd684b;p=modules%2Fsuperv.git diff --git a/src/SUPERVGUI/SUPERVGUI_Service.cxx b/src/SUPERVGUI/SUPERVGUI_Service.cxx index 0c9f542..9d9c9d2 100644 --- a/src/SUPERVGUI/SUPERVGUI_Service.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Service.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -25,7 +25,6 @@ // Author : Francis KLOSS // Module : SUPERV -using namespace std; #include "SUPERVGUI_Service.h" #include "SUPERVGUI_Main.h" #include "SUPERVGUI_Library.h" @@ -118,6 +117,8 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns): aBaseLayoutV->setSpacing(10); QHBoxLayout* aBaseLayout = new QHBoxLayout(aCorbaPane); //!! + aBaseLayout->setMargin(5); + aBaseLayout->setSpacing(10); components = new QListView(aCorbaPane); components->addColumn(tr("COL_COMPONENTS")); @@ -128,6 +129,7 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns): components->setColumnAlignment(3, AlignLeft); components->setSelectionMode(QListView::Extended); components->setRootIsDecorated(true); + // aBaseLayout->addWidget(components); aBaseLayoutV->addWidget(components); //!! @@ -138,11 +140,16 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns): //NRI connect(aComputeCBtn, SIGNAL(clicked()), this, SLOT(addComputeNode())); //!! //NRI aComputeCBtn->setDefault(false); - QPushButton* aComputeBtn = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane); - connect(aComputeBtn, SIGNAL(clicked()), this, SLOT(addFactoryNode())); - aComputeBtn->setDefault(true); + QPushButton* aComputeBtnDef = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane); + connect(aComputeBtnDef, SIGNAL(clicked()), this, SLOT(addFactoryNodeDef())); + aComputeBtnDef->setDefault(true); + + QPushButton* aComputeBtnCust = new QPushButton(tr("TIT_ADDFNODE_CUST"), aCorbaPane); + connect(aComputeBtnCust, SIGNAL(clicked()), this, SLOT(addFactoryNodeCust())); + aComputeBtnCust->setDefault(true); - aBaseLayout->addWidget(aComputeBtn); + aBaseLayout->addWidget(aComputeBtnDef); + aBaseLayout->addWidget(aComputeBtnCust); //NRI aBaseLayout->addWidget(aComputeCBtn); //!! aBaseLayoutV->insertLayout(-1, aBaseLayout); @@ -256,22 +263,22 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns): } -char* getDataStreamParameterName(int aType) +char* getDataStreamParameterName(const char * aType) { - switch(aType) { - case 1: + QString type (aType); + + if (aType == "int") // 1 return "integer"; - case 2: + if (aType == "float") // 2 return "float"; - case 3: + if (aType == "double") // 3 return "double"; - case 4: + if (aType == "string") // 4 return "string"; - case 6: + if (aType == "bool") // 6 ?? return "boolean"; - default: - return "unknown"; - } + + return "unknown"; } void SUPERVGUI_Service::initialise() { @@ -329,10 +336,11 @@ void SUPERVGUI_Service::initialise() { long nbStreamPortsOut = Service->ServiceoutDataStreamParameter.length(); for (int m=0; mServiceoutDataStreamParameter[m]); + SALOME_ModuleCatalog::ServicesDataStreamParameter* PortOut = + &(Service->ServiceoutDataStreamParameter[m]); QListViewItem* myPortOutItem = new QListViewItem(myServiceItem, (char*)PortOut->Parametername, - getDataStreamParameterName(PortOut->Parametertype), "DataStream Out"); + getDataStreamParameterName(PortOut->Parametertype), "DataStream Out"); myPortOutItem->setSelectable(false); } @@ -421,7 +429,7 @@ void SUPERVGUI_Service::addComputeNode() { } } -void SUPERVGUI_Service::addFactoryNode() { +void SUPERVGUI_Service::addFactoryNodeDef() { SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop(); CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication()); if ( !anApp ) return; @@ -453,8 +461,10 @@ void SUPERVGUI_Service::addFactoryNode() { const char* service = item->text(0).latin1(); const char* interface = item->parent()->text(0).latin1(); //const char* component = anApp->moduleName(item->parent()->parent()->text(0).latin1()); - if ( aSupMod->getInterfaceNameMap().contains(item->parent()->text(0)) ) { - const char* component = aSupMod->getInterfaceNameMap().find(item->parent()->text(0)).data(); + // mkr : PAL13135 --> + if ( aSupMod->getInterfaceNameMap().contains(item->parent()->parent()->text(0)) ) { + const char* component = aSupMod->getInterfaceNameMap().find(item->parent()->parent()->text(0)).data(); + // mkr : PAL13135 <-- SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component); if (myComponent==NULL) { @@ -471,7 +481,7 @@ void SUPERVGUI_Service::addFactoryNode() { } } else { // Factory Node - aNode = aMain->getDataflow()->FNode(component, interface, *myService); + aNode = aMain->getDataflow()->FNode(component, interface, *myService, myComponent->implementation_type()); // mkr : PAL11273 if ( CORBA::is_nil( aNode ) ) { QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; @@ -491,6 +501,115 @@ void SUPERVGUI_Service::addFactoryNode() { } } +void SUPERVGUI_Service::addFactoryNodeCust() { + SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop(); + CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication()); + if ( !anApp ) return; + + SUPERVGUI* aSupMod = SUPERVGUI::Supervision(); + if ( !aSupMod ) { + MESSAGE("NULL Supervision module!"); + return; + } + + SUPERVGUI_Main* aMain = aSupMod->getMain(); + if (aMain==0) { + QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW")); + } else if (!aMain->isEditable()) { + QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); + } else { + CORBA::Object_ptr obj = naming->Resolve("/Kernel/ModulCatalog"); + SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var; + *aModuleCatalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj); + if (CORBA::is_nil(*aModuleCatalog)) { + QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE")); + } else { + QListViewItem* item; + bool b = false; + + QListViewItemIterator iSel(components); + int count = 0; + for (; iSel.current(); ++iSel) { // check : how many objects are selected (single or multi) + item = iSel.current(); + if (item->isSelected()) count++; + if ( count > 1) break; + } + + QListViewItemIterator i(components); + QString anAuthor, aContainer, aComment; + bool DoneSetting = false; + int aRes = 0; + for (; i.current(); ++i) { + item = i.current(); + if (item->isSelected()) { + const char* service = item->text(0).latin1(); + const char* interface = item->parent()->text(0).latin1(); + //const char* component = anApp->moduleName(item->parent()->parent()->text(0).latin1()); + // mkr : PAL13135 --> + if ( aSupMod->getInterfaceNameMap().contains(item->parent()->parent()->text(0)) ) { + const char* component = aSupMod->getInterfaceNameMap().find(item->parent()->parent()->text(0)).data(); + // mkr : PAL13135 <-- + + SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component); + if (myComponent==NULL) { + QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE")); + } + else { + const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service); + SUPERV_CNode aNode; + if ( myService->TypeOfNode == 0 ) { // ComputeNode + aNode = aMain->getDataflow()->CNode(*myService); + if (CORBA::is_nil( aNode ) ) { + QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); + return; + } + } + else { // Factory Node + + SUPERVGUI_CustomSettings* aCSDialog = 0; + if ( count > 1 && !DoneSetting) { // multi selection + DoneSetting = true; + aCSDialog = new SUPERVGUI_CustomSettings(item, true, myComponent->implementation_type()); + } + else if ( count == 1 ) // single selection + aCSDialog = new SUPERVGUI_CustomSettings(item, false, myComponent->implementation_type()); + + if ( aCSDialog ) { + aRes = aCSDialog->exec(); + if (aRes) { + anAuthor = aCSDialog->Author(); + aContainer = aCSDialog->Container(); + aComment = aCSDialog->Comment(); + } + delete aCSDialog; + } + + aNode = aMain->getDataflow()->FNode(component, interface, *myService, myComponent->implementation_type()); // mkr : PAL11273 + if ( CORBA::is_nil( aNode ) ) { + QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); + return; + } + + if (aRes) { + aNode->SetAuthor(anAuthor.latin1()); + SUPERV::FNode::_narrow(aNode)->SetContainer(aContainer.latin1()); + aNode->SetComment(aComment.latin1()); + } + + } + SUPERV::INode_var aDummyEndNode; + addNode( aNode, aDummyEndNode, myX, myY ); + b = true; + } + } + } + } + if ( !b ) { + QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD")); + } + } + } +} void SUPERVGUI_Service::addInlineNode() { SUPERVGUI* aSupMod = SUPERVGUI::Supervision(); @@ -511,13 +630,20 @@ void SUPERVGUI_Service::addInlineNode() { switch (aSel) { case 0: // Computation { - SUPERV_CNode aNode = aMain->getDataflow()->INode(myScriptPane->getFuncName().latin1(), - (myScriptPane->getFunction()).in()); + SUPERV_CNode aNode = + aMain->getDataflow()->INode(myScriptPane->getFuncName().isEmpty() ? "" : myScriptPane->getFuncName().latin1(), + (myScriptPane->getFunction()).in()); if (CORBA::is_nil(aNode)) { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; } SUPERV::INode_var aDummyEndNode; + // here we have to + // 1) parse nodes' python function to find ports names + // 2) create ports for engine node with found names and "undefined" types + // ( aNode->InPort(name,type), aNode->OutPort(name,type) ) + // P.S. CanvasNode->createPort(...) for create presentation of port + // will be called from addNode(...) (inside CanvasNode constructor) addNode( aNode, aDummyEndNode, myX, myY ); } break; @@ -525,9 +651,10 @@ void SUPERVGUI_Service::addInlineNode() { case 1: // Switch { SUPERV_INode aEndNode; - SUPERV_CNode aStartNode = aMain->getDataflow()->SNode(myScriptPane->getFuncName().latin1(), - (myScriptPane->getFunction()).in(), - aEndNode); + SUPERV_CNode aStartNode = + aMain->getDataflow()->SNode(myScriptPane->getFuncName().isEmpty() ? "" : myScriptPane->getFuncName().latin1(), + (myScriptPane->getFunction()).in(), + aEndNode); if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; @@ -539,10 +666,14 @@ void SUPERVGUI_Service::addInlineNode() { case 2: // Loop { SUPERV_INode aEndNode; - SUPERV_CNode aStartNode = aMain->getDataflow()->LNode(myInitPane->getFuncName().latin1(), (myInitPane->getFunction()).in(), - myMorePane->getFuncName().latin1(), (myMorePane->getFunction()).in(), - myNextPane->getFuncName().latin1(), (myNextPane->getFunction()).in(), - aEndNode); + SUPERV_CNode aStartNode = + aMain->getDataflow()->LNode(myInitPane->getFuncName().isEmpty() ? "" : myInitPane->getFuncName().latin1(), + (myInitPane->getFunction()).in(), + myMorePane->getFuncName().isEmpty() ? "" : myMorePane->getFuncName().latin1(), + (myMorePane->getFunction()).in(), + myNextPane->getFuncName().isEmpty() ? "" : myNextPane->getFuncName().latin1(), + (myNextPane->getFunction()).in(), + aEndNode); if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; @@ -693,9 +824,9 @@ void SUPERVGUI_Service::tabChanged(QWidget* theWidget) { -//***************************************************** +//*****************************************************/ // Pane for Python script editing -//***************************************************** +//*****************************************************/ SUPERVGUI_PythonEditPane::SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation, int& theX, int& theY ) : myIsWithLibrary( isNodeCreation ), QFrame( theParent ), @@ -866,8 +997,10 @@ SUPERV_Strings SUPERVGUI_PythonEditPane::getFunction() { // it's user's responsibility to enter correct Python code, we don't do anything with it. // if (..) -- initial, while(..) -- my improvement, but also commented out -- needless. //if (!aLine.right(1).compare(" ")) // replaced with the line below -- loop - //while (aLine.at(aLine.length()-1).isSpace()) // remove trailing spaces - // aLine = aLine.remove(aLine.length()-1,1); + // uncommented by mkr to fix bugs IPAL12363, IPAL12885 --> + while (aLine.at(aLine.length()-1).isSpace()) // remove trailing spaces + aLine = aLine.remove(aLine.length()-1,1); + // <-- aStrings[i] = CORBA::string_dup(aLine.latin1()); } return aStrings._retn(); @@ -898,21 +1031,23 @@ void SUPERVGUI_PythonEditPane::autoIndentLine() { // get current cursor position and previous line (the one to be analized) int pos, para, i; - myText->getCursorPosition( ¶, &pos ); // pos==0, beginning of line - QString line = myText->text( para-1 ); // previous paragraph line - - // construct a string containing all leading space characters of previous line (tabs, etc.) QString spacesStr; - i = -1; - while ( line[++i].isSpace() ) // append all isSpace() characters at beginning of line to spacesStr - spacesStr += line[i]; - - // if ':' was found -- add more spaces to spacesStr - line = line.stripWhiteSpace(); - if ( line[ line.length()-1 ] == ':' ) { - i = 0; - while ( i++ < N ) - spacesStr += ' '; + myText->getCursorPosition( ¶, &pos ); // pos==0, beginning of line + if ( myText->paragraphLength(para-1) > 0 ) { // mkr : IPAL9817 + QString line = myText->text( para-1 ); // previous paragraph line + + // construct a string containing all leading space characters of previous line (tabs, etc.) + i = -1; + while ( line[++i].isSpace() ) // append all isSpace() characters at beginning of line to spacesStr + spacesStr += line[i]; + + // if ':' was found -- add more spaces to spacesStr + line = line.stripWhiteSpace(); + if ( line[ line.length()-1 ] == ':' ) { + i = 0; + while ( i++ < N ) + spacesStr += ' '; + } } // ok, append spacesStr at the beginning of the current line = make indentation @@ -945,6 +1080,7 @@ SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg( bool isLoop ) resize( 500, 250 ); QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 4); int a,b; // dummies for PythonEditPane, not used, since library = false and myX, myY are not used in PythonEditPane + myIsLoop = isLoop; // mkr : PAL12236 if (isLoop) { QTabWidget* aLoopTabPane = new QTabWidget(this); myInitPane = new SUPERVGUI_PythonEditPane( this, false, a, b ); // library == false, since no creation of a node is needed here @@ -969,7 +1105,7 @@ SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg( bool isLoop ) aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 ); QPushButton* aOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox ); - connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( clickOnOk() ) ); aBtnLayout->addWidget( aOKBtn ); aBtnLayout->addStretch(); @@ -981,6 +1117,21 @@ SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg( bool isLoop ) aMainLayout->addWidget(aBtnBox); } +// mkr : IPAL9817 : to avoid a SIGSEGV when INode_Impl::SetPyFunction(...) +// will call with null python function name +void SUPERVGUI_EditPythonDlg::clickOnOk() +{ + // mkr : PAL12236 + bool hasEmptyName = myIsLoop ? + ( getInitFuncName().isEmpty() || getMoreFuncName().isEmpty() || getNextFuncName().isEmpty() ) : + getFuncName().isEmpty(); + + if ( hasEmptyName ) + QMessageBox::warning( SUIT_Session::session()->activeApplication()->desktop(), tr( "ERROR" ), tr( "MSG_INCORRECT_INDENT" ) ); + else + accept(); +} + /** * Do the following actions for newly created Engine's CNode: * 1. Create a presentation for it (CanvasNode) @@ -1022,9 +1173,172 @@ void SUPERVGUI_Service::addNode( SUPERV::CNode_var theNode, SUPERV::INode_var th aMain->addMacroNode( theNode ); else if ( theNode->IsLoop() || theNode->IsSwitch() ) aMain->addControlNode( theNode, SUPERV::CNode::_narrow( theEndNode ), true ); - else + else aMain->addComputeNode( theNode ); aSupMod->nullifyInitialVF(); } } +/*! + Constructor +*/ +SUPERVGUI_CustomSettings::SUPERVGUI_CustomSettings(QListViewItem* theItem, + bool isMultiSel, + bool isCimpl) + : QDialog( SUIT_Session::session()->activeApplication()->desktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +{ + Trace("SUPERVGUI_CustomSettings::SUPERVGUI_CustomSettings"); + + SUPERVGUI* aSupMod = SUPERVGUI::Supervision(); + if ( !aSupMod ) { + MESSAGE("NULL Supervision module!"); + return; + } + + SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop(); + + setSizeGripEnabled( true ); + + QGridLayout* TopLayout = new QGridLayout( this ); + TopLayout->setSpacing( 6 ); + TopLayout->setMargin( 11 ); + + QGroupBox* TopGroup = new QGroupBox( this, "TopGroup" ); + TopGroup->setColumnLayout(0, Qt::Vertical ); + TopGroup->layout()->setSpacing( 0 ); + TopGroup->layout()->setMargin( 0 ); + QGridLayout* TopGroupLayout = new QGridLayout( TopGroup->layout() ); + TopGroupLayout->setAlignment( Qt::AlignTop ); + TopGroupLayout->setSpacing( 6 ); + TopGroupLayout->setMargin( 11 ); + + QLabel* authL = new QLabel( tr( "AUTHOR_LBL" ), TopGroup); + authV = new QLineEdit( TopGroup ); + authV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + authV->setMinimumSize( 200, 0 ); + authV->setText( "" ); + + contL = new QLabel( tr( "CONTAINER_LBL" ), TopGroup ); + contV = new QLineEdit( TopGroup ); + contV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + contV->setMinimumSize( 200, 0 ); + + QLabel* commL = new QLabel( tr( "COMMENT_LBL" ), TopGroup); + commV = new QMultiLineEdit( TopGroup ); + commV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); + commV->setMinimumSize( 200, 100 ); + + if ( !aSupMod->getInterfaceNameMap().contains(theItem->parent()->parent()->text(0)) ) { + QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD")); + return; + } + const char* component = aSupMod->getInterfaceNameMap().find(theItem->parent()->parent()->text(0)).data(); + + QString aNodeDefComment; + if ( !isMultiSel ) { + // 1) set caption + const char* service = theItem->text(0).latin1(); + aNodeDefComment = QString(service) + QString(tr("COMMENT_FROM")) + QString(component); + setCaption( tr( "TLT_CUSTOMPARAMETERS_SINGLE" ) + aNodeDefComment ); + } + else { + // 1) set caption + aNodeDefComment = QString("Factory Node"); + setCaption( tr( "TLT_CUSTOMPARAMETERS_MULTI" ) ); + } + + // 2) set Container + SUPERVGUI_Main* aMain = aSupMod->getMain(); + if (aMain==0) { + QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW")); + return; + } + const char* aContainer = aMain->getDataflow()->ContainerNameForComponent(component); + if ( aContainer && strlen(aContainer) > 0 ) + contV->setText( QString(aContainer) ); + else if ( isCimpl ) // C++ implementation + contV->setText( QString(aMain->getDataflow()->DefaultCContainerName()) ); + else // Python implementation + contV->setText( QString(aMain->getDataflow()->DefaultPythonContainerName()) ); + + // 3) set comment + commV->setText( aNodeDefComment ); + + TopGroupLayout->addWidget( authL, 1, 0 ); + TopGroupLayout->addWidget( authV, 1, 1 ); + TopGroupLayout->addWidget( contL, 2, 0 ); + TopGroupLayout->addWidget( contV, 2, 1 ); + TopGroupLayout->addWidget( commL, 7, 0 ); + TopGroupLayout->addMultiCellWidget( commV, 7, 8, 1, 1 ); + TopGroupLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::Expanding ), 8, 0 ); + TopGroupLayout->setColStretch( 1, 5 ); + + QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); + GroupButtons->setColumnLayout(0, Qt::Vertical ); + GroupButtons->layout()->setSpacing( 0 ); + GroupButtons->layout()->setMargin( 0 ); + QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); + GroupButtonsLayout->setAlignment( Qt::AlignTop ); + GroupButtonsLayout->setSpacing( 6 ); + GroupButtonsLayout->setMargin( 11 ); + + QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons ); + connect( okB, SIGNAL( clicked() ), this, SLOT( okButton() ) ); + QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons ); + connect( cancelB, SIGNAL( clicked() ), this, SLOT( koButton() ) ); + + GroupButtonsLayout->addWidget( okB, 0, 0 ); + GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); + GroupButtonsLayout->addWidget( cancelB, 0, 2 ); + + TopLayout->addWidget( TopGroup, 0, 0 ); + TopLayout->addWidget( GroupButtons, 1, 0 ); + TopLayout->setRowStretch( 0, 1 ); + TopLayout->setRowStretch( 1, 0 ); + + resize(370,200); +} + +/*! + Destructor +*/ +SUPERVGUI_CustomSettings::~SUPERVGUI_CustomSettings() { + Trace("SUPERVGUI_CustomSettings::~SUPERVGUI_CustomSettings"); +} + +/*! + Get author +*/ +QString SUPERVGUI_CustomSettings::Author() { + return authV->text(); +} + +/*! + Get container +*/ +QString SUPERVGUI_CustomSettings::Container() { + return contV->text(); +} + +/*! + Get comment +*/ +QString SUPERVGUI_CustomSettings::Comment() { + return commV->text(); +} + +/*! + button slot +*/ +void SUPERVGUI_CustomSettings::okButton() { + Trace("SUPERVGUI_CustomSettings::okButton"); + accept(); +} + +/*! + button slot +*/ +void SUPERVGUI_CustomSettings::koButton() { + Trace("SUPERVGUI_CustomSettings::koButton"); + reject(); +}