summaryrefslogtreecommitdiff
path: root/ui/qt/follow_stream_text.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-11-14 17:37:40 +0000
committerGerald Combs <gerald@wireshark.org>2013-11-14 17:37:40 +0000
commit190bdc32de952cc679c25f61d47e2dfab41c29e7 (patch)
treede80eb71b731298780f01eeea92448fe541684a8 /ui/qt/follow_stream_text.cpp
parent2809240ead3af25b531ae3048b6e437dbf1ab004 (diff)
downloadwireshark-190bdc32de952cc679c25f61d47e2dfab41c29e7.tar.gz
Add packet information and selection to the Follow Stream dialog.
Collect packet numbers when following streams so that we can correlate text positions with packets. Add a FollowStreamText class so that we can track mouse events. Add a hint label that shows the packet under the cursor along with packet counts and the number of "turns". Add the packet number to the C array dump. Note that dumping to YAML might be useful for Scapy users. svn path=/trunk/; revision=53314
Diffstat (limited to 'ui/qt/follow_stream_text.cpp')
-rw-r--r--ui/qt/follow_stream_text.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/ui/qt/follow_stream_text.cpp b/ui/qt/follow_stream_text.cpp
new file mode 100644
index 0000000000..d09b167869
--- /dev/null
+++ b/ui/qt/follow_stream_text.cpp
@@ -0,0 +1,64 @@
+/* follow_stream_text.cpp
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "follow_stream_text.h"
+
+#include <QMouseEvent>
+#include <QTextCursor>
+
+FollowStreamText::FollowStreamText(QWidget *parent) :
+ QTextEdit(parent)
+{
+ setMouseTracking(true);
+}
+
+void FollowStreamText::mouseMoveEvent(QMouseEvent *event)
+{
+ emit mouseMovedToTextCursorPosition(cursorForPosition(event->pos()).position());
+ QTextEdit::mouseMoveEvent(event);
+}
+
+void FollowStreamText::mousePressEvent(QMouseEvent *event)
+{
+ emit mouseClickedOnTextCursorPosition(cursorForPosition(event->pos()).position());
+ QTextEdit::mousePressEvent(event);
+}
+
+void FollowStreamText::leaveEvent(QEvent *event)
+{
+ emit mouseMovedToTextCursorPosition(-1);
+ QTextEdit::leaveEvent(event);
+}
+
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */