X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLightApp%2FLightApp_NameDlg.cxx;h=7a4a5c138690f90126c0705408436338ee85c515;hb=cac0b4571c951b557e1956d4777cf1e5199637c3;hp=f6eb0543e0a970610f371c6260fc5aa094ad1097;hpb=aa05f2a1b23a54321ea7248ae9ac3463652c734e;p=modules%2Fgui.git diff --git a/src/LightApp/LightApp_NameDlg.cxx b/src/LightApp/LightApp_NameDlg.cxx index f6eb0543e..7a4a5c138 100644 --- a/src/LightApp/LightApp_NameDlg.cxx +++ b/src/LightApp/LightApp_NameDlg.cxx @@ -1,87 +1,88 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// 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.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : LightApp_NameDlg.cxx -// Author : Vadim SANDLER -// $Header$ -#include -#include -#include +// File : LightApp_NameDlg.cxx +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// +#include "LightApp_NameDlg.h" #include -#include -#include -#include -#include -#include - -#ifndef WIN32 -using namespace std; -#endif +#include +#include +#include +#include +#include +#include /*! Constructor */ LightApp_NameDlg::LightApp_NameDlg( QWidget* parent ) : QDialog( parent ? parent : NULL,//application()->desktop(), -"LightApp_NameDlg", -true, -WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +Qt::WindowTitleHint | Qt::WindowSystemMenuHint ) { - setCaption( tr("TLT_RENAME") ); + setObjectName( "LightApp_NameDlg" ); + setModal( true ); + + setWindowTitle( tr("TLT_RENAME") ); setSizeGripEnabled( TRUE ); QVBoxLayout* topLayout = new QVBoxLayout( this ); topLayout->setMargin( 11 ); topLayout->setSpacing( 6 ); /***************************************************************/ - QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setMargin( 0 ); GroupC1->layout()->setSpacing( 0 ); - QHBoxLayout* GroupC1Layout = new QHBoxLayout( GroupC1->layout() ); + QGroupBox* GroupC1 = new QGroupBox( this ); + GroupC1->setObjectName( "GroupC1" ); + QHBoxLayout* GroupC1Layout = new QHBoxLayout( GroupC1 ); GroupC1Layout->setAlignment( Qt::AlignTop ); GroupC1Layout->setMargin( 11 ); GroupC1Layout->setSpacing( 6 ); - QLabel* TextLabel = new QLabel( GroupC1, "TextLabel1" ); + QLabel* TextLabel = new QLabel( GroupC1 ); + TextLabel->setObjectName( "TextLabel1" ); TextLabel->setText( tr( "NAME_LBL" ) ); GroupC1Layout->addWidget( TextLabel ); - myLineEdit = new QLineEdit( GroupC1, "LineEdit1" ); + myLineEdit = new QLineEdit( GroupC1 ); + myLineEdit->setObjectName( "LineEdit1" ); myLineEdit->setMinimumSize( 250, 0 ); GroupC1Layout->addWidget( myLineEdit ); /***************************************************************/ - QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setMargin( 0 ); GroupButtons->layout()->setSpacing( 0 ); - QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() ); + QGroupBox* GroupButtons = new QGroupBox( this ); + GroupButtons->setObjectName( "GroupButtons" ); + QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons ); GroupButtonsLayout->setAlignment( Qt::AlignTop ); GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 ); - myButtonOk = new QPushButton( GroupButtons, "buttonOk" ); + myButtonOk = new QPushButton( GroupButtons ); + myButtonOk->setObjectName( "buttonOk" ); myButtonOk->setText( tr( "BUT_OK" ) ); myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE ); GroupButtonsLayout->addWidget( myButtonOk ); GroupButtonsLayout->addStretch(); - myButtonCancel = new QPushButton( GroupButtons, "buttonCancel" ); + myButtonCancel = new QPushButton( GroupButtons ); + myButtonCancel->setObjectName( "buttonCancel" ); myButtonCancel->setText( tr( "BUT_CANCEL" ) ); myButtonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( myButtonCancel ); @@ -128,7 +129,7 @@ QString LightApp_NameDlg::name() */ void LightApp_NameDlg::accept() { - if ( name().stripWhiteSpace().isEmpty() ) + if ( name().trimmed().isEmpty() ) return; QDialog::accept(); }