summaryrefslogtreecommitdiff
path: root/ui/qt/label_stack.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@zing.org>2014-10-26 18:48:14 -0700
committerGerald Combs <gerald@wireshark.org>2014-10-27 02:05:13 +0000
commit1c159818fd9a1cbc667d7aa675ed776e3c202523 (patch)
treecd0c77b30818d1cfdd609bfd1395e529c0dbffb9 /ui/qt/label_stack.cpp
parentc33deaa92f0bf607778d7b20668c3bba23446c2e (diff)
downloadwireshark-1c159818fd9a1cbc667d7aa675ed776e3c202523.tar.gz
Qt: ByteViewText hover information.
When the user hovers over a byte view field, highlight it and show a description in the status bar. Add a "byte" status bar context and fix a label stack pop bug. Keep proto_find_field_from_offset from matching generated items. Otherwise hovering and selecting finds things like GeoIP entries and checksum validation information. This affects the GTK+ UI as well. Change-Id: Ic81c0d8159510a72d30c41f961807d8a48d05e16 Reviewed-on: https://code.wireshark.org/review/4943 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/label_stack.cpp')
-rw-r--r--ui/qt/label_stack.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/ui/qt/label_stack.cpp b/ui/qt/label_stack.cpp
index 5c7ba18bce..2ccb9092c3 100644
--- a/ui/qt/label_stack.cpp
+++ b/ui/qt/label_stack.cpp
@@ -48,7 +48,7 @@ void LabelStack::setTemporaryContext(const int ctx) {
}
void LabelStack::fillLabel() {
- StackItem *si;
+ StackItem si;
QString style_sheet;
style_sheet =
@@ -62,7 +62,7 @@ void LabelStack::fillLabel() {
si = labels_.first();
- if (si->ctx == temporary_ctx_) {
+ if (si.ctx == temporary_ctx_) {
style_sheet += QString(
" border-radius: 0.25em;"
" color: #%1;"
@@ -74,23 +74,23 @@ void LabelStack::fillLabel() {
style_sheet += "}";
setStyleSheet(style_sheet);
- setText(si->text);
+ setText(si.text);
}
void LabelStack::pushText(QString &text, int ctx) {
- StackItem *si = new StackItem;
+ popText(ctx);
if (ctx == temporary_ctx_) {
temporary_timer_.stop();
- popText(temporary_ctx_);
temporary_epoch_.start();
temporary_timer_.start(temporary_flash_timeout_);
emit toggleTemporaryFlash(true);
}
- si->text = text;
- si->ctx = ctx;
+ StackItem si;
+ si.text = text;
+ si.ctx = ctx;
labels_.prepend(si);
fillLabel();
}
@@ -122,10 +122,10 @@ void LabelStack::contextMenuEvent(QContextMenuEvent *event)
}
void LabelStack::popText(int ctx) {
- QMutableListIterator<StackItem *> iter(labels_);
+ QMutableListIterator<StackItem> iter(labels_);
while (iter.hasNext()) {
- if (iter.next()->ctx == ctx) {
+ if (iter.next().ctx == ctx) {
iter.remove();
break;
}