summaryrefslogtreecommitdiffstats
path: root/ui/logray
diff options
context:
space:
mode:
Diffstat (limited to 'ui/logray')
-rw-r--r--ui/logray/CMakeLists.txt934
-rw-r--r--ui/logray/logray_application.cpp13
-rw-r--r--ui/logray/logray_en.ts62
-rw-r--r--ui/logray/logray_main.cpp167
-rw-r--r--ui/logray/logray_main_window.cpp738
-rw-r--r--ui/logray/logray_main_window.h34
-rw-r--r--ui/logray/logray_main_window.ui246
-rw-r--r--ui/logray/logray_main_window_slots.cpp495
8 files changed, 1365 insertions, 1324 deletions
diff --git a/ui/logray/CMakeLists.txt b/ui/logray/CMakeLists.txt
index 2af4cceb..9e113406 100644
--- a/ui/logray/CMakeLists.txt
+++ b/ui/logray/CMakeLists.txt
@@ -16,116 +16,123 @@ endif()
ADD_CUSTOM_CMAKE_INCLUDE()
set(WIRESHARK_WIDGET_HEADERS
- ../qt/widgets/additional_toolbar.h
- ../qt/widgets/apply_line_edit.h
- ../qt/widgets/byte_view_text.h
- ../qt/widgets/capture_filter_combo.h
- ../qt/widgets/capture_filter_edit.h
- ../qt/widgets/clickable_label.h
- ../qt/widgets/copy_from_profile_button.h
- ../qt/widgets/detachable_tabwidget.h
- ../qt/widgets/display_filter_combo.h
- ../qt/widgets/display_filter_edit.h
- ../qt/widgets/dissector_syntax_line_edit.h
- ../qt/widgets/dissector_tables_view.h
- ../qt/widgets/drag_drop_toolbar.h
- ../qt/widgets/drag_label.h
- ../qt/widgets/editor_file_dialog.h
- ../qt/widgets/elided_label.h
- ../qt/widgets/expert_info_view.h
- ../qt/widgets/export_objects_view.h
- ../qt/widgets/field_filter_edit.h
- ../qt/widgets/filter_expression_toolbar.h
- ../qt/widgets/find_line_edit.h
- ../qt/widgets/interface_toolbar_lineedit.h
- ../qt/widgets/label_stack.h
- ../qt/widgets/overlay_scroll_bar.h
- ../qt/widgets/packet_list_header.h
- ../qt/widgets/path_selection_edit.h
- ../qt/widgets/pref_module_view.h
- ../qt/widgets/profile_tree_view.h
- ../qt/widgets/range_syntax_lineedit.h
- ../qt/widgets/splash_overlay.h
- ../qt/widgets/stock_icon_tool_button.h
- ../qt/widgets/syntax_line_edit.h
- ../qt/widgets/wireless_timeline.h # Required by PacketListModel
- ../qt/widgets/tabnav_tree_view.h
- ../qt/widgets/traffic_tab.h
- ../qt/widgets/traffic_tree.h
- ../qt/widgets/traffic_types_list.h
- ../qt/widgets/wireshark_file_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/additional_toolbar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/apply_line_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/byte_view_text.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/capture_filter_combo.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/capture_filter_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/clickable_label.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/compression_group_box.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/copy_from_profile_button.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/detachable_tabwidget.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/display_filter_combo.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/display_filter_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/dissector_syntax_line_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/dissector_tables_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/drag_drop_toolbar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/drag_label.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/editor_file_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/elided_label.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/expert_info_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/field_filter_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/filter_expression_toolbar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/find_line_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/follow_stream_text.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/interface_toolbar_lineedit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/label_stack.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/overlay_scroll_bar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/packet_list_header.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/path_selection_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/pref_module_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/profile_tree_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_axis_ticker_elided.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_axis_ticker_si.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_string_legend_item.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/range_syntax_lineedit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/resize_header_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/resolved_addresses_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/rowmove_tree_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/splash_overlay.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/stock_icon_tool_button.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/syntax_line_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/wireless_timeline.h # Required by PacketListModel
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/tabnav_tree_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_tab.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_tree.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_types_list.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/wireshark_file_dialog.h
)
set (LOGRAY_WIDGET_HEADERS ${WIRESHARK_WIDGET_HEADERS})
set(WIRESHARK_3RD_PARTY_WIDGET_HEADERS
- ../qt/widgets/qcustomplot.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcustomplot.h
)
set (LOGRAY_3RD_PARTY_WIDGET_HEADERS ${WIRESHARK_3RD_PARTY_WIDGET_HEADERS})
set(WIRESHARK_MANAGER_HEADERS
- ../qt/manager/preference_manager.h
- ../qt/manager/wireshark_preference.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/manager/preference_manager.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/manager/wireshark_preference.h
)
set (LOGRAY_MANAGER_HEADERS ${WIRESHARK_MANAGER_HEADERS})
set(WIRESHARK_UTILS_HEADERS
- ../qt/utils/color_utils.h
- ../qt/utils/data_printer.h
- ../qt/utils/field_information.h
- ../qt/utils/frame_information.h
- ../qt/utils/idata_printable.h
- ../qt/utils/proto_node.h
- ../qt/utils/qt_ui_utils.h
- ../qt/utils/stock_icon.h
- ../qt/utils/tango_colors.h
- ../qt/utils/variant_pointer.h
- ../qt/utils/wireshark_mime_data.h
- ../qt/utils/wireshark_zip_helper.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/color_utils.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/data_printer.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/field_information.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/frame_information.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/idata_printable.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/profile_switcher.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/proto_node.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/qt_ui_utils.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/stock_icon.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/tango_colors.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/variant_pointer.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/wireshark_mime_data.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/wireshark_zip_helper.h
)
set (LOGRAY_UTILS_HEADERS ${WIRESHARK_UTILS_HEADERS})
set(WIRESHARK_MODEL_HEADERS
- ../qt/models/astringlist_list_model.h
- ../qt/models/atap_data_model.h
- ../qt/models/cache_proxy_model.h
- ../qt/models/coloring_rules_delegate.h
- ../qt/models/coloring_rules_model.h
- ../qt/models/column_list_model.h
- ../qt/models/decode_as_delegate.h
- ../qt/models/decode_as_model.h
- ../qt/models/dissector_tables_model.h
- ../qt/models/enabled_protocols_model.h
- ../qt/models/expert_info_model.h
- ../qt/models/expert_info_proxy_model.h
- ../qt/models/export_objects_model.h
- ../qt/models/fileset_entry_model.h
- ../qt/models/filter_list_model.h
- ../qt/models/info_proxy_model.h
- ../qt/models/interface_sort_filter_model.h
- ../qt/models/interface_tree_cache_model.h
- ../qt/models/interface_tree_model.h
- ../qt/models/numeric_value_chooser_delegate.h
- ../qt/models/packet_list_model.h
- ../qt/models/packet_list_record.h
- ../qt/models/path_selection_delegate.h
- ../qt/models/percent_bar_delegate.h
- ../qt/models/pref_delegate.h
- ../qt/models/pref_models.h
- ../qt/models/profile_model.h
- ../qt/models/proto_tree_model.h
- ../qt/models/related_packet_delegate.h
- ../qt/models/resolved_addresses_models.h
- ../qt/models/sparkline_delegate.h
- ../qt/models/supported_protocols_model.h
- ../qt/models/timeline_delegate.h
- ../qt/models/tree_model_helpers.h
- ../qt/models/uat_delegate.h
- ../qt/models/uat_model.h
- ../qt/models/url_link_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/astringlist_list_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/atap_data_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/cache_proxy_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/coloring_rules_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/coloring_rules_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/column_list_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/decode_as_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/decode_as_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/dissector_tables_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/enabled_protocols_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/expert_info_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/expert_info_proxy_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/fileset_entry_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/filter_list_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/info_proxy_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_sort_filter_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_tree_cache_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_tree_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/numeric_value_chooser_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/packet_list_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/packet_list_record.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/path_selection_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/percent_bar_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/pref_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/pref_models.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/profile_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/proto_tree_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/related_packet_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/resolved_addresses_models.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/sparkline_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/supported_protocols_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/timeline_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/tree_model_helpers.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/uat_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/uat_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/url_link_delegate.h
)
set (LOGRAY_MODEL_HEADERS ${WIRESHARK_MODEL_HEADERS})
@@ -133,108 +140,111 @@ set (LOGRAY_MODEL_HEADERS ${WIRESHARK_MODEL_HEADERS})
# All .h files which inherit from QObject aka which use the Q_OBJECT macro
# need to go here.
set(WIRESHARK_QT_HEADERS
- ../qt/about_dialog.h
- ../qt/accordion_frame.h
- ../qt/address_editor_frame.h
- ../qt/byte_view_tab.h
- ../qt/capture_file_dialog.h
- ../qt/capture_file_properties_dialog.h
- ../qt/capture_file.h
- ../qt/capture_filter_syntax_worker.h
- ../qt/capture_options_dialog.h
- ../qt/capture_preferences_frame.h
- ../qt/coloring_rules_dialog.h
- ../qt/column_editor_frame.h
- ../qt/column_preferences_frame.h
- ../qt/compiled_filter_output.h
- ../qt/conversation_colorize_action.h
- ../qt/conversation_dialog.h
- ../qt/conversation_hash_tables_dialog.h
- ../qt/decode_as_dialog.h
- ../qt/display_filter_expression_dialog.h
- ../qt/dissector_tables_dialog.h
- ../qt/enabled_protocols_dialog.h
- ../qt/endpoint_dialog.h
- ../qt/expert_info_dialog.h
- ../qt/export_dissection_dialog.h
- ../qt/export_object_action.h
- ../qt/export_object_dialog.h
- ../qt/export_pdu_dialog.h
- ../qt/extcap_argument_file.h
- ../qt/extcap_argument_multiselect.h
- ../qt/extcap_argument.h
- ../qt/extcap_options_dialog.h
- ../qt/file_set_dialog.h
- ../qt/filter_action.h
- ../qt/filter_dialog.h
- ../qt/filter_dialog.h
- ../qt/filter_expression_frame.h
- ../qt/follow_stream_action.h
- ../qt/font_color_preferences_frame.h
- ../qt/funnel_statistics.h
- ../qt/funnel_string_dialog.h
- ../qt/funnel_text_dialog.h
- ../qt/geometry_state_dialog.h
- ../qt/glib_mainloop_on_qeventloop.h
- ../qt/import_text_dialog.h
- ../qt/interface_frame.h
- ../qt/interface_toolbar_reader.h
- ../qt/interface_toolbar.h
- ../qt/io_console_dialog.h
- ../qt/io_graph_dialog.h
- ../qt/layout_preferences_frame.h
- ../qt/main_application.h
- ../qt/main_status_bar.h
- ../qt/main_window_preferences_frame.h
- ../qt/main_window.h
- ../qt/manage_interfaces_dialog.h
- ../qt/module_preferences_scroll_area.h
- ../qt/packet_comment_dialog.h
- ../qt/packet_diagram.h
- ../qt/packet_dialog.h
- ../qt/packet_format_group_box.h
- ../qt/packet_list.h
- ../qt/packet_range_group_box.h
- ../qt/preference_editor_frame.h
- ../qt/preferences_dialog.h
- ../qt/print_dialog.h
- ../qt/profile_dialog.h
- ../qt/progress_frame.h
- ../qt/proto_tree.h
- ../qt/protocol_hierarchy_dialog.h
- ../qt/protocol_preferences_menu.h
- ../qt/recent_file_status.h
- ../qt/resolved_addresses_dialog.h
- ../qt/response_time_delay_dialog.h
- ../qt/rsa_keys_frame.h
- ../qt/search_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/about_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/accordion_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/address_editor_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/byte_view_tab.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_comment_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_properties_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_filter_syntax_worker.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_options_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/coloring_rules_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_editor_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/compiled_filter_output.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_colorize_action.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_hash_tables_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/decode_as_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/display_filter_expression_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/dissector_tables_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/enabled_protocols_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/endpoint_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/expert_info_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/export_dissection_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument_file.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument_multiselect.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_options_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/file_set_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_action.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_expression_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_action.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/font_color_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_statistics.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_string_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_text_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/geometry_state_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/glib_mainloop_on_qeventloop.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/import_text_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar_reader.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_console_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_action.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/layout_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_application.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_status_bar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/manage_interfaces_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/module_preferences_scroll_area.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_comment_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_format_group_box.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_list.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_range_group_box.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/preference_editor_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/preferences_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/print_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/profile_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/progress_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/proto_tree.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_hierarchy_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_preferences_menu.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/recent_file_status.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/resolved_addresses_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/response_time_delay_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/rsa_keys_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/search_frame.h
# XXX Depends on RTP Stream Dialog
- # ../qt/sequence_diagram.h
- # ../qt/sequence_dialog.h
- ../qt/show_packet_bytes_dialog.h
- ../qt/simple_statistics_dialog.h
- ../qt/stats_tree_dialog.h
- ../qt/supported_protocols_dialog.h
- ../qt/tabnav_tree_widget.h
- ../qt/tap_parameter_dialog.h
- ../qt/tcp_stream_dialog.h
- ../qt/time_shift_dialog.h
- ../qt/traffic_table_dialog.h
- ../qt/uat_dialog.h
- ../qt/uat_frame.h
- ../qt/welcome_page.h
- ../qt/wireshark_dialog.h
- ../qt/${WIRESHARK_CUSTOM_QT_HEADERS}
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_diagram.h
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/show_packet_bytes_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/simple_statistics_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/stats_tree_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/supported_protocols_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/tabnav_tree_widget.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/tap_parameter_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/tcp_stream_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/time_shift_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/traffic_table_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/welcome_page.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_dialog.h
)
+if(WIRESHARK_CUSTOM_QT_HEADERS)
+ list(APPEND WIRESHARK_QT_HEADERS
+ ${CMAKE_SOURCE_DIR}/ui/qt/${WIRESHARK_CUSTOM_QT_HEADERS}
+ )
+endif()
+
if(ENABLE_PCAP)
list(APPEND WIRESHARK_QT_HEADERS
- ../qt/capture_info_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_info_dialog.h
)
if(HAVE_PCAP_REMOTE)
list(APPEND WIRESHARK_QT_HEADERS
- ../qt/remote_capture_dialog.h
- ../qt/remote_settings_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_capture_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_settings_dialog.h
)
endif()
endif()
@@ -246,216 +256,228 @@ set (LOGRAY_QT_HEADERS
)
set(WIRESHARK_WIDGET_SRCS
- ../qt/widgets/additional_toolbar.cpp
- ../qt/widgets/apply_line_edit.cpp
- ../qt/widgets/byte_view_text.cpp
- ../qt/widgets/capture_filter_combo.cpp
- ../qt/widgets/capture_filter_edit.cpp
- ../qt/widgets/clickable_label.cpp
- ../qt/widgets/copy_from_profile_button.cpp
- ../qt/widgets/detachable_tabwidget.cpp
- ../qt/widgets/display_filter_combo.cpp
- ../qt/widgets/display_filter_edit.cpp
- ../qt/widgets/dissector_syntax_line_edit.cpp
- ../qt/widgets/dissector_tables_view.cpp
- ../qt/widgets/drag_drop_toolbar.cpp
- ../qt/widgets/drag_label.cpp
- ../qt/widgets/editor_file_dialog.cpp
- ../qt/widgets/elided_label.cpp
- ../qt/widgets/expert_info_view.cpp
- ../qt/widgets/export_objects_view.cpp
- ../qt/widgets/field_filter_edit.cpp
- ../qt/widgets/filter_expression_toolbar.cpp
- ../qt/widgets/find_line_edit.cpp
- ../qt/widgets/interface_toolbar_lineedit.cpp
- ../qt/widgets/label_stack.cpp
- ../qt/widgets/overlay_scroll_bar.cpp
- ../qt/widgets/packet_list_header.cpp
- ../qt/widgets/path_selection_edit.cpp
- ../qt/widgets/pref_module_view.cpp
- ../qt/widgets/profile_tree_view.cpp
- ../qt/widgets/range_syntax_lineedit.cpp
- ../qt/widgets/splash_overlay.cpp
- ../qt/widgets/stock_icon_tool_button.cpp
- ../qt/widgets/syntax_line_edit.cpp
- ../qt/widgets/wireless_timeline.cpp # Required by PacketListModel
- ../qt/widgets/tabnav_tree_view.cpp
- ../qt/widgets/traffic_tab.cpp
- ../qt/widgets/traffic_tree.cpp
- ../qt/widgets/traffic_types_list.cpp
- ../qt/widgets/wireshark_file_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/additional_toolbar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/apply_line_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/byte_view_text.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/capture_filter_combo.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/capture_filter_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/clickable_label.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/compression_group_box.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/copy_from_profile_button.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/detachable_tabwidget.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/display_filter_combo.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/display_filter_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/dissector_syntax_line_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/dissector_tables_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/drag_drop_toolbar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/drag_label.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/editor_file_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/elided_label.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/expert_info_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/field_filter_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/filter_expression_toolbar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/find_line_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/follow_stream_text.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/interface_toolbar_lineedit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/label_stack.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/overlay_scroll_bar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/packet_list_header.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/path_selection_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/pref_module_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/profile_tree_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_axis_ticker_elided.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_axis_ticker_si.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_string_legend_item.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/range_syntax_lineedit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/resize_header_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/resolved_addresses_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/rowmove_tree_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/splash_overlay.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/stock_icon_tool_button.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/syntax_line_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/wireless_timeline.cpp # Required by PacketListModel
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/tabnav_tree_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_tab.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_tree.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_types_list.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/wireshark_file_dialog.cpp
)
set (LOGRAY_WIDGET_SRCS ${WIRESHARK_WIDGET_SRCS})
set(WIRESHARK_3RD_PARTY_WIDGET_SRCS
- ../qt/widgets/qcustomplot.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcustomplot.cpp
)
set (LOGRAY_3RD_PARTY_WIDGET_SRCS ${WIRESHARK_3RD_PARTY_WIDGET_SRCS})
set(WIRESHARK_MANAGER_SRCS
- ../qt/manager/preference_manager.cpp
- ../qt/manager/wireshark_preference.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/manager/preference_manager.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/manager/wireshark_preference.cpp
)
set (LOGRAY_MANAGER_SRCS ${WIRESHARK_MANAGER_SRCS})
set(WIRESHARK_UTILS_SRCS
- ../qt/utils/color_utils.cpp
- ../qt/utils/data_printer.cpp
- ../qt/utils/field_information.cpp
- ../qt/utils/frame_information.cpp
- ../qt/utils/proto_node.cpp
- ../qt/utils/qt_ui_utils.cpp
- ../qt/utils/stock_icon.cpp
- ../qt/utils/wireshark_mime_data.cpp
- ../qt/utils/wireshark_zip_helper.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/color_utils.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/data_printer.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/field_information.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/frame_information.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/profile_switcher.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/proto_node.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/qt_ui_utils.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/stock_icon.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/wireshark_mime_data.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/wireshark_zip_helper.cpp
)
set (LOGRAY_UTILS_SRCS ${WIRESHARK_UTILS_SRCS})
set(WIRESHARK_MODEL_SRCS
- ../qt/models/astringlist_list_model.cpp
- ../qt/models/atap_data_model.cpp
- ../qt/models/cache_proxy_model.cpp
- ../qt/models/coloring_rules_delegate.cpp
- ../qt/models/coloring_rules_model.cpp
- ../qt/models/column_list_model.cpp
- ../qt/models/decode_as_delegate.cpp
- ../qt/models/decode_as_model.cpp
- ../qt/models/dissector_tables_model.cpp
- ../qt/models/enabled_protocols_model.cpp
- ../qt/models/expert_info_model.cpp
- ../qt/models/expert_info_proxy_model.cpp
- ../qt/models/export_objects_model.cpp
- ../qt/models/fileset_entry_model.cpp
- ../qt/models/filter_list_model.cpp
- ../qt/models/info_proxy_model.cpp
- ../qt/models/interface_sort_filter_model.cpp
- ../qt/models/interface_tree_cache_model.cpp
- ../qt/models/interface_tree_model.cpp
- ../qt/models/numeric_value_chooser_delegate.cpp
- ../qt/models/packet_list_model.cpp
- ../qt/models/packet_list_record.cpp
- ../qt/models/path_selection_delegate.cpp
- ../qt/models/percent_bar_delegate.cpp
- ../qt/models/pref_delegate.cpp
- ../qt/models/pref_models.cpp
- ../qt/models/profile_model.cpp
- ../qt/models/proto_tree_model.cpp
- ../qt/models/related_packet_delegate.cpp
- ../qt/models/resolved_addresses_models.cpp
- ../qt/models/sparkline_delegate.cpp
- ../qt/models/supported_protocols_model.cpp
- ../qt/models/timeline_delegate.cpp
- ../qt/models/uat_delegate.cpp
- ../qt/models/uat_model.cpp
- ../qt/models/url_link_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/astringlist_list_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/atap_data_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/cache_proxy_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/coloring_rules_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/coloring_rules_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/column_list_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/decode_as_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/decode_as_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/dissector_tables_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/enabled_protocols_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/expert_info_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/expert_info_proxy_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/fileset_entry_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/filter_list_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/info_proxy_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_sort_filter_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_tree_cache_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_tree_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/numeric_value_chooser_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/packet_list_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/packet_list_record.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/path_selection_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/percent_bar_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/pref_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/pref_models.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/profile_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/proto_tree_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/related_packet_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/resolved_addresses_models.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/sparkline_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/supported_protocols_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/timeline_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/uat_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/uat_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/url_link_delegate.cpp
)
set (LOGRAY_MODEL_SRCS ${WIRESHARK_MODEL_SRCS})
set(WIRESHARK_QT_SRC
- ../qt/about_dialog.cpp
- ../qt/accordion_frame.cpp
- ../qt/address_editor_frame.cpp
- ../qt/byte_view_tab.cpp
- ../qt/capture_file_dialog.cpp
- ../qt/capture_file_properties_dialog.cpp
- ../qt/capture_file.cpp
- ../qt/capture_filter_syntax_worker.cpp
- ../qt/capture_options_dialog.cpp
- ../qt/capture_preferences_frame.cpp
- ../qt/coloring_rules_dialog.cpp
- ../qt/column_editor_frame.cpp
- ../qt/column_preferences_frame.cpp
- ../qt/compiled_filter_output.cpp
- ../qt/conversation_colorize_action.cpp
- ../qt/conversation_dialog.cpp
- ../qt/conversation_hash_tables_dialog.cpp
- ../qt/decode_as_dialog.cpp
- ../qt/display_filter_expression_dialog.cpp
- ../qt/dissector_tables_dialog.cpp
- ../qt/enabled_protocols_dialog.cpp
- ../qt/endpoint_dialog.cpp
- ../qt/export_dissection_dialog.cpp
- ../qt/export_object_action.cpp
- ../qt/export_object_dialog.cpp
- ../qt/export_pdu_dialog.cpp
- ../qt/extcap_argument_file.cpp
- ../qt/extcap_argument_multiselect.cpp
- ../qt/extcap_argument.cpp
- ../qt/extcap_options_dialog.cpp
- ../qt/file_set_dialog.cpp
- ../qt/filter_action.cpp
- ../qt/filter_dialog.cpp
- ../qt/filter_expression_frame.cpp
- ../qt/follow_stream_action.cpp
- ../qt/font_color_preferences_frame.cpp
- ../qt/funnel_string_dialog.cpp
- ../qt/funnel_text_dialog.cpp
- ../qt/geometry_state_dialog.cpp
- ../qt/glib_mainloop_on_qeventloop.cpp
- ../qt/import_text_dialog.cpp
- ../qt/interface_frame.cpp
- ../qt/interface_toolbar_reader.cpp
- ../qt/interface_toolbar.cpp
- ../qt/io_console_dialog.cpp
- ../qt/layout_preferences_frame.cpp
- ../qt/main_application.cpp
- ../qt/main_status_bar.cpp
- ../qt/main_window_layout.cpp
- ../qt/main_window_preferences_frame.cpp
- ../qt/main_window.cpp
- ../qt/manage_interfaces_dialog.cpp
- ../qt/module_preferences_scroll_area.cpp
- ../qt/packet_comment_dialog.cpp
- ../qt/packet_diagram.cpp
- ../qt/packet_dialog.cpp
- ../qt/packet_format_group_box.cpp
- ../qt/packet_list.cpp
- ../qt/packet_range_group_box.cpp
- ../qt/preference_editor_frame.cpp
- ../qt/preferences_dialog.cpp
- ../qt/print_dialog.cpp
- ../qt/profile_dialog.cpp
- ../qt/progress_frame.cpp
- ../qt/proto_tree.cpp
- ../qt/protocol_hierarchy_dialog.cpp
- ../qt/protocol_preferences_menu.cpp
- ../qt/recent_file_status.cpp
- ../qt/resolved_addresses_dialog.cpp
- ../qt/response_time_delay_dialog.cpp
- ../qt/rsa_keys_frame.cpp
- ../qt/search_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/about_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/accordion_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/address_editor_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/byte_view_tab.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_comment_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_properties_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_filter_syntax_worker.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_options_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/coloring_rules_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_editor_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/compiled_filter_output.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_colorize_action.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_hash_tables_dialog.cpp
+ # XXX Required by packet list
+ ${CMAKE_SOURCE_DIR}/ui/qt/decode_as_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/display_filter_expression_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/dissector_tables_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/enabled_protocols_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/endpoint_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/export_dissection_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument_file.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument_multiselect.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_options_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/file_set_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_action.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_expression_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_action.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/font_color_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_string_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_text_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/geometry_state_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/glib_mainloop_on_qeventloop.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/import_text_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar_reader.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_console_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_action.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/layout_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_application.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_status_bar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window_layout.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/manage_interfaces_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/module_preferences_scroll_area.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_comment_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_format_group_box.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_list.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_range_group_box.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/preference_editor_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/preferences_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/print_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/profile_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/progress_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/proto_tree.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_hierarchy_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_preferences_menu.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/recent_file_status.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/resolved_addresses_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/response_time_delay_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/rsa_keys_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/search_frame.cpp
# XXX Depends on RTP Stream Dialog
- # ../qt/sequence_diagram.cpp
- # ../qt/sequence_dialog.cpp
- ../qt/show_packet_bytes_dialog.cpp
- ../qt/simple_dialog.cpp
- ../qt/simple_statistics_dialog.cpp
- ../qt/supported_protocols_dialog.cpp
- ../qt/tabnav_tree_widget.cpp
- ../qt/tap_parameter_dialog.cpp
- ../qt/tcp_stream_dialog.cpp
- ../qt/time_shift_dialog.cpp
- ../qt/traffic_table_dialog.cpp
- ../qt/uat_dialog.cpp
- ../qt/uat_frame.cpp
- ../qt/welcome_page.cpp
- ../qt/wireshark_dialog.cpp
- ../qt/${WIRESHARK_CUSTOM_QT_SRCS}
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_diagram.cpp
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/show_packet_bytes_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/simple_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/simple_statistics_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/supported_protocols_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/tabnav_tree_widget.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/tap_parameter_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/tcp_stream_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/time_shift_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/traffic_table_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/welcome_page.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_dialog.cpp
)
+if(WIRESHARK_CUSTOM_QT_SRCS)
+ list(APPEND WIRESHARK_QT_SRC
+ ${CMAKE_SOURCE_DIR}/ui/qt/${WIRESHARK_CUSTOM_QT_SRCS}
+ )
+endif()
+
if(ENABLE_PCAP)
list(APPEND WIRESHARK_QT_SRC
- ../qt/capture_info_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_info_dialog.cpp
)
if(HAVE_PCAP_REMOTE)
list(APPEND WIRESHARK_QT_SRC
- ../qt/remote_capture_dialog.cpp
- ../qt/remote_settings_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_capture_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_settings_dialog.cpp
)
endif()
endif()
@@ -468,10 +490,10 @@ set (LOGRAY_QT_SRC
${WIRESHARK_QT_SRC})
set(WIRESHARK_QT_TAP_SRC
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt/expert_info_dialog.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt/funnel_statistics.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt/io_graph_dialog.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt/stats_tree_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/expert_info_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_statistics.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/stats_tree_dialog.cpp
${WIRESHARK_CUSTOM_TAP_SRC}
)
@@ -485,71 +507,71 @@ set(WIRESHARK_QT_FILES
set (LOGRAY_QT_FILES ${WIRESHARK_QT_FILES})
set(WIRESHARK_QT_UI
- ../qt/about_dialog.ui
- ../qt/address_editor_frame.ui
- ../qt/capture_file_properties_dialog.ui
- ../qt/capture_info_dialog.ui
- ../qt/capture_options_dialog.ui
- ../qt/capture_preferences_frame.ui
- ../qt/coloring_rules_dialog.ui
- ../qt/column_editor_frame.ui
- ../qt/column_preferences_frame.ui
- ../qt/compiled_filter_output.ui
- ../qt/conversation_hash_tables_dialog.ui
- ../qt/decode_as_dialog.ui
- ../qt/display_filter_expression_dialog.ui
- ../qt/dissector_tables_dialog.ui
- ../qt/enabled_protocols_dialog.ui
- ../qt/expert_info_dialog.ui
- ../qt/export_object_dialog.ui
- ../qt/export_pdu_dialog.ui
- ../qt/extcap_options_dialog.ui
- ../qt/file_set_dialog.ui
- ../qt/filter_dialog.ui
- ../qt/filter_expression_frame.ui
- ../qt/font_color_preferences_frame.ui
- ../qt/funnel_string_dialog.ui
- ../qt/funnel_text_dialog.ui
- ../qt/import_text_dialog.ui
- ../qt/interface_frame.ui
- ../qt/interface_toolbar.ui
- ../qt/io_console_dialog.ui
- ../qt/io_graph_dialog.ui
- ../qt/layout_preferences_frame.ui
- ../qt/main_window_preferences_frame.ui
- ../qt/manage_interfaces_dialog.ui
- ../qt/module_preferences_scroll_area.ui
- ../qt/packet_comment_dialog.ui
- ../qt/packet_dialog.ui
- ../qt/packet_format_group_box.ui
- ../qt/packet_range_group_box.ui
- ../qt/preference_editor_frame.ui
- ../qt/preferences_dialog.ui
- ../qt/print_dialog.ui
- ../qt/profile_dialog.ui
- ../qt/progress_frame.ui
- ../qt/protocol_hierarchy_dialog.ui
- ../qt/resolved_addresses_dialog.ui
- ../qt/rsa_keys_frame.ui
- ../qt/search_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/about_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/address_editor_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_comment_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_properties_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_info_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_options_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/coloring_rules_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_editor_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/compiled_filter_output.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_hash_tables_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/decode_as_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/display_filter_expression_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/dissector_tables_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/enabled_protocols_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/expert_info_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_options_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/file_set_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_expression_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/font_color_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_string_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_text_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/import_text_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_console_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/layout_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/manage_interfaces_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/module_preferences_scroll_area.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_comment_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_format_group_box.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_range_group_box.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/preference_editor_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/preferences_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/print_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/profile_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/progress_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_hierarchy_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/resolved_addresses_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/rsa_keys_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/search_frame.ui
# XXX Depends on RTP Stream Dialog
- # ../qt/sequence_dialog.ui
- ../qt/show_packet_bytes_dialog.ui
- ../qt/supported_protocols_dialog.ui
- ../qt/tap_parameter_dialog.ui
- ../qt/tcp_stream_dialog.ui
- ../qt/time_shift_dialog.ui
- ../qt/traffic_table_dialog.ui
- ../qt/uat_dialog.ui
- ../qt/uat_frame.ui
- ../qt/welcome_page.ui
- ../qt/widgets/splash_overlay.ui
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/show_packet_bytes_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/supported_protocols_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/tap_parameter_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/tcp_stream_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/time_shift_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/traffic_table_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/welcome_page.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/splash_overlay.ui
)
if(HAVE_PCAP_REMOTE)
list(APPEND WIRESHARK_QT_UI
- ../qt/remote_capture_dialog.ui
- ../qt/remote_settings_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_capture_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_settings_dialog.ui
)
endif()
@@ -559,18 +581,18 @@ set (LOGRAY_QT_UI
)
set(WIRESHARK_QT_TS
- ../qt/wireshark_de.ts
- ../qt/wireshark_en.ts # lupdate -pluralonly
- ../qt/wireshark_es.ts
- ../qt/wireshark_fr.ts
- ../qt/wireshark_it.ts
- ../qt/wireshark_ja_JP.ts
- ../qt/wireshark_pl.ts
- ../qt/wireshark_ru.ts
- ../qt/wireshark_sv.ts
- ../qt/wireshark_tr_TR.ts
- ../qt/wireshark_uk.ts
- ../qt/wireshark_zh_CN.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_de.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_en.ts # lupdate -pluralonly
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_es.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_fr.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_it.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_ja_JP.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_pl.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_ru.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_sv.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_tr_TR.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_uk.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_zh_CN.ts
)
set(LOGRAY_QT_TS
@@ -583,15 +605,35 @@ foreach(_file ${LOGRAY_QT_TS})
set(_qresource_qm "${_qresource}.qm")
set(i18n_qresource "${i18n_qresource}\n <file>${_qresource_qm}</file>")
endforeach()
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/i18n.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc)
+configure_file(i18n.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/authors.qrc"
+"<RCC>\n"
+" <qresource prefix=\"/about\">\n"
+" <file compress-algo=\"zstd\">authors.csv</file>\n"
+" </qresource>\n"
+"</RCC>\n"
+)
+
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/authors.csv
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-authors-csv.py
+ < ${CMAKE_SOURCE_DIR}/AUTHORS
+ > ${CMAKE_CURRENT_BINARY_DIR}/authors.csv
+ DEPENDS
+ ${CMAKE_SOURCE_DIR}/tools/make-authors-csv.py
+ ${CMAKE_SOURCE_DIR}/AUTHORS
+)
set(LOGRAY_QT_QRC
- ../../resources/about.qrc
- ../../resources/languages/languages.qrc
- ../../resources/layout.qrc
- ../../resources/lricon.qrc
- ../../resources/stock_icons.qrc
+ ${CMAKE_SOURCE_DIR}/resources/about.qrc
+ ${CMAKE_SOURCE_DIR}/resources/languages/languages.qrc
+ ${CMAKE_SOURCE_DIR}/resources/layout.qrc
+ ${CMAKE_SOURCE_DIR}/resources/lricon.qrc
+ ${CMAKE_SOURCE_DIR}/resources/stock_icons.qrc
${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc
+ ${CMAKE_CURRENT_BINARY_DIR}/authors.qrc
+ ${CMAKE_CURRENT_BINARY_DIR}/authors.csv
)
if(NOT Qt${qtver}Widgets_VERSION VERSION_LESS "5.9")
@@ -688,13 +730,14 @@ target_include_directories(ui_logray
${QT5_INCLUDE_DIRS}
${GCRYPT_INCLUDE_DIRS}
${MINIZIP_INCLUDE_DIRS}
+ ${MINIZIPNG_INCLUDE_DIRS}
${PCAP_INCLUDE_DIRS}
${SPEEXDSP_INCLUDE_DIRS}
${WINSPARKLE_INCLUDE_DIRS}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt
+ ${CMAKE_SOURCE_DIR}/ui/qt
)
if(USE_qt6)
@@ -707,6 +750,9 @@ if(USE_qt6)
if(Qt6Multimedia_FOUND)
target_link_libraries(ui_logray PUBLIC Qt6::Multimedia)
endif()
+ if(Qt6DBus_FOUND)
+ target_link_libraries(ui_logray PUBLIC Qt6::DBus)
+ endif()
endif()
target_compile_definitions(ui_logray
diff --git a/ui/logray/logray_application.cpp b/ui/logray/logray_application.cpp
index 76106c42..ab0bc722 100644
--- a/ui/logray/logray_application.cpp
+++ b/ui/logray/logray_application.cpp
@@ -13,7 +13,7 @@
#include "ui/iface_lists.h"
#include "ui/ws_ui_util.h"
-LograyApplication *lwApp = NULL;
+LograyApplication *lwApp;
LograyApplication::LograyApplication(int &argc, char **argv) :
MainApplication(argc, argv)
@@ -34,8 +34,17 @@ void LograyApplication::refreshLocalInterfaces()
extcap_clear_interfaces();
#ifdef HAVE_LIBPCAP
+ free_interface_list(cached_if_list_);
+ cached_if_list_ = NULL;
+
GList * filter_list = NULL;
- filter_list = g_list_append(filter_list, GUINT_TO_POINTER((guint) IF_EXTCAP));
+ filter_list = g_list_append(filter_list, GUINT_TO_POINTER((unsigned) IF_EXTCAP));
+
+ // We don't need to (re)start the stats (which calls dumpcap) because
+ // Logray only uses extcaps now. If that changes, do the below instead.
+#if 0
+ emit scanLocalInterfaces(filter_list);
+#endif
scan_local_interfaces_filtered(filter_list, main_window_update);
diff --git a/ui/logray/logray_en.ts b/ui/logray/logray_en.ts
index 1b989309..69c98095 100644
--- a/ui/logray/logray_en.ts
+++ b/ui/logray/logray_en.ts
@@ -12,11 +12,11 @@
<context>
<name>AboutDialog</name>
<message>
- <source>About Wireshark</source>
+ <source>About Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireshark</source>
+ <source>Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -860,12 +860,12 @@
</message>
<message>
<source>Open Capture File</source>
- <oldsource>Wireshark: Open Capture File</oldsource>
+ <oldsource>Logray: Open Capture File</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save Capture File As</source>
- <oldsource>Wireshark: Save Capture File As</oldsource>
+ <oldsource>Logray: Save Capture File As</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
@@ -874,7 +874,7 @@
</message>
<message>
<source>Export Specified Packets</source>
- <oldsource>Wireshark: Export Specified Packets</oldsource>
+ <oldsource>Logray: Export Specified Packets</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
@@ -883,7 +883,7 @@
</message>
<message>
<source>Merge Capture File</source>
- <oldsource>Wireshark: Merge Capture File</oldsource>
+ <oldsource>Logray: Merge Capture File</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
@@ -891,7 +891,7 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Please report this as a Wireshark issue at https://gitlab.com/wireshark/wireshark/-/issues.</source>
+ <source>Please report this as a Logray issue at https://gitlab.com/wireshark/wireshark/-/issues.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1128,7 +1128,7 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Created by Wireshark %1
+ <source>Created by Logray %1
</source>
<translation type="unfinished"></translation>
@@ -1672,7 +1672,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireshark doesn&apos;t recognize one or more of your coloring rules. They have been disabled.</source>
+ <source>Logray doesn&apos;t recognize one or more of your coloring rules. They have been disabled.</source>
<translation type="unfinished"></translation>
</message>
</context>
@@ -2469,7 +2469,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>ExportDissectionDialog</name>
<message>
<source>Export Packet Dissections</source>
- <oldsource>Wireshark: Export Packet Dissections</oldsource>
+ <oldsource>Logray: Export Packet Dissections</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3789,7 +3789,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireshark I/O Graphs: %1</source>
+ <source>Logray I/O Graphs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4148,7 +4148,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Import a standard hex dump as exported by Wireshark</source>
+ <source>Import a standard hex dump as exported by Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4559,7 +4559,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>This version of Wireshark was built without packet capture support.</source>
+ <source>This version of Logray was built without packet capture support.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6073,7 +6073,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>MainWindow</name>
<message>
- <source>Wireshark</source>
+ <source>Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6197,7 +6197,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Quit Wireshark</source>
+ <source>Quit Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6225,7 +6225,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireshark Filter</source>
+ <source>Logray Filter</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6269,7 +6269,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;About Wireshark</source>
+ <source>&amp;About Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6704,7 +6704,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Manage Wireshark&apos;s preferences</source>
+ <source>Manage Logray&apos;s preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -7700,7 +7700,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Please report this as a Wireshark issue at https://gitlab.com/wireshark/wireshark/-/issues.</source>
+ <source>Please report this as a Logray issue at https://gitlab.com/wireshark/wireshark/-/issues.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -7734,7 +7734,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
+ <source>There is no &quot;rtp.ssrc&quot; field in this version of Logray.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -7760,7 +7760,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>The Wireshark Network Analyzer</source>
+ <source>The Logray System Call and Log Analyzer</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -7882,7 +7882,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Please wait while Wireshark is initializing…</source>
+ <source>Please wait while Logray is initializing…</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -8093,15 +8093,15 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>This version of Wireshark does not save pipe settings.</source>
+ <source>This version of Logray does not save pipe settings.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>This version of Wireshark does not save remote settings.</source>
+ <source>This version of Logray does not save remote settings.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>This version of Wireshark does not support remote interfaces.</source>
+ <source>This version of Logray does not support remote interfaces.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -11001,7 +11001,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>SCTPAllAssocsDialog</name>
<message>
- <source>Wireshark - SCTP Associations</source>
+ <source>Logray - SCTP Associations</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -11288,7 +11288,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>SCTPAssocAnalyseDialog</name>
<message>
- <source>Wireshark - Analyse Association</source>
+ <source>Logray - Analyse Association</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -13423,7 +13423,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:large;&quot;&gt;Welcome to Wireshark&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:large;&quot;&gt;Welcome to Logray&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -13520,11 +13520,11 @@ a:hover {
</translation>
</message>
<message>
- <source>You are sniffing the glue that holds the Internet together using Wireshark </source>
+ <source>You are sniffing the glue that holds the Internet together using Logray </source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>You are running Wireshark </source>
+ <source>You are running Logray </source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -13587,7 +13587,7 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireless controls are not supported in this version of Wireshark.</source>
+ <source>Wireless controls are not supported in this version of Logray.</source>
<translation type="unfinished"></translation>
</message>
<message>
diff --git a/ui/logray/logray_main.cpp b/ui/logray/logray_main.cpp
index 2b754402..ff81b546 100644
--- a/ui/logray/logray_main.cpp
+++ b/ui/logray/logray_main.cpp
@@ -10,8 +10,6 @@
#include <config.h>
#define WS_LOG_DOMAIN LOG_DOMAIN_MAIN
-#include <glib.h>
-
#include <locale.h>
#ifdef _WIN32
@@ -133,7 +131,7 @@ void exit_application(int status) {
/*
* Report an error in command-line arguments.
*
- * On Windows, Wireshark is built for the Windows subsystem, and runs
+ * On Windows, Logray is built for the Windows subsystem, and runs
* without a console, so we create a console on Windows to receive the
* output.
*
@@ -142,25 +140,25 @@ void exit_application(int status) {
*
* On UN*Xes:
*
- * If Wireshark is run from the command line, its output either goes
+ * If Logray is run from the command line, its output either goes
* to the terminal or to wherever the standard error was redirected.
*
- * If Wireshark is run by executing it as a remote command, e.g. with
+ * If Logray is run by executing it as a remote command, e.g. with
* ssh, its output either goes to whatever socket was set up for the
* remote command's standard error or to wherever the standard error
* was redirected.
*
- * If Wireshark was run from the GUI, e.g. by double-clicking on its
+ * If Logray was run from the GUI, e.g. by double-clicking on its
* icon or on a file that it opens, there are no guarantees as to
* where the standard error went. It could be going to /dev/null
* (current macOS), or to a socket to systemd for the journal, or
* to a log file in the user's home directory, or to the "console
* device" ("workstation console"), or....
*
- * Part of determining that, at least for locally-run Wireshark,
+ * Part of determining that, at least for locally-run Logray,
* is to try to open /dev/tty to determine whether the process
* has a controlling terminal. (It fails, at a minimum, for
- * Wireshark launched from the GUI under macOS, Ubuntu with GNOME,
+ * Logray launched from the GUI under macOS, Ubuntu with GNOME,
* and Ubuntu with KDE; in all cases, an attempt to open /dev/tty
* fails with ENXIO.) If it does have a controlling terminal,
* write to the standard error, otherwise assume that the standard
@@ -302,7 +300,7 @@ qt_log_message_handler(QtMsgType type, const QMessageLogContext &, const QString
static void
check_and_warn_user_startup()
{
- gchar *cur_user, *cur_group;
+ char *cur_user, *cur_group;
/* Tell the user not to run as root. */
if (running_with_special_privs() && recent.privs_warn_if_elevated) {
@@ -311,7 +309,7 @@ check_and_warn_user_startup()
simple_message_box(ESD_TYPE_WARN, &recent.privs_warn_if_elevated,
"Running as user \"%s\" and group \"%s\".\n"
"This could be dangerous.\n\n"
- "If you're running Wireshark this way in order to perform live capture, "
+ "If you're running Logray this way in order to perform live capture, "
"you may want to be aware that there is a better way documented at\n"
WS_WIKI_URL("CaptureSetup/CapturePrivileges"), cur_user, cur_group);
g_free(cur_user);
@@ -330,7 +328,7 @@ check_and_warn_user_startup()
//
// and
//
-// - You install Wireshark that was built on a machine with Qt version
+// - You install Logray that was built on a machine with Qt version
// 5.x.z installed in the default location.
//
// Qt5Core.dll will load qwindows.dll from your local C:\Qt\5.x\...\plugins
@@ -402,18 +400,22 @@ macos_enable_layer_backing(void)
#ifdef HAVE_LIBPCAP
static GList *
-capture_opts_get_interface_list(int *err, char **err_str)
+capture_opts_get_interface_list(int *err _U_, char **err_str _U_)
{
- /*
- * XXX - should this pass an update callback?
- * We already have a window up by the time we start parsing
- * the majority of the command-line arguments, because
- * we need to do a bunch of initialization work before
- * parsing those arguments, and we want to let the user
- * know that we're doing that initialization, given that
- * it can take a while.
- */
- return capture_interface_list(err, err_str, NULL);
+ // logray only wants the IF_EXTCAP interfaces, so there's no point
+ // in spawning dumpcap to retrieve the other types of interfaces.
+#if 0
+ if (mainApp) {
+ GList *if_list = mainApp->getInterfaceList();
+ if (if_list == NULL) {
+ if_list = capture_interface_list(err, err_str, main_window_update);
+ mainApp->setInterfaceList(if_list);
+ }
+ return if_list;
+ }
+ return capture_interface_list(err, err_str, main_window_update);
+#endif
+ return append_extcap_interface_list(NULL);
}
#endif
@@ -432,15 +434,15 @@ int main(int argc, char *qt_argv[])
char *rf_path;
int rf_open_errno;
#ifdef HAVE_LIBPCAP
- gchar *err_str, *err_str_secondary;;
+ char *err_str, *err_str_secondary;
#else
#ifdef _WIN32
#ifdef HAVE_AIRPCAP
- gchar *err_str;
+ char *err_str;
#endif
#endif
#endif
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
df_error_t *df_err = NULL;
QString dfilter, read_filter;
@@ -448,7 +450,7 @@ int main(int argc, char *qt_argv[])
int caps_queries = 0;
#endif
/* Start time in microseconds */
- guint64 start_time = g_get_monotonic_time();
+ uint64_t start_time = g_get_monotonic_time();
static const struct report_message_routines wireshark_report_routines = {
vfailure_alert_box,
vwarning_alert_box,
@@ -499,7 +501,7 @@ int main(int argc, char *qt_argv[])
/* Initialize log handler early so we can have proper logging during startup. */
ws_log_init("logray", vcmdarg_err);
/* For backward compatibility with GLib logging and Wireshark 3.4. */
- ws_log_console_writer_set_use_stdout(TRUE);
+ ws_log_console_writer_set_use_stdout(true);
qInstallMessageHandler(qt_log_message_handler);
@@ -632,7 +634,7 @@ int main(int argc, char *qt_argv[])
g_free (rf_path);
}
- profile_store_persconffiles(TRUE);
+ profile_store_persconffiles(true);
recent_init();
/* Read the profile independent recent file. We have to do this here so we can */
@@ -664,7 +666,7 @@ int main(int argc, char *qt_argv[])
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
- /* Create The Wireshark app */
+ /* Create The Logray app */
LograyApplication ls_app(argc, qt_argv);
/* initialize the funnel mini-api */
@@ -728,7 +730,7 @@ int main(int argc, char *qt_argv[])
}
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "set_console_log_handler, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "set_console_log_handler, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
#ifdef HAVE_LIBPCAP
@@ -742,17 +744,17 @@ int main(int argc, char *qt_argv[])
* dissection-time handlers for file-type-dependent blocks can
* register using the file type/subtype value for the file type.
*/
- wtap_init(TRUE);
+ wtap_init(true);
splash_update(RA_DISSECTORS, NULL, NULL);
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling epan init, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling epan init, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
/* Register all dissectors; we must do this before checking for the
"-G" flag, as the "-G" flag dumps information registered by the
dissectors, and we must do it before we read the preferences, in
case any dissectors register preferences. */
- if (!epan_init(splash_update, NULL, TRUE)) {
+ if (!epan_init(splash_update, NULL, true)) {
SimpleDialog::displayQueuedMessages(main_w);
ret_val = WS_EXIT_INIT_FAILED;
goto clean_exit;
@@ -760,7 +762,7 @@ int main(int argc, char *qt_argv[])
#ifdef DEBUG_STARTUP_TIME
/* epan_init resets the preferences */
prefs.gui_console_open = console_open_always;
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "epan done, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "epan done, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
/* Register all audio codecs. */
@@ -779,7 +781,7 @@ int main(int argc, char *qt_argv[])
splash_update(RA_LISTENERS, NULL, NULL);
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Register all tap listeners, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Register all tap listeners, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
/* Register all tap listeners; we do this before we parse the arguments,
as the "-z" argument can specify a registered tap. */
@@ -796,14 +798,9 @@ int main(int argc, char *qt_argv[])
in_file_type = open_info_name_to_type(ex_opt_get_next("read_format"));
}
-#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling extcap_register_preferences, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
-#endif
- splash_update(RA_EXTCAP, NULL, NULL);
- extcap_register_preferences();
splash_update(RA_PREFERENCES, NULL, NULL);
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling module preferences, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling module preferences, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
/* Read the preferences, but don't apply them yet. */
@@ -813,7 +810,17 @@ int main(int argc, char *qt_argv[])
* line, and store them. We have to do this before applying the
* preferences to the capture options.
*/
- commandline_override_prefs(argc, argv, TRUE);
+ commandline_override_prefs(argc, argv, true);
+
+ /* Register the extcap preferences. We do this after seeing if the
+ * capture_no_extcap preference is set in the configuration file
+ * or command line. This will re-read the extcap specific preferences.
+ */
+#ifdef DEBUG_STARTUP_TIME
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling extcap_register_preferences, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
+#endif
+ splash_update(RA_EXTCAP, NULL, NULL);
+ extcap_register_preferences();
/* Some of the preferences affect the capture options. Apply those
* before getting the other command line arguments, which can also
@@ -824,7 +831,7 @@ int main(int argc, char *qt_argv[])
prefs_to_capture_opts();
/* Now get our remaining args */
- commandline_other_options(argc, argv, TRUE);
+ commandline_other_options(argc, argv, true);
/* Convert some command-line parameters to QStrings */
if (global_commandline_info.cf_name != NULL)
@@ -839,19 +846,6 @@ int main(int argc, char *qt_argv[])
timestamp_set_seconds_type (recent.gui_seconds_format);
#ifdef HAVE_LIBPCAP
-#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling fill_in_local_interfaces, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
-#endif
- splash_update(RA_INTERFACES, NULL, NULL);
-
- if (!global_commandline_info.cf_name && !prefs.capture_no_interface_load) {
- /* Allow only extcap interfaces to be found */
- GList * filter_list = NULL;
- filter_list = g_list_append(filter_list, GUINT_TO_POINTER((guint) IF_EXTCAP));
- fill_in_local_interfaces_filtered(filter_list, main_window_update);
- g_list_free(filter_list);
- }
-
if (global_commandline_info.list_link_layer_types)
caps_queries |= CAPS_QUERY_LINK_TYPES;
if (global_commandline_info.list_timestamp_types)
@@ -873,27 +867,41 @@ int main(int argc, char *qt_argv[])
* and exit.
*/
if (caps_queries) {
- guint i;
+ unsigned i;
#ifdef _WIN32
create_console();
#endif /* _WIN32 */
/* Get the list of link-layer types for the capture devices. */
ret_val = EXIT_SUCCESS;
+ GList *if_cap_queries = NULL;
+ if_cap_query_t *if_cap_query;
+ GHashTable *capability_hash;
for (i = 0; i < global_capture_opts.ifaces->len; i++) {
interface_options *interface_opts;
- if_capabilities_t *caps;
- char *auth_str = NULL;
interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, i);
+ if_cap_query = g_new(if_cap_query_t, 1);
+ if_cap_query->name = interface_opts->name;
+ if_cap_query->monitor_mode = interface_opts->monitor_mode;
+ if_cap_query->auth_username = NULL;
+ if_cap_query->auth_password = NULL;
#ifdef HAVE_PCAP_REMOTE
if (interface_opts->auth_type == CAPTURE_AUTH_PWD) {
- auth_str = g_strdup_printf("%s:%s", interface_opts->auth_username, interface_opts->auth_password);
+ if_cap_query->auth_username = interface_opts->auth_username;
+ if_cap_query->auth_password = interface_opts->auth_password;
}
#endif
- caps = capture_get_if_capabilities(interface_opts->name, interface_opts->monitor_mode,
- auth_str, &err_str, &err_str_secondary, NULL);
- g_free(auth_str);
+ if_cap_queries = g_list_prepend(if_cap_queries, if_cap_query);
+ }
+ if_cap_queries = g_list_reverse(if_cap_queries);
+ capability_hash = capture_get_if_list_capabilities(if_cap_queries, &err_str, &err_str_secondary, NULL);
+ g_list_free_full(if_cap_queries, g_free);
+ for (i = 0; i < global_capture_opts.ifaces->len; i++) {
+ interface_options *interface_opts;
+ if_capabilities_t *caps;
+ interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, i);
+ caps = static_cast<if_capabilities_t*>(g_hash_table_lookup(capability_hash, interface_opts->name));
if (caps == NULL) {
cmdarg_err("%s%s%s", err_str, err_str_secondary ? "\n" : "", err_str_secondary ? err_str_secondary : "");
g_free(err_str);
@@ -903,7 +911,6 @@ int main(int argc, char *qt_argv[])
}
ret_val = capture_opts_print_if_capabilities(caps, interface_opts,
caps_queries);
- free_if_capabilities(caps);
if (ret_val != EXIT_SUCCESS) {
break;
}
@@ -911,9 +918,26 @@ int main(int argc, char *qt_argv[])
#ifdef _WIN32
destroy_console();
#endif /* _WIN32 */
+ g_hash_table_destroy(capability_hash);
goto clean_exit;
}
+#ifdef DEBUG_STARTUP_TIME
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling fill_in_local_interfaces, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
+#endif
+ splash_update(RA_INTERFACES, NULL, NULL);
+
+ if (!global_commandline_info.cf_name && !prefs.capture_no_interface_load) {
+ /* Allow only extcap interfaces to be found */
+ GList * filter_list = NULL;
+ filter_list = g_list_append(filter_list, GUINT_TO_POINTER((unsigned) IF_EXTCAP));
+ // The below starts the stats; we don't need that since Logray only
+ // supports extcaps.
+ //lwApp->scanLocalInterfaces(filter_list);
+ fill_in_local_interfaces_filtered(filter_list, main_window_update);
+ g_list_free(filter_list);
+ }
+
capture_opts_trim_snaplen(&global_capture_opts, MIN_PACKET_SIZE);
capture_opts_trim_ring_num_files(&global_capture_opts);
#endif /* HAVE_LIBPCAP */
@@ -922,7 +946,7 @@ int main(int argc, char *qt_argv[])
changed either from one of the preferences file or from the command
line that their preferences have changed. */
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling prefs_apply_all, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling prefs_apply_all, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
prefs_apply_all();
lwApp->emitAppSignal(LograyApplication::PreferencesChanged);
@@ -930,12 +954,12 @@ int main(int argc, char *qt_argv[])
#ifdef HAVE_LIBPCAP
if ((global_capture_opts.num_selected == 0) &&
(prefs.capture_device != NULL)) {
- guint i;
+ unsigned i;
interface_t *device;
for (i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (!device->hidden && strcmp(device->display_name, prefs.capture_device) == 0) {
- device->selected = TRUE;
+ device->selected = true;
global_capture_opts.num_selected++;
break;
}
@@ -952,7 +976,7 @@ int main(int argc, char *qt_argv[])
goto clean_exit;
}
- build_column_format_array(&CaptureFile::globalCapFile()->cinfo, global_commandline_info.prefs_p->num_cols, TRUE);
+ build_column_format_array(&CaptureFile::globalCapFile()->cinfo, global_commandline_info.prefs_p->num_cols, true);
lwApp->emitAppSignal(LograyApplication::ColumnsChanged); // We read "recent" widths above.
lwApp->emitAppSignal(LograyApplication::RecentPreferencesRead); // Must be emitted after PreferencesChanged.
@@ -988,7 +1012,7 @@ int main(int argc, char *qt_argv[])
if (global_commandline_info.go_to_packet != 0) {
/* Jump to the specified frame number, kept for backward
compatibility. */
- cf_goto_frame(CaptureFile::globalCapFile(), global_commandline_info.go_to_packet);
+ cf_goto_frame(CaptureFile::globalCapFile(), global_commandline_info.go_to_packet, false);
} else if (global_commandline_info.jfilter != NULL) {
dfilter_t *jump_to_filter = NULL;
/* try to compile given filter */
@@ -1014,7 +1038,7 @@ int main(int argc, char *qt_argv[])
if (global_capture_opts.save_file != NULL) {
/* Save the directory name for future file dialogs. */
/* (get_dirname overwrites filename) */
- gchar *s = g_strdup(global_capture_opts.save_file);
+ char *s = g_strdup(global_capture_opts.save_file);
set_last_open_dir(get_dirname(s));
g_free(s);
}
@@ -1051,8 +1075,9 @@ int main(int argc, char *qt_argv[])
// loaded when the dialog is shown. Register them here.
profile_register_persconffile("io_graphs");
profile_register_persconffile("import_hexdump.json");
+ profile_register_persconffile("remote_hosts.json");
- profile_store_persconffiles(FALSE);
+ profile_store_persconffiles(false);
// If the lwApp->exec() event loop exits cleanly, we call
// LograyApplication::cleanup().
diff --git a/ui/logray/logray_main_window.cpp b/ui/logray/logray_main_window.cpp
index f7886daf..6262bca6 100644
--- a/ui/logray/logray_main_window.cpp
+++ b/ui/logray/logray_main_window.cpp
@@ -12,7 +12,7 @@
/*
* The generated Ui_LograyMainWindow::setupUi() can grow larger than our configured limit,
- * so turn off -Wframe-larger-than= for ui_main_window.h.
+ * so turn off -Wframe-larger-than= for ui_logray_main_window.h.
*/
DIAG_OFF(frame-larger-than=)
#include <ui_logray_main_window.h>
@@ -26,12 +26,11 @@ DIAG_ON(frame-larger-than=)
#include <wsutil/ws_assert.h>
#include <wsutil/version_info.h>
#include <epan/prefs.h>
-#include <epan/stats_tree_priv.h>
#include <epan/plugin_if.h>
-#include <epan/export_object.h>
#include <frame_tvbuff.h>
#include "ui/iface_toolbar.h"
+#include "ui/commandline.h"
#ifdef HAVE_LIBPCAP
#include "ui/capture.h"
@@ -55,13 +54,12 @@ DIAG_ON(frame-larger-than=)
#endif
#include "conversation_colorize_action.h"
#include "export_dissection_dialog.h"
-#include "export_object_action.h"
#include "file_set_dialog.h"
#include "filter_dialog.h"
+#include "follow_stream_action.h"
#include "funnel_statistics.h"
#include "import_text_dialog.h"
#include "interface_toolbar.h"
-#include "packet_diagram.h"
#include "packet_list.h"
#include "proto_tree.h"
#include "simple_dialog.h"
@@ -72,6 +70,7 @@ DIAG_ON(frame-larger-than=)
#include <ui/qt/widgets/filter_expression_toolbar.h>
#include <ui/qt/utils/color_utils.h>
+#include <ui/qt/utils/profile_switcher.h>
#include <ui/qt/utils/qt_ui_utils.h>
#include <ui/qt/utils/stock_icon.h>
#include <ui/qt/utils/variant_pointer.h>
@@ -93,7 +92,7 @@ DIAG_ON(frame-larger-than=)
//menu_recent_file_write_all
// If we ever add support for multiple windows this will need to be replaced.
-static LograyMainWindow *gbl_cur_main_window_ = NULL;
+static LograyMainWindow *gbl_cur_main_window_;
static void plugin_if_mainwindow_apply_filter(GHashTable * data_set)
{
@@ -116,9 +115,9 @@ static void plugin_if_mainwindow_preference(GHashTable * data_set)
const char * pref_value;
DIAG_OFF_CAST_AWAY_CONST
- if (g_hash_table_lookup_extended(data_set, "pref_module", NULL, (gpointer *)&module_name) &&
- g_hash_table_lookup_extended(data_set, "pref_key", NULL, (gpointer *)&pref_name) &&
- g_hash_table_lookup_extended(data_set, "pref_value", NULL, (gpointer *)&pref_value))
+ if (g_hash_table_lookup_extended(data_set, "pref_module", NULL, (void * *)&module_name) &&
+ g_hash_table_lookup_extended(data_set, "pref_key", NULL, (void * *)&pref_name) &&
+ g_hash_table_lookup_extended(data_set, "pref_value", NULL, (void * *)&pref_value))
{
unsigned int changed_flags = prefs_store_ext(module_name, pref_name, pref_value);
if (changed_flags) {
@@ -134,7 +133,7 @@ static void plugin_if_mainwindow_gotoframe(GHashTable * data_set)
if (!gbl_cur_main_window_ || !data_set)
return;
- gpointer framenr;
+ void *framenr;
if (g_hash_table_lookup_extended(data_set, "frame_nr", NULL, &framenr)) {
if (GPOINTER_TO_UINT(framenr) != 0)
@@ -212,7 +211,7 @@ static void plugin_if_mainwindow_get_ws_info(GHashTable * data_set)
}
else {
ws_info->cf_framenr = 0;
- ws_info->frame_passed_dfilter = FALSE;
+ ws_info->frame_passed_dfilter = false;
}
}
else
@@ -220,7 +219,7 @@ static void plugin_if_mainwindow_get_ws_info(GHashTable * data_set)
/* Initialise the other ws_info structure values */
ws_info->cf_count = 0;
ws_info->cf_framenr = 0;
- ws_info->frame_passed_dfilter = FALSE;
+ ws_info->frame_passed_dfilter = false;
}
}
@@ -290,7 +289,7 @@ static void mainwindow_add_toolbar(const iface_toolbar *toolbar_entry)
}
}
-static void mainwindow_remove_toolbar(const gchar *menu_title)
+static void mainwindow_remove_toolbar(const char *menu_title)
{
if (gbl_cur_main_window_ && menu_title)
{
@@ -298,16 +297,22 @@ static void mainwindow_remove_toolbar(const gchar *menu_title)
}
}
-QMenu* LograyMainWindow::findOrAddMenu(QMenu *parent_menu, QString& menu_text) {
- QList<QAction *> actions = parent_menu->actions();
- QList<QAction *>::const_iterator i;
- for (i = actions.constBegin(); i != actions.constEnd(); ++i) {
- if ((*i)->text()==menu_text) {
- return (*i)->menu();
+QMenu* LograyMainWindow::findOrAddMenu(QMenu *parent_menu, const QStringList& menu_parts) {
+ for (auto const & menu_text : menu_parts) {
+ bool found = false;
+ for (auto const & action : parent_menu->actions()) {
+ if (action->text() == menu_text.trimmed()) {
+ parent_menu = action->menu();
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ // If we get here the menu entry was not found, add a sub menu
+ parent_menu = parent_menu->addMenu(menu_text.trimmed());
}
}
- // If we get here there menu entry was not found, add a sub menu
- return parent_menu->addMenu(menu_text);
+ return parent_menu;
}
LograyMainWindow::LograyMainWindow(QWidget *parent) :
@@ -322,7 +327,8 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
freeze_focus_(NULL),
was_maximized_(false),
capture_stopping_(false),
- capture_filter_valid_(false)
+ capture_filter_valid_(false),
+ use_capturing_title_(false)
#ifdef HAVE_LIBPCAP
, capture_options_dialog_(NULL)
, info_data_()
@@ -332,10 +338,9 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
#endif
{
if (!gbl_cur_main_window_) {
- connect(mainApp, SIGNAL(openStatCommandDialog(QString, const char*, void*)),
- this, SLOT(openStatCommandDialog(QString, const char*, void*)));
- connect(mainApp, SIGNAL(openTapParameterDialog(QString, const QString, void*)),
- this, SLOT(openTapParameterDialog(QString, const QString, void*)));
+ connect(mainApp, &MainApplication::openStatCommandDialog, this, &LograyMainWindow::openStatCommandDialog);
+ connect(mainApp, &MainApplication::openTapParameterDialog,
+ this, [=](const QString cfg_str, const QString arg, void *userdata) {openTapParameterDialog(cfg_str, arg, userdata);});
}
gbl_cur_main_window_ = this;
#ifdef HAVE_LIBPCAP
@@ -356,7 +361,7 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
<< REGISTER_LOG_STAT_GROUP_UNSORTED;
setWindowIcon(mainApp->normalIcon());
- setTitlebarForCaptureFile();
+ updateTitlebar();
setMenusForCaptureFile();
setForCapturedPackets(false);
setMenusForFileSet(false);
@@ -369,35 +374,36 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
qRegisterMetaType<FilterAction::Action>("FilterAction::Action");
qRegisterMetaType<FilterAction::ActionType>("FilterAction::ActionType");
- connect(this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SLOT(queuedFilterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- Qt::QueuedConnection);
+ connect(this, &LograyMainWindow::filterAction, this, &LograyMainWindow::queuedFilterAction, Qt::QueuedConnection);
//To prevent users use features before initialization complete
//Otherwise unexpected problems may occur
setFeaturesEnabled(false);
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(setFeaturesEnabled()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(applyGlobalCommandLineOptions()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(zoomText()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initViewColorizeMenu()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(addStatsPluginsToMenu()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(addDynamicMenus()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(addPluginIFStructures()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initConversationMenus()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initExportObjectsMenus()));
-
- connect(mainApp, SIGNAL(profileChanging()), this, SLOT(saveWindowGeometry()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(layoutPanes()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(layoutToolbars()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(updatePreferenceActions()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(zoomText()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(setTitlebarForCaptureFile()));
-
- connect(mainApp, SIGNAL(updateRecentCaptureStatus(const QString &, qint64, bool)), this, SLOT(updateRecentCaptures()));
+ connect(mainApp, &MainApplication::appInitialized, this, [this]() { setFeaturesEnabled(); });
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::applyGlobalCommandLineOptions);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::zoomText);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::initViewColorizeMenu);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::addStatsPluginsToMenu);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::addDynamicMenus);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::addPluginIFStructures);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::initConversationMenus);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::initFollowStreamMenus);
+ connect(mainApp, &MainApplication::appInitialized, this,
+ [=]() { addDisplayFilterTranslationActions(main_ui_->menuEditCopy); });
+
+ connect(mainApp, &MainApplication::profileChanging, this, &LograyMainWindow::saveWindowGeometry);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::layoutPanes);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::layoutToolbars);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::updatePreferenceActions);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::zoomText);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::updateTitlebar);
+
+ connect(mainApp, &MainApplication::updateRecentCaptureStatus, this, &LograyMainWindow::updateRecentCaptures);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::updateRecentCaptures);
updateRecentCaptures();
#if defined(HAVE_SOFTWARE_UPDATE) && defined(Q_OS_WIN)
- connect(mainApp, SIGNAL(softwareUpdateRequested()), this, SLOT(softwareUpdateRequested()),
+ connect(mainApp, &MainApplication::softwareUpdateRequested, this, &LograyMainWindow::softwareUpdateRequested,
Qt::BlockingQueuedConnection);
#endif
@@ -406,12 +412,13 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
funnel_statistics_ = new FunnelStatistics(this, capture_file_);
connect(df_combo_box_, &QComboBox::editTextChanged, funnel_statistics_, &FunnelStatistics::displayFilterTextChanged);
connect(funnel_statistics_, &FunnelStatistics::setDisplayFilter, this, &LograyMainWindow::setDisplayFilter);
- connect(funnel_statistics_, SIGNAL(openCaptureFile(QString, QString)),
- this, SLOT(openCaptureFile(QString, QString)));
+ connect(funnel_statistics_, &FunnelStatistics::openCaptureFile, this,
+ [=](QString cf_path, QString filter) { openCaptureFile(cf_path, filter); });
+
+ connect(df_combo_box_, &QComboBox::editTextChanged, this, &LograyMainWindow::updateDisplayFilterTranslationActions);
file_set_dialog_ = new FileSetDialog(this);
- connect(file_set_dialog_, SIGNAL(fileSetOpenCaptureFile(QString)),
- this, SLOT(openCaptureFile(QString)));
+ connect(file_set_dialog_, &FileSetDialog::fileSetOpenCaptureFile, this, [=](QString cf_path) { openCaptureFile(cf_path); });
initMainToolbarIcons();
@@ -428,15 +435,13 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
main_ui_->displayFilterToolBar->addWidget(filter_expression_toolbar_);
main_ui_->goToFrame->hide();
- connect(main_ui_->goToFrame, SIGNAL(visibilityChanged(bool)),
- main_ui_->actionGoGoToPacket, SLOT(setChecked(bool)));
+ connect(main_ui_->goToFrame, &AccordionFrame::visibilityChanged, main_ui_->actionGoGoToPacket, &QAction::setChecked);
// XXX For some reason the cursor is drawn funny with an input mask set
// https://bugreports.qt-project.org/browse/QTBUG-7174
main_ui_->searchFrame->hide();
- connect(main_ui_->searchFrame, SIGNAL(visibilityChanged(bool)),
- main_ui_->actionEditFindPacket, SLOT(setChecked(bool)));
+ connect(main_ui_->searchFrame, &SearchFrame::visibilityChanged, main_ui_->actionEditFindPacket, &QAction::setChecked);
main_ui_->addressEditorFrame->hide();
main_ui_->columnEditorFrame->hide();
@@ -483,7 +488,7 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
#ifdef HAVE_SOFTWARE_UPDATE
QAction *update_sep = main_ui_->menuHelp->insertSeparator(main_ui_->actionHelpAbout);
main_ui_->menuHelp->insertAction(update_sep, update_action_);
- connect(update_action_, SIGNAL(triggered()), this, SLOT(checkForUpdates()));
+ connect(update_action_, &QAction::triggered, this, &LograyMainWindow::checkForUpdates);
#endif
master_split_.setObjectName("splitterMaster");
extra_split_.setObjectName("splitterExtra");
@@ -495,22 +500,21 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
empty_pane_.setVisible(false);
packet_list_ = new PacketList(&master_split_);
- connect(packet_list_, SIGNAL(framesSelected(QList<int>)), this, SLOT(setMenusForSelectedPacket()));
- connect(packet_list_, SIGNAL(framesSelected(QList<int>)), this, SIGNAL(framesSelected(QList<int>)));
+ connect(packet_list_, &PacketList::framesSelected, this, &LograyMainWindow::setMenusForSelectedPacket);
+ connect(packet_list_, &PacketList::framesSelected, this, &LograyMainWindow::framesSelected);
QAction *action = main_ui_->menuPacketComment->addAction(tr("Add New Comment…"));
connect(action, &QAction::triggered, this, &LograyMainWindow::addPacketComment);
action->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_C));
- connect(main_ui_->menuPacketComment, SIGNAL(aboutToShow()), this, SLOT(setEditCommentsMenu()));
+ connect(main_ui_->menuPacketComment, &QMenu::aboutToShow, this, &LograyMainWindow::setEditCommentsMenu);
proto_tree_ = new ProtoTree(&master_split_);
proto_tree_->installEventFilter(this);
packet_list_->setProtoTree(proto_tree_);
+ packet_list_->setProfileSwitcher(profile_switcher_);
packet_list_->installEventFilter(this);
- packet_diagram_ = new PacketDiagram(&master_split_);
-
main_stack_ = main_ui_->mainStack;
welcome_page_ = main_ui_->welcomePage;
main_status_bar_ = main_ui_->statusBar;
@@ -546,40 +550,27 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
setTabOrder(df_combo_box_->lineEdit(), packet_list_);
setTabOrder(packet_list_, proto_tree_);
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
- this, SLOT(captureEventHandler(CaptureEvent)));
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
- mainApp, SLOT(captureEventHandler(CaptureEvent)));
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
- main_ui_->statusBar, SLOT(captureEventHandler(CaptureEvent)));
-
- connect(mainApp, SIGNAL(freezePacketList(bool)),
- packet_list_, SLOT(freezePacketList(bool)));
- connect(mainApp, SIGNAL(columnsChanged()),
- packet_list_, SLOT(columnsChanged()));
- connect(mainApp, SIGNAL(preferencesChanged()),
- packet_list_, SLOT(preferencesChanged()));
- connect(mainApp, SIGNAL(recentPreferencesRead()),
- this, SLOT(applyRecentPaneGeometry()));
- connect(mainApp, SIGNAL(recentPreferencesRead()),
- this, SLOT(updateRecentActions()));
- connect(mainApp, SIGNAL(packetDissectionChanged()),
- this, SLOT(redissectPackets()), Qt::QueuedConnection);
-
- connect(mainApp, SIGNAL(checkDisplayFilter()),
- this, SLOT(checkDisplayFilter()));
- connect(mainApp, SIGNAL(fieldsChanged()),
- this, SLOT(fieldsChanged()));
- connect(mainApp, SIGNAL(reloadLuaPlugins()),
- this, SLOT(reloadLuaPlugins()));
-
- connect(main_ui_->mainStack, SIGNAL(currentChanged(int)),
- this, SLOT(mainStackChanged(int)));
-
- connect(welcome_page_, SIGNAL(startCapture(QStringList)),
- this, SLOT(startCapture(QStringList)));
- connect(welcome_page_, SIGNAL(recentFileActivated(QString)),
- this, SLOT(openCaptureFile(QString)));
+ connect(&capture_file_, &CaptureFile::captureEvent, this, &LograyMainWindow::captureEventHandler);
+ connect(&capture_file_, &CaptureFile::captureEvent, mainApp, &WiresharkApplication::captureEventHandler);
+ connect(&capture_file_, &CaptureFile::captureEvent, main_ui_->statusBar, &MainStatusBar::captureEventHandler);
+ connect(&capture_file_, &CaptureFile::captureEvent, profile_switcher_, &ProfileSwitcher::captureEventHandler);
+
+ connect(mainApp, &MainApplication::freezePacketList, packet_list_, &PacketList::freezePacketList);
+ connect(mainApp, &MainApplication::columnsChanged, packet_list_, &PacketList::columnsChanged);
+ connect(mainApp, &MainApplication::colorsChanged, packet_list_, &PacketList::colorsChanged);
+ connect(mainApp, &MainApplication::preferencesChanged, packet_list_, &PacketList::preferencesChanged);
+ connect(mainApp, &MainApplication::recentPreferencesRead, this, &LograyMainWindow::applyRecentPaneGeometry);
+ connect(mainApp, &MainApplication::recentPreferencesRead, this, &LograyMainWindow::updateRecentActions);
+ connect(mainApp, &MainApplication::packetDissectionChanged, this, &LograyMainWindow::redissectPackets, Qt::QueuedConnection);
+
+ connect(mainApp, &MainApplication::checkDisplayFilter, this, &LograyMainWindow::checkDisplayFilter);
+ connect(mainApp, &MainApplication::fieldsChanged, this, &LograyMainWindow::fieldsChanged);
+ connect(mainApp, &MainApplication::reloadLuaPlugins, this, &LograyMainWindow::reloadLuaPlugins);
+
+ connect(main_ui_->mainStack, &QStackedWidget::currentChanged, this, &LograyMainWindow::mainStackChanged);
+
+ connect(welcome_page_, &WelcomePage::startCapture, this, [this](QStringList) { startCapture(); });
+ connect(welcome_page_, &WelcomePage::recentFileActivated, this, [this](QString cfile) { openCaptureFile(cfile); });
connect(main_ui_->addressEditorFrame, &AddressEditorFrame::redissectPackets,
this, &LograyMainWindow::redissectPackets);
@@ -602,10 +593,8 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
connect(this, &LograyMainWindow::setCaptureFile,
proto_tree_, &ProtoTree::setCaptureFile);
- connect(mainApp, SIGNAL(zoomMonospaceFont(QFont)),
- packet_list_, SLOT(setMonospaceFont(QFont)));
- connect(mainApp, SIGNAL(zoomMonospaceFont(QFont)),
- proto_tree_, SLOT(setMonospaceFont(QFont)));
+ connect(mainApp, &MainApplication::zoomMonospaceFont, packet_list_, &PacketList::setMonospaceFont);
+ connect(mainApp, &MainApplication::zoomMonospaceFont, proto_tree_, &ProtoTree::setMonospaceFont);
connectFileMenuActions();
connectEditMenuActions();
@@ -614,28 +603,21 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
connectCaptureMenuActions();
connectAnalyzeMenuActions();
connectStatisticsMenuActions();
+ connectToolsMenuActions();
connectHelpMenuActions();
- connect(packet_list_, SIGNAL(packetDissectionChanged()),
- this, SLOT(redissectPackets()));
- connect(packet_list_, SIGNAL(showColumnPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
- connect(packet_list_, SIGNAL(showProtocolPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
+ connect(packet_list_, &PacketList::packetDissectionChanged, this, &LograyMainWindow::redissectPackets);
+ connect(packet_list_, &PacketList::showColumnPreferences, this, &LograyMainWindow::showPreferencesDialog);
+ connect(packet_list_, &PacketList::showProtocolPreferences, this, &LograyMainWindow::showPreferencesDialog);
connect(packet_list_, SIGNAL(editProtocolPreference(preference*, pref_module*)),
main_ui_->preferenceEditorFrame, SLOT(editPreference(preference*, pref_module*)));
- connect(packet_list_, SIGNAL(editColumn(int)), this, SLOT(showColumnEditor(int)));
- connect(main_ui_->columnEditorFrame, SIGNAL(columnEdited()),
- packet_list_, SLOT(columnsChanged()));
- connect(packet_list_, SIGNAL(doubleClicked(QModelIndex)),
- this, SLOT(openPacketDialog()));
- connect(packet_list_, SIGNAL(packetListScrolled(bool)),
- main_ui_->actionGoAutoScroll, SLOT(setChecked(bool)));
-
- connect(proto_tree_, SIGNAL(openPacketInNewWindow(bool)),
- this, SLOT(openPacketDialog(bool)));
- connect(proto_tree_, SIGNAL(showProtocolPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
+ connect(packet_list_, &PacketList::editColumn, this, &LograyMainWindow::showColumnEditor);
+ connect(main_ui_->columnEditorFrame, &ColumnEditorFrame::columnEdited, packet_list_, &PacketList::columnsChanged);
+ connect(packet_list_, &QAbstractItemView::doubleClicked, this, [=](const QModelIndex &){ openPacketDialog(); });
+ connect(packet_list_, &PacketList::packetListScrolled, main_ui_->actionGoAutoScroll, &QAction::setChecked);
+
+ connect(proto_tree_, &ProtoTree::openPacketInNewWindow, this, &LograyMainWindow::openPacketDialog);
+ connect(proto_tree_, &ProtoTree::showProtocolPreferences, this, &LograyMainWindow::showPreferencesDialog);
connect(proto_tree_, SIGNAL(editProtocolPreference(preference*, pref_module*)),
main_ui_->preferenceEditorFrame, SLOT(editPreference(preference*, pref_module*)));
@@ -657,16 +639,13 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
#ifdef HAVE_LIBPCAP
QTreeWidget *iface_tree = findChild<QTreeWidget *>("interfaceTree");
if (iface_tree) {
- connect(iface_tree, SIGNAL(itemSelectionChanged()),
- this, SLOT(interfaceSelectionChanged()));
+ connect(iface_tree, &QTreeWidget::itemSelectionChanged, this, &LograyMainWindow::interfaceSelectionChanged);
}
- connect(main_ui_->welcomePage, SIGNAL(captureFilterSyntaxChanged(bool)),
- this, SLOT(captureFilterSyntaxChanged(bool)));
+ connect(main_ui_->welcomePage, &WelcomePage::captureFilterSyntaxChanged,
+ this, &LograyMainWindow::captureFilterSyntaxChanged);
- connect(this, SIGNAL(showExtcapOptions(QString&, bool)),
- this, SLOT(showExtcapOptionsDialog(QString&, bool)));
- connect(this->welcome_page_, SIGNAL(showExtcapOptions(QString&, bool)),
- this, SLOT(showExtcapOptionsDialog(QString&, bool)));
+ connect(this, &LograyMainWindow::showExtcapOptions, this, &LograyMainWindow::showExtcapOptionsDialog);
+ connect(this->welcome_page_, &WelcomePage::showExtcapOptions, this, &LograyMainWindow::showExtcapOptionsDialog);
#endif // HAVE_LIBPCAP
@@ -697,7 +676,7 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
main_ui_->actionHelpMPText2pcap->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_TEXT2PCAP)));
main_ui_->actionHelpMPTShark->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_TSHARK)));
- main_ui_->actionHelpContents->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_USERGUIDE)));
+ main_ui_->actionHelpContents->setToolTip(gchar_free_to_qstring(topic_action_url(HELP_CONTENT)));
main_ui_->actionHelpWebsite->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_HOME)));
main_ui_->actionHelpFAQ->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_FAQ)));
main_ui_->actionHelpAsk->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_ASK)));
@@ -711,11 +690,14 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
LograyMainWindow::~LograyMainWindow()
{
disconnect(main_ui_->mainStack, 0, 0, 0);
+ if (previous_focus_ != nullptr) {
+ disconnect(previous_focus_, &QWidget::destroyed, this, &LograyMainWindow::resetPreviousFocus);
+ }
#ifndef Q_OS_MAC
// Below dialogs inherit GeometryStateDialog
// For reasons described in geometry_state_dialog.h no parent is set when
- // instantiating the dialogs and as a resul objects are not automatically
+ // instantiating the dialogs and as a result objects are not automatically
// freed by its parent. Free then here explicitly to avoid leak and numerous
// Valgrind complaints.
delete file_set_dialog_;
@@ -753,7 +735,6 @@ QMenu *LograyMainWindow::createPopupMenu()
menu->addAction(main_ui_->actionViewPacketList);
menu->addAction(main_ui_->actionViewPacketDetails);
menu->addAction(main_ui_->actionViewPacketBytes);
- menu->addAction(main_ui_->actionViewPacketDiagram);
return menu;
}
@@ -780,8 +761,8 @@ void LograyMainWindow::addInterfaceToolbar(const iface_toolbar *toolbar_entry)
menu->insertAction(before, action);
InterfaceToolbar *interface_toolbar = new InterfaceToolbar(this, toolbar_entry);
- connect(mainApp, SIGNAL(appInitialized()), interface_toolbar, SLOT(interfaceListChanged()));
- connect(mainApp, SIGNAL(localInterfaceListChanged()), interface_toolbar, SLOT(interfaceListChanged()));
+ connect(mainApp, &MainApplication::appInitialized, interface_toolbar, &InterfaceToolbar::interfaceListChanged);
+ connect(mainApp, &MainApplication::localInterfaceListChanged, interface_toolbar, &InterfaceToolbar::interfaceListChanged);
QToolBar *toolbar = new QToolBar(this);
toolbar->addWidget(interface_toolbar);
@@ -800,7 +781,7 @@ void LograyMainWindow::addInterfaceToolbar(const iface_toolbar *toolbar_entry)
menu->menuAction()->setVisible(true);
}
-void LograyMainWindow::removeInterfaceToolbar(const gchar *menu_title)
+void LograyMainWindow::removeInterfaceToolbar(const char *menu_title)
{
QMenu *menu = main_ui_->menuInterfaceToolbars;
QAction *action = NULL;
@@ -829,6 +810,23 @@ void LograyMainWindow::removeInterfaceToolbar(const gchar *menu_title)
menu->menuAction()->setVisible(!menu->actions().isEmpty());
}
+void LograyMainWindow::updateStyleSheet()
+{
+#ifdef Q_OS_MAC
+ // TODO: The event type QEvent::ApplicationPaletteChange is not sent to all child widgets.
+ // Workaround this by doing it manually for all AccordionFrame.
+ main_ui_->addressEditorFrame->updateStyleSheet();
+ main_ui_->columnEditorFrame->updateStyleSheet();
+ main_ui_->filterExpressionFrame->updateStyleSheet();
+ main_ui_->goToFrame->updateStyleSheet();
+ main_ui_->preferenceEditorFrame->updateStyleSheet();
+ main_ui_->searchFrame->updateStyleSheet();
+
+ df_combo_box_->updateStyleSheet();
+ welcome_page_->updateStyleSheets();
+#endif
+}
+
bool LograyMainWindow::eventFilter(QObject *obj, QEvent *event) {
// The user typed some text. Start filling in a filter.
@@ -852,6 +850,7 @@ bool LograyMainWindow::event(QEvent *event)
switch (event->type()) {
case QEvent::ApplicationPaletteChange:
initMainToolbarIcons();
+ updateStyleSheet();
break;
default:
break;
@@ -1008,10 +1007,10 @@ void LograyMainWindow::dropEvent(QDropEvent *event)
if (cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, static_cast<int>(local_files.size()),
in_filenames,
wtap_pcapng_file_type_subtype(),
- FALSE) == CF_OK) {
+ false) == CF_OK) {
/* Merge succeeded; close the currently-open file and try
to open the merged capture file. */
- openCaptureFile(tmpname, QString(), WTAP_TYPE_AUTO, TRUE);
+ openCaptureFile(tmpname, QString(), WTAP_TYPE_AUTO, true);
}
g_free(tmpname);
@@ -1030,6 +1029,18 @@ void LograyMainWindow::loadWindowGeometry()
#ifndef Q_OS_MAC
if (recent.gui_geometry_main_maximized) {
+ // [save|restore]Geometry does a better job (on Linux and Windows)
+ // of restoring to the original monitor because it saves
+ // QGuiApplication::screens().indexOf(screen())
+ // (it also saves Qt::WindowFullScreen, restores the non-maximized
+ // size even when starting out maximized, etc.)
+ // Monitors of different DPI might still be tricky:
+ // https://bugreports.qt.io/browse/QTBUG-70721
+ // https://bugreports.qt.io/browse/QTBUG-77385
+ //
+ // We might eventually want to always use restoreGeometry, but
+ // for now at least use it just for maximized because it's better
+ // then what we've been doing.
setWindowState(Qt::WindowMaximized);
} else
#endif
@@ -1061,6 +1072,13 @@ void LograyMainWindow::loadWindowGeometry()
void LograyMainWindow::saveWindowGeometry()
{
+ if (prefs.gui_geometry_save_position ||
+ prefs.gui_geometry_save_size ||
+ prefs.gui_geometry_save_maximized) {
+ g_free(recent.gui_geometry_main);
+ recent.gui_geometry_main = g_strdup(saveGeometry().toHex().constData());
+ }
+
if (prefs.gui_geometry_save_position) {
recent.gui_geometry_main_x = pos().x();
recent.gui_geometry_main_y = pos().y();
@@ -1073,9 +1091,20 @@ void LograyMainWindow::saveWindowGeometry()
if (prefs.gui_geometry_save_maximized) {
// On macOS this is false when it shouldn't be
+ // XXX: Does save/restoreGeometry work any better on macOS
+ // for maximized windows? Apparently not:
+ // https://bugreports.qt.io/browse/QTBUG-100272
recent.gui_geometry_main_maximized = isMaximized();
}
+ g_free(recent.gui_geometry_main_master_split);
+ g_free(recent.gui_geometry_main_extra_split);
+ recent.gui_geometry_main_master_split = g_strdup(master_split_.saveState().toHex().constData());
+ recent.gui_geometry_main_extra_split = g_strdup(extra_split_.saveState().toHex().constData());
+
+ // Saving the QSplitter state is more accurate (#19361), but save
+ // the old GTK-style pane information for backwards compatibility
+ // for switching back and forth with older versions.
if (master_split_.sizes().length() > 0) {
recent.gui_geometry_main_upper_pane = master_split_.sizes()[0];
}
@@ -1090,7 +1119,7 @@ void LograyMainWindow::saveWindowGeometry()
// Our event loop becomes nested whenever we call update_progress_dlg, which
// includes several places in file.c. The GTK+ UI stays out of trouble by
// showing a modal progress dialog. We attempt to do the equivalent below by
-// disabling parts of the main window. At a minumum the ProgressFrame in the
+// disabling parts of the main window. At a minimum the ProgressFrame in the
// main status bar must remain accessible.
//
// We might want to do this any time the main status bar progress frame is
@@ -1132,7 +1161,7 @@ void LograyMainWindow::mergeCaptureFile()
if (prefs.gui_ask_unsaved) {
if (cf_has_unsaved_data(capture_file_.capFile())) {
QMessageBox msg_dialog;
- gchar *display_basename;
+ char *display_basename;
int response;
msg_dialog.setIcon(QMessageBox::Question);
@@ -1202,17 +1231,17 @@ void LograyMainWindow::mergeCaptureFile()
/* chronological order */
in_filenames[0] = g_strdup(capture_file_.capFile()->filename);
in_filenames[1] = qstring_strdup(file_name);
- merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, FALSE);
+ merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, false);
} else if (merge_dlg.mergeType() <= 0) {
/* prepend file */
in_filenames[0] = qstring_strdup(file_name);
in_filenames[1] = g_strdup(capture_file_.capFile()->filename);
- merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, TRUE);
+ merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, true);
} else {
/* append file */
in_filenames[0] = g_strdup(capture_file_.capFile()->filename);
in_filenames[1] = qstring_strdup(file_name);
- merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, TRUE);
+ merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, true);
}
g_free(in_filenames[0]);
@@ -1227,8 +1256,10 @@ void LograyMainWindow::mergeCaptureFile()
cf_close(capture_file_.capFile());
/* Try to open the merged capture file. */
+ // XXX - Just free rfcode and call
+ // openCaptureFile(tmpname, read_filter, WTAP_TYPE_AUTO, true);
CaptureFile::globalCapFile()->window = this;
- if (cf_open(CaptureFile::globalCapFile(), tmpname, WTAP_TYPE_AUTO, TRUE /* temporary file */, &err) != CF_OK) {
+ if (cf_open(CaptureFile::globalCapFile(), tmpname, WTAP_TYPE_AUTO, true /* temporary file */, &err) != CF_OK) {
/* We couldn't open it; fail. */
CaptureFile::globalCapFile()->window = NULL;
dfilter_free(rfcode);
@@ -1241,7 +1272,7 @@ void LograyMainWindow::mergeCaptureFile()
previous read filter attached to "cf"). */
cf_set_rfcode(CaptureFile::globalCapFile(), rfcode);
- switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/FALSE)) {
+ switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/false)) {
case CF_READ_OK:
case CF_READ_ERROR:
@@ -1259,8 +1290,7 @@ void LograyMainWindow::mergeCaptureFile()
return;
}
- /* Save the name of the containing directory specified in the path name. */
- mainApp->setLastOpenDirFromFilename(tmpname);
+ /* This is a tempfile; don't change the last open directory. */
g_free(tmpname);
main_ui_->statusBar->showExpert();
return;
@@ -1282,12 +1312,12 @@ void LograyMainWindow::importCaptureFile() {
return;
}
- openCaptureFile(import_dlg.capfileName());
+ openCaptureFile(import_dlg.capfileName(), QString(), WTAP_TYPE_AUTO, true);
}
bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
QString file_name;
- gboolean discard_comments;
+ bool discard_comments;
if (cf->is_tempfile) {
/* This is a temporary capture file, so saving it means saving
@@ -1297,7 +1327,7 @@ bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
probably pcapng, which supports comments and, if it's
not pcapng, let the user decide what they want to do
if they've added comments. */
- return saveAsCaptureFile(cf, FALSE, dont_reopen);
+ return saveAsCaptureFile(cf, false, dont_reopen);
} else {
if (cf->unsaved_changes) {
cf_write_status_t status;
@@ -1316,7 +1346,7 @@ bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
case SAVE:
/* The file can be saved in the specified format as is;
just drive on and save in the format they selected. */
- discard_comments = FALSE;
+ discard_comments = false;
break;
case SAVE_WITHOUT_COMMENTS:
@@ -1324,7 +1354,7 @@ bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
but it can be saved without the comments, and the user
said "OK, discard the comments", so save it in the
format they specified without the comments. */
- discard_comments = TRUE;
+ discard_comments = true;
break;
case SAVE_IN_ANOTHER_FORMAT:
@@ -1332,7 +1362,7 @@ bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
support comments, and the user said not to delete the
comments. Do a "Save As" so the user can select
one of those formats and choose a file name. */
- return saveAsCaptureFile(cf, TRUE, dont_reopen);
+ return saveAsCaptureFile(cf, true, dont_reopen);
case CANCELLED:
/* The user said "forget it". Just return. */
@@ -1400,8 +1430,8 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
int file_type;
wtap_compression_type compression_type;
cf_write_status_t status;
- gchar *dirname;
- gboolean discard_comments = FALSE;
+ char *dirname;
+ bool discard_comments = false;
if (!cf) {
return false;
@@ -1418,7 +1448,7 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
case SAVE:
/* The file can be saved in the specified format as is;
just drive on and save in the format they selected. */
- discard_comments = FALSE;
+ discard_comments = false;
break;
case SAVE_WITHOUT_COMMENTS:
@@ -1426,7 +1456,7 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
but it can be saved without the comments, and the user
said "OK, discard the comments", so save it in the
format they specified without the comments. */
- discard_comments = TRUE;
+ discard_comments = true;
break;
case SAVE_IN_ANOTHER_FORMAT:
@@ -1436,7 +1466,7 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
formats that don't support comments trimmed from it,
so run the dialog again, to let the user decide
whether to save in one of those formats or give up. */
- must_support_comments = TRUE;
+ must_support_comments = true;
continue;
case CANCELLED:
@@ -1451,17 +1481,12 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
msg_dialog.setIcon(QMessageBox::Critical);
msg_dialog.setText(tr("Unknown file type returned by merge dialog."));
- msg_dialog.setInformativeText(tr("Please report this as a Wireshark issue at https://gitlab.com/wireshark/wireshark/-/issues."));
+ msg_dialog.setInformativeText(tr("Please report this as a Logray issue at https://gitlab.com/wireshark/wireshark/-/issues."));
msg_dialog.exec();
return false;
}
compression_type = save_as_dlg.compressionType();
-#ifdef Q_OS_WIN
- // the Windows dialog does not fixup extensions, do it manually here.
- fileAddExtension(file_name, file_type, compression_type);
-#endif // Q_OS_WIN
-
//#ifndef _WIN32
// /* If the file exists and it's user-immutable or not writable,
// ask the user whether they want to override that. */
@@ -1502,7 +1527,7 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
cf->unsaved_changes = false; //we just saved so we signal that we have no unsaved changes
updateForUnsavedChanges(); // we update the title bar to remove the *
/* Add this filename to the list of recent files in the "Recent Files" submenu */
- add_menu_recent_capture_file(qUtf8Printable(file_name));
+ add_menu_recent_capture_file(qUtf8Printable(file_name), false);
return true;
case CF_WRITE_ERROR:
@@ -1523,7 +1548,7 @@ void LograyMainWindow::exportSelectedPackets() {
wtap_compression_type compression_type;
packet_range_t range;
cf_write_status_t status;
- gchar *dirname;
+ char *dirname;
bool discard_comments = false;
if (!capture_file_.capFile())
@@ -1531,8 +1556,8 @@ void LograyMainWindow::exportSelectedPackets() {
/* Init the packet range */
packet_range_init(&range, capture_file_.capFile());
- range.process_filtered = TRUE;
- range.include_dependents = TRUE;
+ range.process_filtered = true;
+ range.include_dependents = true;
QList<int> rows = packet_list_->selectedRows(true);
@@ -1552,7 +1577,7 @@ void LograyMainWindow::exportSelectedPackets() {
case SAVE:
/* The file can be saved in the specified format as is;
just drive on and save in the format they selected. */
- discard_comments = FALSE;
+ discard_comments = false;
break;
case SAVE_WITHOUT_COMMENTS:
@@ -1560,7 +1585,7 @@ void LograyMainWindow::exportSelectedPackets() {
but it can be saved without the comments, and the user
said "OK, discard the comments", so save it in the
format they specified without the comments. */
- discard_comments = TRUE;
+ discard_comments = true;
break;
case SAVE_IN_ANOTHER_FORMAT:
@@ -1588,7 +1613,7 @@ void LograyMainWindow::exportSelectedPackets() {
*/
if (files_identical(capture_file_.capFile()->filename, qUtf8Printable(file_name))) {
QMessageBox msg_box;
- gchar *display_basename = g_filename_display_basename(qUtf8Printable(file_name));
+ char *display_basename = g_filename_display_basename(qUtf8Printable(file_name));
msg_box.setIcon(QMessageBox::Critical);
msg_box.setText(QString(tr("Unable to export to \"%1\".").arg(display_basename)));
@@ -1607,15 +1632,11 @@ void LograyMainWindow::exportSelectedPackets() {
msg_box.setIcon(QMessageBox::Critical);
msg_box.setText(tr("Unknown file type returned by export dialog."));
- msg_box.setInformativeText(tr("Please report this as a Wireshark issue at https://gitlab.com/wireshark/wireshark/-/issues."));
+ msg_box.setInformativeText(tr("Please report this as a Logray issue at https://gitlab.com/wireshark/wireshark/-/issues."));
msg_box.exec();
goto cleanup;
}
compression_type = esp_dlg.compressionType();
-#ifdef Q_OS_WIN
- // the Windows dialog does not fixup extensions, do it manually here.
- fileAddExtension(file_name, file_type, compression_type);
-#endif // Q_OS_WIN
//#ifndef _WIN32
// /* If the file exists and it's user-immutable or not writable,
@@ -1644,7 +1665,7 @@ void LograyMainWindow::exportSelectedPackets() {
if (discard_comments)
packet_list_->redrawVisiblePackets();
/* Add this filename to the list of recent files in the "Recent Files" submenu */
- add_menu_recent_capture_file(qUtf8Printable(file_name));
+ add_menu_recent_capture_file(qUtf8Printable(file_name), false);
goto cleanup;
case CF_WRITE_ERROR:
@@ -1678,110 +1699,6 @@ void LograyMainWindow::exportDissections(export_type_e export_type) {
ed_dlg->show();
}
-#ifdef Q_OS_WIN
-/*
- * Ensure that:
- *
- * If the file is to be compressed:
- *
- * if there is a set of extensions used by the file type to be used,
- * the file name has one of those extensions followed by the extension
- * for the compression type to be used;
- *
- * otherwise, the file name has the extension for the compression type
- * to be used;
- *
- * otherwise:
- *
- * if there is a set of extensions used by the file type to be used,
- * the file name has one of those extensions.
- */
-void LograyMainWindow::fileAddExtension(QString &file_name, int file_type, wtap_compression_type compression_type) {
- QString file_name_lower;
- GSList *extensions_list;
- const char *compressed_file_extension;
- gboolean add_extension_for_file_type;
-
- /* Lower-case the file name, so the extension matching is case-insensitive. */
- file_name_lower = file_name.toLower();
-
- /* Get a list of all extensions used for this file type; don't
- include the ones with compression type extensions, as we
- only want to check for the extension for the compression
- type we'll be using. */
- extensions_list = wtap_get_file_extensions_list(file_type, FALSE);
-
- /* Get the extension for the compression type we'll be using;
- NULL is returned if the type isn't supported or compression
- is not being done. */
- compressed_file_extension = wtap_compression_type_extension(compression_type);
-
- if (extensions_list != NULL) {
- GSList *extension;
-
- /* This file type has one or more extensions.
- Start out assuming we need to add the default one. */
- add_extension_for_file_type = TRUE;
-
- /* OK, see if the file has one of those extensions, followed
- by the appropriate compression type extension if it's to be
- compressed. */
- for (extension = extensions_list; extension != NULL;
- extension = g_slist_next(extension)) {
- QString file_suffix = QString(".") + (char *)extension->data;
- if (compressed_file_extension != NULL)
- file_suffix += QString(".") + compressed_file_extension;
- if (file_name_lower.endsWith(file_suffix)) {
- /*
- * The file name has one of the extensions for this file
- * type, followed by a compression type extension if
- * appropriate, so we don't need to add an extension for
- * the file type or the compression type.
- */
- add_extension_for_file_type = FALSE;
- break;
- }
- }
- } else {
- /* We have no extensions for this file type. Just check
- to see if we need to add an extension for the compressed
- file type.
-
- Start out assuming we do. */
- add_extension_for_file_type = TRUE;
- if (compressed_file_extension != NULL) {
- QString file_suffix = QString(".") + compressed_file_extension;
- if (file_name_lower.endsWith(file_suffix)) {
- /*
- * The file name has the appropriate compressed file extension,
- * so we don't need to add an extension for the compression
- * type.
- */
- add_extension_for_file_type = FALSE;
- }
- }
- }
-
- /*
- * If we need to add an extension for the file type or compressed
- * file type, do so.
- */
- if (add_extension_for_file_type) {
- if (wtap_default_file_extension(file_type) != NULL) {
- /* This file type has a default extension; append it. */
- file_name += QString(".") + wtap_default_file_extension(file_type);
- }
- if (compression_type != WTAP_UNCOMPRESSED) {
- /*
- * The file is to be compressed, so append the extension for
- * its compression type.
- */
- file_name += QString(".") + compressed_file_extension;
- }
- }
-}
-#endif // Q_OS_WIN
-
bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContext context) {
bool capture_in_progress = false;
bool do_close_file = false;
@@ -1820,7 +1737,7 @@ bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContex
// We're being called from the software update window;
// don't spawn yet another dialog. Just try again later.
// XXX: The WinSparkle dialogs *aren't* modal, and a user
- // can bring Wireshark to the foreground, close/save the
+ // can bring Logray to the foreground, close/save the
// file, and then click "Install Update" again, but it
// seems like many users don't expect that (and also don't
// know that Help->Check for Updates... exist, only knowing
@@ -1854,7 +1771,7 @@ bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContex
}
} else {
// No capture in progress and not a tempfile, so this is not unsaved packets
- gchar *display_basename = g_filename_display_basename(capture_file_.capFile()->filename);
+ char *display_basename = g_filename_display_basename(capture_file_.capFile()->filename);
question = tr("Do you want to save the changes you've made to the capture file \"%1\"%2?").arg(display_basename, before_what);
infotext = tr("Your changes will be lost if you don't save them.");
g_free(display_basename);
@@ -1929,7 +1846,7 @@ bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContex
*/
QList<QAbstractButton *> buttons = msg_dialog.buttons();
for (int i = 0; i < buttons.size(); ++i) {
- QPushButton *button = static_cast<QPushButton *>(buttons.at(i));;
+ QPushButton *button = static_cast<QPushButton *>(buttons.at(i));
button->setAutoDefault(false);
}
@@ -1939,7 +1856,13 @@ bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContex
*/
discard_button->setFocus();
#endif
-
+ /*
+ * On Windows, if multiple Wireshark processes are open, another
+ * application has focus, and "Close all [Wireshark] windows" is
+ * chosen from the taskbar, we need to activate the window to
+ * at least flash the taskbar (#16309).
+ */
+ activateWindow();
msg_dialog.exec();
/* According to the Qt doc:
* when using QMessageBox with custom buttons, exec() function returns an opaque value.
@@ -2057,7 +1980,7 @@ void LograyMainWindow::findTextCodecs() {
// annoying to properly place IBM00858 and IBM00924 in the middle of
// code page numbers not zero padded to 5 digits.
// We could manipulate the key further to have more commonly used
- // charsets earlier. IANA MIB ordering would be unxpected:
+ // charsets earlier. IANA MIB ordering would be unexpected:
// https://www.iana.org/assignments/character-sets/character-sets.xml
// For data about use in HTTP (other protocols can be quite different):
// https://w3techs.com/technologies/overview/character_encoding
@@ -2090,11 +2013,10 @@ void LograyMainWindow::initMainToolbarIcons()
main_ui_->actionCaptureRestart->setIcon(StockIcon("x-capture-restart-circle"));
main_ui_->actionCaptureOptions->setIcon(StockIcon("x-capture-options"));
- // Menu icons are disabled in main_window.ui for these items.
+ // Menu icons are disabled in logray_main_window.ui for these File-> items.
main_ui_->actionFileOpen->setIcon(StockIcon("document-open"));
main_ui_->actionFileSave->setIcon(StockIcon("x-capture-file-save"));
main_ui_->actionFileClose->setIcon(StockIcon("x-capture-file-close"));
- main_ui_->actionViewReload->setIcon(StockIcon("x-capture-file-reload"));
main_ui_->actionEditFindPacket->setIcon(StockIcon("edit-find"));
main_ui_->actionGoPreviousPacket->setIcon(StockIcon("go-previous"));
@@ -2121,6 +2043,8 @@ void LograyMainWindow::initMainToolbarIcons()
main_ui_->actionViewZoomOut->setIcon(StockIcon("zoom-out"));
main_ui_->actionViewNormalSize->setIcon(StockIcon("zoom-original"));
main_ui_->actionViewResizeColumns->setIcon(StockIcon("x-resize-columns"));
+ main_ui_->actionViewResetLayout->setIcon(StockIcon("x-reset-layout_2"));
+ main_ui_->actionViewReload->setIcon(StockIcon("x-capture-file-reload"));
main_ui_->actionNewDisplayFilterExpression->setIcon(StockIcon("list-add"));
}
@@ -2141,7 +2065,6 @@ void LograyMainWindow::initShowHideMainWidgets()
shmw_actions[main_ui_->actionViewPacketList] = packet_list_;
shmw_actions[main_ui_->actionViewPacketDetails] = proto_tree_;
shmw_actions[main_ui_->actionViewPacketBytes] = byte_view_tab_;
- shmw_actions[main_ui_->actionViewPacketDiagram] = packet_diagram_;
foreach(QAction *shmwa, shmw_actions.keys()) {
shmwa->setData(QVariant::fromValue(shmw_actions[shmwa]));
@@ -2154,7 +2077,7 @@ void LograyMainWindow::initShowHideMainWidgets()
/* Initially hide the additional toolbars menus */
main_ui_->menuAdditionalToolbars->menuAction()->setVisible(false);
- connect(show_hide_actions_, SIGNAL(triggered(QAction*)), this, SLOT(showHideMainWidgets(QAction*)));
+ connect(show_hide_actions_, &QActionGroup::triggered, this, &LograyMainWindow::showHideMainWidgets);
}
void LograyMainWindow::initTimeDisplayFormatMenu()
@@ -2181,7 +2104,7 @@ void LograyMainWindow::initTimeDisplayFormatMenu()
time_display_actions_->addAction(tda);
}
- connect(time_display_actions_, SIGNAL(triggered(QAction*)), this, SLOT(setTimestampFormat(QAction*)));
+ connect(time_display_actions_, &QActionGroup::triggered, this, &LograyMainWindow::setTimestampFormat);
}
void LograyMainWindow::initTimePrecisionFormatMenu()
@@ -2209,7 +2132,7 @@ void LograyMainWindow::initTimePrecisionFormatMenu()
time_precision_actions_->addAction(tpa);
}
- connect(time_precision_actions_, SIGNAL(triggered(QAction*)), this, SLOT(setTimestampPrecision(QAction*)));
+ connect(time_precision_actions_, &QActionGroup::triggered, this, &LograyMainWindow::setTimestampPrecision);
}
// Menu items which will be disabled when we freeze() and whose state will
@@ -2219,10 +2142,10 @@ void LograyMainWindow::initFreezeActions()
QList<QAction *> freeze_actions = QList<QAction *>()
<< main_ui_->actionFileClose
<< main_ui_->actionViewReload
- << main_ui_->actionEditMarkPacket
+ << main_ui_->actionEditMarkSelected
<< main_ui_->actionEditMarkAllDisplayed
<< main_ui_->actionEditUnmarkAllDisplayed
- << main_ui_->actionEditIgnorePacket
+ << main_ui_->actionEditIgnoreSelected
<< main_ui_->actionEditIgnoreAllDisplayed
<< main_ui_->actionEditUnignoreAllDisplayed
<< main_ui_->actionEditSetTimeReference
@@ -2250,8 +2173,8 @@ void LograyMainWindow::initConversationMenus()
ConversationAction *conv_action = new ConversationAction(main_ui_->menuConversationFilter, conv_filter);
main_ui_->menuConversationFilter->addAction(conv_action);
- connect(this, SIGNAL(packetInfoChanged(_packet_info*)), conv_action, SLOT(setPacketInfo(_packet_info*)));
- connect(conv_action, SIGNAL(triggered()), this, SLOT(applyConversationFilter()), Qt::QueuedConnection);
+ connect(this, &LograyMainWindow::packetInfoChanged, conv_action, &ConversationAction::setPacketInfo);
+ connect(conv_action, &ConversationAction::triggered, this, &LograyMainWindow::applyConversationFilter, Qt::QueuedConnection);
// Packet list context menu items
packet_list_->conversationMenu()->addAction(conv_action);
@@ -2265,15 +2188,15 @@ void LograyMainWindow::initConversationMenus()
conv_action->setIcon(cc_action->icon());
conv_action->setColorNumber(i++);
submenu->addAction(conv_action);
- connect(this, SIGNAL(packetInfoChanged(_packet_info*)), conv_action, SLOT(setPacketInfo(_packet_info*)));
- connect(conv_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &LograyMainWindow::packetInfoChanged, conv_action, &ConversationAction::setPacketInfo);
+ connect(conv_action, &ConversationAction::triggered, this, &LograyMainWindow::colorizeActionTriggered);
}
conv_action = new ConversationAction(submenu, conv_filter);
conv_action->setText(main_ui_->actionViewColorizeNewColoringRule->text());
submenu->addAction(conv_action);
- connect(this, SIGNAL(packetInfoChanged(_packet_info*)), conv_action, SLOT(setPacketInfo(_packet_info*)));
- connect(conv_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &LograyMainWindow::packetInfoChanged, conv_action, &ConversationAction::setPacketInfo);
+ connect(conv_action, &ConversationAction::triggered, this, &LograyMainWindow::colorizeActionTriggered);
// Proto tree conversation menu is filled in in ProtoTree::contextMenuEvent.
// We should probably do that here.
@@ -2288,65 +2211,92 @@ void LograyMainWindow::initConversationMenus()
colorize_action->setIcon(cc_action->icon());
colorize_action->setColorNumber(i++);
proto_tree_->colorizeMenu()->addAction(colorize_action);
- connect(this, SIGNAL(fieldFilterChanged(QByteArray)), colorize_action, SLOT(setFieldFilter(QByteArray)));
- connect(colorize_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &LograyMainWindow::fieldFilterChanged, colorize_action, &ColorizeAction::setFieldFilter);
+ connect(colorize_action, &ColorizeAction::triggered, this, &LograyMainWindow::colorizeActionTriggered);
}
colorize_action = new ColorizeAction(proto_tree_->colorizeMenu());
colorize_action->setText(main_ui_->actionViewColorizeNewColoringRule->text());
proto_tree_->colorizeMenu()->addAction(colorize_action);
- connect(this, SIGNAL(fieldFilterChanged(QByteArray)), colorize_action, SLOT(setFieldFilter(QByteArray)));
- connect(colorize_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &LograyMainWindow::fieldFilterChanged, colorize_action, &ColorizeAction::setFieldFilter);
+ connect(colorize_action, &ColorizeAction::triggered, this, &LograyMainWindow::colorizeActionTriggered);
}
-bool LograyMainWindow::addExportObjectsMenuItem(const void *, void *value, void *userdata)
+bool LograyMainWindow::addFollowStreamMenuItem(const void *key _U_, void *value, void *userdata)
{
- register_eo_t *eo = (register_eo_t*)value;
+ register_follow_t *follow = (register_follow_t*)value;
LograyMainWindow *window = (LograyMainWindow*)userdata;
- ExportObjectAction *export_action = new ExportObjectAction(window->main_ui_->menuFileExportObjects, eo);
- window->main_ui_->menuFileExportObjects->addAction(export_action);
+ FollowStreamAction *follow_action = new FollowStreamAction(window->main_ui_->menuFollow, follow);
+ window->main_ui_->menuFollow->addAction(follow_action);
- //initially disable until a file is loaded (then file signals will take over)
- export_action->setEnabled(false);
+ follow_action->setEnabled(false);
- connect(&window->capture_file_, SIGNAL(captureEvent(CaptureEvent)), export_action, SLOT(captureFileEvent(CaptureEvent)));
- connect(export_action, SIGNAL(triggered()), window, SLOT(applyExportObject()));
- return FALSE;
+ /* Special features for some of the built in follow types, like
+ * shortcuts and overriding the name. XXX: Should these go in
+ * FollowStreamAction, or should some of these (e.g. TCP and UDP)
+ * be registered in initFollowStreamMenus so that they can be
+ * on the top of the menu list too?
+ */
+ // XXX - Should we add matches for syscall properties, e.g. file descriptors?
+ const char *short_name = (const char*)key;
+ if (g_strcmp0(short_name, "Falco Bridge") == 0) {
+ follow_action->setText(tr("File Descriptor Stream"));
+ }
+ // if (g_strcmp0(short_name, "TCP") == 0) {
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_T);
+ // } else if (g_strcmp0(short_name, "UDP") == 0) {
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_U);
+ // } else if (g_strcmp0(short_name, "DCCP") == 0) {
+ // /* XXX: Not sure this one is widely enough used to need a shortcut. */
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_E);
+ // } else if (g_strcmp0(short_name, "TLS") == 0) {
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_S);
+ // } else if (g_strcmp0(short_name, "HTTP") == 0) {
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_H);
+ // } else if (g_strcmp0(short_name, "HTTP2") == 0) {
+ // follow_action->setText(tr("HTTP/2 Stream"));
+ // } else if (g_strcmp0(short_name, "SIP") == 0) {
+ // follow_action->setText(tr("SIP Call"));
+ // } else if (g_strcmp0(short_name, "USBCOM") == 0) {
+ // follow_action->setText(tr("USB CDC Data"));
+ // }
+
+ connect(follow_action, &QAction::triggered, window,
+ [window, follow]() { window->openFollowStreamDialog(get_follow_proto_id(follow)); },
+ Qt::QueuedConnection);
+ return false;
}
-void LograyMainWindow::initExportObjectsMenus()
+void LograyMainWindow::initFollowStreamMenus()
{
- eo_iterate_tables(addExportObjectsMenuItem, this);
+ /* This puts them all in the menus in alphabetical order. */
+ follow_iterate_followers(addFollowStreamMenuItem, this);
}
// Titlebar
void LograyMainWindow::setTitlebarForCaptureFile()
{
- if (capture_file_.capFile() && capture_file_.capFile()->filename) {
- setWSWindowTitle(QString("[*]%1").arg(capture_file_.fileDisplayName()));
- //
- // XXX - on non-Mac platforms, put in the application
- // name? Or do so only for temporary files?
- //
- if (!capture_file_.capFile()->is_tempfile) {
- //
- // Set the file path; that way, for macOS, it'll set the
- // "proxy icon".
- //
- setWindowFilePath(capture_file_.filePath());
- }
- setWindowModified(cf_has_unsaved_data(capture_file_.capFile()));
- } else {
- /* We have no capture file. */
- setWSWindowTitle();
- }
+ use_capturing_title_ = false;
+ updateTitlebar();
}
QString LograyMainWindow::replaceWindowTitleVariables(QString title)
{
title.replace("%P", get_profile_name());
- title.replace("%V", get_ws_vcs_version_info());
+ title.replace("%V", get_lr_vcs_version_info());
+
+#ifdef HAVE_LIBPCAP
+ if (global_commandline_info.capture_comments) {
+ // Use the first capture comment from command line.
+ title.replace("%C", (char *)g_ptr_array_index(global_commandline_info.capture_comments, 0));
+ } else {
+ // No capture comment.
+ title.remove("%C");
+ }
+#else
+ title.remove("%C");
+#endif
if (title.contains("%F")) {
// %F is file path of the capture file.
@@ -2389,7 +2339,7 @@ QString LograyMainWindow::replaceWindowTitleVariables(QString title)
void LograyMainWindow::setWSWindowTitle(QString title)
{
if (title.isEmpty()) {
- title = tr("The Logray System Log Analyzer");
+ title = tr("The Logray System Call and Log Analyzer");
}
if (prefs.gui_prepend_window_title && prefs.gui_prepend_window_title[0]) {
@@ -2417,10 +2367,30 @@ void LograyMainWindow::setWSWindowTitle(QString title)
void LograyMainWindow::setTitlebarForCaptureInProgress()
{
- if (capture_file_.capFile()) {
+ use_capturing_title_ = true;
+ updateTitlebar();
+}
+
+void LograyMainWindow::updateTitlebar()
+{
+ if (use_capturing_title_ && capture_file_.capFile()) {
setWSWindowTitle(tr("Capturing from %1").arg(cf_get_tempfile_source(capture_file_.capFile())));
+ } else if (capture_file_.capFile() && capture_file_.capFile()->filename) {
+ setWSWindowTitle(QString("[*]%1").arg(capture_file_.fileDisplayName()));
+ //
+ // XXX - on non-Mac platforms, put in the application
+ // name? Or do so only for temporary files?
+ //
+ if (!capture_file_.capFile()->is_tempfile) {
+ //
+ // Set the file path; that way, for macOS, it'll set the
+ // "proxy icon".
+ //
+ setWindowFilePath(capture_file_.filePath());
+ }
+ setWindowModified(cf_has_unsaved_data(capture_file_.capFile()));
} else {
- /* We have no capture in progress. */
+ /* We have no capture file. */
setWSWindowTitle();
}
}
@@ -2466,12 +2436,6 @@ void LograyMainWindow::setMenusForCaptureFile(bool force_disable)
main_ui_->actionFileExportAsPSML->setEnabled(enable);
main_ui_->actionFileExportAsJSON->setEnabled(enable);
- main_ui_->actionFileExportPDU->setEnabled(enable);
-
- foreach(QAction *eo_action, main_ui_->menuFileExportObjects->actions()) {
- eo_action->setEnabled(enable);
- }
-
main_ui_->actionViewReload->setEnabled(enable);
#ifdef HAVE_SOFTWARE_UPDATE
@@ -2494,12 +2458,6 @@ void LograyMainWindow::setMenusForCaptureInProgress(bool capture_in_progress) {
main_ui_->actionFileExportAsPSML->setEnabled(capture_in_progress);
main_ui_->actionFileExportAsJSON->setEnabled(capture_in_progress);
- main_ui_->actionFileExportPDU->setEnabled(!capture_in_progress);
-
- foreach(QAction *eo_action, main_ui_->menuFileExportObjects->actions()) {
- eo_action->setEnabled(capture_in_progress);
- }
-
main_ui_->menuFileSet->setEnabled(!capture_in_progress);
main_ui_->actionFileQuit->setEnabled(true);
#ifdef HAVE_SOFTWARE_UPDATE
@@ -2585,7 +2543,7 @@ void LograyMainWindow::setWindowIcon(const QIcon &icon) {
}
void LograyMainWindow::updateForUnsavedChanges() {
- setTitlebarForCaptureFile();
+ updateTitlebar();
setMenusForCaptureFile();
}
@@ -2599,6 +2557,7 @@ void LograyMainWindow::changeEvent(QEvent* event)
main_ui_->retranslateUi(this);
// make sure that the "Clear Menu" item is retranslated
mainApp->emitAppSignal(WiresharkApplication::RecentCapturesChanged);
+ updateTitlebar();
break;
case QEvent::LocaleChange: {
QString locale = QLocale::system().name();
@@ -2649,28 +2608,29 @@ void LograyMainWindow::addMenuActions(QList<QAction *> &actions, int menu_group)
main_ui_->actionStatistics_REGISTER_STAT_GROUP_UNSORTED,
action);
break;
-// case REGISTER_TOOLS_GROUP_UNSORTED:
-// {
-// // Allow the creation of submenus. Mimics the behavor of
-// // ui/gtk/main_menubar.c:add_menu_item_to_main_menubar
-// // and GtkUIManager.
-// //
-// // For now we limit the insanity to the "Tools" menu.
-// QStringList menu_path = action->text().split('/');
-// QMenu *cur_menu = main_ui_->menuTools;
-// while (menu_path.length() > 1) {
-// QString menu_title = menu_path.takeFirst();
-// QMenu *submenu = cur_menu->findChild<QMenu *>(menu_title.toLower(), Qt::FindDirectChildrenOnly);
-// if (!submenu) {
-// submenu = cur_menu->addMenu(menu_title);
-// submenu->setObjectName(menu_title.toLower());
-// }
-// cur_menu = submenu;
-// }
-// action->setText(menu_path.last());
-// cur_menu->addAction(action);
-// break;
-// }
+ case REGISTER_TOOLS_GROUP_UNSORTED:
+ {
+ main_ui_->menuTools->show(); // Remove this if we ever add any built-in tools.
+ // Allow the creation of submenus. Mimics the behaviour of
+ // ui/gtk/main_menubar.c:add_menu_item_to_main_menubar
+ // and GtkUIManager.
+ //
+ // For now we limit the insanity to the "Tools" menu.
+ QStringList menu_path = action->text().split('/');
+ QMenu *cur_menu = main_ui_->menuTools;
+ while (menu_path.length() > 1) {
+ QString menu_title = menu_path.takeFirst();
+ QMenu *submenu = cur_menu->findChild<QMenu *>(menu_title.toLower(), Qt::FindDirectChildrenOnly);
+ if (!submenu) {
+ submenu = cur_menu->addMenu(menu_title);
+ submenu->setObjectName(menu_title.toLower());
+ }
+ cur_menu = submenu;
+ }
+ action->setText(menu_path.last());
+ cur_menu->addAction(action);
+ break;
+ }
default:
// Skip packet items.
return;
@@ -2680,9 +2640,9 @@ void LograyMainWindow::addMenuActions(QList<QAction *> &actions, int menu_group)
// distinguish various types of actions. Setting their objectName
// seems to work OK.
if (action->objectName() == TapParameterDialog::actionName()) {
- connect(action, SIGNAL(triggered(bool)), this, SLOT(openTapParameterDialog()));
+ connect(action, &QAction::triggered, this, [=]() { openTapParameterDialog(); });
} else if (action->objectName() == FunnelStatistics::actionName()) {
- connect(action, SIGNAL(triggered(bool)), funnel_statistics_, SLOT(funnelActionTriggered()));
+ connect(action, &QAction::triggered, funnel_statistics_, &FunnelStatistics::funnelActionTriggered);
}
}
}
@@ -2695,20 +2655,26 @@ void LograyMainWindow::removeMenuActions(QList<QAction *> &actions, int menu_gro
case REGISTER_LOG_STAT_GROUP_UNSORTED:
main_ui_->menuStatistics->removeAction(action);
break;
-// case REGISTER_TOOLS_GROUP_UNSORTED:
-// {
-// // Allow removal of submenus.
-// // For now we limit the insanity to the "Tools" menu.
-// QStringList menu_path = action->text().split('/');
-// QMenu *cur_menu = main_ui_->menuTools;
-// while (menu_path.length() > 1) {
-// QString menu_title = menu_path.takeFirst();
-// QMenu *submenu = cur_menu->findChild<QMenu *>(menu_title.toLower(), Qt::FindDirectChildrenOnly);
-// cur_menu = submenu;
-// }
-// cur_menu->removeAction(action);
-// break;
-// }
+ case REGISTER_TOOLS_GROUP_UNSORTED:
+ {
+ // Allow removal of submenus.
+ // For now we limit the insanity to the "Tools" menu.
+ QStringList menu_path = action->text().split('/');
+ QMenu *cur_menu = main_ui_->menuTools;
+ while (menu_path.length() > 1) {
+ QString menu_title = menu_path.takeFirst();
+ QMenu *submenu = cur_menu->findChild<QMenu *>(menu_title.toLower(), Qt::FindDirectChildrenOnly);
+ cur_menu = submenu;
+ }
+ cur_menu->removeAction(action);
+ // Remove empty submenus.
+ while (cur_menu != main_ui_->menuTools) {
+ QMenu *empty_menu = (cur_menu->isEmpty() ? cur_menu : NULL);
+ cur_menu = dynamic_cast<QMenu *>(cur_menu->parent());
+ delete empty_menu;
+ }
+ break;
+ }
default:
// qDebug() << "FIX: Remove" << action->text() << "from the menu";
break;
@@ -2739,7 +2705,7 @@ void LograyMainWindow::reloadDynamicMenus()
mainApp->clearRemovedMenuGroupItems();
}
-void LograyMainWindow::externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, gint depth)
+void LograyMainWindow::externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, int depth)
{
QAction * itemAction = Q_NULLPTR;
ext_menubar_t * item = Q_NULLPTR;
diff --git a/ui/logray/logray_main_window.h b/ui/logray/logray_main_window.h
index 328cf0f8..5b84084d 100644
--- a/ui/logray/logray_main_window.h
+++ b/ui/logray/logray_main_window.h
@@ -40,8 +40,6 @@
#include <config.h>
-#include <glib.h>
-
#include "file.h"
#include "ui/ws_ui_util.h"
@@ -81,7 +79,6 @@ class FilterDialog;
class FunnelStatistics;
class WelcomePage;
class PacketCommentDialog;
-class PacketDiagram;
class PacketList;
class ProtoTree;
class FilterExpressionToolBar;
@@ -117,7 +114,7 @@ public:
void removeAdditionalToolbar(QString toolbarName);
void addInterfaceToolbar(const iface_toolbar *toolbar_entry);
- void removeInterfaceToolbar(const gchar *menu_title);
+ void removeInterfaceToolbar(const char *menu_title);
QString getMwFileName();
void setMwFileName(QString fileName);
@@ -172,6 +169,7 @@ private:
bool capture_stopping_;
bool capture_filter_valid_;
+ bool use_capturing_title_;
#ifdef HAVE_LIBPCAP
capture_session cap_session_;
CaptureOptionsDialog *capture_options_dialog_;
@@ -220,11 +218,12 @@ private:
void setMenusForFileSet(bool enable_list_files);
void setWindowIcon(const QIcon &icon);
QString replaceWindowTitleVariables(QString title);
+ void updateStyleSheet();
- void externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, gint depth);
+ void externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, int depth);
void setForCaptureInProgress(bool capture_in_progress = false, bool handle_toolbars = false, GArray *ifaces = NULL);
- QMenu* findOrAddMenu(QMenu *parent_menu, QString& menu_text);
+ QMenu* findOrAddMenu(QMenu *parent_menu, const QStringList& menu_parts);
void captureFileReadStarted(const QString &action);
@@ -255,11 +254,11 @@ public slots:
* @param cf_path Path to the file.
* @param display_filter Display filter to apply. May be empty.
* @param type File type.
- * @param is_tempfile TRUE/FALSE.
+ * @param is_tempfile true/false.
* @return True on success, false on failure.
*/
// XXX We might want to return a cf_read_status_t or a CaptureFile.
- bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, gboolean is_tempfile = FALSE);
+ bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, bool is_tempfile = false);
bool openCaptureFile(QString cf_path = QString(), QString display_filter = QString()) { return openCaptureFile(cf_path, display_filter, WTAP_TYPE_AUTO); }
void filterPackets(QString new_filter = QString(), bool force = false);
void updateForUnsavedChanges();
@@ -293,8 +292,8 @@ private slots:
void initViewColorizeMenu();
void initConversationMenus();
- static bool addExportObjectsMenuItem(const void *key, void *value, void *userdata);
- void initExportObjectsMenus();
+ static bool addFollowStreamMenuItem(const void *key, void *value, void *userdata);
+ void initFollowStreamMenus();
// in main_window_slots.cpp
/**
@@ -304,6 +303,7 @@ private slots:
*/
void startCapture(QStringList);
void startCapture();
+ void pushLiveCaptureInProgress();
void popLiveCaptureInProgress();
void stopCapture();
@@ -335,6 +335,7 @@ private slots:
void addPluginIFStructures();
QMenu * searchSubMenu(QString objectName);
void activatePluginIFToolbar(bool);
+ void updateTitlebar();
void startInterfaceCapture(bool valid, const QString capture_filter);
@@ -382,8 +383,6 @@ private slots:
// gtk/main_menubar.c
void connectFileMenuActions();
- void exportPacketBytes();
- void exportPDU();
void printFile();
void connectEditMenuActions();
@@ -393,7 +392,7 @@ private slots:
void editConfigurationProfiles();
void editTimeShiftFinished(int);
void addPacketCommentFinished(PacketCommentDialog* pc_dialog, int result);
- void editPacketCommentFinished(PacketCommentDialog* pc_dialog, int result, guint nComment);
+ void editPacketCommentFinished(PacketCommentDialog* pc_dialog, int result, unsigned nComment);
void deleteAllPacketComments();
void deleteAllPacketCommentsFinished(int result);
void showPreferencesDialog(QString module_name);
@@ -429,10 +428,14 @@ private slots:
void filterMenuAboutToShow();
void applyConversationFilter();
- void applyExportObject();
+
+ void openFollowStreamDialog(int proto_id, unsigned stream_num, unsigned sub_stream_num, bool use_stream_index = true);
+ void openFollowStreamDialog(int proto_id);
void statCommandExpertInfo(const char *, void *);
+ void connectToolsMenuActions();
+
void connectHelpMenuActions();
#ifdef HAVE_SOFTWARE_UPDATE
@@ -449,8 +452,9 @@ private slots:
void showConversationsDialog();
void showEndpointsDialog();
- void openStatisticsTreeDialog(const gchar *abbr);
+ void openStatisticsTreeDialog(const char *abbr);
void statCommandIOGraph(const char *, void *);
+ void showIOGraphDialog(io_graph_item_unit_t, QString);
void externalMenuItemTriggered();
diff --git a/ui/logray/logray_main_window.ui b/ui/logray/logray_main_window.ui
index bf2f9bc6..15ed7a8b 100644
--- a/ui/logray/logray_main_window.ui
+++ b/ui/logray/logray_main_window.ui
@@ -14,7 +14,7 @@
<bool>true</bool>
</property>
<property name="windowTitle">
- <string>Wireshark</string>
+ <string>Logray</string>
</property>
<property name="unifiedTitleAndToolBarOnMac">
<bool>true</bool>
@@ -67,7 +67,7 @@
<item>
<widget class="QLabel" name="goToPacketLabel">
<property name="text">
- <string>Packet:</string>
+ <string>Event:</string>
</property>
</widget>
</item>
@@ -84,7 +84,7 @@
</size>
</property>
<property name="text">
- <string>Go to packet</string>
+ <string>Go to event</string>
</property>
<property name="default">
<bool>true</bool>
@@ -161,7 +161,7 @@
</widget>
<widget class="QMenu" name="menuFileExportPacketDissections">
<property name="title">
- <string>Export Packet Dissections</string>
+ <string>Export Event Dissections</string>
</property>
<addaction name="actionFileExportAsPlainText"/>
<addaction name="actionFileExportAsCSV"/>
@@ -171,11 +171,6 @@
<addaction name="actionFileExportAsPDML"/>
<addaction name="actionFileExportAsJSON"/>
</widget>
- <widget class="QMenu" name="menuFileExportObjects">
- <property name="title">
- <string>Export Objects</string>
- </property>
- </widget>
<addaction name="actionFileOpen"/>
<addaction name="menuOpenRecentCaptureFile"/>
<addaction name="actionFileMerge"/>
@@ -189,9 +184,6 @@
<addaction name="separator"/>
<addaction name="actionFileExportPackets"/>
<addaction name="menuFileExportPacketDissections"/>
- <addaction name="actionFileExportPacketBytes"/>
- <addaction name="actionFileExportPDU"/>
- <addaction name="menuFileExportObjects"/>
<addaction name="separator"/>
<addaction name="actionFilePrint"/>
<addaction name="separator"/>
@@ -364,7 +356,6 @@
<addaction name="actionViewPacketList"/>
<addaction name="actionViewPacketDetails"/>
<addaction name="actionViewPacketBytes"/>
- <addaction name="actionViewPacketDiagram"/>
<addaction name="separator"/>
<addaction name="menuTime_Display_Format"/>
<addaction name="menuName_Resolution"/>
@@ -403,6 +394,11 @@
<string>Prepare as Filter</string>
</property>
</widget>
+ <widget class="QMenu" name="menuFollow">
+ <property name="title">
+ <string>Follow</string>
+ </property>
+ </widget>
<widget class="QMenu" name="menuConversationFilter">
<property name="title">
<string>Conversation Filter</string>
@@ -418,9 +414,10 @@
<addaction name="menuConversationFilter"/>
<addaction name="separator"/>
<addaction name="actionAnalyzeEnabledProtocols"/>
- <addaction name="actionAnalyzeDecodeAs"/>
<addaction name="actionAnalyzeReloadLuaPlugins"/>
<addaction name="separator"/>
+ <addaction name="menuFollow"/>
+ <addaction name="separator"/>
<addaction name="actionAnalyzeShowPacketBytes"/>
<addaction name="actionAnalyzeExpertInfo"/>
</widget>
@@ -464,7 +461,7 @@
</widget>
<widget class="QMenu" name="menuPacketComment">
<property name="title">
- <string>Packet Comments</string>
+ <string>Event Comments</string>
</property>
</widget>
<addaction name="menuEditCopy"/>
@@ -472,13 +469,13 @@
<addaction name="actionEditFindNext"/>
<addaction name="actionEditFindPrevious"/>
<addaction name="separator"/>
- <addaction name="actionEditMarkPacket"/>
+ <addaction name="actionEditMarkSelected"/>
<addaction name="actionEditMarkAllDisplayed"/>
<addaction name="actionEditUnmarkAllDisplayed"/>
<addaction name="actionEditNextMark"/>
<addaction name="actionEditPreviousMark"/>
<addaction name="separator"/>
- <addaction name="actionEditIgnorePacket"/>
+ <addaction name="actionEditIgnoreSelected"/>
<addaction name="actionEditIgnoreAllDisplayed"/>
<addaction name="actionEditUnignoreAllDisplayed"/>
<addaction name="separator"/>
@@ -562,6 +559,7 @@
<addaction name="actionViewZoomOut"/>
<addaction name="actionViewNormalSize"/>
<addaction name="actionViewResizeColumns"/>
+ <addaction name="actionViewResetLayout"/>
</widget>
<widget class="MainStatusBar" name="statusBar"/>
<widget class="QToolBar" name="displayFilterToolBar">
@@ -604,7 +602,7 @@
<string>&amp;Quit</string>
</property>
<property name="toolTip">
- <string>Quit Wireshark</string>
+ <string>Quit Logray</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Q</string>
@@ -621,7 +619,7 @@
<string>&amp;Start</string>
</property>
<property name="toolTip">
- <string>Start capturing packets</string>
+ <string>Start capturing events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+E</string>
@@ -632,7 +630,7 @@
<string>S&amp;top</string>
</property>
<property name="toolTip">
- <string>Stop capturing packets</string>
+ <string>Stop capturing events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+E</string>
@@ -662,17 +660,15 @@
</action>
<action name="actionHelpContents">
<property name="text">
- <string>&amp;Contents</string>
+ <string>&amp;User's Guide</string>
</property>
+ <!-- This tooltip is replaced with the URL -->
<property name="toolTip">
- <string>Help contents</string>
+ <string>Wireshark User's Guide</string>
</property>
<property name="shortcut">
<string notr="true">F1</string>
</property>
- <property name="iconVisibleInMenu">
- <bool>true</bool>
- </property>
</action>
<action name="actionHelpMPWireshark">
<property name="text">
@@ -681,7 +677,7 @@
</action>
<action name="actionHelpMPWireshark_Filter">
<property name="text">
- <string>Wireshark Filter</string>
+ <string>Display Filters</string>
</property>
</action>
<action name="actionHelpMPTShark">
@@ -752,7 +748,7 @@
</action>
<action name="actionHelpAbout">
<property name="text">
- <string>&amp;About Wireshark</string>
+ <string>&amp;About Logray</string>
</property>
<property name="menuRole">
<enum>QAction::AboutRole</enum>
@@ -772,10 +768,10 @@
</action>
<action name="actionGoNextPacket">
<property name="text">
- <string>Next Packet</string>
+ <string>Next Event</string>
</property>
<property name="toolTip">
- <string>Go to the next packet</string>
+ <string>Go to the next event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Down</string>
@@ -783,10 +779,10 @@
</action>
<action name="actionGoPreviousPacket">
<property name="text">
- <string>Previous Packet</string>
+ <string>Previous Event</string>
</property>
<property name="toolTip">
- <string>Go to the previous packet</string>
+ <string>Go to the previous event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Up</string>
@@ -794,10 +790,10 @@
</action>
<action name="actionGoNextConversationPacket">
<property name="text">
- <string>Next Packet in Conversation</string>
+ <string>Next Event in Conversation</string>
</property>
<property name="toolTip">
- <string>Go to the next packet in this conversation</string>
+ <string>Go to the next event in this conversation</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+.</string>
@@ -805,10 +801,10 @@
</action>
<action name="actionGoPreviousConversationPacket">
<property name="text">
- <string>Previous Packet in Conversation</string>
+ <string>Previous Event in Conversation</string>
</property>
<property name="toolTip">
- <string>Go to the previous packet in this conversation</string>
+ <string>Go to the previous event in this conversation</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+,</string>
@@ -816,10 +812,10 @@
</action>
<action name="actionGoNextHistoryPacket">
<property name="text">
- <string>Next Packet In History</string>
+ <string>Next Event In History</string>
</property>
<property name="toolTip">
- <string>Go to the next packet in your selection history</string>
+ <string>Go to the next event in your selection history</string>
</property>
<property name="shortcut">
<string notr="true">Alt+Right</string>
@@ -827,10 +823,10 @@
</action>
<action name="actionGoPreviousHistoryPacket">
<property name="text">
- <string>Previous Packet In History</string>
+ <string>Previous Event In History</string>
</property>
<property name="toolTip">
- <string>Go to the previous packet in your selection history</string>
+ <string>Go to the previous event in your selection history</string>
</property>
<property name="shortcut">
<string notr="true">Alt+Left</string>
@@ -838,10 +834,10 @@
</action>
<action name="actionGoFirstPacket">
<property name="text">
- <string>First Packet</string>
+ <string>First Event</string>
</property>
<property name="toolTip">
- <string>Go to the first packet</string>
+ <string>Go to the first event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Home</string>
@@ -849,10 +845,10 @@
</action>
<action name="actionGoLastPacket">
<property name="text">
- <string>Last Packet</string>
+ <string>Last Event</string>
</property>
<property name="toolTip">
- <string>Go to the last packet</string>
+ <string>Go to the last event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+End</string>
@@ -866,7 +862,7 @@
<string>E&amp;xpand Subtrees</string>
</property>
<property name="toolTip">
- <string>Expand the current packet detail</string>
+ <string>Expand the current event detail</string>
</property>
<property name="shortcut">
<string notr="true">Shift+Right</string>
@@ -880,7 +876,7 @@
<string>Collapse Subtrees</string>
</property>
<property name="toolTip">
- <string>Collapse the current packet detail</string>
+ <string>Collapse the current event detail</string>
</property>
<property name="shortcut">
<string notr="true">Shift+Left</string>
@@ -891,7 +887,7 @@
<string>&amp;Expand All</string>
</property>
<property name="toolTip">
- <string>Expand packet details</string>
+ <string>Expand event details</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Right</string>
@@ -902,7 +898,7 @@
<string>Collapse &amp;All</string>
</property>
<property name="toolTip">
- <string>Collapse all packet details</string>
+ <string>Collapse all event details</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Left</string>
@@ -913,10 +909,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Go to Packet…</string>
+ <string>Go to Event…</string>
</property>
<property name="toolTip">
- <string>Go to specified packet</string>
+ <string>Go to specified event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+G</string>
@@ -965,18 +961,10 @@
</action>
<action name="actionFileExportPackets">
<property name="text">
- <string>Export Specified Packets…</string>
+ <string>Export Specified Events…</string>
</property>
<property name="toolTip">
- <string>Export specified packets</string>
- </property>
- </action>
- <action name="actionFileExportPacketBytes">
- <property name="text">
- <string>Export Packet &amp;Bytes…</string>
- </property>
- <property name="shortcut">
- <string notr="true">Ctrl+Shift+X</string>
+ <string>Export specified events</string>
</property>
</action>
<action name="actionFilePrint">
@@ -1188,7 +1176,7 @@
<string>Apply as Column</string>
</property>
<property name="toolTip">
- <string>Create a packet list column from the selected field.</string>
+ <string>Create an event list column from the selected field.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+I</string>
@@ -1196,10 +1184,10 @@
</action>
<action name="actionEditFindPacket">
<property name="text">
- <string>&amp;Find Packet…</string>
+ <string>&amp;Find Event…</string>
</property>
<property name="toolTip">
- <string>Find a packet</string>
+ <string>Find an event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+F</string>
@@ -1210,7 +1198,7 @@
<string>Find Ne&amp;xt</string>
</property>
<property name="toolTip">
- <string>Find the next packet</string>
+ <string>Find the next event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+N</string>
@@ -1221,18 +1209,18 @@
<string>Find Pre&amp;vious</string>
</property>
<property name="toolTip">
- <string>Find the previous packet</string>
+ <string>Find the previous event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+B</string>
</property>
</action>
- <action name="actionEditMarkPacket">
+ <action name="actionEditMarkSelected">
<property name="text">
- <string>&amp;Mark/Unmark Packet(s)</string>
+ <string>&amp;Mark/Unmark Selected</string>
</property>
<property name="toolTip">
- <string>Mark or unmark each selected packet</string>
+ <string>Mark or unmark each selected event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+M</string>
@@ -1243,7 +1231,7 @@
<string>Mark All Displayed</string>
</property>
<property name="toolTip">
- <string>Mark all displayed packets</string>
+ <string>Mark all displayed events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+M</string>
@@ -1254,7 +1242,7 @@
<string>&amp;Unmark All Displayed</string>
</property>
<property name="toolTip">
- <string>Unmark all displayed packets</string>
+ <string>Unmark all displayed events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+M</string>
@@ -1265,7 +1253,7 @@
<string>Next Mark</string>
</property>
<property name="toolTip">
- <string>Go to the next marked packet</string>
+ <string>Go to the next marked event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+N</string>
@@ -1276,18 +1264,18 @@
<string>Previous Mark</string>
</property>
<property name="toolTip">
- <string>Go to the previous marked packet</string>
+ <string>Go to the previous marked event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+B</string>
</property>
</action>
- <action name="actionEditIgnorePacket">
+ <action name="actionEditIgnoreSelected">
<property name="text">
- <string>&amp;Ignore/Unignore Packet(s)</string>
+ <string>&amp;Ignore/Unignore Selected</string>
</property>
<property name="toolTip">
- <string>Ignore or unignore each selected packet</string>
+ <string>Ignore or unignore each selected event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+D</string>
@@ -1298,7 +1286,7 @@
<string>Ignore All Displayed</string>
</property>
<property name="toolTip">
- <string>Ignore all displayed packets</string>
+ <string>Ignore all displayed events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+D</string>
@@ -1309,7 +1297,7 @@
<string>U&amp;nignore All Displayed</string>
</property>
<property name="toolTip">
- <string>Unignore all displayed packets</string>
+ <string>Unignore all displayed events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+D</string>
@@ -1320,7 +1308,7 @@
<string>Set/Unset Time Reference</string>
</property>
<property name="toolTip">
- <string>Set or unset a time reference for this packet</string>
+ <string>Set or unset a time reference for this event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+T</string>
@@ -1364,7 +1352,7 @@
<string>Time Shift…</string>
</property>
<property name="toolTip">
- <string>Shift or change packet timestamps</string>
+ <string>Shift or change event timestamps</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+T</string>
@@ -1372,10 +1360,10 @@
</action>
<action name="actionDeleteAllPacketComments">
<property name="text">
- <string>Delete All Packet Comments</string>
+ <string>Delete All Event Comments</string>
</property>
<property name="toolTip">
- <string>Remove all packet comments in the capture file</string>
+ <string>Remove all event comments in the capture file</string>
</property>
</action>
<action name="actionEditConfigurationProfiles">
@@ -1403,7 +1391,7 @@
<string>&amp;Preferences…</string>
</property>
<property name="toolTip">
- <string>Manage Wireshark's preferences</string>
+ <string>Manage Logray's preferences</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+P</string>
@@ -1457,21 +1445,10 @@
</action>
<action name="actionStatisticsPacketLengths">
<property name="text">
- <string>Packet Lengths</string>
- </property>
- <property name="toolTip">
- <string>Packet length statistics</string>
- </property>
- </action>
- <action name="actionAnalyzeDecodeAs">
- <property name="text">
- <string>Decode &amp;As…</string>
+ <string>Event Lengths</string>
</property>
<property name="toolTip">
- <string>Change the way packets are dissected</string>
- </property>
- <property name="shortcut">
- <string notr="true">Ctrl+Shift+U</string>
+ <string>Event length statistics</string>
</property>
</action>
<action name="actionAnalyzeReloadLuaPlugins">
@@ -1485,11 +1462,6 @@
<string notr="true">Ctrl+Shift+L</string>
</property>
</action>
- <action name="actionFileExportPDU">
- <property name="text">
- <string>Export PDUs to File…</string>
- </property>
- </action>
<action name="actionStatisticsIOGraph">
<property name="text">
<string>&amp;I/O Graphs</string>
@@ -1547,10 +1519,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Colorize Packet List</string>
+ <string>Colorize Event List</string>
</property>
<property name="toolTip">
- <string>Draw packets using your coloring rules</string>
+ <string>Draw events using your coloring rules</string>
</property>
</action>
<action name="actionViewZoomIn">
@@ -1591,7 +1563,7 @@
<string>Reset Layout</string>
</property>
<property name="toolTip">
- <string>Reset appearance layout to default size</string>
+ <string>Reset layout to default size</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+W</string>
@@ -1602,7 +1574,7 @@
<string>Resize Columns</string>
</property>
<property name="toolTip">
- <string>Resize packet list columns to fit contents</string>
+ <string>Resize event list columns to fit contents</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+R</string>
@@ -1616,7 +1588,7 @@
<string>Date and Time of Day (1970-01-01 01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the date and time of day.</string>
+ <string>Show event times as the date and time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+1</string>
@@ -1630,7 +1602,7 @@
<string>Year, Day of Year, and Time of Day (1970/001 01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the year, day of the year and time of day.</string>
+ <string>Show event times as the year, day of the year and time of day.</string>
</property>
</action>
<action name="actionViewTimeDisplayFormatTimeOfDay">
@@ -1641,7 +1613,7 @@
<string>Time of Day (01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the date and time of day.</string>
+ <string>Show event times as the date and time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+2</string>
@@ -1655,7 +1627,7 @@
<string>Seconds Since 1970-01-01</string>
</property>
<property name="toolTip">
- <string>Show packet times as the seconds since the UNIX / POSIX epoch (1970-01-01).</string>
+ <string>Show event times as the seconds since the UNIX / POSIX epoch (1970-01-01).</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+3</string>
@@ -1669,7 +1641,7 @@
<string>Seconds Since Beginning of Capture</string>
</property>
<property name="toolTip">
- <string>Show packet times as the date and time of day.</string>
+ <string>Show event times as the date and time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+4</string>
@@ -1680,10 +1652,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Seconds Since Previous Captured Packet</string>
+ <string>Seconds Since Previous Captured Event</string>
</property>
<property name="toolTip">
- <string>Show packet times as the seconds since the previous captured packet.</string>
+ <string>Show event times as the seconds since the previous captured event.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+5</string>
@@ -1694,10 +1666,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Seconds Since Previous Displayed Packet</string>
+ <string>Seconds Since Previous Displayed Event</string>
</property>
<property name="toolTip">
- <string>Show packet times as the seconds since the previous displayed packet.</string>
+ <string>Show event times as the seconds since the previous displayed event.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+6</string>
@@ -1711,7 +1683,7 @@
<string>UTC Date and Time of Day (1970-01-01 01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the UTC date and time of day.</string>
+ <string>Show event times as the UTC date and time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+7</string>
@@ -1725,7 +1697,7 @@
<string>UTC Year, Day of Year, and Time of Day (1970/001 01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the UTC year, day of the year and time of day.</string>
+ <string>Show event times as the UTC year, day of the year and time of day.</string>
</property>
</action>
<action name="actionViewTimeDisplayFormatUTCTimeOfDay">
@@ -1736,7 +1708,7 @@
<string>UTC Time of Day (01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the UTC time of day.</string>
+ <string>Show event times as the UTC time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+8</string>
@@ -1899,10 +1871,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Packet &amp;List</string>
+ <string>Event &amp;List</string>
</property>
<property name="toolTip">
- <string>Show or hide the packet list</string>
+ <string>Show or hide the event list</string>
</property>
</action>
<action name="actionViewPacketDetails">
@@ -1913,10 +1885,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Packet &amp;Details</string>
+ <string>Event &amp;Details</string>
</property>
<property name="toolTip">
- <string>Show or hide the packet details</string>
+ <string>Show or hide the event details</string>
</property>
</action>
<action name="actionViewPacketBytes">
@@ -1927,24 +1899,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Packet &amp;Bytes</string>
- </property>
- <property name="toolTip">
- <string>Show or hide the packet bytes</string>
- </property>
- </action>
- <action name="actionViewPacketDiagram">
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <property name="text">
- <string>Packet &amp;Diagram</string>
+ <string>Event &amp;Bytes</string>
</property>
<property name="toolTip">
- <string>Show or hide the packet diagram</string>
+ <string>Show or hide the event bytes</string>
</property>
</action>
<action name="actionViewInternalsConversationHashTables">
@@ -1976,23 +1934,23 @@
<string>&amp;Coloring Rules…</string>
</property>
<property name="toolTip">
- <string>Edit the packet list coloring rules.</string>
+ <string>Edit the event list coloring rules.</string>
</property>
</action>
<action name="actionViewShowPacketInNewWindow">
<property name="text">
- <string>Show Packet in New &amp;Window</string>
+ <string>Show Event in New &amp;Window</string>
</property>
<property name="toolTip">
- <string>Show this packet in a separate window.</string>
+ <string>Show this event in a separate window.</string>
</property>
</action>
<action name="actionContextShowLinkedPacketInNewWindow">
<property name="text">
- <string>Show Linked Packet in New Window</string>
+ <string>Show Linked Event in New Window</string>
</property>
<property name="toolTip">
- <string>Show the linked packet in a separate window.</string>
+ <string>Show the linked event in a separate window.</string>
</property>
</action>
<action name="actionGoAutoScroll">
@@ -2003,7 +1961,7 @@
<string>Auto Scroll in Li&amp;ve Capture</string>
</property>
<property name="toolTip">
- <string>Automatically scroll to the last packet during a live capture.</string>
+ <string>Automatically scroll to the last event during a live capture.</string>
</property>
</action>
<action name="actionAnalyzeExpertInfo">
@@ -2194,7 +2152,7 @@
</action>
<action name="actionAnalyzeShowPacketBytes">
<property name="text">
- <string>Show Packet Bytes…</string>
+ <string>Show Event Bytes…</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+O</string>
@@ -2218,10 +2176,10 @@
</action>
<action name="actionGoGoToLinkedPacket">
<property name="text">
- <string>Go to &amp;Linked Packet</string>
+ <string>Go to &amp;Linked Event</string>
</property>
<property name="toolTip">
- <string>Go to the packet referenced by the selected field.</string>
+ <string>Go to the event referenced by the selected field.</string>
</property>
</action>
<action name="actionNewDisplayFilterExpression">
diff --git a/ui/logray/logray_main_window_slots.cpp b/ui/logray/logray_main_window_slots.cpp
index f0882ed5..7a691f23 100644
--- a/ui/logray/logray_main_window_slots.cpp
+++ b/ui/logray/logray_main_window_slots.cpp
@@ -19,7 +19,7 @@
/*
* The generated Ui_LograyMainWindow::setupUi() can grow larger than our configured limit,
- * so turn off -Wframe-larger-than= for ui_main_window.h.
+ * so turn off -Wframe-larger-than= for ui_logray_main_window.h.
*/
DIAG_OFF(frame-larger-than=)
#include <ui_logray_main_window.h>
@@ -40,7 +40,6 @@ DIAG_ON(frame-larger-than=)
#include "ui/urls.h"
#include "epan/color_filters.h"
-#include "epan/export_object.h"
#include "wsutil/file_util.h"
#include "wsutil/filesystem.h"
@@ -105,20 +104,18 @@ DIAG_ON(frame-larger-than=)
#include "dissector_tables_dialog.h"
#include "endpoint_dialog.h"
#include "expert_info_dialog.h"
-#include "export_object_action.h"
-#include "export_object_dialog.h"
-#include "export_pdu_dialog.h"
#include "extcap_options_dialog.h"
#include "file_set_dialog.h"
#include "filter_action.h"
#include "filter_dialog.h"
+#include "follow_stream_action.h"
+#include "follow_stream_dialog.h"
#include "funnel_statistics.h"
#include "interface_toolbar.h"
#include "io_graph_dialog.h"
#include <ui/qt/widgets/additional_toolbar.h>
#include "main_application.h"
#include "packet_comment_dialog.h"
-#include "packet_diagram.h"
#include "packet_dialog.h"
#include "packet_list.h"
#include "preferences_dialog.h"
@@ -157,14 +154,14 @@ DIAG_ON(frame-larger-than=)
// Public slots
//
-bool LograyMainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned int type, gboolean is_tempfile)
+bool LograyMainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned int type, bool is_tempfile)
{
QString file_name = "";
dfilter_t *rfcode = NULL;
df_error_t *df_err = NULL;
int err;
- gboolean name_param;
- gboolean ret = true;
+ bool name_param;
+ bool ret = true;
// was a file name given as function parameter?
name_param = !cf_path.isEmpty();
@@ -232,7 +229,7 @@ bool LograyMainWindow::openCaptureFile(QString cf_path, QString read_filter, uns
continue;
}
- switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/FALSE)) {
+ switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/false)) {
case CF_READ_OK:
case CF_READ_ERROR:
/* Just because we got an error, that doesn't mean we were unable
@@ -252,7 +249,9 @@ bool LograyMainWindow::openCaptureFile(QString cf_path, QString read_filter, uns
break;
}
- mainApp->setLastOpenDirFromFilename(cf_path);
+ if (!is_tempfile) {
+ mainApp->setLastOpenDirFromFilename(cf_path);
+ }
main_ui_->statusBar->showExpert();
@@ -331,16 +330,28 @@ void LograyMainWindow::layoutToolbars()
}
}
+static const char* layout_icons[] = {
+ NULL,
+ "x-reset-layout_5",
+ "x-reset-layout_2",
+ "x-reset-layout_1",
+ "x-reset-layout_4",
+ "x-reset-layout_3",
+ "x-reset-layout_6"
+};
+
void LograyMainWindow::updatePreferenceActions()
{
main_ui_->actionViewPacketList->setEnabled(prefs_has_layout_pane_content(layout_pane_content_plist));
main_ui_->actionViewPacketDetails->setEnabled(prefs_has_layout_pane_content(layout_pane_content_pdetails));
main_ui_->actionViewPacketBytes->setEnabled(prefs_has_layout_pane_content(layout_pane_content_pbytes));
- main_ui_->actionViewPacketDiagram->setEnabled(prefs_has_layout_pane_content(layout_pane_content_pdiagram));
main_ui_->actionViewNameResolutionPhysical->setChecked(gbl_resolv_flags.mac_name);
main_ui_->actionViewNameResolutionNetwork->setChecked(gbl_resolv_flags.network_name);
main_ui_->actionViewNameResolutionTransport->setChecked(gbl_resolv_flags.transport_name);
+
+ if (prefs.gui_layout_type > 0)
+ main_ui_->actionViewResetLayout->setIcon(StockIcon(layout_icons[prefs.gui_layout_type]));
}
void LograyMainWindow::updateRecentActions()
@@ -351,7 +362,6 @@ void LograyMainWindow::updateRecentActions()
main_ui_->actionViewPacketList->setChecked(recent.packet_list_show && prefs_has_layout_pane_content(layout_pane_content_plist));
main_ui_->actionViewPacketDetails->setChecked(recent.tree_view_show && prefs_has_layout_pane_content(layout_pane_content_pdetails));
main_ui_->actionViewPacketBytes->setChecked(recent.byte_view_show && prefs_has_layout_pane_content(layout_pane_content_pbytes));
- main_ui_->actionViewPacketDiagram->setChecked(recent.packet_diagram_show && prefs_has_layout_pane_content(layout_pane_content_pdiagram));
foreach(QAction *action, main_ui_->menuInterfaceToolbars->actions()) {
if (g_list_find_custom(recent.interface_toolbars, action->text().toUtf8(), (GCompareFunc)strcmp)) {
@@ -388,7 +398,7 @@ void LograyMainWindow::updateRecentActions()
main_ui_->actionGoAutoScroll->setChecked(recent.capture_auto_scroll);
}
-// Don't connect to this directly. Connect to or emit fiterAction(...) instead.
+// Don't connect to this directly. Connect to or emit filterAction(...) instead.
void LograyMainWindow::queuedFilterAction(QString action_filter, FilterAction::Action action, FilterAction::ActionType type)
{
QString cur_filter, new_filter;
@@ -472,17 +482,17 @@ void LograyMainWindow::queuedFilterAction(QString action_filter, FilterAction::A
#ifdef HAVE_LIBPCAP
void LograyMainWindow::captureCapturePrepared(capture_session *session) {
setTitlebarForCaptureInProgress();
-
setWindowIcon(mainApp->captureIcon());
+ pushLiveCaptureInProgress();
/* Disable menu items that make no sense if you're currently running
a capture. */
bool handle_toolbars = (session->session_will_restart ? false : true);
setForCaptureInProgress(true, handle_toolbars, session->capture_opts->ifaces);
-// set_capture_if_dialog_for_capture_in_progress(TRUE);
+// set_capture_if_dialog_for_capture_in_progress(true);
// /* Don't set up main window for a capture file. */
-// main_set_for_capture_file(FALSE);
+// main_set_for_capture_file(false);
showCapture();
}
@@ -492,6 +502,7 @@ void LograyMainWindow::captureCaptureUpdateStarted(capture_session *session) {
switching to the next multiple file. */
setTitlebarForCaptureInProgress();
setWindowIcon(mainApp->captureIcon());
+ pushLiveCaptureInProgress();
bool handle_toolbars = (session->session_will_restart ? false : true);
setForCaptureInProgress(true, handle_toolbars, session->capture_opts->ifaces);
@@ -506,6 +517,7 @@ void LograyMainWindow::captureCaptureUpdateFinished(capture_session *session) {
/* Update the main window as appropriate */
updateForUnsavedChanges();
+ setTitlebarForCaptureFile();
/* Enable menu items that make sense if you're not currently running
a capture. */
@@ -527,6 +539,7 @@ void LograyMainWindow::captureCaptureFixedFinished(capture_session *) {
/* The capture isn't stopping any more - it's stopped. */
capture_stopping_ = false;
+ setTitlebarForCaptureFile();
/* Enable menu items that make sense if you're not currently running
a capture. */
@@ -549,7 +562,7 @@ void LograyMainWindow::captureCaptureFixedFinished(capture_session *) {
void LograyMainWindow::captureCaptureFailed(capture_session *) {
/* Capture isn't stopping any more. */
capture_stopping_ = false;
-
+ setTitlebarForCaptureFile();
setForCaptureInProgress(false);
showWelcome();
@@ -632,7 +645,7 @@ void LograyMainWindow::captureEventHandler(CaptureEvent ev)
thaw();
break;
case CaptureEvent::Flushed:
- draw_tap_listeners(FALSE);
+ draw_tap_listeners(false);
break;
default:
break;
@@ -722,7 +735,7 @@ void LograyMainWindow::captureFileReadStarted(const QString &action) {
// tap_param_dlg_update();
/* Set up main window for a capture file. */
-// main_set_for_capture_file(TRUE);
+// main_set_for_capture_file(true);
mainApp->popStatus(WiresharkApplication::FileStatus);
QString msg = QString(tr("%1: %2")).arg(action).arg(capture_file_.fileName());
@@ -735,7 +748,7 @@ void LograyMainWindow::captureFileReadStarted(const QString &action) {
void LograyMainWindow::captureFileReadFinished() {
if (!capture_file_.capFile()->is_tempfile && capture_file_.capFile()->filename) {
/* Add this filename to the list of recent files in the "Recent Files" submenu */
- add_menu_recent_capture_file(capture_file_.capFile()->filename);
+ add_menu_recent_capture_file(capture_file_.capFile()->filename, false);
/* Remember folder for next Open dialog and save it in recent */
mainApp->setLastOpenDirFromFilename(capture_file_.capFile()->filename);
@@ -757,6 +770,7 @@ void LograyMainWindow::captureFileReadFinished() {
void LograyMainWindow::captureFileClosing() {
setMenusForCaptureFile(true);
+ setTitlebarForCaptureFile();
setForCapturedPackets(false);
setForCaptureInProgress(false);
@@ -797,16 +811,16 @@ void LograyMainWindow::captureFileClosed() {
// ui/gtk/capture_dlg.c:start_capture_confirmed
-void LograyMainWindow::startCapture() {
- startCapture(QStringList());
+void LograyMainWindow::startCapture(QStringList) {
+ startCapture();
}
-void LograyMainWindow::startCapture(QStringList interfaces _U_) {
+void LograyMainWindow::startCapture() {
#ifdef HAVE_LIBPCAP
interface_options *interface_opts;
- guint i;
+ unsigned i;
interface_t *device;
- gboolean can_start_capture = TRUE;
+ bool can_start_capture = true;
/* did the user ever select a capture interface before? */
if (global_capture_opts.num_selected == 0) {
@@ -824,11 +838,11 @@ void LograyMainWindow::startCapture(QStringList interfaces _U_) {
*/
if (extcap_requires_configuration(device->name))
{
- /* Request openning of extcap options dialog */
+ /* Request opening of extcap options dialog */
QString device_name(device->name);
emit showExtcapOptions(device_name, false);
/* Cancel start of capture */
- can_start_capture = FALSE;
+ can_start_capture = false;
}
}
}
@@ -871,24 +885,6 @@ void LograyMainWindow::startCapture(QStringList interfaces _U_) {
info_data_.ui.ui = this;
if (capture_start(&global_capture_opts, NULL, &cap_session_, &info_data_,
main_window_update)) {
- capture_options *capture_opts = cap_session_.capture_opts;
- GString *interface_names;
-
- /* Add "interface name<live capture in progress>" on main status bar */
- interface_names = get_iface_list_string(capture_opts, 0);
- if (strlen(interface_names->str) > 0) {
- g_string_append(interface_names, ":");
- }
- g_string_append(interface_names, " ");
-
- mainApp->popStatus(WiresharkApplication::FileStatus);
- QString msg = QString("%1<live capture in progress>").arg(interface_names->str);
- QString msgtip = QString("to file: ");
- if (capture_opts->save_file)
- msgtip += capture_opts->save_file;
- mainApp->pushStatus(WiresharkApplication::FileStatus, msg, msgtip);
- g_string_free(interface_names, TRUE);
-
/* The capture succeeded, which means the capture filter syntax is
valid; add this capture filter to the recent capture filter list. */
QByteArray filter_ba;
@@ -919,6 +915,28 @@ void LograyMainWindow::startCapture(QStringList interfaces _U_) {
#endif // HAVE_LIBPCAP
}
+void LograyMainWindow::pushLiveCaptureInProgress() {
+#ifdef HAVE_LIBPCAP
+ capture_options *capture_opts = cap_session_.capture_opts;
+ GString *interface_names;
+
+ /* Add "interface name<live capture in progress>" on main status bar */
+ interface_names = get_iface_list_string(capture_opts, 0);
+ if (strlen(interface_names->str) > 0) {
+ g_string_append(interface_names, ":");
+ }
+ g_string_append(interface_names, " ");
+
+ mainApp->popStatus(WiresharkApplication::FileStatus);
+ QString msg = QString("%1<live capture in progress>").arg(interface_names->str);
+ QString msgtip = QString("to file: ");
+ if (capture_opts->save_file)
+ msgtip += capture_opts->save_file;
+ mainApp->pushStatus(WiresharkApplication::FileStatus, msg, msgtip);
+ g_string_free(interface_names, TRUE);
+#endif // HAVE_LIBPCAP
+}
+
void LograyMainWindow::popLiveCaptureInProgress() {
/* Pop the "<live capture in progress>" message off the status bar. */
main_ui_->statusBar->setFileName(capture_file_);
@@ -981,7 +999,9 @@ void LograyMainWindow::updateRecentCaptures() {
/* Iterate through the actions in menuOpenRecentCaptureFile,
* removing special items, a maybe duplicate entry and every item above count_max */
+#if defined(Q_OS_MAC)
int shortcut = Qt::Key_0;
+#endif
foreach(recent_item_status *ri, mainApp->recentItems()) {
// Add the new item
ra = new QAction(recentMenu);
@@ -990,12 +1010,14 @@ void LograyMainWindow::updateRecentCaptures() {
ra->setEnabled(ri->accessible);
recentMenu->insertAction(NULL, ra);
action_cf_name = ra->data().toString();
+#if defined(Q_OS_MAC)
if (shortcut <= Qt::Key_9) {
ra->setShortcut(Qt::META | (Qt::Key)shortcut);
shortcut++;
}
+#endif
ra->setText(action_cf_name);
- connect(ra, SIGNAL(triggered()), this, SLOT(recentActionTriggered()));
+ connect(ra, &QAction::triggered, this, &LograyMainWindow::recentActionTriggered);
/* This is slow, at least on my VM here. The added links also open Wireshark
* in a new window. It might make more sense to add a recent item when we
@@ -1019,8 +1041,15 @@ void LograyMainWindow::updateRecentCaptures() {
QFileInfo fi(ri->filename);
rda->setText(fi.fileName());
dock_menu_->insertAction(NULL, rda);
- connect(rda, SIGNAL(triggered()), ra, SLOT(trigger()));
+ connect(rda, &QAction::triggered, ra, &QAction::trigger);
+#endif
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ if (recentMenu->actions().count() == static_cast<int>(prefs.gui_recent_files_count_max)) {
+#else
+ if (recentMenu->actions().count() == static_cast<qsizetype>(prefs.gui_recent_files_count_max)) {
#endif
+ break;
+ }
}
if (recentMenu->actions().count() > 0) {
@@ -1033,7 +1062,7 @@ void LograyMainWindow::updateRecentCaptures() {
ra = new QAction(recentMenu);
ra->setText(tr("Clear Menu"));
recentMenu->insertAction(NULL, ra);
- connect(ra, SIGNAL(triggered()), mainApp, SLOT(clearRecentCaptures()));
+ connect(ra, &QAction::triggered, mainApp, &MainApplication::clearRecentCaptures);
} else {
if (main_ui_->actionDummyNoFilesFound) {
recentMenu->addAction(main_ui_->actionDummyNoFilesFound);
@@ -1075,34 +1104,34 @@ void LograyMainWindow::setEditCommentsMenu()
const int thisRow = selectedRows().first();
frame_data * current_frame = frameDataForRow(thisRow);
wtap_block_t pkt_block = cf_get_packet_block(capture_file_.capFile(), current_frame);
- guint nComments = wtap_block_count_option(pkt_block, OPT_COMMENT);
+ unsigned nComments = wtap_block_count_option(pkt_block, OPT_COMMENT);
if (nComments > 0) {
main_ui_->menuPacketComment->addSeparator();
- for (guint i = 0; i < nComments; i++) {
+ for (unsigned i = 0; i < nComments; i++) {
QString comment = packet_list_->getPacketComment(i);
comment = this->commentToMenuText(comment);
- action = main_ui_->menuPacketComment->addAction(tr("Edit \"%1\"", "edit packet comment").arg(comment));
+ action = main_ui_->menuPacketComment->addAction(tr("Edit \"%1\"", "edit event comment").arg(comment));
connect(action, &QAction::triggered, this, &LograyMainWindow::editPacketComment);
action->setData(i);
}
main_ui_->menuPacketComment->addSeparator();
- for (guint i = 0; i < nComments; i++) {
+ for (unsigned i = 0; i < nComments; i++) {
QString comment = packet_list_->getPacketComment(i);
comment = this->commentToMenuText(comment);
- action = main_ui_->menuPacketComment->addAction(tr("Delete \"%1\"", "delete packet comment").arg(comment));
+ action = main_ui_->menuPacketComment->addAction(tr("Delete \"%1\"", "delete event comment").arg(comment));
connect(action, &QAction::triggered, this, &LograyMainWindow::deletePacketComment);
action->setData(i);
}
main_ui_->menuPacketComment->addSeparator();
- action = main_ui_->menuPacketComment->addAction(tr("Delete packet comments"));
+ action = main_ui_->menuPacketComment->addAction(tr("Delete event comments"));
connect(action, &QAction::triggered, this, &LograyMainWindow::deleteCommentsFromPackets);
}
wtap_block_unref(pkt_block);
}
if (selectedRows().count() > 1) {
main_ui_->menuPacketComment->addSeparator();
- action = main_ui_->menuPacketComment->addAction(tr("Delete comments from %n packet(s)", nullptr, static_cast<int>(selectedRows().count())));
+ action = main_ui_->menuPacketComment->addAction(tr("Delete comments from %n event(s)", nullptr, static_cast<int>(selectedRows().count())));
connect(action, &QAction::triggered, this, &LograyMainWindow::deleteCommentsFromPackets);
}
}
@@ -1170,16 +1199,25 @@ void LograyMainWindow::setMenusForSelectedPacket()
have_time_ref = capture_file_.capFile()->ref_time_count > 0;
another_is_time_ref = have_time_ref && rows.count() <= 1 &&
!(capture_file_.capFile()->ref_time_count == 1 && frame_selected && current_frame->ref_time);
- }
- main_ui_->actionEditMarkPacket->setText(tr("&Mark/Unmark Packet(s)", "", static_cast<int>(selectedRows().count())));
- main_ui_->actionEditIgnorePacket->setText(tr("&Ignore/Unignore Packet(s)", "", static_cast<int>(selectedRows().count())));
+ if (capture_file_.capFile()->edt && ! multi_selection && frame_selected)
+ {
+ foreach (FollowStreamAction *follow_action, main_ui_->menuFollow->findChildren<FollowStreamAction *>()) {
+ bool is_frame = proto_is_frame_protocol(capture_file_.capFile()->edt->pi.layers, follow_action->filterName());
+ follow_action->setEnabled(is_frame);
+ }
+ } else {
+ foreach (FollowStreamAction *follow_action, main_ui_->menuFollow->findChildren<FollowStreamAction *>()) {
+ follow_action->setEnabled(false);
+ }
+ }
+ }
main_ui_->actionCopyListAsText->setEnabled(selectedRows().count() > 0);
main_ui_->actionCopyListAsCSV->setEnabled(selectedRows().count() > 0);
main_ui_->actionCopyListAsYAML->setEnabled(selectedRows().count() > 0);
- main_ui_->actionEditMarkPacket->setEnabled(frame_selected || multi_selection);
+ main_ui_->actionEditMarkSelected->setEnabled(frame_selected || multi_selection);
main_ui_->actionEditMarkAllDisplayed->setEnabled(have_frames);
/* Unlike un-ignore, do not allow unmark of all frames when no frames are displayed */
main_ui_->actionEditUnmarkAllDisplayed->setEnabled(have_marked);
@@ -1194,7 +1232,7 @@ void LograyMainWindow::setMenusForSelectedPacket()
main_ui_->menuPacketComment->setEnabled(enableEditComments && selectedRows().count() > 0);
main_ui_->actionDeleteAllPacketComments->setEnabled(enableEditComments);
- main_ui_->actionEditIgnorePacket->setEnabled(frame_selected || multi_selection);
+ main_ui_->actionEditIgnoreSelected->setEnabled(frame_selected || multi_selection);
main_ui_->actionEditIgnoreAllDisplayed->setEnabled(have_filtered);
/* Allow un-ignore of all frames even with no frames currently displayed */
main_ui_->actionEditUnignoreAllDisplayed->setEnabled(have_ignored);
@@ -1250,10 +1288,26 @@ void LograyMainWindow::setMenusForSelectedTreeRow(FieldInformation *finfo) {
if (fi && fi->ds_tvb && (fi->length > 0)) {
have_packet_bytes = true;
}
+
+ if (!(capture_file_.capFile()->search_in_progress && (capture_file_.capFile()->hex || (capture_file_.capFile()->string && capture_file_.capFile()->packet_data)))) {
+ // If we're not in the middle of a packet bytes search, then set
+ // search_pos and search_len so that we can start a new search
+ // from this point. (If we are, then we already set it.)
+ if (fi && capture_file_.capFile()->edt && (fi->ds_tvb == capture_file_.capFile()->edt->tvb)) {
+ // We can only do a Packet Bytes search in the main bytes from
+ // the frame, not from any secondary data sources. (XXX: This
+ // might be surprising to users, though.)
+ capture_file_.capFile()->search_pos = (uint32_t)(finfo->position().start + finfo->position().length - 1);
+ capture_file_.capFile()->search_len = (uint32_t)finfo->position().length;
+ } else {
+ capture_file_.capFile()->search_pos = 0;
+ capture_file_.capFile()->search_len = 0;
+ }
+ }
}
if (capture_file_.capFile() != NULL && fi != NULL) {
- header_field_info *hfinfo = fi->hfinfo;
+ const header_field_info *hfinfo = fi->hfinfo;
int linked_frame = -1;
can_match_selected = proto_can_match_selected(capture_file_.capFile()->finfo_selected, capture_file_.capFile()->edt);
@@ -1298,7 +1352,6 @@ void LograyMainWindow::setMenusForSelectedTreeRow(FieldInformation *finfo) {
main_ui_->actionEditCopyAsFilter->setEnabled(can_match_selected);
main_ui_->actionAnalyzeShowPacketBytes->setEnabled(have_packet_bytes);
- main_ui_->actionFileExportPacketBytes->setEnabled(have_packet_bytes);
main_ui_->actionViewExpandSubtrees->setEnabled(have_subtree);
main_ui_->actionViewCollapseSubtrees->setEnabled(have_subtree);
@@ -1411,7 +1464,7 @@ void LograyMainWindow::checkDisplayFilter()
void LograyMainWindow::fieldsChanged()
{
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
if (!color_filters_reload(&err_msg, color_filter_add_cb)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
@@ -1434,7 +1487,7 @@ void LograyMainWindow::reloadLuaPlugins()
if (mainApp->isReloadingLua())
return;
- gboolean uses_lua_filehandler = FALSE;
+ bool uses_lua_filehandler = false;
if (capture_file_.capFile()) {
// Check if the current capture file is opened with a Lua FileHandler
@@ -1521,11 +1574,11 @@ void LograyMainWindow::initViewColorizeMenu()
<< main_ui_->actionViewColorizeConversation7 << main_ui_->actionViewColorizeConversation8
<< main_ui_->actionViewColorizeConversation9 << main_ui_->actionViewColorizeConversation10;
- guint8 color_num = 1;
+ uint8_t color_num = 1;
foreach(QAction *cc_action, cc_actions) {
cc_action->setData(color_num);
- connect(cc_action, SIGNAL(triggered()), this, SLOT(colorizeConversation()));
+ connect(cc_action, &QAction::triggered, this, &LograyMainWindow::colorizeConversation);
const color_filter_t *colorf = color_filters_tmp_color(color_num);
if (colorf) {
@@ -1562,16 +1615,15 @@ void LograyMainWindow::addStatsPluginsToMenu() {
parent_menu = main_ui_->menuStatistics;
// gtk/main_menubar.c compresses double slashes, hence SkipEmptyParts
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
- QStringList cfg_name_parts = QString(cfg->name).split("/", Qt::SkipEmptyParts);
+ QStringList cfg_name_parts = QString(cfg->path).split(STATS_TREE_MENU_SEPARATOR, Qt::SkipEmptyParts);
#else
- QStringList cfg_name_parts = QString(cfg->name).split("/", QString::SkipEmptyParts);
+ QStringList cfg_name_parts = QString(cfg->path).split(STATS_TREE_MENU_SEPARATOR, QString::SkipEmptyParts);
#endif
if (cfg_name_parts.isEmpty()) continue;
- QString stat_name = cfg_name_parts.takeLast();
+ QString stat_name = cfg_name_parts.takeLast().trimmed();
if (!cfg_name_parts.isEmpty()) {
- QString menu_name = cfg_name_parts.join("/");
- parent_menu = findOrAddMenu(parent_menu, menu_name);
+ parent_menu = findOrAddMenu(parent_menu, cfg_name_parts);
}
stats_tree_action = new QAction(stat_name, this);
@@ -1602,7 +1654,7 @@ void LograyMainWindow::setFeaturesEnabled(bool enabled)
}
else
{
- main_ui_->statusBar->showMessage(tr("Please wait while Wireshark is initializing…"));
+ main_ui_->statusBar->showMessage(tr("Please wait while Logray is initializing…"));
}
}
@@ -1645,10 +1697,8 @@ void LograyMainWindow::openTapParameterDialog(const QString cfg_str, const QStri
TapParameterDialog *tp_dialog = TapParameterDialog::showTapParameterStatistics(*this, capture_file_, cfg_str, arg, userdata);
if (!tp_dialog) return;
- connect(tp_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- connect(tp_dialog, SIGNAL(updateFilter(QString)),
- df_combo_box_->lineEdit(), SLOT(setText(QString)));
+ connect(tp_dialog, &TapParameterDialog::filterAction, this, &LograyMainWindow::filterAction);
+ connect(tp_dialog, &TapParameterDialog::updateFilter, df_combo_box_->lineEdit(), &QLineEdit::setText);
tp_dialog->show();
}
@@ -1740,57 +1790,10 @@ void LograyMainWindow::connectFileMenuActions()
connect(main_ui_->actionFileExportAsJSON, &QAction::triggered, this,
[this]() { exportDissections(export_type_json); });
- connect(main_ui_->actionFileExportPacketBytes, &QAction::triggered, this,
- [this]() { exportPacketBytes(); }, Qt::QueuedConnection);
-
- connect(main_ui_->actionFileExportPDU, &QAction::triggered, this,
- [this]() { exportPDU(); });
-
connect(main_ui_->actionFilePrint, &QAction::triggered, this,
[this]() { printFile(); });
}
-void LograyMainWindow::exportPacketBytes()
-{
- QString file_name;
-
- if (!capture_file_.capFile() || !capture_file_.capFile()->finfo_selected) return;
-
- file_name = WiresharkFileDialog::getSaveFileName(this,
- mainApp->windowTitleString(tr("Export Selected Packet Bytes")),
- mainApp->openDialogInitialDir().canonicalPath(),
- tr("Raw data (*.bin *.dat *.raw);;All Files (" ALL_FILES_WILDCARD ")")
- );
-
- if (file_name.length() > 0) {
- const guint8 *data_p;
-
- data_p = tvb_get_ptr(capture_file_.capFile()->finfo_selected->ds_tvb, 0, -1) +
- capture_file_.capFile()->finfo_selected->start;
- write_file_binary_mode(qUtf8Printable(file_name), data_p, capture_file_.capFile()->finfo_selected->length);
-
- /* Save the directory name for future file dialogs. */
- mainApp->setLastOpenDirFromFilename(file_name);
- }
-}
-
-void LograyMainWindow::exportPDU()
-{
- ExportPDUDialog *exportpdu_dialog = new ExportPDUDialog(this);
-
- if (exportpdu_dialog->isMinimized() == true)
- {
- exportpdu_dialog->showNormal();
- }
- else
- {
- exportpdu_dialog->show();
- }
-
- exportpdu_dialog->raise();
- exportpdu_dialog->activateWindow();
-}
-
void LograyMainWindow::printFile()
{
capture_file *cf = capture_file_.capFile();
@@ -1851,7 +1854,7 @@ void LograyMainWindow::connectEditMenuActions()
// The items below are used in the packet list and detail context menus.
// Use QueuedConnections so that the context menus aren't destroyed
// prematurely.
- connect(main_ui_->actionEditMarkPacket, &QAction::triggered, this, [this]() {
+ connect(main_ui_->actionEditMarkSelected, &QAction::triggered, this, [this]() {
freeze();
packet_list_->markFrame();
thaw();
@@ -1884,7 +1887,7 @@ void LograyMainWindow::connectEditMenuActions()
}
}, Qt::QueuedConnection);
- connect(main_ui_->actionEditIgnorePacket, &QAction::triggered, this, [this]() {
+ connect(main_ui_->actionEditIgnoreSelected, &QAction::triggered, this, [this]() {
freeze();
packet_list_->ignoreFrame();
thaw();
@@ -1962,7 +1965,7 @@ void LograyMainWindow::copySelectedItems(LograyMainWindow::CopySelected selectio
break;
case CopySelectedValue:
if (finfo_selected && capture_file_.capFile()->edt != 0) {
- gchar* field_str = get_node_field_value(finfo_selected, capture_file_.capFile()->edt);
+ char* field_str = get_node_field_value(finfo_selected, capture_file_.capFile()->edt);
clip.append(field_str);
g_free(field_str);
}
@@ -2053,11 +2056,10 @@ void LograyMainWindow::findPacket()
void LograyMainWindow::editTimeShift()
{
TimeShiftDialog *ts_dialog = new TimeShiftDialog(this, capture_file_.capFile());
- connect(ts_dialog, SIGNAL(finished(int)), this, SLOT(editTimeShiftFinished(int)));
+ connect(ts_dialog, &TimeShiftDialog::finished, this, &LograyMainWindow::editTimeShiftFinished);
- connect(this, SIGNAL(setCaptureFile(capture_file*)),
- ts_dialog, SLOT(setCaptureFile(capture_file*)));
- connect(ts_dialog, SIGNAL(timeShifted()), packet_list_, SLOT(applyTimeShift()));
+ connect(this, &LograyMainWindow::setCaptureFile, ts_dialog, &TimeShiftDialog::setCaptureFile);
+ connect(ts_dialog, &TimeShiftDialog::timeShifted, packet_list_, &PacketList::applyTimeShift, Qt::QueuedConnection);
ts_dialog->setWindowModality(Qt::ApplicationModal);
ts_dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -2104,7 +2106,7 @@ void LograyMainWindow::editPacketComment()
return;
QAction *ra = qobject_cast<QAction*>(sender());
- guint nComment = ra->data().toUInt();
+ unsigned nComment = ra->data().toUInt();
PacketCommentDialog* pc_dialog;
pc_dialog = new PacketCommentDialog(true, this, packet_list_->getPacketComment(nComment));
connect(pc_dialog, &QDialog::finished, std::bind(&LograyMainWindow::editPacketCommentFinished, this, pc_dialog, std::placeholders::_1, nComment));
@@ -2113,7 +2115,7 @@ void LograyMainWindow::editPacketComment()
pc_dialog->show();
}
-void LograyMainWindow::editPacketCommentFinished(PacketCommentDialog* pc_dialog _U_, int result _U_, guint nComment)
+void LograyMainWindow::editPacketCommentFinished(PacketCommentDialog* pc_dialog _U_, int result _U_, unsigned nComment)
{
if (result == QDialog::Accepted) {
packet_list_->setPacketComment(nComment, pc_dialog->text());
@@ -2124,7 +2126,7 @@ void LograyMainWindow::editPacketCommentFinished(PacketCommentDialog* pc_dialog
void LograyMainWindow::deletePacketComment()
{
QAction *ra = qobject_cast<QAction*>(sender());
- guint nComment = ra->data().toUInt();
+ unsigned nComment = ra->data().toUInt();
packet_list_->setPacketComment(nComment, QString(""));
updateForUnsavedChanges();
}
@@ -2138,7 +2140,7 @@ void LograyMainWindow::deleteCommentsFromPackets()
void LograyMainWindow::deleteAllPacketComments()
{
QMessageBox *msg_dialog = new QMessageBox();
- connect(msg_dialog, SIGNAL(finished(int)), this, SLOT(deleteAllPacketCommentsFinished(int)));
+ connect(msg_dialog, &QMessageBox::finished, this, &LograyMainWindow::deleteAllPacketCommentsFinished);
msg_dialog->setIcon(QMessageBox::Question);
msg_dialog->setText(tr("Are you sure you want to remove all packet comments?"));
@@ -2171,7 +2173,7 @@ void LograyMainWindow::editConfigurationProfiles()
void LograyMainWindow::showPreferencesDialog(QString module_name)
{
PreferencesDialog *pref_dialog = new PreferencesDialog(this);
- connect(pref_dialog, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
+ connect(pref_dialog, &PreferencesDialog::destroyed, mainApp, &MainApplication::flushAppSignals);
saveWindowGeometry(); // Save in case the layout panes are rearranged
pref_dialog->setPane(module_name);
@@ -2250,7 +2252,7 @@ void LograyMainWindow::connectViewMenuActions()
[this]() { showColoringRulesDialog(); });
connect(main_ui_->actionViewColorizeResetColorization, &QAction::triggered, this, [this]() {
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
if (!color_filters_reset_tmp(&err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
@@ -2265,6 +2267,10 @@ void LograyMainWindow::connectViewMenuActions()
connect(main_ui_->actionViewResetLayout, &QAction::triggered, this, [this]() {
recent.gui_geometry_main_upper_pane = 0;
recent.gui_geometry_main_lower_pane = 0;
+ g_free(recent.gui_geometry_main_master_split);
+ g_free(recent.gui_geometry_main_extra_split);
+ recent.gui_geometry_main_master_split = NULL;
+ recent.gui_geometry_main_extra_split = NULL;
applyRecentPaneGeometry();
});
@@ -2334,9 +2340,6 @@ void LograyMainWindow::showHideMainWidgets(QAction *action)
} else if (widget == byte_view_tab_) {
recent.byte_view_show = show;
main_ui_->actionViewPacketBytes->setChecked(show);
- } else if (widget == packet_diagram_) {
- recent.packet_diagram_show = show;
- main_ui_->actionViewPacketDiagram->setChecked(show);
} else {
foreach(QAction *action, main_ui_->menuInterfaceToolbars->actions()) {
QToolBar *toolbar = action->data().value<QToolBar *>();
@@ -2442,9 +2445,9 @@ void LograyMainWindow::editResolvedName()
void LograyMainWindow::setNameResolution()
{
- gbl_resolv_flags.mac_name = main_ui_->actionViewNameResolutionPhysical->isChecked() ? TRUE : FALSE;
- gbl_resolv_flags.network_name = main_ui_->actionViewNameResolutionNetwork->isChecked() ? TRUE : FALSE;
- gbl_resolv_flags.transport_name = main_ui_->actionViewNameResolutionTransport->isChecked() ? TRUE : FALSE;
+ gbl_resolv_flags.mac_name = main_ui_->actionViewNameResolutionPhysical->isChecked() ? true : false;
+ gbl_resolv_flags.network_name = main_ui_->actionViewNameResolutionNetwork->isChecked() ? true : false;
+ gbl_resolv_flags.transport_name = main_ui_->actionViewNameResolutionTransport->isChecked() ? true : false;
if (packet_list_) {
packet_list_->resetColumns();
@@ -2478,8 +2481,8 @@ void LograyMainWindow::colorizeConversation(bool create_rule)
if (capture_file_.capFile() && selectedRows().count() > 0) {
packet_info *pi = capture_file_.packetInfo();
- guint8 cc_num = colorize_action->data().toUInt();
- gchar *filter = conversation_filter_from_log(pi);
+ uint8_t cc_num = colorize_action->data().toUInt();
+ char *filter = conversation_filter_from_log(pi);
if (filter == NULL) {
mainApp->pushStatus(WiresharkApplication::TemporaryStatus, tr("Unable to build conversation filter."));
return;
@@ -2493,8 +2496,8 @@ void LograyMainWindow::colorizeConversation(bool create_rule)
this, &LograyMainWindow::filterAction);
coloring_rules_dialog.exec();
} else {
- gchar *err_msg = NULL;
- if (!color_filters_set_tmp(cc_num, filter, FALSE, &err_msg)) {
+ char *err_msg = NULL;
+ if (!color_filters_set_tmp(cc_num, filter, false, &err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
}
@@ -2530,8 +2533,8 @@ void LograyMainWindow::colorizeWithFilter(QByteArray filter, int color_number)
if (color_number > 0) {
// Assume "Color X"
- gchar *err_msg = NULL;
- if (!color_filters_set_tmp(color_number, filter.constData(), FALSE, &err_msg)) {
+ char *err_msg = NULL;
+ if (!color_filters_set_tmp(color_number, filter.constData(), false, &err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
}
@@ -2554,7 +2557,7 @@ void LograyMainWindow::openPacketDialog(bool from_reference)
/* Find the frame for which we're popping up a dialog */
if (from_reference) {
- guint32 framenum = fvalue_get_uinteger(capture_file_.capFile()->finfo_selected->value);
+ uint32_t framenum = fvalue_get_uinteger(capture_file_.capFile()->finfo_selected->value);
if (framenum == 0)
return;
@@ -2680,9 +2683,9 @@ void LograyMainWindow::connectGoMenuActions()
}
void LograyMainWindow::goToConversationFrame(bool go_next) {
- gchar *filter = NULL;
+ char *filter = NULL;
dfilter_t *dfcode = NULL;
- gboolean found_packet = FALSE;
+ bool found_packet = false;
packet_info *pi = capture_file_.packetInfo();
if (!pi) {
@@ -2736,7 +2739,7 @@ void LograyMainWindow::connectCaptureMenuActions()
connect(main_ui_->actionCaptureRestart, &QAction::triggered, this, [this]() {
#ifdef HAVE_LIBPCAP
QString before_what(tr(" before restarting the capture"));
- cap_session_.capture_opts->restart = TRUE;
+ cap_session_.capture_opts->restart = true;
if (!testCaptureFileClose(before_what, Restart)) {
return;
}
@@ -2812,13 +2815,13 @@ void LograyMainWindow::startCaptureTriggered()
// /*
// * There's an options dialog; get the values from it and close it.
// */
-// gboolean success;
+// bool success;
// /* Determine if "capture start" while building of the "capture options" window */
// /* is in progress. If so, ignore the "capture start. */
// /* XXX: Would it be better/cleaner for the "capture options" window code to */
// /* disable the capture start button temporarily ? */
-// if (cap_open_complete == FALSE) {
+// if (cap_open_complete == false) {
// return; /* Building options window: ignore "capture start" */
// }
// success = capture_dlg_prep(cap_open_w);
@@ -2859,14 +2862,10 @@ void LograyMainWindow::connectAnalyzeMenuActions()
});
connect(main_ui_->actionAnalyzeDisplayFilterMacros, &QAction::triggered, this, [=]() {
- struct epan_uat* dfm_uat;
- dfilter_macro_get_uat(&dfm_uat);
- UatDialog *uat_dlg = new UatDialog(parentWidget(), dfm_uat);
- connect(uat_dlg, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
-
- uat_dlg->setWindowModality(Qt::ApplicationModal);
- uat_dlg->setAttribute(Qt::WA_DeleteOnClose);
- uat_dlg->show();
+ FilterDialog *display_filter_dlg = new FilterDialog(window(), FilterDialog::DisplayMacro);
+ display_filter_dlg->setWindowModality(Qt::ApplicationModal);
+ display_filter_dlg->setAttribute(Qt::WA_DeleteOnClose);
+ display_filter_dlg->show();
});
connect(main_ui_->actionDisplayFilterExpression, &QAction::triggered, this, [=]() {
@@ -2882,25 +2881,13 @@ void LograyMainWindow::connectAnalyzeMenuActions()
connect(main_ui_->actionAnalyzeEnabledProtocols, &QAction::triggered, this, [=]() {
EnabledProtocolsDialog *enable_proto_dialog = new EnabledProtocolsDialog(this);
- connect(enable_proto_dialog, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
+ connect(enable_proto_dialog, &EnabledProtocolsDialog::destroyed, mainApp, &MainApplication::flushAppSignals);
enable_proto_dialog->setWindowModality(Qt::ApplicationModal);
enable_proto_dialog->setAttribute(Qt::WA_DeleteOnClose);
enable_proto_dialog->show();
});
- connect(main_ui_->actionAnalyzeDecodeAs, &QAction::triggered, this, [=]() {
- QAction *da_action = qobject_cast<QAction*>(sender());
- bool create_new = da_action && da_action->property("create_new").toBool();
-
- DecodeAsDialog *da_dialog = new DecodeAsDialog(this, capture_file_.capFile(), create_new);
- connect(da_dialog, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
-
- da_dialog->setWindowModality(Qt::ApplicationModal);
- da_dialog->setAttribute(Qt::WA_DeleteOnClose);
- da_dialog->show();
- });
-
connect(main_ui_->actionAnalyzeReloadLuaPlugins, &QAction::triggered, this, &LograyMainWindow::reloadLuaPlugins);
connect(main_ui_->actionAnalyzeShowPacketBytes, &QAction::triggered, this, [=]() {
@@ -2959,7 +2946,7 @@ void LograyMainWindow::matchFieldFilter(FilterAction::Action action, FilterActio
void LograyMainWindow::applyFieldAsColumn()
{
if (capture_file_.capFile() != 0 && capture_file_.capFile()->finfo_selected != 0) {
- header_field_info *hfinfo = capture_file_.capFile()->finfo_selected->hfinfo;
+ const header_field_info *hfinfo = capture_file_.capFile()->finfo_selected->hfinfo;
int col = column_prefs_has_custom(hfinfo->abbrev);
if (col == -1) {
insertColumn(hfinfo->name, hfinfo->abbrev);
@@ -2974,7 +2961,7 @@ void LograyMainWindow::applyFieldAsColumn()
if (!get_column_visible(col)) {
packet_list_->setColumnHidden(col, false);
- set_column_visible(col, TRUE);
+ set_column_visible(col, true);
prefs_main_write();
}
}
@@ -2999,16 +2986,23 @@ void LograyMainWindow::applyConversationFilter()
}
}
-void LograyMainWindow::applyExportObject()
-{
- ExportObjectAction *export_action = qobject_cast<ExportObjectAction*>(sender());
- if (!export_action)
- return;
+void LograyMainWindow::openFollowStreamDialog(int proto_id, unsigned stream_num, unsigned sub_stream_num, bool use_stream_index) {
+ FollowStreamDialog *fsd = new FollowStreamDialog(*this, capture_file_, proto_id);
+ connect(fsd, &FollowStreamDialog::updateFilter, this, &LograyMainWindow::filterPackets);
+ connect(fsd, &FollowStreamDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ fsd->addCodecs(text_codec_map_);
+ fsd->show();
+ if (use_stream_index) {
+ // If a specific conversation was requested, then ignore any previous
+ // display filters and display all related packets.
+ fsd->follow("", true, stream_num, sub_stream_num);
+ } else {
+ fsd->follow(getFilter());
+ }
+}
- ExportObjectDialog* export_dialog = new ExportObjectDialog(*this, capture_file_, export_action->exportObject());
- export_dialog->setWindowModality(Qt::ApplicationModal);
- export_dialog->setAttribute(Qt::WA_DeleteOnClose);
- export_dialog->show();
+void LograyMainWindow::openFollowStreamDialog(int proto_id) {
+ openFollowStreamDialog(proto_id, 0, 0, false);
}
// -z expert
@@ -3017,10 +3011,9 @@ void LograyMainWindow::statCommandExpertInfo(const char *, void *)
const DisplayFilterEdit *df_edit = dynamic_cast<DisplayFilterEdit *>(df_combo_box_->lineEdit());
ExpertInfoDialog *expert_dialog = new ExpertInfoDialog(*this, capture_file_, df_edit->text());
- connect(expert_dialog->getExpertInfoView(), SIGNAL(goToPacket(int, int)),
- packet_list_, SLOT(goToPacket(int, int)));
- connect(expert_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
+ connect(expert_dialog->getExpertInfoView(), &ExpertInfoTreeView::goToPacket,
+ this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(expert_dialog, &ExpertInfoDialog::filterAction, this, &LograyMainWindow::filterAction);
expert_dialog->show();
}
@@ -3034,59 +3027,100 @@ void LograyMainWindow::connectStatisticsMenuActions()
{
connect(main_ui_->actionStatisticsCaptureFileProperties, &QAction::triggered, this, [=]() {
CaptureFilePropertiesDialog *capture_file_properties_dialog = new CaptureFilePropertiesDialog(*this, capture_file_);
- connect(capture_file_properties_dialog, SIGNAL(captureCommentChanged()),
- this, SLOT(updateForUnsavedChanges()));
+ connect(capture_file_properties_dialog, &CaptureFilePropertiesDialog::captureCommentChanged,
+ this, &LograyMainWindow::updateForUnsavedChanges);
capture_file_properties_dialog->show();
});
- connect(main_ui_->actionStatisticsResolvedAddresses, &QAction::triggered, this, &LograyMainWindow::showResolvedAddressesDialog);
+ main_ui_->actionStatisticsResolvedAddresses->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsResolvedAddresses, &QAction::triggered, this, &LograyMainWindow::showResolvedAddressesDialog);
- connect(main_ui_->actionStatisticsProtocolHierarchy, &QAction::triggered, this, [=]() {
- ProtocolHierarchyDialog *phd = new ProtocolHierarchyDialog(*this, capture_file_);
- connect(phd, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- phd->show();
- });
+ main_ui_->actionStatisticsProtocolHierarchy->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsProtocolHierarchy, &QAction::triggered, this, [=]() {
+ // ProtocolHierarchyDialog *phd = new ProtocolHierarchyDialog(*this, capture_file_);
+ // connect(phd, &ProtocolHierarchyDialog::filterAction, this, &LograyMainWindow::filterAction);
+ // phd->show();
+ // });
- connect(main_ui_->actionStatisticsConversations, &QAction::triggered, this, &LograyMainWindow::showConversationsDialog);
- connect(main_ui_->actionStatisticsEndpoints, &QAction::triggered, this, &LograyMainWindow::showEndpointsDialog);
+ main_ui_->actionStatisticsConversations->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsConversations, &QAction::triggered, this, &LograyMainWindow::showConversationsDialog);
+ main_ui_->actionStatisticsEndpoints->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsEndpoints, &QAction::triggered, this, &LograyMainWindow::showEndpointsDialog);
- connect(main_ui_->actionStatisticsPacketLengths, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("plen"); });
+ main_ui_->actionStatisticsPacketLengths->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsPacketLengths, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("plen"); });
connect(main_ui_->actionStatisticsIOGraph, &QAction::triggered, this, [=]() { statCommandIOGraph(NULL, NULL); });
- connect(main_ui_->actionStatisticsFlowGraph, &QAction::triggered, this, [=]() {
- QMessageBox::warning(this, "Oops", "SequenceDialog depends on RTPStreamDialog");
- // SequenceDialog *sequence_dialog = new SequenceDialog(*this, capture_file_);
- // sequence_dialog->show();
- });
+ main_ui_->actionStatisticsFlowGraph->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsFlowGraph, &QAction::triggered, this, [=]() {
+ // QMessageBox::warning(this, "Oops", "SequenceDialog depends on RTPStreamDialog");
+ // // SequenceDialog *sequence_dialog = new SequenceDialog(*this, capture_file_);
+ // // sequence_dialog->show();
+ // });
}
-void LograyMainWindow::openStatisticsTreeDialog(const gchar *abbr)
+void LograyMainWindow::openStatisticsTreeDialog(const char *abbr)
{
StatsTreeDialog *st_dialog = new StatsTreeDialog(*this, capture_file_, abbr);
-// connect(st_dialog, SIGNAL(goToPacket(int)),
-// packet_list_, SLOT(goToPacket(int)));
+// connect(st_dialog, &StatsTreeDialog::goToPacket, packet_list_, &PacketList::goToPacket);
st_dialog->show();
}
// -z io,stat
void LograyMainWindow::statCommandIOGraph(const char *, void *)
{
+ showIOGraphDialog(IOG_ITEM_UNIT_PACKETS, QString());
+}
+
+void LograyMainWindow::showIOGraphDialog(io_graph_item_unit_t value_units, QString yfield)
+{
const DisplayFilterEdit *df_edit = qobject_cast<DisplayFilterEdit *>(df_combo_box_->lineEdit());
+ IOGraphDialog *iog_dialog = nullptr;
QString displayFilter;
if (df_edit)
displayFilter = df_edit->text();
- IOGraphDialog *iog_dialog = new IOGraphDialog(*this, capture_file_, displayFilter);
- connect(iog_dialog, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
- connect(this, SIGNAL(reloadFields()), iog_dialog, SLOT(reloadFields()));
+ if (!yfield.isEmpty()) {
+ QList<IOGraphDialog *> iographdialogs = findChildren<IOGraphDialog *>();
+ // GeometryStateDialogs aren't parented on Linux and Windows
+ // (see geometry_state_dialog.h), so we search for an
+ // I/O Dialog in all the top level widgets.
+ if (iographdialogs.isEmpty()) {
+ foreach(QWidget *topLevelWidget, mainApp->topLevelWidgets()) {
+ if (qobject_cast<IOGraphDialog*>(topLevelWidget)) {
+ iographdialogs << qobject_cast<IOGraphDialog*>(topLevelWidget);
+ }
+ }
+ }
+ bool iog_found = false;
+ foreach(iog_dialog, iographdialogs) {
+ if (!iog_dialog->fileClosed()) {
+ iog_found = true;
+ iog_dialog->addGraph(true, displayFilter, value_units, yfield);
+ break;
+ }
+ }
+ if (!iog_found) {
+ iog_dialog = nullptr;
+ }
+ }
+
+ if (iog_dialog == nullptr) {
+ iog_dialog = new IOGraphDialog(*this, capture_file_, displayFilter, value_units, yfield);
+ connect(iog_dialog, &IOGraphDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(this, &LograyMainWindow::reloadFields, iog_dialog, &IOGraphDialog::reloadFields);
+ }
iog_dialog->show();
}
// Tools Menu
-// XXX No log tools yet
+void LograyMainWindow::connectToolsMenuActions()
+{
+ // We don't have any built in tools yet, so hide it until we add actions via Lua scripts.
+ main_ui_->menuTools->hide();
+}
// Help Menu
void LograyMainWindow::connectHelpMenuActions()
@@ -3136,7 +3170,7 @@ void LograyMainWindow::checkForUpdates()
void LograyMainWindow::setPreviousFocus() {
previous_focus_ = mainApp->focusWidget();
if (previous_focus_ != nullptr) {
- connect(previous_focus_, SIGNAL(destroyed()), this, SLOT(resetPreviousFocus()));
+ connect(previous_focus_, &QWidget::destroyed, this, &LograyMainWindow::resetPreviousFocus);
}
}
@@ -3148,7 +3182,7 @@ void LograyMainWindow::goToCancelClicked()
{
main_ui_->goToFrame->animatedHide();
if (previous_focus_) {
- disconnect(previous_focus_, SIGNAL(destroyed()), this, SLOT(resetPreviousFocus()));
+ disconnect(previous_focus_, &QWidget::destroyed, this, &LograyMainWindow::resetPreviousFocus);
previous_focus_->setFocus();
resetPreviousFocus();
}
@@ -3183,20 +3217,21 @@ void LograyMainWindow::showResolvedAddressesDialog()
void LograyMainWindow::showConversationsDialog()
{
ConversationDialog *conv_dialog = new ConversationDialog(*this, capture_file_);
- connect(conv_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- connect(conv_dialog, SIGNAL(openFollowStreamDialog(int, guint, guint)),
- this, SLOT(openFollowStreamDialog(int, guint, guint)));
+ connect(conv_dialog, &ConversationDialog::filterAction, this, &LograyMainWindow::filterAction);
+ connect(conv_dialog, &ConversationDialog::openFollowStreamDialog, this,
+ [=](int proto_id, unsigned stream_num, unsigned sub_stream_num) {
+ openFollowStreamDialog(proto_id, stream_num, sub_stream_num);
+ });
conv_dialog->show();
}
void LograyMainWindow::showEndpointsDialog()
{
EndpointDialog *endp_dialog = new EndpointDialog(*this, capture_file_);
- connect(endp_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- connect(endp_dialog, SIGNAL(openFollowStreamDialog(int)),
- this, SLOT(openFollowStreamDialog(int)));
+ connect(endp_dialog, &EndpointDialog::filterAction, this, &LograyMainWindow::filterAction);
+ connect(endp_dialog, &EndpointDialog::openFollowStreamDialog, this,
+ [=](int proto_id) {openFollowStreamDialog(proto_id);
+ });
endp_dialog->show();
}
@@ -3214,9 +3249,9 @@ void LograyMainWindow::externalMenuItemTriggered()
entry = (ext_menubar_t *)v.value<void *>();
if (entry->type == EXT_MENUBAR_ITEM) {
- entry->callback(EXT_MENUBAR_QT_GUI, (gpointer)((void *)main_ui_), entry->user_data);
+ entry->callback(EXT_MENUBAR_QT_GUI, (void *)((void *)main_ui_), entry->user_data);
} else {
- QDesktopServices::openUrl(QUrl(QString((gchar *)entry->user_data)));
+ QDesktopServices::openUrl(QUrl(QString((char *)entry->user_data)));
}
}
}
@@ -3241,14 +3276,12 @@ void LograyMainWindow::showExtcapOptionsDialog(QString &device_name, bool startC
extcap_options_dialog->setModal(true);
extcap_options_dialog->setAttribute(Qt::WA_DeleteOnClose);
if (startCaptureOnClose) {
- connect(extcap_options_dialog, SIGNAL(finished(int)),
- this, SLOT(extcap_options_finished(int)));
+ connect(extcap_options_dialog, &ExtcapOptionsDialog::finished, this, &LograyMainWindow::extcap_options_finished);
}
#ifdef HAVE_LIBPCAP
if (capture_options_dialog_ && startCaptureOnClose) {
/* Allow capture options dialog to close */
- connect(extcap_options_dialog, SIGNAL(accepted()),
- capture_options_dialog_, SLOT(accept()));
+ connect(extcap_options_dialog, &ExtcapOptionsDialog::accepted, capture_options_dialog_, &CaptureOptionsDialog::accept);
}
#endif
extcap_options_dialog->show();