Make the find behaviour in event browser to be a bit more 'sticky'

* Clicking away from the find box doesn't lose your highlight/search,
  and if you open find again it has the previous search text there.
This commit is contained in:
baldurk
2017-02-13 16:31:06 +00:00
parent f8ed197318
commit ea7cee9d13
2 changed files with 20 additions and 8 deletions
+19 -8
View File
@@ -76,8 +76,6 @@ EventBrowser::EventBrowser(CaptureContext &ctx, QWidget *parent)
QObject::connect(ui->closeFind, &QToolButton::clicked, this, &EventBrowser::on_HideFindJump);
QObject::connect(ui->closeJump, &QToolButton::clicked, this, &EventBrowser::on_HideFindJump);
QObject::connect(ui->jumpToEID, &RDLineEdit::leave, this, &EventBrowser::on_HideFindJump);
QObject::connect(ui->findEvent, &RDLineEdit::leave, this, &EventBrowser::on_HideFindJump);
QObject::connect(ui->events, &RDTreeWidget::keyPress, this, &EventBrowser::events_keyPress);
ui->jumpStrip->hide();
ui->findStrip->hide();
@@ -301,7 +299,6 @@ void EventBrowser::on_HideFindJump()
ui->jumpToEID->setText("");
ClearFindIcons();
ui->findEvent->setText("");
ui->findEvent->setStyleSheet("");
}
@@ -344,16 +341,30 @@ void EventBrowser::on_findEvent_textEdited(const QString &arg1)
void EventBrowser::on_findEvent_returnPressed()
{
// stop the timer, we'll manually fire it instantly
if(m_FindHighlight->isActive())
{
// manually fire it instantly
m_FindHighlight->stop();
findHighlight_timeout();
}
if(!ui->findEvent->text().isEmpty())
{
Find(true);
findHighlight_timeout();
}
void EventBrowser::on_findEvent_keyPress(QKeyEvent *event)
{
if(event->key() == Qt::Key_F3)
{
// stop the timer, we'll manually fire it instantly
if(m_FindHighlight->isActive())
m_FindHighlight->stop();
if(!ui->findEvent->text().isEmpty())
Find(event->modifiers() & Qt::ShiftModifier ? false : true);
findHighlight_timeout();
event->accept();
}
}
+1
View File
@@ -63,6 +63,7 @@ private slots:
void on_HideFindJump();
void on_jumpToEID_returnPressed();
void on_findEvent_returnPressed();
void on_findEvent_keyPress(QKeyEvent *event);
void on_findEvent_textEdited(const QString &arg1);
void on_events_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void on_findNext_clicked();