aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/main_window_slots.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/main_window_slots.cpp')
-rw-r--r--ui/qt/main_window_slots.cpp30
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