59# include <QSocketNotifier>
70class CaptureOptionsDialog;
85 class StratosharkMainWindow;
124 info_data_t *captureInfoData() {
return &info_data_; }
241 MatchSelectedReplace,
249 Ui::StratosharkMainWindow *main_ui_;
251 QWidget *previous_focus_;
253 QActionGroup *show_hide_actions_;
254 QActionGroup *time_display_actions_;
255 QActionGroup *time_precision_actions_;
257 QList<QPair<QAction *, bool>> freeze_actions_;
258 QPointer<QWidget> freeze_focus_;
259 QMap<QAction *, ts_type> td_actions;
260 QMap<QAction *, ts_precision> tp_actions;
265 bool capture_stopping_;
266 bool capture_filter_valid_;
269 CaptureOptionsDialog *capture_options_dialog_;
273 QPoint dragStartPosition;
289 void mergeCaptureFile();
295 void importCaptureFile();
303 bool saveCaptureFile(
capture_file *cf,
bool dont_reopen);
313 bool saveAsCaptureFile(
capture_file *cf,
bool must_support_comments =
false,
bool dont_reopen =
false);
319 void exportSelectedPackets();
335 void fileAddExtension(QString &file_name,
int file_type, ws_compression_type compression_type);
344 void initMainToolbarIcons();
347 void initShowHideMainWidgets();
350 void initTimeDisplayFormatMenu();
353 void initTimePrecisionFormatMenu();
356 void initFreezeActions();
362 void setMenusForCaptureFile(
bool force_disable =
false)
override;
368 void setMenusForCaptureInProgress(
bool capture_in_progress =
false);
371 void setMenusForCaptureStopping();
377 void setForCapturedPackets(
bool have_captured_packets);
383 void setMenusForFileSet(
bool enable_list_files);
388 void updateStyleSheet();
396 void externalMenuHelper(
ext_menu_t *menu, QMenu *subMenu,
int depth);
405 void setForCaptureInProgress(
bool capture_in_progress =
false,
bool handle_toolbars =
false, GArray *ifaces = NULL);
414 QMenu *findOrAddMenu(QMenu *parent_menu,
const QStringList &menu_parts);
420 void captureFileReadStarted(
const QString &action);
427 void addMenuActions(QList<QAction *> &actions,
int menu_group);
434 void removeMenuActions(QList<QAction *> &actions,
int menu_group);
441 void goToConversationFrame(
bool go_next,
bool start_current =
true);
448 void colorizeWithFilter(QByteArray filter,
int color_number = -1);
481 void showExtcapOptions(QString &device_name,
bool startCaptureOnClose);
503 bool openCaptureFile(QString cf_path, QString display_filter,
unsigned int type,
bool is_tempfile =
false);
575 void openLuaDebuggerDialog();
584 void applyFilter(QString new_filter = QString(),
bool force =
false)
override;
594 void onAppInitialized();
603 void initViewColorizeMenu();
606 void initConversationMenus();
615 static bool addFollowStreamMenuItem(
const void *key,
void *value,
void *userdata);
618 void initFollowStreamMenus();
625 void startCapture(QStringList);
631 void pushLiveCaptureInProgress();
634 void popLiveCaptureInProgress();
640 void loadWindowGeometry();
643 void saveWindowGeometry();
648 void mainStackChanged(
int);
651 void updateRecentCaptures();
654 void addPacketComment();
657 void editPacketComment();
660 void deletePacketComment();
663 void deleteCommentsFromPackets();
671 QString commentToMenuText(QString text,
int max_len = 40);
674 void setEditCommentsMenu();
677 void setMenusForSelectedPacket();
686 void interfaceSelectionChanged();
692 void captureFilterSyntaxChanged(
bool valid);
695 void redissectPackets();
698 void checkDisplayFilter();
701 void fieldsChanged();
704 void reloadLuaPlugins();
711 void showAccordionFrame(
AccordionFrame *show_frame,
bool toggle =
false);
717 void showColumnEditor(
int column);
720 void showPreferenceEditor();
723 void addStatsPluginsToMenu();
726 void addDynamicMenus();
729 void reloadDynamicMenus();
732 void addPluginIFStructures();
739 QMenu *searchSubMenu(QString objectName);
744 void activatePluginIFToolbar(
bool);
751 void startInterfaceCapture(
bool valid,
const QString capture_filter);
755 void applyGlobalCommandLineOptions();
761 void setFeaturesEnabled(
bool enabled =
true);
764 void on_actionNewDisplayFilterExpression_triggered();
771 void onFilterSelected(QString filterText,
bool prepare);
774 void onFilterPreferences();
780 void onFilterEdit(
int uatIndex);
796 void openStatCommandDialog(
const QString &menu_path,
const char *arg,
void *userdata);
804 void openTapParameterDialog(
const QString cfg_str,
const QString arg,
void *userdata);
807 void openTapParameterDialog();
810 void connectFileMenuActions();
816 void connectEditMenuActions();
828 void editTimeShift();
831 void editConfigurationProfiles();
836 void editTimeShiftFinished(
int);
851 void editPacketCommentFinished(
PacketCommentDialog *pc_dialog,
int result,
unsigned nComment);
854 void deleteAllPacketComments();
860 void deleteAllPacketCommentsFinished(
int result);
866 void showPreferencesDialog(QString module_name)
override;
869 void connectViewMenuActions();
875 void showHideMainWidgets(QAction *action);
881 void setTimestampFormat(QAction *action);
887 void setTimestampPrecision(QAction *action);
893 void setTimeDisplaySecondsWithHoursAndMinutes(
bool checked);
896 void editResolvedName();
899 void setNameResolution();
903 void showColoringRulesDialog();
910 void colorizeConversation(
bool create_rule =
false);
913 void colorizeActionTriggered();
919 void openPacketDialog(
bool from_reference =
false);
922 void reloadCaptureFileAsFormatOrCapture();
925 void reloadCaptureFile();
928 void connectGoMenuActions();
931 void setPreviousFocus();
934 void resetPreviousFocus();
937 void connectCaptureMenuActions();
940 void startCaptureTriggered();
943 void connectAnalyzeMenuActions();
954 void applyFieldAsColumn();
957 void filterMenuAboutToShow();
960 void applyConversationFilter();
969 void openFollowStreamDialog(
int proto_id,
unsigned stream_num,
unsigned sub_stream_num,
bool use_stream_index =
true);
975 void openFollowStreamDialog(
int proto_id);
980 void statCommandExpertInfo(
const char *,
void *);
983 void connectToolsMenuActions();
986 void connectHelpMenuActions();
989 void goToCancelClicked();
992 void goToGoClicked();
995 void goToLineEditReturnPressed();
998 void connectStatisticsMenuActions();
1001 void showResolvedAddressesDialog();
1004 void showConversationsDialog();
1007 void showEndpointsDialog();
1013 void openStatisticsTreeDialog(
const char *abbr);
1018 void statCommandIOGraph(
const char *,
void *);
1032 void showPlotDialog(
const QString &y_field = QString(),
bool filtered =
false)
override;
1035 void externalMenuItemTriggered();
1038 void on_actionContextWikiProtocolPage_triggered();
1041 void on_actionContextFilterFieldReference_triggered();
1047 void extcap_options_finished(
int result);
1054 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
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
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:222
MainWindow(QWidget *parent=nullptr)
Constructs a new MainWindow.
Definition main_window.cpp:50
CaptureFile capture_file_
Definition main_window.h:289
FileCloseContext
Context under which a capture file is being closed.
Definition main_window.h:246
@ Default
Default closing context.
Definition main_window.h:248
The main packet list view for displaying captured packets.
Definition packet_list.h:45
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
CaptureFile * captureFile()
Returns a pointer to the current capture file object.
Definition stratoshark_main_window.h:137
void setMwFileName(QString fileName)
Sets the file path shown in the main window title bar.
Definition stratoshark_main_window.cpp:2763
void layoutToolbars()
Repositions and resizes toolbars according to current layout settings.
Definition stratoshark_main_window_slots.cpp:284
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:1738
void setFunnelMenus(void)
Rebuilds the Lua funnel statistics menus from registered funnel entries.
Definition stratoshark_main_window.cpp:2724
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:271
void dragEnterEvent(QDragEnterEvent *event) override
Accepts drag-enter events for capture files dragged onto the window.
Definition stratoshark_main_window.cpp:969
bool event(QEvent *event) override
Handles window-level events such as activation changes.
Definition stratoshark_main_window.cpp:863
void captureFileOpened()
Updates UI state when a capture file is first opened.
Definition stratoshark_main_window_slots.cpp:718
friend class MainApplication
Friend class allowing access to private members.
Definition stratoshark_main_window.h:1057
void updateForUnsavedChanges()
Updates title bar, menus, and status bar to reflect unsaved changes.
Definition stratoshark_main_window.cpp:2420
void captureFileClosed()
Resets UI state after a capture file has been fully closed.
Definition stratoshark_main_window_slots.cpp:778
void updatePreferenceActions()
Refreshes menu items that reflect preference values.
Definition stratoshark_main_window_slots.cpp:335
void keyPressEvent(QKeyEvent *event) override
Handles key press events for global keyboard shortcuts.
Definition stratoshark_main_window.cpp:877
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:2758
void addInterfaceToolbar(const iface_toolbar *toolbar_entry)
Adds an interface toolbar for the given toolbar descriptor.
Definition stratoshark_main_window.cpp:752
void showCaptureOptionsDialog()
Opens the capture options dialog (interface selection, filters, etc.).
Definition stratoshark_main_window_slots.cpp:2742
~StratosharkMainWindow()
Destroys the main window and releases all associated resources.
Definition stratoshark_main_window.cpp:701
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:162
void setTitlebarForCaptureFile()
Updates the window title bar to reflect the current capture file name and state.
Definition stratoshark_main_window.cpp:2274
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:511
void updateRecentActions()
Rebuilds the File → Open Recent submenu from the recent-files list.
Definition stratoshark_main_window_slots.cpp:349
void changeEvent(QEvent *event) override
Responds to locale or palette changes by retranslating the UI.
Definition stratoshark_main_window.cpp:2425
QMenu * createPopupMenu() override
Creates and returns the window's right-click popup menu.
Definition stratoshark_main_window.cpp:723
void removeInterfaceToolbar(const char *menu_title)
Removes the interface toolbar with the given menu title.
Definition stratoshark_main_window.cpp:793
StratosharkMainWindow(QWidget *parent=nullptr)
Constructs the Stratoshark main window and initialises all menus, toolbars, and UI components.
Definition stratoshark_main_window.cpp:319
void captureFileClosing()
Updates UI state while a capture file is being closed.
Definition stratoshark_main_window_slots.cpp:763
void dropEvent(QDropEvent *event) override
Opens a capture file dropped onto the window.
Definition stratoshark_main_window.cpp:1000
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:958
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:2729
void captureFileReadFinished()
Updates UI state after a capture file has been fully read.
Definition stratoshark_main_window_slots.cpp:740
void closeEvent(QCloseEvent *event) override
Prompts the user to save unsaved changes before closing the window.
Definition stratoshark_main_window.cpp:917
bool eventFilter(QObject *obj, QEvent *event) override
Filters events on watched objects (e.g. focus changes on child widgets).
Definition stratoshark_main_window.cpp:845
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