24#include <QElapsedTimer>
83 virtual void scrollTo(
const QModelIndex &index, QAbstractItemView::ScrollHint hint = EnsureVisible)
override;
111 bool freeze(
bool keep_current_frame =
false);
122 bool thaw(
bool restore_selection =
false);
200 void setCaptureInProgress(
bool in_progress =
false,
bool auto_scroll =
true) { capture_in_progress_ = in_progress; tail_at_end_ = in_progress && auto_scroll; }
371 void pinRow(
int frame_num);
423 static bool isColumnFrozen(
int column,
int boundary) {
return column < boundary; }
523 void forwardHeaderMouseMove(QMouseEvent *event,
const QPoint &header_pos);
526 void forwardHeaderMouseRelease(QMouseEvent *event,
const QPoint &header_pos);
608 void selectionChanged(
const QItemSelection & selected,
const QItemSelection & deselected)
override;
650 virtual void leaveEvent(QEvent *event)
override;
656 virtual void resizeEvent(QResizeEvent *event)
override;
690 void rowsInserted(
const QModelIndex &parent,
int start,
int end)
override;
698 virtual void drawRow(QPainter *painter,
const QStyleOptionViewItem &option,
699 const QModelIndex &index)
const override;
718 QMenu colorize_menu_;
732 bool ctx_from_pinned_row_strip_;
735 QByteArray column_state_;
741 int overlay_timer_id_;
753 QElapsedTimer key_hold_elapsed_;
756 bool create_near_overlay_;
759 bool create_far_overlay_;
762 QVector<QRgb> overlay_colors_;
765 bool changing_profile_;
768 QModelIndex mouse_pressed_at_;
777 QAction *show_hide_separator_;
780 QList<QAction *>show_hide_actions_;
783 bool capture_in_progress_;
789 bool columns_changed_;
792 bool set_column_visibility_;
795 bool set_style_sheet_;
798 QModelIndex frozen_current_row_;
801 QModelIndexList frozen_selected_rows_;
808 int pinned_column_boundary_;
818 QSize pinned_column_view_size_;
827 QString overlay_active_flat_style_;
830 QString overlay_inactive_flat_style_;
838 int hovered_frame_num_;
841 QVector<int> selection_history_;
850 GPtrArray *finfo_array;
860 void setFrameReftime(
bool set,
frame_data *fdata);
866 void setRecentColumnWidth(
int column);
871 void drawCurrentPacket();
876 void applyRecentColumnWidths();
885 QList<QTreeView *> pinnedOverlayViews()
const;
895 void repaintPinnedOverlays();
903 void mirrorSectionWidthToOverlays(
int column,
int width);
909 void applyOverlayActiveState();
916 void applicationFocusChanged(QWidget *old, QWidget *now);
922 void scrollViewChanged(
bool at_end);
931 QString joinSummaryRow(QStringList col_parts,
int row,
SummaryCopyType type);
1164 void columnVisibilityTriggered();
1171 void sectionResized(
int col,
int,
int new_width);
1179 void sectionMoved(
int logicalIndex,
int oldVisualIndex,
int newVisualIndex);
1189 void vScrollBarActionTriggered(
int);
1194 void drawFarOverlay();
1199 void drawNearOverlay();
1205 void updatePackets(
bool redraw);
1210 void ctxDecodeAsDialog();
1217 void updatePinnedRowVisibility();
1230 void layoutPinnedOverlays();
struct _capture_file capture_file
Represents a capture file and its associated metadata.
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:2320
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:1296
bool uniqueSelectActive()
Checks if a single unique selection is currently active.
Definition packet_list.cpp:607
QString createSummaryText(QModelIndex idx, SummaryCopyType type)
Creates a summary text for a specific index.
Definition packet_list.cpp:2792
void showContextMenuForRow(int row, const QPoint &global_pos, bool from_pinned_row_strip=false)
Shows this view's context menu for a row already resolved by an overlay view's own indexAt(),...
Definition packet_list.cpp:1222
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:1326
QString allPacketComments()
Retrieves all packet comments in the capture.
Definition packet_list.cpp:2247
void applyTimeShift()
Applies a time shift to the capture packets.
Definition packet_list.cpp:2519
void timerEvent(QTimerEvent *event) override
Handles timer events.
Definition packet_list.cpp:1047
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:1617
QPoint frozenHeaderPosToReal(const QPoint &frozen_pos) const
Translates a position local to the pinned column view's own header (PinnedColumnHeader,...
Definition packet_list.cpp:1271
void setHoveredFrameNum(int frame_num)
Same as setHoveredRowFromOverlay(), but given the frame number directly rather than a row to resolve ...
Definition packet_list.cpp:1458
void resizeAllColumns(bool onlyTimeFormatted=false)
Resizes all columns to fit their content.
Definition packet_list.cpp:3308
QString createHeaderSummaryForAligned(QStringList hdr_parts, QList< int > align_parts, QList< int > size_parts)
Creates an aligned header summary.
Definition packet_list.cpp:2875
void setTimeReference()
Toggles the time reference status on the currently selected frame.
Definition packet_list.cpp:2505
virtual void mouseMoveEvent(QMouseEvent *event) override
Handles mouse move events.
Definition packet_list.cpp:1351
PacketList(QWidget *parent=0)
Constructs a new PacketList object.
Definition packet_list.cpp:225
virtual void keyPressEvent(QKeyEvent *event) override
Handles key press events.
Definition packet_list.cpp:1469
void markAllDisplayedFrames(bool set)
Marks or unmarks all displayed frames.
Definition packet_list.cpp:2454
QList< int > createAlignmentPartsForAligned()
Creates alignment parts for formatting.
Definition packet_list.cpp:2829
void setPacketComment(unsigned c_number, QString new_comment)
Sets the comment for a specific packet.
Definition packet_list.cpp:2223
void addPacketComment(QString new_comment)
Adds a new comment to the currently selected packet.
Definition packet_list.cpp:2197
void resetColumns()
Resets the columns to their default state.
Definition packet_list.cpp:1753
void goPreviousPacket()
Navigates to the previous packet.
Definition packet_list.cpp:2354
void setHoveredRowFromOverlay(int row)
Updates which row is considered "hovered" from a pinned overlay view's own mouse-move event,...
Definition packet_list.cpp:1452
void setProfileSwitcher(ProfileSwitcher *profile_switcher)
Sets the profile switcher for the packet list.
Definition packet_list.cpp:1794
void redrawVisiblePackets()
Fully redraws all visible packets.
Definition packet_list.cpp:1742
bool freeze(bool keep_current_frame=false)
Disable and clear the packet list.
Definition packet_list.cpp:1960
void setCaptureInProgress(bool in_progress=false, bool auto_scroll=true)
Sets the capture in progress state.
Definition packet_list.h:200
QMenu * colorizeMenu()
Retrieves the colorize menu.
Definition packet_list.h:95
void captureFileReadFinished()
Handles the event when the capture file has finished reading.
Definition packet_list.cpp:1947
virtual void mousePressEvent(QMouseEvent *event) override
Handles mouse press events.
Definition packet_list.cpp:1071
void writeRecent(FILE *rf)
Writes recent configuration to a file.
Definition packet_list.cpp:2070
QList< int > createSizePartsForAligned(bool useHeader, QStringList hdr_parts, QList< int > rows)
Creates size parts for aligned formatting.
Definition packet_list.cpp:2840
void deleteCommentsFromPackets()
Deletes comments from the selected packets.
Definition packet_list.cpp:2278
void colorsChanged()
Slot triggered when global color configurations change.
Definition packet_list.cpp:427
bool havePreviousHistory(bool update_cur=false)
Checks if there is a previous packet in the selection history.
Definition packet_list.cpp:1777
void setColumnVisibility()
Updates the visibility of columns, including propagating global column-hidden state to the pinned-col...
Definition packet_list.cpp:1637
virtual void focusInEvent(QFocusEvent *event) override
Handles focus in events.
Definition packet_list.cpp:1595
virtual void contextMenuEvent(QContextMenuEvent *event) override
Handles context menu events.
Definition packet_list.cpp:801
virtual void scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint hint=EnsureVisible) override
Scrolls the view to the given index.
Definition packet_list.cpp:414
void pinRow(int frame_num)
Pins a packet's row so that it stays visible (stacked with any other pinned rows, ordered to match th...
Definition packet_list.cpp:2649
void editColumn(int column)
Signal emitted to trigger editing for a specific column.
void selectRowFromOverlay(int row, int column, Qt::MouseButtons buttons)
Selects/marks a row as if the user had clicked it directly in this view, given a row already resolved...
Definition packet_list.cpp:1106
QString createOpeningTagForHtml()
Creates the opening tag block for HTML summaries.
Definition packet_list.cpp:2927
QMenu * conversationMenu()
Retrieves the conversation menu.
Definition packet_list.h:89
void selectFrameFromOverlay(int frame_num)
Same as selectRowFromOverlay(), but given a frame/packet number directly rather than a row in this vi...
Definition packet_list.cpp:1147
void setColumnDelegate()
Sets the column delegate for the view.
Definition packet_list.cpp:1659
bool haveNextHistory(bool update_cur=false)
Checks if there is a next packet in the selection history.
Definition packet_list.cpp:1759
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:1988
void goNextPacket()
Navigates to the next packet.
Definition packet_list.cpp:2336
virtual void drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Custom drawing logic for a row.
Definition packet_list.cpp:554
void setProtoTree(ProtoTree *proto_tree)
Sets the protocol tree.
Definition packet_list.cpp:599
void goToPacket(int packet, int hf_id=-1)
Jumps directly to a specific packet number.
Definition packet_list.cpp:2393
int hoveredFrameNum() const
The frame number of the row currently tracked as hovered across all panes, or -1 if none....
Definition packet_list.h:575
int pinnedColumnBoundary() const
The current frozen-column boundary (see setPinnedColumnBoundary()), for callers that need the current...
Definition packet_list.h:414
void showProtocolPreferences(const QString module_name)
Signal emitted to show protocol specific preferences.
void clear()
Clears the packet list.
Definition packet_list.cpp:2040
void goNextHistoryPacket()
Navigates to the next packet in the selection history.
Definition packet_list.cpp:2407
bool multiSelectActive()
Checks if multiple selections are currently active.
Definition packet_list.cpp:612
QString getFilterFromRowAndColumn(QModelIndex idx)
Retrieves the filter string based on a given row and column.
Definition packet_list.cpp:2100
~PacketList()
Destroys the PacketList object.
Definition packet_list.cpp:406
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:2288
void setMonospaceFont(const QFont &mono_font)
Sets the monospace font used in the list.
Definition packet_list.cpp:2311
virtual void mouseReleaseEvent(QMouseEvent *event) override
Handles mouse release events.
Definition packet_list.cpp:1091
void goPreviousHistoryPacket()
Navigates to the previous packet in the selection history.
Definition packet_list.cpp:2416
void packetDissectionChanged()
Signal emitted when packet dissection data changes.
QList< int > selectedRows(bool useFrameNum=false)
Retrieves a list of selected row numbers.
Definition packet_list.cpp:617
int currentFrameNum() const
The frame number of the currently selected packet, or -1 if none. Reflects cap_file_->current_frame,...
Definition packet_list.cpp:656
virtual void keyReleaseEvent(QKeyEvent *event) override
Handles key release events.
Definition packet_list.cpp:1581
void columnsChanged()
Slot triggered when the column configuration changes.
Definition packet_list.cpp:1808
void goFirstPacket()
Navigates to the very first packet.
Definition packet_list.cpp:2377
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override
Handles selection change events.
Definition packet_list.cpp:664
void freezePacketList(bool changing_profile)
Slot to trigger freezing the packet list state.
Definition packet_list.cpp:1924
void redrawVisiblePacketsDontSelectCurrent()
Redraws all visible packets without modifying the current selection.
Definition packet_list.cpp:1749
void goLastPacket()
Navigates to the very last packet.
Definition packet_list.cpp:2385
void resetColorized()
Resets the colorized state of the packets.
Definition packet_list.cpp:2168
QString createDefaultStyleForHtml()
Retrieves the default CSS style for HTML summaries.
Definition packet_list.cpp:2915
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:1282
void setPinnedColumnBoundary(int column_count)
Freezes the leftmost columns so they stay visible while the view is scrolled horizontally.
Definition packet_list.cpp:2678
QString createHeaderSummaryText(SummaryCopyType type)
Creates the header summary text.
Definition packet_list.cpp:2807
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:3290
QString createClosingTagForHtml()
Creates the closing tag block for HTML summaries.
Definition packet_list.cpp:2973
QString createSummaryForAligned(QModelIndex idx, QList< int > align_parts, QList< int > size_parts)
Creates an aligned summary for a specific index.
Definition packet_list.cpp:2889
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:2667
void recolorPackets()
Recolors the displayed packets based on rules.
Definition packet_list.cpp:1930
void unsetAllTimeReferences()
Unsets all time reference flags on all frames.
Definition packet_list.cpp:2512
QString createHeaderSummaryForHtml()
Creates the HTML header summary.
Definition packet_list.cpp:2932
QStringList createHeaderPartsForAligned()
Creates string parts for aligned headers.
Definition packet_list.cpp:2818
void setVerticalAutoScroll(bool enabled=true)
Enables or disables vertical auto-scrolling.
Definition packet_list.cpp:1937
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:1331
void fieldsChanged(capture_file *cf)
Slot triggered when global fields configuration changes.
Definition packet_list.cpp:1842
void unpinRow(int frame_num)
Unpins a single packet's row, if pinned.
Definition packet_list.cpp:2655
void fieldSelected(FieldInformation *finfo)
Signal emitted when a specific field is selected.
void paintEvent(QPaintEvent *event) override
Handles paint events.
Definition packet_list.cpp:1062
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:423
void setCaptureFile(capture_file *cf)
Sets the active capture file.
Definition packet_list.cpp:2299
QString getPacketComment(unsigned c_number)
Retrieves the comment for a specific packet.
Definition packet_list.cpp:2174
virtual void changeEvent(QEvent *event) override
Handles window-activation changes.
Definition packet_list.cpp:516
QString createSummaryForHtml(QModelIndex idx)
Creates an HTML summary for a specific index.
Definition packet_list.cpp:2947
bool contextMenuActive()
Checks if the context menu is currently active.
Definition packet_list.cpp:2095
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:357
SummaryCopyType
Types of formats available for copying packet summaries.
Definition packet_list.h:66
@ CopyAsYAML
Copy summary as YAML format.
Definition packet_list.h:72
@ CopyAsHTML
Copy summary as HTML format.
Definition packet_list.h:74
@ CopyAsCSV
Copy summary as Comma-Separated Values (CSV).
Definition packet_list.h:70
@ CopyAsText
Copy summary as plain text.
Definition packet_list.h:68
void showContextMenuForFrame(int frame_num, const QPoint &global_pos, bool from_pinned_row_strip=true)
Same as showContextMenuForRow(), but given a frame/packet number directly for a pinned packet that's ...
Definition packet_list.cpp:1239
virtual void resizeEvent(QResizeEvent *event) override
Handles resize events.
Definition packet_list.cpp:1629
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:1441
void framesSelected(QList< int > frames)
Signal emitted when multiple frames are selected.
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:2496
void ignoreFrame()
Toggles the ignore status of the currently selected frame.
Definition packet_list.cpp:2467
void preferencesChanged()
Slot triggered when global preferences have changed.
Definition packet_list.cpp:1882
void markFrame()
Toggles the mark on the currently selected frame.
Definition packet_list.cpp:2425
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:1802
A Qt item model representing the list of packets in a capture file.
Definition packet_list_model.h:36
A QTreeView clone showing only a leftmost run of columns from a shared model, used to keep "frozen" c...
Definition pinned_column_view.h:33
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:35
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
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.