fixed #1757 Allow searching by attributes even after an object

is dropped into the drop area in search panel.
This commit is contained in:
Vadim Kurland
2010-10-01 01:51:41 +00:00
parent 7a389e9c7d
commit 5ba94e3b3b
4 changed files with 30 additions and 9 deletions
+1 -1
View File
@@ -1 +1 @@
#define BUILD_NUM 3297
#define BUILD_NUM 3298
+4
View File
@@ -1,5 +1,9 @@
2010-09-30 Vadim Kurland <vadim@vk.crocodile.org>
* FindObjectWidget.cpp (objectInserted): fixed #1757 Allow
searching by attributes even after an object is dropped into the
drop area in search panel.
* newFirewallDialog.cpp (browseTemplate): fixed #1759 "Use default
template library" button seems to do nothing. This button should
only be enabled if user switched to their own library of template
+18 -8
View File
@@ -118,18 +118,23 @@ void FindObjectWidget::disableAll()
void FindObjectWidget::objectInserted()
{
FWObject *o=m_widget->findDropArea->getObject();
if (o==NULL) return;
disableAll();
FWObject *o = m_widget->findDropArea->getObject();
if (o == NULL) return;
QString n=QString::fromUtf8(o->getName().c_str());
// disableAll(); // see #1757
QString n = QString::fromUtf8(o->getName().c_str());
m_widget->findAttr->blockSignals(true);
if (m_widget->findAttr->count()>=MAX_SEARCH_ITEMS_COUNT)
m_widget->findAttr->removeItem(MAX_SEARCH_ITEMS_COUNT-1);
m_widget->findAttr->lineEdit()->setText (n);
m_widget->findAttr->lineEdit()->setText(n);
reset();
m_widget->findAttr->blockSignals(false);
reset();
}
void FindObjectWidget::reset()
@@ -139,11 +144,16 @@ void FindObjectWidget::reset()
found_objects.clear();
}
/**
* This slot is called when @attribute or @findAttr fields change
* (that is, whenever user changes attribute they want to match or type
* in the input field to change the value)
*/
void FindObjectWidget::findAttrChanged(const QString &ns)
{
if (ns!=lastAttrSearch) reset();
lastAttrSearch=ns;
lastAttrSearch = ns;
m_widget->findDropArea->deleteObject(); // for #1757
}
void FindObjectWidget::find()
@@ -282,6 +282,13 @@
</p>
</li>
<li>
<p>
fixed #1757 Allow searching by attributes even after an object
is dropped into the drop area in search panel.
</p>
</li>
</ul>