diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-26 17:44:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-26 17:44:17 +0000 |
commit | 2d78050fd56b8188aa5a65ad2667e301b60eea45 (patch) | |
tree | b54d4adac6de0a196b8bb8a67b34fe186c21378f /ui/qt/utils/data_printer.cpp | |
parent | Adding upstream version 4.2.2. (diff) | |
download | wireshark-2d78050fd56b8188aa5a65ad2667e301b60eea45.tar.xz wireshark-2d78050fd56b8188aa5a65ad2667e301b60eea45.zip |
Adding upstream version 4.2.4.upstream/4.2.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ui/qt/utils/data_printer.cpp')
-rw-r--r-- | ui/qt/utils/data_printer.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/qt/utils/data_printer.cpp b/ui/qt/utils/data_printer.cpp index 36f1abd..a96e1ed 100644 --- a/ui/qt/utils/data_printer.cpp +++ b/ui/qt/utils/data_printer.cpp @@ -54,6 +54,14 @@ void DataPrinter::toClipboard(DataPrinter::DumpType type, IDataPrintable * print for (int i = 0; i < printData.length(); i++) clipboard_text += QString("%1").arg((uint8_t) printData[i], 2, 16, QChar('0')); break; + case DP_PrintableText: + for (int i = 0; i < printData.length(); i++) { + QChar ch(printData[i]); + if (ch.isSpace() || ch.isPrint()) { + clipboard_text += ch; + } + } + break; case DP_Base64: #if WS_IS_AT_LEAST_GNUC_VERSION(12,1) DIAG_OFF(stringop-overread) @@ -219,6 +227,11 @@ QActionGroup * DataPrinter::copyActions(QObject * copyClass, QObject * data) action->setProperty("printertype", DataPrinter::DP_HexOnly); connect(action, &QAction::triggered, dpi, &DataPrinter::copyIDataBytes); + action = new QAction(tr("…as Printable Text"), actions); + action->setToolTip(tr("Copy only the printable text in the packet.")); + action->setProperty("printertype", DataPrinter::DP_PrintableText); + connect(action, &QAction::triggered, dpi, &DataPrinter::copyIDataBytes); + action = new QAction(tr("…as a Hex Stream"), actions); action->setToolTip(tr("Copy packet bytes as a stream of hex.")); action->setProperty("printertype", DataPrinter::DP_HexStream); |