diff options
author | Roland Knall <roland.knall@br-automation.com> | 2017-10-25 15:39:35 +0200 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2017-10-31 11:42:21 +0000 |
commit | 56a130a152db73ea37f91d39be7d72f814013236 (patch) | |
tree | bc30c2a8cc9f0c4ad6ecd6ddf4a895b5f49b2fcb /ui/qt/main_window_slots.cpp | |
parent | c5165f325b6742f407a951f9c7d959314f15a6b5 (diff) |
ByteViewText: Remove epan dependancy
Remove all dependancy for the byte_view_text from the epan system,
and therefore cleanly separate data and display for further separation
of dissection and view
Change-Id: Id1ee91b93da4511afa95f24da4cbbf39cbb89b1f
Reviewed-on: https://code.wireshark.org/review/24050
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/main_window_slots.cpp')
-rw-r--r-- | ui/qt/main_window_slots.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index c61b03abd6..c4068eab80 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -1779,13 +1779,33 @@ void MainWindow::openTapParameterDialog() openTapParameterDialog(cfg_str, NULL, NULL); } -void MainWindow::byteViewTabChanged(int tab_index) +void MainWindow::setTvbOffsetHovered(tvbuff_t * tvb, int idx) { - QWidget *new_tab = byte_view_tab_->widget(tab_index); - if (new_tab) { - setTabOrder(proto_tree_, new_tab); - setTabOrder(new_tab, df_combo_box_->lineEdit()); // XXX Toolbar instead? + QString field_str(""); + + if ( tvb && capture_file_.capFile() && capture_file_.capFile()->edt ) + { + proto_tree * tree = capture_file_.capFile()->edt->tree; + if ( tree ) + { + field_info * fi = proto_find_field_from_offset(tree, idx, tvb); + + if (fi) { + if (fi->length < 2) { + field_str = QString(tr("Byte %1")) + .arg(fi->start); + } else { + field_str = QString(tr("Bytes %1-%2")) + .arg(fi->start) + .arg(fi->start + fi->length - 1); + } + field_str += QString(": %1 (%2)") + .arg(fi->hfinfo->name) + .arg(fi->hfinfo->abbrev); + } + } } + main_ui_->statusBar->pushByteStatus(field_str); } #ifdef HAVE_SOFTWARE_UPDATE |