20#include <ui/qt/models/tag_column_delegate.h>
27#include <QElapsedTimer>
86 virtual void scrollTo(
const QModelIndex &index, QAbstractItemView::ScrollHint hint = EnsureVisible)
override;
114 bool freeze(
bool keep_current_frame =
false);
125 bool thaw(
bool restore_selection =
false);
131 bool isFrozen()
const {
return model() ==
nullptr; }
215 void setCaptureInProgress(
bool in_progress =
false,
bool auto_scroll =
true) { capture_in_progress_ = in_progress; tail_at_end_ = in_progress && auto_scroll; }
309 QList<frame_data *>
selectedFrames(
bool fall_back_to_current =
true)
const;
501 static bool isColumnFrozen(
int column,
int boundary) {
return column < boundary; }
535 Qt::KeyboardModifiers modifiers = Qt::NoModifier);
581 bool from_pinned_row_strip =
false);
609 void forwardHeaderMouseMove(QMouseEvent *event,
const QPoint &header_pos);
612 void forwardHeaderMouseRelease(QMouseEvent *event,
const QPoint &header_pos);
673 const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
692 void selectionChanged(
const QItemSelection & selected,
const QItemSelection & deselected)
override;
734 virtual void leaveEvent(QEvent *event)
override;
740 virtual void resizeEvent(QResizeEvent *event)
override;
774 void rowsInserted(
const QModelIndex &parent,
int start,
int end)
override;
782 virtual void drawRow(QPainter *painter,
const QStyleOptionViewItem &option,
783 const QModelIndex &index)
const override;
790 QModelIndexList selectedSourceIndexes()
const;
797 void installSelectionModel();
805 void reconcilePinnedSelection();
813 void syncPinnedSelection(
bool to_pinned);
834 QMenu colorize_menu_;
841 void startCellDrag(
frame_data *fdata,
int column,
const QString &cell_text);
847 QByteArray column_state_;
853 int overlay_timer_id_;
865 QElapsedTimer key_hold_elapsed_;
868 bool create_near_overlay_;
871 bool create_far_overlay_;
874 QVector<QRgb> overlay_colors_;
877 bool changing_profile_;
880 QModelIndex mouse_pressed_at_;
890 QAction *show_hide_separator_;
893 QList<QAction *>show_hide_actions_;
896 bool capture_in_progress_;
902 bool columns_changed_;
905 bool set_column_visibility_;
908 bool set_style_sheet_;
911 QModelIndex frozen_current_row_;
914 QModelIndexList frozen_selected_rows_;
928 QItemSelectionModel *pinned_selection_model_;
935 bool syncing_selection_;
938 int pinned_column_boundary_;
941 bool reload_pending_;
951 QSize pinned_column_view_size_;
952 bool header_drag_active_ =
false;
953 void updateFrozenOverlayMask();
962 QString overlay_active_flat_style_;
965 QString overlay_inactive_flat_style_;
973 int hovered_frame_num_;
976 QVector<int> selection_history_;
985 GPtrArray *finfo_array;
998 void updateHistory(
int frame_num);
1005 void setFrameReftime(
bool set,
frame_data *fdata);
1011 void setRecentColumnWidth(
int column);
1017 void drawCurrentPacket(
bool scroll =
true);
1022 void applyRecentColumnWidths();
1031 QList<QTreeView *> pinnedOverlayViews()
const;
1041 void repaintPinnedOverlays();
1049 void mirrorSectionWidthToOverlays(
int column,
int width);
1055 void applyOverlayActiveState();
1062 bool selectionIsActive()
const {
return hasFocus() && isActiveWindow(); }
1069 void applicationFocusChanged(QWidget *old, QWidget *now);
1075 void scrollViewChanged(
bool at_end);
1084 QString joinSummaryRow(QStringList col_parts,
int row,
SummaryCopyType type);
1320 void columnVisibilityTriggered();
1327 void sectionResized(
int col,
int,
int new_width);
1335 void sectionMoved(
int logicalIndex,
int oldVisualIndex,
int newVisualIndex);
1345 void vScrollBarActionTriggered(
int);
1350 void drawFarOverlay();
1355 void drawNearOverlay();
1361 void updatePackets(
bool redraw);
1366 void ctxDecodeAsDialog();
1373 void updatePinnedRowVisibility();
1379 void pinnedSelectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected);
1385 void pinnedCurrentChanged(
const QModelIndex ¤t);
1398 void layoutPinnedOverlays();
struct _capture_file capture_file
Represents a capture file and its associated metadata.
Context
Defines the operational context of the event.
Definition capture_event.h:29
A delegate for rendering multi-colored packet items in a view.
Definition multi_color_packet_delegate.h:40
void setRegularFont(const QFont ®ular_font)
Sets the regular font used in the list.
Definition packet_list.cpp:2750
void forwardHeaderMousePress(QMouseEvent *event, const QPoint &header_pos)
Forwards a header mouse press (used for resize dragging) from the pinned column view's own header to ...
Definition packet_list.cpp:1486
void showContextMenuForRow(int row, const QPoint &global_pos)
Shows this view's context menu for a row already resolved by an overlay view's own indexAt(),...
Definition packet_list.cpp:1439
bool uniqueSelectActive()
Checks if a single unique selection is currently active.
Definition packet_list.cpp:729
QList< int > createSizePartsForAligned(bool useHeader, QStringList hdr_parts, QList< int > frame_nums)
Creates size parts for aligned formatting.
Definition packet_list.cpp:3357
void forwardWheelEvent(QWheelEvent *event)
Forwards a wheel scroll event from a pinned overlay view so scrolling stays perfectly in sync with th...
Definition packet_list.cpp:1516
QString allPacketComments()
Retrieves all packet comments in the capture.
Definition packet_list.cpp:2664
PinAction
What pinning or unpinning the selected packets would do.
Definition packet_list.h:433
@ UnpinRows
Definition packet_list.h:437
@ PinRows
Definition packet_list.h:435
@ PinRowsOverLimit
Definition packet_list.h:436
@ NoPinAction
Definition packet_list.h:434
void applyTimeShift()
Applies a time shift to the capture packets.
Definition packet_list.cpp:2918
void timerEvent(QTimerEvent *event) override
Handles timer events.
Definition packet_list.cpp:1313
void columnHiddenChanged(int column, bool hidden)
Emitted from setColumnVisibility() for every column whenever any column's visibility changes,...
virtual void focusOutEvent(QFocusEvent *event) override
Handles focus out events. Needed to stops turbo mode navigation if we lose focus.
Definition packet_list.cpp:1812
QPoint frozenHeaderPosToReal(const QPoint &frozen_pos) const
Translates a position local to the pinned column view's own header (PinnedColumnHeader,...
Definition packet_list.cpp:1461
void captureFileReloadPending()
Handles the event when the capture file is about to be closed and reopened to reload the same records...
Definition packet_list.h:229
QString createSummaryText(int frame_num, SummaryCopyType type)
Creates a summary text for a specific packet.
Definition packet_list.cpp:3308
void setHoveredFrameNum(int frame_num)
Same as setHoveredRowFromOverlay(), but given the frame number directly rather than a row to resolve ...
Definition packet_list.cpp:1657
void resizeAllColumns(bool onlyTimeFormatted=false)
Resizes all columns to fit their content.
Definition packet_list.cpp:3793
QString createHeaderSummaryForAligned(QStringList hdr_parts, QList< int > align_parts, QList< int > size_parts)
Creates an aligned header summary.
Definition packet_list.cpp:3394
void setTimeReference()
Toggles the time reference status on the currently selected frame.
Definition packet_list.cpp:2903
virtual void mouseMoveEvent(QMouseEvent *event) override
Handles mouse move events.
Definition packet_list.cpp:1541
PacketList(QWidget *parent=0)
Constructs a new PacketList object.
Definition packet_list.cpp:266
virtual void keyPressEvent(QKeyEvent *event) override
Handles key press events.
Definition packet_list.cpp:1668
void markAllDisplayedFrames(bool set)
Marks or unmarks all displayed frames.
Definition packet_list.cpp:2868
QList< int > createAlignmentPartsForAligned()
Creates alignment parts for formatting.
Definition packet_list.cpp:3346
void setPacketComment(unsigned c_number, QString new_comment)
Sets the comment for a specific packet.
Definition packet_list.cpp:2638
void addPacketComment(QString new_comment)
Adds a new comment to the currently selected packet.
Definition packet_list.cpp:2611
void resetColumns()
Resets the columns to their default state.
Definition packet_list.cpp:2113
void goPreviousPacket()
Navigates to the previous packet.
Definition packet_list.cpp:2784
void setHoveredRowFromOverlay(int row)
Updates which row is considered "hovered" from a pinned overlay view's own mouse-move event,...
Definition packet_list.cpp:1651
void setProfileSwitcher(ProfileSwitcher *profile_switcher)
Sets the profile switcher for the packet list.
Definition packet_list.cpp:2178
void redrawVisiblePackets()
Fully redraws all visible packets.
Definition packet_list.cpp:2101
bool freeze(bool keep_current_frame=false)
Disable and clear the packet list.
Definition packet_list.cpp:2353
void setCaptureInProgress(bool in_progress=false, bool auto_scroll=true)
Sets the capture in progress state.
Definition packet_list.h:215
QMenu * colorizeMenu()
Retrieves the colorize menu.
Definition packet_list.h:98
virtual void mousePressEvent(QMouseEvent *event) override
Handles mouse press events.
Definition packet_list.cpp:1337
QString getFilterFromFdataAndColumn(frame_data *fdata, int column)
Same as getFilterFromRowAndColumn(), but for a frame that may not have a row in this (filtered) view,...
Definition packet_list.cpp:2523
void writeRecent(FILE *rf)
Writes recent configuration to a file.
Definition packet_list.cpp:2485
void pinSelectedRows()
Pins every currently selected row (or, if nothing is selected, the current row) so each stays visible...
Definition packet_list.cpp:3124
void deleteCommentsFromPackets()
Deletes comments from the selected packets.
Definition packet_list.cpp:2695
void colorsChanged()
Slot triggered when global color configurations change.
Definition packet_list.cpp:513
bool havePreviousHistory(bool update_cur=false)
Checks if there is a previous packet in the selection history.
Definition packet_list.cpp:2137
void setColumnVisibility()
Updates the visibility of columns, including propagating global column-hidden state to the pinned-col...
Definition packet_list.cpp:1832
int selectedFrameCount(int limit=0) const
Counts the selected packets, as selectedFrames(false) would return, stopping early once the count rea...
Definition packet_list.cpp:739
virtual void focusInEvent(QFocusEvent *event) override
Handles focus in events.
Definition packet_list.cpp:1790
QList< frame_data * > selectedFrames(bool fall_back_to_current=true) const
The selected packets: the union of the rows selected in this view and the pinned rows selected in the...
Definition packet_list.cpp:839
void startCellDragFromOverlay(int row, int column)
Starts a cell drag (filter, or selected-rows text) for the given row/column, exactly as dragging that...
Definition packet_list.cpp:1559
virtual void contextMenuEvent(QContextMenuEvent *event) override
Handles context menu events.
Definition packet_list.cpp:1059
void toggleFrameMarkFromClick(const QModelIndex &source_index)
Toggles the mark on a packet in response to a middle click, in this view or one of the pinned overlay...
Definition packet_list.cpp:1351
virtual void scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint hint=EnsureVisible) override
Scrolls the view to the given index.
Definition packet_list.cpp:490
void editColumn(int column)
Signal emitted to trigger editing for a specific column.
void paintHoveredRow(QPainter *painter, const QTreeView *view, const QStyleOptionViewItem &option, const QModelIndex &index) const
Paints the hover highlight over one row of view.
Definition packet_list.cpp:679
void selectRowFromOverlay(int row, int column, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
Selects/marks a row as if the user had clicked it directly in this view, given a row already resolved...
Definition packet_list.cpp:1381
void showContextMenuForSourceIndex(const QModelIndex &source_index, const QPoint &global_pos, bool from_pinned_row_strip=false)
Shows this view's context menu for a packet given by its index in the source PacketListModel....
Definition packet_list.cpp:1068
QString createOpeningTagForHtml()
Creates the opening tag block for HTML summaries.
Definition packet_list.cpp:3447
QMenu * conversationMenu()
Retrieves the conversation menu.
Definition packet_list.h:92
void setColumnDelegate()
Sets the column delegate for the view.
Definition packet_list.cpp:1854
bool haveNextHistory(bool update_cur=false)
Checks if there is a next packet in the selection history.
Definition packet_list.cpp:2119
void pinnedRowsCornerWidthChanged(int corner_width, bool have_pinned_rows)
Emitted whenever the width needed for the pinned-row strip's "corner" (the frozen-column portion,...
bool thaw(bool restore_selection=false)
Enable and restore the packet list.
Definition packet_list.cpp:2394
void goNextPacket()
Navigates to the next packet.
Definition packet_list.cpp:2766
virtual void drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Custom drawing logic for a row.
Definition packet_list.cpp:655
void setProtoTree(ProtoTree *proto_tree)
Sets the protocol tree.
Definition packet_list.cpp:721
void togglePinSelectedRows()
Pins the selected packets, or unpins them if they're all pinned already (see selectedRowsPinAction())...
Definition packet_list.cpp:3105
void goToPacket(int packet, int hf_id=-1)
Jumps directly to a specific packet number.
Definition packet_list.cpp:2823
int hoveredFrameNum() const
The frame number of the row currently tracked as hovered across all panes, or -1 if none....
Definition packet_list.h:656
int pinnedColumnBoundary() const
The current frozen-column boundary (see setPinnedColumnBoundary()), for callers that need the current...
Definition packet_list.h:492
bool isFrozen() const
Whether the packet list is frozen (see freeze()).
Definition packet_list.h:131
void showProtocolPreferences(const QString module_name)
Signal emitted to show protocol specific preferences.
void clear()
Clears the packet list.
Definition packet_list.cpp:2462
void goNextHistoryPacket()
Navigates to the next packet in the selection history.
Definition packet_list.cpp:2837
bool multiSelectActive()
Checks if multiple selections are currently active.
Definition packet_list.cpp:734
PinAction selectedRowsPinAction() const
What toggling the pinning of the selected packets (see selectedFrames()) would do.
Definition packet_list.cpp:3048
QString getFilterFromRowAndColumn(QModelIndex idx)
Retrieves the filter string based on a given row and column.
Definition packet_list.cpp:2515
~PacketList()
Destroys the PacketList object.
Definition packet_list.cpp:482
void packetListScrolled(bool at_end)
Signal emitted when the packet list has been scrolled.
void deleteAllPacketComments()
Deletes all packet comments in the capture.
Definition packet_list.cpp:2706
QString createSummaryForAligned(int frame_num, QList< int > align_parts, QList< int > size_parts)
Creates an aligned summary for a specific packet.
Definition packet_list.cpp:3408
QString createSummaryForHtml(int frame_num)
Creates an HTML summary for a specific packet.
Definition packet_list.cpp:3467
void setMonospaceFont(const QFont &mono_font)
Sets the monospace font used in the list.
Definition packet_list.cpp:2738
virtual void mouseReleaseEvent(QMouseEvent *event) override
Handles mouse release events.
Definition packet_list.cpp:1365
void goPreviousHistoryPacket()
Navigates to the previous packet in the selection history.
Definition packet_list.cpp:2846
void packetDissectionChanged()
Signal emitted when packet dissection data changes.
void captureFileReadFinished(CaptureEvent::Context context)
Handles the event when the capture file has finished reading.
Definition packet_list.cpp:2331
QList< int > selectedRows(bool useFrameNum=false)
Retrieves a list of selected row numbers.
Definition packet_list.cpp:809
virtual void keyReleaseEvent(QKeyEvent *event) override
Handles key release events.
Definition packet_list.cpp:1776
void columnsChanged()
Slot triggered when the column configuration changes.
Definition packet_list.cpp:2192
void goFirstPacket()
Navigates to the very first packet.
Definition packet_list.cpp:2807
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override
Handles selection change events.
Definition packet_list.cpp:1024
void freezePacketList(bool changing_profile)
Slot to trigger freezing the packet list state.
Definition packet_list.cpp:2308
void redrawVisiblePacketsDontSelectCurrent()
Redraws all visible packets without modifying the current selection.
Definition packet_list.cpp:2108
void goLastPacket()
Navigates to the very last packet.
Definition packet_list.cpp:2815
void resetColorized()
Resets the colorized state of the packets.
Definition packet_list.cpp:2582
QString createDefaultStyleForHtml()
Retrieves the default CSS style for HTML summaries.
Definition packet_list.cpp:3435
void forwardHeaderContextMenu(QContextMenuEvent *event, const QPoint &header_pos)
Forwards a header context menu request from the pinned column view's own header.
Definition packet_list.cpp:1472
void setPinnedColumnBoundary(int column_count)
Freezes the leftmost columns so they stay visible while the view is scrolled horizontally.
Definition packet_list.cpp:3177
QString createHeaderSummaryText(SummaryCopyType type)
Creates the header summary text.
Definition packet_list.cpp:3324
void editProtocolPreference(pref_t *pref, module_t *module)
Signal emitted to edit a specific protocol preference.
void rowsInserted(const QModelIndex &parent, int start, int end) override
Slot triggered when rows are inserted into the model.
Definition packet_list.cpp:3778
QString createClosingTagForHtml()
Creates the closing tag block for HTML summaries.
Definition packet_list.cpp:3494
int pinnedRowHeight() const
The height of a single row in this view, for sizing the pinned-row strip to exactly N rows (see Pinne...
Definition packet_list.cpp:3166
void recolorPackets()
Recolors the displayed packets based on rules.
Definition packet_list.cpp:2314
void unsetAllTimeReferences()
Unsets all time reference flags on all frames.
Definition packet_list.cpp:2911
QString createHeaderSummaryForHtml()
Creates the HTML header summary.
Definition packet_list.cpp:3452
QStringList createHeaderPartsForAligned()
Creates string parts for aligned headers.
Definition packet_list.cpp:3335
void setVerticalAutoScroll(bool enabled=true)
Enables or disables vertical auto-scrolling.
Definition packet_list.cpp:2321
void startCellDragForSourceIndex(const QModelIndex &source_index)
As startCellDragFromOverlay(), for a cell given by its index in the source PacketListModel....
Definition packet_list.cpp:1568
void sortByColumnFromOverlay(int column)
Sorts by the given column as if its header section had been clicked directly, toggling order if it's ...
Definition packet_list.cpp:1521
void fieldsChanged(capture_file *cf)
Slot triggered when global fields configuration changes.
Definition packet_list.cpp:2226
void fieldSelected(FieldInformation *finfo)
Signal emitted when a specific field is selected.
void paintEvent(QPaintEvent *event) override
Handles paint events.
Definition packet_list.cpp:1328
static bool isColumnFrozen(int column, int boundary)
The single shared definition of "column i is frozen" given a frozen-column boundary,...
Definition packet_list.h:501
void setCaptureFile(capture_file *cf)
Sets the active capture file.
Definition packet_list.cpp:2717
QString getPacketComment(unsigned c_number)
Retrieves the comment for a specific packet.
Definition packet_list.cpp:2588
virtual void changeEvent(QEvent *event) override
Handles window-activation changes.
Definition packet_list.cpp:617
bool contextMenuActive()
Checks if the context menu is currently active.
Definition packet_list.cpp:2510
void setPinnedRowViews(PinnedRowView *row_view, PinnedRowView *corner_view)
Supplies the pinned-row-strip overlay views for this view to manage the content/properties of (model,...
Definition packet_list.cpp:424
void unpinSelectedRows()
Unpins every currently selected row (or, if nothing is selected, the current row) that is currently p...
Definition packet_list.cpp:3137
SummaryCopyType
Types of formats available for copying packet summaries.
Definition packet_list.h:69
@ CopyAsYAML
Copy summary as YAML format.
Definition packet_list.h:75
@ CopyAsHTML
Copy summary as HTML format.
Definition packet_list.h:77
@ CopyAsCSV
Copy summary as Comma-Separated Values (CSV).
Definition packet_list.h:73
@ CopyAsText
Copy summary as plain text.
Definition packet_list.h:71
void pinnedRowsChanged()
Emitted when packets are pinned or unpinned.
virtual void resizeEvent(QResizeEvent *event) override
Handles resize events.
Definition packet_list.cpp:1824
virtual void leaveEvent(QEvent *event) override
Clears the tracked hover row when the mouse leaves this view (and, by extension, all pinned overlay v...
Definition packet_list.cpp:1640
void framesSelected(QList< int > frames)
Signal emitted when multiple frames are selected.
void updatePinActions(QAction *pin_selected, QAction *unpin_all) const
Sets the text and enabled state of the main window's pin actions to match the selection and the pinne...
Definition packet_list.cpp:3077
void pinnedColumnBoundaryChanged(int column_count)
Emitted from setPinnedColumnBoundary() whenever the frozen- column boundary changes,...
void ignoreAllDisplayedFrames(bool set)
Ignores or un-ignores all displayed frames.
Definition packet_list.cpp:2894
void ignoreFrame()
Toggles the ignore status of the currently selected frame.
Definition packet_list.cpp:2881
void preferencesChanged()
Slot triggered when global preferences have changed.
Definition packet_list.cpp:2266
void markFrame()
Toggles the mark on the currently selected frame.
Definition packet_list.cpp:2855
void showColumnPreferences(QString pane_name)
Signal emitted to show preferences for a specific pane.
frame_data * getFDataForRow(int row) const
Retrieves the frame data for a specific row.
Definition packet_list.cpp:2186
A Qt item model representing the list of packets in a capture file.
Definition packet_list_model.h:36
A proxy model exposing the packets of a PacketListModel that pass the display filter,...
Definition packet_list_proxy_model.h:42
A QTreeView clone showing only a leftmost run of columns from a shared model, used to keep "frozen" c...
Definition pinned_column_view.h:34
A QTreeView clone that shows every row of a PinnedRowsModel (i.e. every currently pinned packet,...
Definition pinned_row_view.h:32
A proxy model exposing only a chosen set of "pinned" packets from a PacketListModel,...
Definition pinned_rows_model.h:39
Monitors incoming packets and automatically switches the active configuration profile when a packet m...
Definition profile_switcher.h:38
A tree view for displaying protocol dissection details.
Definition proto_tree.h:30
Definition tag_column_delegate.h:24
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.