aboutsummaryrefslogtreecommitdiffstats
path: root/ui/win32/file_dlg_win32.c
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2019-11-12 16:39:19 +0100
committerRoland Knall <rknall@gmail.com>2019-11-17 12:20:29 +0000
commitb3f240dbf8c5e24cf420e977d8544c4abb40c80e (patch)
treec783c4f210f09ed7c8ab227e9923953a6d8872e0 /ui/win32/file_dlg_win32.c
parent7d2e3fa8f5115e8cdddd5ea7a05797151a3965e7 (diff)
Qt: Multiselection in PacketList
This implements multi-selection for the PacketList. It allows multiple lines to be selected, and either drag/drop them to a text editor or use Ctrl/Cmd+C to copy the content to a clipboard. Opening the context menu disables the selection, and it does not change the underlying currently selection. This is done on purpose, as multi-selection is a copy-task only functionality at this point Export & Print work as expected, exporting just the selected items. Same goes for the copy menu, which has the additional entries for copying the list elements Bug: 14612 Change-Id: I77960aa1ab1d172a21abfa469baac0cd57f9f9d9 Reviewed-on: https://code.wireshark.org/review/35073 Petri-Dish: Roland Knall <rknall@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/win32/file_dlg_win32.c')
-rw-r--r--ui/win32/file_dlg_win32.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/ui/win32/file_dlg_win32.c b/ui/win32/file_dlg_win32.c
index 6a8a9201e2..a9b579ac6d 100644
--- a/ui/win32/file_dlg_win32.c
+++ b/ui/win32/file_dlg_win32.c
@@ -1606,7 +1606,6 @@ range_update_dynamics(HWND dlg_hwnd, packet_range_t *range) {
HWND cur_ctrl;
gboolean filtered_active = FALSE;
TCHAR static_val[STATIC_LABEL_CHARS];
- gint selected_num;
guint32 ignored_cnt = 0, displayed_ignored_cnt = 0;
guint32 displayed_cnt;
gboolean range_valid = TRUE;
@@ -1639,22 +1638,21 @@ range_update_dynamics(HWND dlg_hwnd, packet_range_t *range) {
SetWindowText(cur_ctrl, static_val);
/* RANGE_SELECT_CURR */
- selected_num = (g_cf->current_frame) ? g_cf->current_frame->num : 0;
cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_SEL_PKT_CAP);
- EnableWindow(cur_ctrl, selected_num && !filtered_active);
- if (range->remove_ignored && g_cf->current_frame && g_cf->current_frame->ignored) {
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("0"));
+ EnableWindow(cur_ctrl, range->selection_range_cnt > 0 && !filtered_active);
+ if (range->remove_ignored) {
+ StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), range->selection_range_cnt - range->ignored_selection_range_cnt);
} else {
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), selected_num ? 1 : 0);
+ StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), range->selection_range_cnt);
}
SetWindowText(cur_ctrl, static_val);
cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_SEL_PKT_DISP);
- EnableWindow(cur_ctrl, selected_num && filtered_active);
- if (range->remove_ignored && g_cf->current_frame && g_cf->current_frame->ignored) {
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("0"));
+ EnableWindow(cur_ctrl, range->displayed_selection_range_cnt > 0 && filtered_active);
+ if (range->remove_ignored) {
+ StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), range->displayed_selection_range_cnt - range->displayed_ignored_selection_range_cnt);
} else {
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), selected_num ? 1 : 0);
+ StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), range->displayed_selection_range_cnt);
}
SetWindowText(cur_ctrl, static_val);
@@ -1756,8 +1754,8 @@ range_update_dynamics(HWND dlg_hwnd, packet_range_t *range) {
displayed_ignored_cnt = range->displayed_ignored_cnt;
break;
case(range_process_selected):
- ignored_cnt = (g_cf->current_frame && g_cf->current_frame->ignored) ? 1 : 0;
- displayed_ignored_cnt = ignored_cnt;
+ ignored_cnt = range->ignored_selection_range_cnt;
+ displayed_ignored_cnt = range->displayed_ignored_selection_range_cnt;
break;
case(range_process_marked):
ignored_cnt = range->ignored_marked_cnt;