projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow arbitrary method prefix for BasicHandler
[quassel.git]
/
src
/
qtui
/
chatviewsearchbar.cpp
diff --git
a/src/qtui/chatviewsearchbar.cpp
b/src/qtui/chatviewsearchbar.cpp
index
a7e6ced
..
5dcc112
100644
(file)
--- a/
src/qtui/chatviewsearchbar.cpp
+++ b/
src/qtui/chatviewsearchbar.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-0
8
by the Quassel Project *
+ * Copyright (C) 2005-0
9
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-32,6
+32,7
@@
ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
ui.hideButton->setIcon(BarIcon("dialog-close"));
ui.searchUpButton->setIcon(SmallIcon("go-up"));
ui.searchDownButton->setIcon(SmallIcon("go-down"));
ui.hideButton->setIcon(BarIcon("dialog-close"));
ui.searchUpButton->setIcon(SmallIcon("go-up"));
ui.searchDownButton->setIcon(SmallIcon("go-down"));
+ _searchDelayTimer.setSingleShot(true);
layout()->setContentsMargins(0, 0, 0, 0);
layout()->setContentsMargins(0, 0, 0, 0);
@@
-47,6
+48,8
@@
ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
hideSearchBar->setShortcut(Qt::Key_Escape);
connect(ui.hideButton, SIGNAL(clicked()), toggleSearchBar, SLOT(toggle()));
hideSearchBar->setShortcut(Qt::Key_Escape);
connect(ui.hideButton, SIGNAL(clicked()), toggleSearchBar, SLOT(toggle()));
+ connect(ui.searchEditLine, SIGNAL(textChanged(const QString &)), this, SLOT(delaySearch()));
+ connect(&_searchDelayTimer, SIGNAL(timeout()), this, SLOT(search()));
}
void ChatViewSearchBar::setVisible(bool visible) {
}
void ChatViewSearchBar::setVisible(bool visible) {
@@
-55,6
+58,16
@@
void ChatViewSearchBar::setVisible(bool visible) {
// a resize event which can lead to strange side effects.
ui.searchEditLine->clear();
QWidget::setVisible(visible);
// a resize event which can lead to strange side effects.
ui.searchEditLine->clear();
QWidget::setVisible(visible);
- if(visible) ui.searchEditLine->setFocus();
+ if(visible)
+ ui.searchEditLine->setFocus();
+ else
+ emit hidden();
}
}
+void ChatViewSearchBar::delaySearch() {
+ _searchDelayTimer.start(300);
+}
+
+void ChatViewSearchBar::search() {
+ emit searchChanged(ui.searchEditLine->text());
+}