diff options
-rw-r--r-- | ui/qt/export_dissection_dialog.cpp | 4 | ||||
-rw-r--r-- | ui/qt/export_dissection_dialog.h | 2 | ||||
-rw-r--r-- | ui/win32/file_dlg_win32.c | 13 | ||||
-rw-r--r-- | ui/win32/file_dlg_win32.h | 3 |
4 files changed, 14 insertions, 8 deletions
diff --git a/ui/qt/export_dissection_dialog.cpp b/ui/qt/export_dissection_dialog.cpp index 04a8e0e9b8..58c42ec0b6 100644 --- a/ui/qt/export_dissection_dialog.cpp +++ b/ui/qt/export_dissection_dialog.cpp @@ -52,6 +52,8 @@ ExportDissectionDialog::ExportDissectionDialog(QWidget *parent, capture_file *ca cap_file_(cap_file) #if !defined(Q_OS_WIN) , save_bt_(NULL) +#else + , sel_range_(selRange) #endif /* Q_OS_WIN */ { setWindowTitle(wsApp->windowTitleString(tr("Export Packet Dissections"))); @@ -162,7 +164,7 @@ void ExportDissectionDialog::show() WiresharkFileDialog::show(); } #else // Q_OS_WIN - win32_export_file((HWND)parentWidget()->effectiveWinId(), windowTitle().toStdWString().c_str(), cap_file_, export_type_); + win32_export_file((HWND)parentWidget()->effectiveWinId(), windowTitle().toStdWString().c_str(), cap_file_, export_type_, sel_range_.toStdString().c_str()); #endif // Q_OS_WIN } diff --git a/ui/qt/export_dissection_dialog.h b/ui/qt/export_dissection_dialog.h index 0911e5b3a4..a38d022189 100644 --- a/ui/qt/export_dissection_dialog.h +++ b/ui/qt/export_dissection_dialog.h @@ -58,6 +58,8 @@ private: PacketFormatGroupBox packet_format_group_box_; QPushButton *save_bt_; +#else + QString sel_range_; #endif // Q_OS_WIN }; diff --git a/ui/win32/file_dlg_win32.c b/ui/win32/file_dlg_win32.c index 97d029fe4e..552e45ac3d 100644 --- a/ui/win32/file_dlg_win32.c +++ b/ui/win32/file_dlg_win32.c @@ -467,7 +467,7 @@ win32_merge_file (HWND h_wnd, const wchar_t *title, GString *file_name, GString } void -win32_export_file(HWND h_wnd, const wchar_t *title, capture_file *cf, export_type_e export_type) { +win32_export_file(HWND h_wnd, const wchar_t *title, capture_file *cf, export_type_e export_type, const gchar *range_) { OPENFILENAME *ofn; TCHAR file_name[MAX_PATH] = _T(""); char *dirname; @@ -501,6 +501,12 @@ win32_export_file(HWND h_wnd, const wchar_t *title, capture_file *cf, export_typ /* Fill in our print (and export) args */ + /* init the printing range */ + packet_range_init(&print_args.range, cf); + + if (strlen(range_) > 0) + packet_range_convert_selection_str(&print_args.range, range_); + print_args.format = PR_FMT_TEXT; print_args.to_file = TRUE; print_args.cmd = NULL; @@ -1705,11 +1711,6 @@ export_file_hook_proc(HWND ef_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) { switch(msg) { case WM_INITDIALOG: { - OPENFILENAME *ofnp = (OPENFILENAME *) l_param; - capture_file *cf = (capture_file *) ofnp->lCustData; - - /* init the printing range */ - packet_range_init(&print_args.range, cf); /* default to displayed packets */ print_args.range.process_filtered = TRUE; range_handle_wm_initdialog(ef_hwnd, &print_args.range); diff --git a/ui/win32/file_dlg_win32.h b/ui/win32/file_dlg_win32.h index 86a518a859..a71c2973a9 100644 --- a/ui/win32/file_dlg_win32.h +++ b/ui/win32/file_dlg_win32.h @@ -101,8 +101,9 @@ gboolean win32_merge_file (HWND h_wnd, const wchar_t *title, GString *file_name, * @param h_wnd HWND of the parent window. * @param cf capture_file Structure for the capture to be saved * @param export_type The export type. + * @param range a possible range */ -void win32_export_file (HWND h_wnd, const wchar_t *title, capture_file *cf, export_type_e export_type); +void win32_export_file (HWND h_wnd, const wchar_t *title, capture_file *cf, export_type_e export_type, const gchar *range); /* Open dialog defines */ /* #define EWFD_FILTER_BTN 1000 */ |