]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Fix a bug from the additional comment from Ilya MATVEYEV 2008-04-28 14:32 for bug...
authorakl <akl@opencascade.com>
Fri, 6 Jun 2008 11:25:41 +0000 (11:25 +0000)
committerakl <akl@opencascade.com>
Fri, 6 Jun 2008 11:25:41 +0000 (11:25 +0000)
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx
src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h

index a8ec5525e78fe9ebd81d86208b2f4f8ff16742f4..8ec99d3fd3e80bd6dc962112594f816d9ec7dc43 100755 (executable)
@@ -582,7 +582,7 @@ void SMESHGUI_FilterTable::Table::setReadOnly( bool on )
 
 bool SMESHGUI_FilterTable::Table::isReadOnly() const
 {
-  return editTriggers() != QAbstractItemView::NoEditTriggers;
+  return editTriggers() == QAbstractItemView::NoEditTriggers;
 }
 
 //=======================================================================
@@ -733,7 +733,7 @@ void SMESHGUI_FilterTable::Init (const QList<int>& theTypes)
 
     // layout widgets
     QGridLayout* aLay = new QGridLayout(myTableGrp);
-    aLay->setMargin(0);
+    aLay->setMargin(MARGIN);
     aLay->setSpacing(SPACING);
 
     aLay->addWidget(mySwitchTableGrp, 0, 0, 7, 1);
index ce055c5b547306429d05164086035628ba79c748..e9f38e86240719978b4a4ab3e6306a70c3031dcc 100644 (file)
@@ -225,8 +225,8 @@ QWidget* SMESHGUI_FilterLibraryDlg::createMainFrame (QWidget* theParent)
   connect(myFileName, SIGNAL(returnPressed()), this, SLOT(onReturnPressed()));
   connect(myOpenBtn, SIGNAL(clicked()), this, SLOT(onBrowse()));
 
-  connect(myListBox, SIGNAL( currentItemChanged( QListWidgetItem*, QListWidgetItem* ) ),
-         this, SLOT( onFilterChanged( QListWidgetItem*, QListWidgetItem* ) ) );
+  connect(myListBox, SIGNAL(itemSelectionChanged()),
+         this, SLOT(onFilterChanged()));
 
   connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtnPressed()));
   connect(myDeleteBtn, SIGNAL(clicked()), this, SLOT(onDeleteBtnPressed()));
@@ -809,11 +809,11 @@ bool SMESHGUI_FilterLibraryDlg::isValid(const bool theMess) const
 
 //=======================================================================
 // name    : SMESHGUI_FilterLibraryDlg::onFilterChanged
-// Purpose : SLOT. Called when selected filter of library  changed
+// Purpose : SLOT. Called when selected filter of library is changed
 //=======================================================================
-void SMESHGUI_FilterLibraryDlg::onFilterChanged( QListWidgetItem* item, QListWidgetItem* )
+void SMESHGUI_FilterLibraryDlg::onFilterChanged()
 {
-  QString theName = item ? item->text() : QString::null;
+  QString theName = myListBox->currentItem() ? myListBox->currentItem()->text() : QString::null;
   if (myLibrary->_is_nil())
     return;
 
@@ -934,13 +934,13 @@ void SMESHGUI_FilterLibraryDlg::onAddBtnPressed()
   {
     if (!isValid(true))
       return;
-  }
-  {
+
     SMESH::Filter_var aFilter = createFilter();
     myLibrary->Replace(myCurrFilterName.toLatin1().constData(), 
                       myName->text().toLatin1().constData(), 
                       aFilter);
   }
+  myTable->Clear(myTable->GetType());
 
   addFilterToLib(getDefaultFilterName());
 }
index 0cf3b306eaf6fcf6b7948806647f5a9eda482917..16dd825add8ec082af2010e9bc5e93c4e325d916 100644 (file)
@@ -90,7 +90,7 @@ private slots:
   
   void                        onBrowse();
   void                        onReturnPressed();
-  void                        onFilterChanged( QListWidgetItem*, QListWidgetItem* );
+  void                        onFilterChanged();
   void                        onAddBtnPressed();
   void                        onDeleteBtnPressed();
   void                        onFilterNameChanged( const QString& );