From: akl Date: Fri, 6 Jun 2008 11:25:41 +0000 (+0000) Subject: Fix a bug from the additional comment from Ilya MATVEYEV 2008-04-28 14:32 for bug... X-Git-Tag: V5_1_0a1~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f8dd22cb6e30afbc9037bc16eb7ee79a004417ed;p=modules%2Fsmesh.git Fix a bug from the additional comment from Ilya MATVEYEV 2008-04-28 14:32 for bug IPAL19572: the content of previously created filter is not cleaned. --- diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index a8ec5525e..8ec99d3fd 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -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& theTypes) // layout widgets QGridLayout* aLay = new QGridLayout(myTableGrp); - aLay->setMargin(0); + aLay->setMargin(MARGIN); aLay->setSpacing(SPACING); aLay->addWidget(mySwitchTableGrp, 0, 0, 7, 1); diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index ce055c5b5..e9f38e862 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -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()); } diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h index 0cf3b306e..16dd825ad 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h @@ -90,7 +90,7 @@ private slots: void onBrowse(); void onReturnPressed(); - void onFilterChanged( QListWidgetItem*, QListWidgetItem* ); + void onFilterChanged(); void onAddBtnPressed(); void onDeleteBtnPressed(); void onFilterNameChanged( const QString& );