X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_FilterLibraryDlg.h;h=cc5d1f7ce6b32f9ef4fadde6c456c26b95556992;hp=cbc8111de65c436992ef8f884e97d0b8235d8457;hb=95d9cf963286991ca0800ec5300c1232435dd25b;hpb=79b1ac2b6df9117f16f11d444b1f165d477a1813 diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h index cbc8111de..cc5d1f7ce 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h @@ -1,49 +1,50 @@ -// SMESH SMESHGUI : GUI for SMESH component +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003 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 -// 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 -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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, 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : SMESHGUI_FilterLibraryDlg.h -// Author : Sergey LITONIN -// Module : SMESH - -#ifndef SMESHGUI_FilterLibraryDlg_H -#define SMESHGUI_FilterLibraryDlg_H +// SMESH SMESHGUI : GUI for SMESH component +// File : SMESHGUI_FilterLibraryDlg.h +// Author : Sergey LITONIN, Open CASCADE S.A.S. +// +#ifndef SMESHGUI_FILTERLIBRARYDLG_H +#define SMESHGUI_FILTERLIBRARYDLG_H +// SMESH includes #include "SMESH_SMESHGUI.hxx" -#include -#include +// Qt includes +#include +#include +#include +// IDL includes #include #include CORBA_SERVER_HEADER(SMESH_Filter) -class QCloseEvent; -class QListBox; -class QFrame; -class QEvent; +class QListWidget; +class QListWidgetItem; class QLineEdit; class QPushButton; -class QGroupBox; +class SMESHGUI; +class SMESHGUI_FilterTable; /* Class : SMESHGUI_FilterLibraryDlg @@ -55,7 +56,7 @@ class SMESHGUI_EXPORT SMESHGUI_FilterLibraryDlg : public QDialog Q_OBJECT // Buttons - enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close, BTN_Help }; + enum { BTN_OK, BTN_Apply, BTN_Close, BTN_Help }; class Dialog; @@ -65,59 +66,47 @@ public: enum { ADD_TO, COPY_FROM, EDIT }; public: - - SMESHGUI_FilterLibraryDlg( SMESHGUI*, - QWidget*, - const QValueList& types, - const int mode, - const char* name = 0 ); - - SMESHGUI_FilterLibraryDlg( SMESHGUI*, - QWidget*, - const int type, - const int mode, - const char* name = 0 ); - - virtual ~SMESHGUI_FilterLibraryDlg(); + SMESHGUI_FilterLibraryDlg( SMESHGUI*, QWidget*, const QList&, const int ); + SMESHGUI_FilterLibraryDlg( SMESHGUI*, QWidget*, const int, const int ); + virtual ~SMESHGUI_FilterLibraryDlg(); - void Init( const QValueList& types, const int theMode ); - void Init( const int type, const int theMode ); + void Init( const QList&, const int ); + void Init( const int, const int ); const SMESHGUI_FilterTable* GetTable() const; void SetTable( const SMESHGUI_FilterTable* ); private: - - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; - void keyPressEvent( QKeyEvent* e ); + void enterEvent( QEvent* ); + void keyPressEvent( QKeyEvent* ); -private slots: +protected slots: + virtual void reject(); +private slots: void onOk(); bool onApply(); - void onClose(); void onHelp(); void onDeactivate(); void onBrowse(); void onReturnPressed(); - void onFilterChanged( const QString& ); + void onFilterChanged(); void onAddBtnPressed(); void onDeleteBtnPressed(); void onFilterNameChanged( const QString& ); void onEntityTypeChanged( const int ); void onNeedValidation(); + void onSelectionDone(); private: - - void construct( const QValueList& types, const int mode ); - QFrame* createButtonFrame( QWidget* ); - QFrame* createMainFrame ( QWidget* ); - bool isValid( const bool theMess = true ) const; - bool isNameValid( const bool theMess = true ) const; - SMESH::Filter_ptr createFilter( const int theType = -1 ); + void construct( const QList&, const int ); + QWidget* createButtonFrame( QWidget* ); + QWidget* createMainFrame( QWidget* ); + bool isValid( const bool = true ) const; + bool isNameValid( const bool = true ) const; + SMESH::Filter_ptr createFilter( const int = -1 ); QStringList prepareFilters() const; QString autoExtension( const QString& ) const; bool setSelected( const QString& ); @@ -127,29 +116,29 @@ private: void enableMainButtons(); void processNewLibrary(); QString getFileName() const; - void setFileName( const QString& txt, const bool autoExtension = true ); - QStringList filterWildCards( const QString& theFilter ) const; + void setFileName( const QString&, const bool = true ); + QStringList filterWildCards( const QString& ) const; QString& getDefaultLibraryName() const; QString getDefaultFilterName() const; - void addFilterToLib( const QString& name ); + void addFilterToLib( const QString& ); void updateList(); - bool isPermissionValid( const bool theIsExistingOnly ); + bool isPermissionValid( const bool ); private: - QFrame* myMainFrame; + QWidget* myMainFrame; QMap myButtons; SMESHGUI_FilterTable* myTable; QLineEdit* myFileName; QPushButton* myOpenBtn; - QListBox* myListBox; + QListWidget* myListBox; QPushButton* myAddBtn; QPushButton* myDeleteBtn; - QGroupBox* myNameGrp; + QWidget* myNameGrp; QLineEdit* myName; SMESHGUI* mySMESHGUI; - QValueList myTypes; + QList myTypes; int myMode; SMESH::FilterLibrary_var myLibrary; @@ -159,4 +148,4 @@ private: QString myHelpFileName; }; -#endif +#endif // SMESHGUI_FILTERLIBRARYDLG_H