59# include <QSocketNotifier>
70class CaptureOptionsDialog;
86 class StratosharkMainWindow;
125 info_data_t *captureInfoData() {
return &info_data_; }
236 MatchSelectedReplace,
244 Ui::StratosharkMainWindow *main_ui_;
246 QWidget *previous_focus_;
248 QActionGroup *show_hide_actions_;
249 QAction *appearance_mode_spacer_ =
nullptr;
250 QActionGroup *time_display_actions_;
251 QActionGroup *time_precision_actions_;
253 QList<QPair<QAction *, bool>> freeze_actions_;
254 QPointer<QWidget> freeze_focus_;
255 QPointer<PreferencesDialog> preferences_dialog_;
256 QMap<QAction *, ts_type> td_actions;
257 QMap<QAction *, ts_precision> tp_actions;
262 bool capture_stopping_;
263 bool capture_filter_valid_;
266 CaptureOptionsDialog *capture_options_dialog_;
270 QPoint dragStartPosition;
286 void mergeCaptureFile();
292 void importCaptureFile();
300 bool saveCaptureFile(
capture_file *cf,
bool dont_reopen);
310 bool saveAsCaptureFile(
capture_file *cf,
bool must_support_comments =
false,
bool dont_reopen =
false);
316 void exportSelectedPackets();
332 void fileAddExtension(QString &file_name,
int file_type, ws_compression_type compression_type);
341 void initMainToolbarIcons();
344 void updateMainToolbarIconSize();
350 void cycleAppearanceMode();
353 void updateAppearanceModeAction();
356 void updateAppearanceModeButton();
359 void initShowHideMainWidgets();
362 void initTimeDisplayFormatMenu();
365 void initTimePrecisionFormatMenu();
368 void initFreezeActions();
374 void setMenusForCaptureFile(
bool force_disable =
false)
override;
380 void setMenusForCaptureInProgress(
bool capture_in_progress =
false);
383 void setMenusForCaptureStopping();
389 void setForCapturedPackets(
bool have_captured_packets);
395 void setMenusForFileSet(
bool enable_list_files);
400 void updateStyleSheet();
408 void externalMenuHelper(
ext_menu_t *menu, QMenu *subMenu,
int depth);
417 void setForCaptureInProgress(
bool capture_in_progress =
false,
bool handle_toolbars =
false, GArray *ifaces = NULL);
426 QMenu *findOrAddMenu(QMenu *parent_menu,
const QStringList &menu_parts);
432 void captureFileReadStarted(
const QString &action);
439 void addMenuActions(QList<QAction *> &actions,
int menu_group);
446 void removeMenuActions(QList<QAction *> &actions,
int menu_group);
453 void goToConversationFrame(
bool go_next,
bool start_current =
true);
460 void colorizeWithFilter(QByteArray filter,
int color_number = -1);
493 void showExtcapOptions(QString &device_name,
bool startCaptureOnClose);
515 bool openCaptureFile(QString cf_path, QString display_filter,
unsigned int type,
bool is_tempfile =
false);
587 void openLuaDebuggerDialog();
596 void applyFilter(QString new_filter = QString(),
bool force =
false)
override;
606 void onAppInitialized();
615 void initViewColorizeMenu();
618 void initConversationMenus();
627 static bool addFollowStreamMenuItem(
const void *key,
void *value,
void *userdata);
630 void initFollowStreamMenus();
637 void startCapture(QStringList);
643 void pushLiveCaptureInProgress();
646 void popLiveCaptureInProgress();
652 void loadWindowGeometry();
655 void saveWindowGeometry();
660 void mainStackChanged(
int);
663 void updateRecentCaptures();
666 void addPacketComment();
669 void editPacketComment();
672 void deletePacketComment();
675 void deleteCommentsFromPackets();
683 QString commentToMenuText(QString text,
int max_len = 40);
686 void setEditCommentsMenu();
689 void setMenusForSelectedPacket();
698 void interfaceSelectionChanged();
704 void captureFilterSyntaxChanged(
bool valid);
707 void redissectPackets();
710 void checkDisplayFilter();
713 void fieldsChanged();
716 void reloadLuaPlugins();
723 void showAccordionFrame(
AccordionFrame *show_frame,
bool toggle =
false);
729 void showColumnEditor(
int column);
732 void showPreferenceEditor();
735 void addStatsPluginsToMenu();
738 void addDynamicMenus();
741 void reloadDynamicMenus();
744 void addPluginIFStructures();
751 QMenu *searchSubMenu(QString objectName);
756 void activatePluginIFToolbar(
bool);
763 void startInterfaceCapture(
bool valid,
const QString capture_filter);
767 void applyGlobalCommandLineOptions();
773 void setFeaturesEnabled(
bool enabled =
true);
776 void on_actionNewDisplayFilterExpression_triggered();
783 void onFilterSelected(QString filterText,
bool prepare);
786 void onFilterPreferences();
792 void onFilterEdit(
int uatIndex);
808 void openStatCommandDialog(
const QString &menu_path,
const char *arg,
void *userdata);
816 void openTapParameterDialog(
const QString cfg_str,
const QString arg,
void *userdata);
819 void openTapParameterDialog();
822 void connectFileMenuActions();
828 void connectEditMenuActions();
840 void editTimeShift();
843 void editConfigurationProfiles();
848 void editTimeShiftFinished(
int);
863 void editPacketCommentFinished(
PacketCommentDialog *pc_dialog,
int result,
unsigned nComment);
866 void deleteAllPacketComments();
872 void deleteAllPacketCommentsFinished(
int result);
878 void showPreferencesDialog(QString module_name)
override;
881 void connectViewMenuActions();
887 void showHideMainWidgets(QAction *action);
893 void setTimestampFormat(QAction *action);
899 void setTimestampPrecision(QAction *action);
905 void setTimeDisplaySecondsWithHoursAndMinutes(
bool checked);
908 void editResolvedName();
911 void setNameResolution();
915 void showColoringRulesDialog();
918 void showTaggingRulesDialog();
925 void colorizeConversation(
bool create_rule =
false);
928 void colorizeActionTriggered();
934 void openPacketDialog(
bool from_reference =
false);
937 void reloadCaptureFileAsFormatOrCapture();
940 void reloadCaptureFile();
943 void connectGoMenuActions();
946 void setPreviousFocus();
949 void resetPreviousFocus();
952 void connectCaptureMenuActions();
955 void startCaptureTriggered();
958 void connectAnalyzeMenuActions();
969 void applyFieldAsColumn();
972 void filterMenuAboutToShow();
975 void applyConversationFilter();
984 void openFollowStreamDialog(
int proto_id,
unsigned stream_num,
unsigned sub_stream_num,
bool use_stream_index =
true);
990 void openFollowStreamDialog(
int proto_id);
995 void statCommandExpertInfo(
const char *,
void *);
998 void connectToolsMenuActions();
1001 void connectHelpMenuActions();
1004 void goToCancelClicked();
1007 void goToGoClicked();
1010 void goToLineEditReturnPressed();
1013 void connectStatisticsMenuActions();
1016 void showResolvedAddressesDialog();
1019 void showConversationsDialog();
1022 void showEndpointsDialog();
1028 void openStatisticsTreeDialog(
const char *abbr);
1033 void statCommandIOGraph(
const char *,
void *);
1047 void showPlotDialog(
const QString &y_field = QString(),
bool filtered =
false)
override;
1055 void showIOGraphDialogForFilters(
const QString &displayFilter,
1056 const QVector<QString> &filters,
1057 const QVector<QString> &names = QVector<QString>())
override;
1060 void externalMenuItemTriggered();
1063 void on_actionContextWikiProtocolPage_triggered();
1066 void on_actionContextFilterFieldReference_triggered();
1072 void extcap_options_finished(
int result);
1079 void showExtcapOptionsDialog(QString device_name,
bool startCaptureOnClose);
struct _info_data info_data_t
Aggregates packet count statistics and UI state for a live capture info display.
struct _capture_session capture_session
Opaque handle representing an active or pending capture session.
struct _capture_file capture_file
Represents a capture file and its associated metadata.
A QFrame that shows and hides itself with a slide animation.
Definition accordion_frame.h:21
Represents an event occurring during a capture or file operation.
Definition capture_event.h:24
A tab widget that manages and displays different data sources for a packet (e.g., Hex,...
Definition data_source_tab.h:36
A dialog for managing and displaying capture file sets.
Definition file_set_dialog.h:32
Action
Defines an action to be taken with a filter.
Definition filter_action.h:30
ActionType
Defines how the new filter should be combined with the existing one.
Definition filter_action.h:43
A dialog for managing and editing capture filters, display filters, and display macros.
Definition filter_dialog.h:31
Manages statistics and user interface interactions for Lua-based funnel plugins.
Definition funnel_statistics.h:35
CopySelected
Enumeration for determining what to copy when items are selected.
Definition main_window.h:255
MainWindow(QWidget *parent=nullptr)
Constructs a new MainWindow.
Definition main_window.cpp:51
FileCloseContext
Context under which a capture file is being closed.
Definition main_window.h:279
@ Default
Default closing context.
Definition main_window.h:281
The main packet list view for displaying captured packets.
Definition packet_list.h:51
Dialog for configuring Wireshark preferences.
Definition preferences_dialog.h:33
Dialog that provides packet print and print-preview functionality for a live or saved capture file.
Definition print_dialog.h:31
A tree view for displaying protocol dissection details.
Definition proto_tree.h:30
void setMwFileName(QString fileName)
Sets the file path shown in the main window title bar.
Definition stratoshark_main_window.cpp:2876
void layoutToolbars()
Repositions and resizes toolbars according to current layout settings.
Definition stratoshark_main_window_slots.cpp:287
bool tryClosingCaptureFile(QString before_what, FileCloseContext context=Default) override
Attempts to close the current capture file, prompting the user to save if there are unsaved changes.
Definition stratoshark_main_window.cpp:1782
void setFunnelMenus(void)
Rebuilds the Lua funnel statistics menus from registered funnel entries.
Definition stratoshark_main_window.cpp:2837
void applyFilter(QString new_filter=QString(), bool force=false) override
Applies a new display filter to the open capture file.
Definition stratoshark_main_window_slots.cpp:274
void dragEnterEvent(QDragEnterEvent *event) override
Accepts drag-enter events for capture files dragged onto the window.
Definition stratoshark_main_window.cpp:1013
bool event(QEvent *event) override
Handles window-level events such as activation changes.
Definition stratoshark_main_window.cpp:907
void captureFileOpened()
Updates UI state when a capture file is first opened.
Definition stratoshark_main_window_slots.cpp:721
friend class MainApplication
Friend class allowing access to private members.
Definition stratoshark_main_window.h:1082
void updateForUnsavedChanges()
Updates title bar, menus, and status bar to reflect unsaved changes.
Definition stratoshark_main_window.cpp:2533
void captureFileClosed()
Resets UI state after a capture file has been fully closed.
Definition stratoshark_main_window_slots.cpp:781
void updatePreferenceActions()
Refreshes menu items that reflect preference values.
Definition stratoshark_main_window_slots.cpp:338
void keyPressEvent(QKeyEvent *event) override
Handles key press events for global keyboard shortcuts.
Definition stratoshark_main_window.cpp:921
void packetInfoChanged(struct _packet_info *pinfo)
Emitted when the selected packet changes, providing the new packet info.
QString getMwFileName()
Returns the file path currently shown in the main window title bar.
Definition stratoshark_main_window.cpp:2871
void addInterfaceToolbar(const iface_toolbar *toolbar_entry)
Adds an interface toolbar for the given toolbar descriptor.
Definition stratoshark_main_window.cpp:796
void showCaptureOptionsDialog()
Opens the capture options dialog (interface selection, filters, etc.).
Definition stratoshark_main_window_slots.cpp:2816
~StratosharkMainWindow()
Destroys the main window and releases all associated resources.
Definition stratoshark_main_window.cpp:740
void fieldFilterChanged(const QByteArray field_filter)
Emitted when the field-based display filter changes.
bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, bool is_tempfile=false)
Open a capture file.
Definition stratoshark_main_window_slots.cpp:165
void setTitlebarForCaptureFile()
Updates the window title bar to reflect the current capture file name and state.
Definition stratoshark_main_window.cpp:2387
void setDissectedCaptureFile(capture_file *cf)
Emitted when a dissected capture file becomes the active file.
bool openCaptureFile(QString cf_path=QString(), QString display_filter=QString())
Convenience overload that auto-detects file type.
Definition stratoshark_main_window.h:523
void updateRecentActions()
Rebuilds the File → Open Recent submenu from the recent-files list.
Definition stratoshark_main_window_slots.cpp:352
void changeEvent(QEvent *event) override
Responds to locale or palette changes by retranslating the UI.
Definition stratoshark_main_window.cpp:2538
QMenu * createPopupMenu() override
Creates and returns the window's right-click popup menu.
Definition stratoshark_main_window.cpp:767
void removeInterfaceToolbar(const char *menu_title)
Removes the interface toolbar with the given menu title.
Definition stratoshark_main_window.cpp:837
StratosharkMainWindow(QWidget *parent=nullptr)
Constructs the Stratoshark main window and initialises all menus, toolbars, and UI components.
Definition stratoshark_main_window.cpp:322
void captureFileClosing()
Updates UI state while a capture file is being closed.
Definition stratoshark_main_window_slots.cpp:766
void dropEvent(QDropEvent *event) override
Opens a capture file dropped onto the window.
Definition stratoshark_main_window.cpp:1044
void closePacketDialogs()
Emitted to request that all packet-detail dialogs close themselves.
void openRecentCaptureFile(const QString &filename) override
Opens the given recent capture file, handling any necessary prompts.
Definition stratoshark_main_window_slots.cpp:961
void reloadFields()
Emitted to request that all views reload their field definitions.
void removeAdditionalToolbar(QString toolbarName)
Removes an additional (plugin/interface) toolbar by name.
Definition stratoshark_main_window.cpp:2842
void captureFileReadFinished()
Updates UI state after a capture file has been fully read.
Definition stratoshark_main_window_slots.cpp:743
void closeEvent(QCloseEvent *event) override
Prompts the user to save unsaved changes before closing the window.
Definition stratoshark_main_window.cpp:961
bool eventFilter(QObject *obj, QEvent *event) override
Filters events on watched objects (e.g. focus changes on child widgets).
Definition stratoshark_main_window.cpp:889
Top-level Qt application object for the Wireshark GUI.
Definition wireshark_application.h:19
export_type_e
Output format for packet data export operations.
Definition file_dialog.h:32
io_graph_item_unit_t
Selects the Y-axis value unit or aggregate calculation mode for an I/O graph plot.
Definition io_graph_item.h:29
ext_menubar_t ext_menu_t
Definition plugin_if.h:65
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
ts_precision
Sub-second precision used when formatting packet timestamps.
Definition timestamp.h:41
ts_type
Format used to display packet timestamps in the summary packet list.
Definition timestamp.h:22