fixed #1790 "When an object

is found using Find and the object is in the object tree, the
keyboard focus shifts to the Object Panel". The "find" pabel now
retains keyboard focus after it shows found object in the tree,
this allows the user to just hit Enter on the keyboard to find
the next object.
This commit is contained in:
Vadim Kurland
2010-10-05 01:23:39 +00:00
parent d079f0f445
commit 10862bdfed
3 changed files with 20 additions and 8 deletions
+1 -1
View File
@@ -1 +1 @@
#define BUILD_NUM 3318 #define BUILD_NUM 3319
+7
View File
@@ -1,5 +1,12 @@
2010-10-04 Vadim Kurland <vadim@vk.crocodile.org> 2010-10-04 Vadim Kurland <vadim@vk.crocodile.org>
* FindObjectWidget.cpp (showObject): fixed #1790 "When an object
is found using Find and the object is in the object tree, the
keyboard focus shifts to the Object Panel". The "find" pabel now
retains keyboard focus after it shows found object in the tree,
this allows the user to just hit Enter on the keyboard to find
the next object.
* FindObjectWidget.cpp (objectDeleted): fixed #1785 "Deleting * FindObjectWidget.cpp (objectDeleted): fixed #1785 "Deleting
graphic icon of object from Find tab should also remove the text graphic icon of object from Find tab should also remove the text
name or label" name or label"
+12 -7
View File
@@ -616,23 +616,28 @@ void FindObjectWidget::replaceDisable()
m_widget->replaceButton->setEnabled (false); m_widget->replaceButton->setEnabled (false);
m_widget->repNextButton->setEnabled (false); m_widget->repNextButton->setEnabled (false);
m_widget->replaceAllButton->setEnabled(false); m_widget->replaceAllButton->setEnabled(false);
} }
/**
* Show object that we have found in the tree or in rules but retain focus
* so that user can find next one by just hitting Return on the keyboard.
*/
void FindObjectWidget::showObject(FWObject* o) void FindObjectWidget::showObject(FWObject* o)
{ {
if (fwbdebug) if (fwbdebug)
qDebug("FindObjectWidget::showObject o: %s parent: %s", qDebug("FindObjectWidget::showObject o: %s parent: %s",
o->getName().c_str(), o->getParent()->getName().c_str()); o->getName().c_str(), o->getParent()->getName().c_str());
QWidget *focus_holder = focusWidget();
FWReference* ref = FWReference::cast(o); FWReference* ref = FWReference::cast(o);
if (ref!=NULL && RuleElement::cast(o->getParent())!=NULL) if (ref!=NULL && RuleElement::cast(o->getParent())!=NULL)
{ {
// found object in rules // found object in rules
QCoreApplication::postEvent( QCoreApplication::sendEvent(
project_panel, new showObjectInRulesetEvent( project_panel, new showObjectInRulesetEvent(
project_panel->getFileName(), ref->getId())); project_panel->getFileName(), ref->getId()));
focus_holder->setFocus();
return; return;
} }
@@ -640,16 +645,16 @@ void FindObjectWidget::showObject(FWObject* o)
Group::cast(o->getParent())!=NULL && Group::cast(o->getParent())!=NULL &&
!FWBTree().isStandardFolder(o->getParent())) !FWBTree().isStandardFolder(o->getParent()))
{ {
QCoreApplication::postEvent( QCoreApplication::sendEvent(
mw, new showObjectInTreeEvent(project_panel->getFileName(), mw, new showObjectInTreeEvent(project_panel->getFileName(),
o->getParent()->getId())); o->getParent()->getId()));
focus_holder->setFocus();
return; return;
} }
QCoreApplication::postEvent( QCoreApplication::sendEvent(
mw, new showObjectInTreeEvent(project_panel->getFileName(), o->getId())); mw, new showObjectInTreeEvent(project_panel->getFileName(), o->getId()));
focus_holder->setFocus();
//project_panel->select(); // selects an item in the tree and assigns kbd focus to it
} }
void FindObjectWidget::init() void FindObjectWidget::init()