summaryrefslogtreecommitdiff
path: root/ui/qt/byte_view_tab.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-11-06 21:49:16 +0000
committerGerald Combs <gerald@wireshark.org>2012-11-06 21:49:16 +0000
commit32074376acc8400f808688660a518d2e827d2edc (patch)
tree3792eff3813ee6e177d1a9ed6ff18e547b57ae9e /ui/qt/byte_view_tab.cpp
parent5d6e03f71b3063d3bfe3b9f868d7553ec6eb4504 (diff)
downloadwireshark-32074376acc8400f808688660a518d2e827d2edc.tar.gz
Show the byte view when we select a packet. Update some method and
variable names. svn path=/trunk/; revision=45953
Diffstat (limited to 'ui/qt/byte_view_tab.cpp')
-rw-r--r--ui/qt/byte_view_tab.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/ui/qt/byte_view_tab.cpp b/ui/qt/byte_view_tab.cpp
index 8b60b0d7fa..b152ebea6a 100644
--- a/ui/qt/byte_view_tab.cpp
+++ b/ui/qt/byte_view_tab.cpp
@@ -33,6 +33,7 @@ ByteViewTab::ByteViewTab(QWidget *parent) :
addTab();
}
+#include <QDebug>
void ByteViewTab::addTab(const char *name, tvbuff_t *tvb, proto_tree *tree, QTreeWidget *protoTree, packet_char_enc encoding) {
ByteViewText *byte_view_text = new ByteViewText(this, tvb, tree, protoTree, encoding);
@@ -40,6 +41,13 @@ void ByteViewTab::addTab(const char *name, tvbuff_t *tvb, proto_tree *tree, QTre
QTabWidget::addTab(byte_view_text, name);
}
+void ByteViewTab::clear()
+{
+ while (currentWidget()) {
+ delete currentWidget();
+ }
+}
+
void ByteViewTab::tabInserted(int index) {
setTabsVisible();
QTabWidget::tabInserted(index);
@@ -75,7 +83,6 @@ void ByteViewTab::protoTreeItemChanged(QTreeWidgetItem *current) {
int p_start = -1, p_end = -1, p_len = -1;
guint len = tvb_length(fi->ds_tvb);
-// byte_view_text->setEncoding(cap_file_->current_frame->flags.encoding);
// Find and highlight the protocol bytes
while (parent && parent->parent()) {
parent = parent->parent();
@@ -157,7 +164,7 @@ void ByteViewTab::protoTreeItemChanged(QTreeWidgetItem *current) {
// Appendix (trailer) bytes
byte_view_text->setFieldAppendixHighlight(fa_start, fa_end);
- byte_view_text->render();
+ byte_view_text->renderBytes();
setCurrentIndex(i);
}