|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
The main window of the application. More...
#include <main_window.h>
Public Slots | |
| void | setDisplayFilter (QString filter, FilterAction::Action action, FilterAction::ActionType filterType) |
| Sets the display filter and performs an action. | |
| virtual void | filterPackets (QString new_filter, bool force)=0 |
| Filters the packets. | |
| virtual void | showPreferencesDialog (QString module_name)=0 |
| Shows the preferences dialog for a specific module. | |
| virtual void | showIOGraphDialog (io_graph_item_unit_t value_units, QString yfield)=0 |
| Shows the IO graph dialog. | |
| virtual void | showPlotDialog (const QString &y_field, bool filtered)=0 |
| Shows a plot dialog. | |
| void | layoutPanes () |
| Recalculates and lays out the panes. | |
| void | applyRecentPaneGeometry () |
| Applies the most recent pane geometry settings. | |
| void | updateForUnsavedChanges () |
| Updates the UI to reflect unsaved changes. | |
| void | cyclePane (bool reverse=false) |
| Cycles the focus through the available panes. | |
Signals | |
| void | setCaptureFile (capture_file *cf) |
| Signal emitted to set a new capture file. | |
| void | captureActive (int active) |
| Signal emitted when a capture becomes active. | |
| void | fieldSelected (FieldInformation *finfo) |
| Signal emitted when a field is selected. | |
| void | fieldHighlight (FieldInformation *finfo) |
| Signal emitted when a field is highlighted. | |
| void | framesSelected (QList< int > frames) |
| Signal emitted when frames are selected. | |
| void | filterAction (QString filter, FilterAction::Action action, FilterAction::ActionType type) |
| Signal emitted to perform a filter action. | |
| void | displayFilterSuccess (bool success) |
| Signal emitted when a display filter is successfully applied. | |
Public Member Functions | |
| MainWindow (QWidget *parent=nullptr) | |
| Constructs a new MainWindow. | |
| ~MainWindow () | |
| Destroys the MainWindow. | |
| void | setMainWindowTitle (QString title=QString()) |
| Sets the title of the main window. | |
| bool | hasSelection () |
| Checks if there is a current selection. | |
| bool | hasUniqueSelection () |
| Checks if the current selection is unique. | |
| QList< int > | selectedRows (bool useFrameNum=false) |
| Retrieves the selected rows. | |
| void | insertColumn (QString name, QString abbrev, int pos=-1) |
| Inserts a column into the view. | |
| void | gotoFrame (int packet_num) |
| Navigates to a specific frame number. | |
| frame_data * | frameDataForRow (int row) const |
| Retrieves frame data for a specific row. | |
| QString | getFilter () |
| Retrieves the current display filter. | |
| MainStatusBar * | statusBar () |
| Retrieves the main status bar. | |
| void | appendPacketMenu (FunnelAction *funnel_action) |
| Appends a custom packet menu action. | |
| QList< QAction * > | getPacketMenuActions () |
| Retrieves the list of custom packet menu actions. | |
| void | clearAddedPacketMenus () |
| Clears the recently added custom packet menus. | |
| bool | addPacketMenus (QMenu *ctx_menu, GPtrArray *finfo_array) |
| Adds packet menus to the given context menu. | |
Protected Types | |
| enum | CopySelected { CopyAllVisibleItems , CopyAllVisibleSelectedTreeItems , CopySelectedDescription , CopySelectedFieldName , CopySelectedValue , CopyListAsText , CopyListAsCSV , CopyListAsYAML , CopyListAsHTML } |
| Enumeration for determining what to copy when items are selected. More... | |
| enum | FileCloseContext { Default , Quit , Restart , Reload , Update , Export } |
| Context under which a capture file is being closed. More... | |
Protected Slots | |
| void | addDisplayFilterTranslationActions (QMenu *copy_menu) |
| Adds translation actions for the display filter to a menu. | |
| void | updateDisplayFilterTranslationActions (const QString &df_text) |
| Updates the available translation actions based on filter text. | |
| void | updateTitlebar () |
| Updates the main title bar text. | |
Protected Member Functions | |
| void | showWelcome () |
| Displays the welcome screen. | |
| void | showCapture () |
| Displays the main capture view. | |
| void | setTitlebarForCaptureInProgress () |
| Sets the title bar text for when a capture is in progress. | |
| void | setIconForCaptureInProgress (bool capture_in_progress) |
| Sets the window icon to indicate if a capture is in progress. | |
| virtual void | setMenusForCaptureFile (bool force_disable=false)=0 |
| Sets up the menus for the active capture file. | |
| QWidget * | getLayoutWidget (layout_pane_content_e type) |
| Retrieves the widget corresponding to a layout pane content type. | |
| void | populateRecentCapturesMenu () |
| Populate the recent captures menu. Calls openRecentCaptureFile() for each menu item action. | |
| void | retranslateUiElements () |
| Handle retranslation of UI elements in MainWindow. | |
| virtual void | openRecentCaptureFile (const QString &filename)=0 |
| Open a capture file from the recent files menu. | |
| virtual bool | tryClosingCaptureFile (QString before_what, FileCloseContext context=Default)=0 |
| Tries to safely close the current capture file. | |
Protected Attributes | |
| CaptureFile | capture_file_ |
| QList< register_stat_group_t > | menu_groups_ |
| QStackedWidget * | main_stack_ |
| WelcomePage * | welcome_page_ |
| QSplitter | master_split_ |
| QSplitter | extra_split_ |
| QWidget | empty_pane_ |
| QVector< unsigned > | cur_layout_ |
| PacketList * | packet_list_ |
| ProtoTree * | proto_tree_ |
| QWidget * | proto_container_ |
| DataSourceTab * | data_source_tab_ |
| PacketDiagram * | packet_diagram_ |
| DisplayFilterCombo * | df_combo_box_ |
| MainStatusBar * | main_status_bar_ |
| ProfileSwitcher * | profile_switcher_ |
| bool | use_capturing_title_ |
| QMap< QString, QTextCodec * > | text_codec_map_ |
| QMenu * | recent_captures_menu_ |
| QAction * | no_recent_files_action_ |
The main window of the application.
|
protected |
Enumeration for determining what to copy when items are selected.
|
protected |
Context under which a capture file is being closed.
|
explicit |
Constructs a new MainWindow.
| parent | The parent widget, defaults to nullptr. |
|
protectedslot |
Adds translation actions for the display filter to a menu.
| copy_menu | The menu to add the actions to. |
| bool MainWindow::addPacketMenus | ( | QMenu * | ctx_menu, |
| GPtrArray * | finfo_array | ||
| ) |
Adds packet menus to the given context menu.
| ctx_menu | The context menu to add to. |
| finfo_array | Array of field information. |
| void MainWindow::appendPacketMenu | ( | FunnelAction * | funnel_action | ) |
Appends a custom packet menu action.
| funnel_action | Pointer to the funnel action to append. |
|
signal |
Signal emitted when a capture becomes active.
| active | Indicator of capture activity. |
|
slot |
Cycles the focus through the available panes.
| reverse | True to cycle in reverse order. |
|
signal |
Signal emitted when a display filter is successfully applied.
| success | True if the display filter was valid and applied. |
|
signal |
Signal emitted when a field is highlighted.
| finfo | Pointer to the highlighted field information. |
|
signal |
Signal emitted when a field is selected.
| finfo | Pointer to the field information. |
|
signal |
Signal emitted to perform a filter action.
| filter | The filter string. |
| action | The filter action. |
| type | The filter action type. |
|
pure virtualslot |
Filters the packets.
| new_filter | The filter string. |
| force | True to force the filter application. |
| frame_data * MainWindow::frameDataForRow | ( | int | row | ) | const |
Retrieves frame data for a specific row.
| row | The index of the row. |
|
signal |
Signal emitted when frames are selected.
| frames | List of selected frame numbers. |
| QString MainWindow::getFilter | ( | ) |
Retrieves the current display filter.
|
protected |
Retrieves the widget corresponding to a layout pane content type.
| type | The layout pane content type. |
| QList< QAction * > MainWindow::getPacketMenuActions | ( | ) |
Retrieves the list of custom packet menu actions.
| void MainWindow::gotoFrame | ( | int | packet_num | ) |
Navigates to a specific frame number.
| packet_num | The packet number to jump to. |
| bool MainWindow::hasSelection | ( | ) |
Checks if there is a current selection.
| bool MainWindow::hasUniqueSelection | ( | ) |
Checks if the current selection is unique.
| void MainWindow::insertColumn | ( | QString | name, |
| QString | abbrev, | ||
| int | pos = -1 |
||
| ) |
Inserts a column into the view.
| name | The name of the column. |
| abbrev | The abbreviation of the column. |
| pos | The position to insert at, defaults to -1 (append). |
|
protectedpure virtual |
Open a capture file from the recent files menu.
| filename | Path to the file to open. |
Implemented in WiresharkMainWindow, and StratosharkMainWindow.
|
protected |
Populate the recent captures menu. Calls openRecentCaptureFile() for each menu item action.
Populate the recent captures menu with files from WorkspaceState. Calls openRecentCaptureFile() (pure virtual) when user selects a file.
|
protected |
Handle retranslation of UI elements in MainWindow.
This function is called when the application language changes and usually handles elements like menu items and labels that need to be updated to reflect the new language.
| QList< int > MainWindow::selectedRows | ( | bool | useFrameNum = false | ) |
Retrieves the selected rows.
| useFrameNum | True to return frame numbers, false for row indices. |
|
signal |
Signal emitted to set a new capture file.
| cf | Pointer to the capture file. |
|
slot |
Sets the display filter and performs an action.
| filter | The filter string. |
| action | The filter action to perform. |
| filterType | The type of the filter action. |
|
protected |
Sets the window icon to indicate if a capture is in progress.
| capture_in_progress | True if a capture is active. |
| void MainWindow::setMainWindowTitle | ( | QString | title = QString() | ) |
Sets the title of the main window.
| title | The title string to set, defaults to an empty string. |
|
protectedpure virtual |
Sets up the menus for the active capture file.
| force_disable | True to force menus to be disabled. |
|
pure virtualslot |
Shows the IO graph dialog.
| value_units | The unit for the IO graph. |
| yfield | The field to display on the y-axis. |
|
pure virtualslot |
Shows a plot dialog.
| y_field | The field to display on the y-axis. |
| filtered | True if the plot should be filtered. |
|
pure virtualslot |
Shows the preferences dialog for a specific module.
| module_name | The name of the module. |
| MainStatusBar * MainWindow::statusBar | ( | ) |
Retrieves the main status bar.
|
protectedpure virtual |
Tries to safely close the current capture file.
| before_what | Description of the operation occurring after the close. |
| context | Context of the file closure. |
Implemented in WiresharkMainWindow, and StratosharkMainWindow.
|
protectedslot |
Updates the available translation actions based on filter text.
| df_text | The current display filter text. |
|
protected |
The active capture file.
|
protected |
Vector storing the current layout configuration.
|
protected |
Pointer to the data source tab widget.
|
protected |
Pointer to the display filter combo box.
|
protected |
An empty pane widget used as a placeholder.
|
protected |
Extra splitter for additional pane layout.
|
protected |
Main stacked widget for central views.
|
protected |
Pointer to the main status bar.
|
protected |
Master splitter for the main layout.
|
protected |
List of register stat groups for the menu.
|
protected |
Action representing no recent files available.
|
protected |
Pointer to the packet diagram widget.
|
protected |
Pointer to the packet list widget.
|
protected |
Pointer to the profile switcher widget.
|
protected |
Wraps proto_tree_ + in-packet find bar
|
protected |
Pointer to the protocol tree widget.
|
protected |
Menu containing recently opened capture files.
|
protected |
Map of text codecs used for different strings.
|
protected |
Flag indicating if the capturing title is used.
|
protected |
Pointer to the welcome page widget.