aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKel Modderman <kel@otaku42.de>2008-02-09 04:10:01 (GMT)
committerJouni Malinen <j@w1.fi>2008-02-09 04:10:01 (GMT)
commita797bb3ca2922ff225cac59a69dddf5b8983783b (patch)
tree00d115540f6ff57109a176884026d81c86f512b8
parent9e63b8ec59f13d5c4c384cbac630679a1c436360 (diff)
downloadhostap-history-a797bb3ca2922ff225cac59a69dddf5b8983783b.zip
hostap-history-a797bb3ca2922ff225cac59a69dddf5b8983783b.tar.gz
hostap-history-a797bb3ca2922ff225cac59a69dddf5b8983783b.tar.bz2
wpa_gui-qt4: scroll with events when added to event list view box
If the event history list view box vertical scrollbar is currently at its maximum position, then scroll to the bottom of the list view box as each new event is added. As soon as the scroll bar handle is no longer at its maximum position this behavior is disabled. Signed-off-by: Kel Modderman <kel@otaku42.de>
-rw-r--r--wpa_supplicant/wpa_gui-qt4/eventhistory.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_gui-qt4/eventhistory.cpp b/wpa_supplicant/wpa_gui-qt4/eventhistory.cpp
index 2f6cc4b..46deb96 100644
--- a/wpa_supplicant/wpa_gui-qt4/eventhistory.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/eventhistory.cpp
@@ -13,6 +13,7 @@
*/
#include <QHeaderView>
+#include <QScrollBar>
#include "eventhistory.h"
@@ -115,6 +116,15 @@ void EventHistory::addEvents(WpaMsgList msgs)
void EventHistory::addEvent(WpaMsg msg)
{
+ bool scroll = true;
+
+ if (eventListView->verticalScrollBar()->value() <
+ eventListView->verticalScrollBar()->maximum())
+ scroll = false;
+
elm->addEvent(msg.getTimestamp().toString("yyyy-MM-dd hh:mm:ss.zzz"),
msg.getMsg());
+
+ if (scroll)
+ eventListView->scrollToBottom();
}