X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_CreatePatternDlg.cxx;h=e501d95649b65c8bd2cb22caf82732acb0b6036f;hb=d4b3f508bf172a4623f109c34fc7371c1fe0dcf1;hp=ac3c7193196579be1b4678894c07883b0815141f;hpb=bd4e115a78b52e3fbc016e5e30bb0e19b2a9e7d6;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx old mode 100755 new mode 100644 index ac3c71931..e501d9564 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 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 @@ -6,7 +6,7 @@ // 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. +// 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 @@ -105,10 +105,7 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule, aDlgLay->setStretchFactor( aMainFrame, 1 ); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) - mySelector = aViewWindow->GetSelector(); - - myHelpFileName = "pattern_mapping_page.html"; + myHelpFileName = "pattern_mapping.html"; Init( theType ); } @@ -230,7 +227,7 @@ QWidget* SMESHGUI_CreatePatternDlg::createButtonFrame( QWidget* theParent ) aLay->addWidget( myHelpBtn ); connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) ); - connect( myCloseBtn, SIGNAL( clicked() ), this, SLOT( onClose() ) ); + connect( myCloseBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( mySaveBtn, SIGNAL( clicked() ), this, SLOT( onSave() ) ); connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); @@ -247,7 +244,7 @@ SMESHGUI_CreatePatternDlg::~SMESHGUI_CreatePatternDlg() //======================================================================= // function : onProject() -// purpose : SLOT. Called when state of "Project nodes on ther face" +// purpose : SLOT. Called when state of "Project nodes on other face" // checkbox is changed //======================================================================= void SMESHGUI_CreatePatternDlg::onProject( bool ) @@ -279,7 +276,7 @@ void SMESHGUI_CreatePatternDlg::Init( const int theType ) connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( onDeactivate() ) ); connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), - this, SLOT( onClose() ) ); + this, SLOT( reject() ) ); mySwitch2d->setEnabled( theType == Type_2d ); mySwitch3d->setEnabled( theType == Type_3d ); @@ -381,7 +378,7 @@ void SMESHGUI_CreatePatternDlg::onSave() SUIT_FileDlg* aDlg = new SUIT_FileDlg( this, false ); aDlg->setWindowTitle( tr( "SAVE_PATTERN" ) ); aDlg->setFileMode( QFileDialog::AnyFile ); - aDlg->setFilter( tr( "PATTERN_FILT" ) ); + aDlg->setNameFilter( tr( "PATTERN_FILT" ) ); if ( myName->text() != "" ) aDlg->selectFile( myName->text() ); @@ -395,14 +392,14 @@ void SMESHGUI_CreatePatternDlg::onSave() if ( QFileInfo( fName ).suffix().isEmpty() ) fName = autoExtension( fName ); - fName = QDir::convertSeparators( fName ); + fName = QDir::toNativeSeparators( fName ); QString aData( myPattern->GetString() ); long aLen = aData.length(); QFile aFile( fName ); aFile.open( QIODevice::WriteOnly ); - long aWritten = aFile.write( aData.toLatin1(), aLen ); + long aWritten = aFile.write( aData.toUtf8(), aLen ); aFile.close(); if ( aWritten != aLen ) { @@ -482,17 +479,17 @@ void SMESHGUI_CreatePatternDlg::onOk() } //======================================================================= -// function : onClose() +// function : reject() // purpose : SLOT called when "Close" button pressed. Close dialog //======================================================================= -void SMESHGUI_CreatePatternDlg::onClose() +void SMESHGUI_CreatePatternDlg::reject() { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) aViewWindow->SetSelectionMode( ActorSelection ); disconnect( mySelectionMgr, 0, this, 0 ); disconnect( mySMESHGUI, 0, this, 0 ); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); emit Close(); } @@ -572,7 +569,7 @@ void SMESHGUI_CreatePatternDlg::onSelectionDone() { try { SALOME_ListIO aList; - mySelectionMgr->selectedObjects( aList, SVTK_Viewer::Type() ); + mySelectionMgr->selectedObjects( aList ); if ( aList.Extent() != 1 ) return; @@ -625,7 +622,7 @@ void SMESHGUI_CreatePatternDlg::onSelectionDone() //======================================================================= // function : onDeactivate() -// purpose : SLOT called when dialog must be deativated +// purpose : SLOT called when dialog must be deactivated //======================================================================= void SMESHGUI_CreatePatternDlg::onDeactivate() { @@ -639,7 +636,7 @@ void SMESHGUI_CreatePatternDlg::onDeactivate() //======================================================================= void SMESHGUI_CreatePatternDlg::enterEvent( QEvent* ) { - // there is a stange problem that enterEvent() comes after onSave() + // there is a strange problem that enterEvent() comes after onSave() if ( isVisible () ) { mySMESHGUI->EmitSignalDeactivateDialog(); setEnabled( true ); @@ -648,15 +645,6 @@ void SMESHGUI_CreatePatternDlg::enterEvent( QEvent* ) } } -//================================================================================= -// function : closeEvent() -// purpose : Close dialog box -//================================================================================= -void SMESHGUI_CreatePatternDlg::closeEvent( QCloseEvent* ) -{ - onClose(); -} - //======================================================================= // function : onSelBtnClicked() // purpose : SLOT. Called when -> button clicked.