From 50713161c39bec8a5b6979092860e3ac73bb66e0 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Mon, 9 Dec 2019 15:24:09 -0800 Subject: Win32: Remove win32_save_as_statstree. win32_save_as_statstree was GTK+-only. Change-Id: Ief029cd1a702b0c17d9602bee8a2d75ee4c3c393 Reviewed-on: https://code.wireshark.org/review/35384 Reviewed-by: Gerald Combs Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- ui/win32/file_dlg_win32.c | 73 ----------------------------------------------- ui/win32/file_dlg_win32.h | 11 ------- 2 files changed, 84 deletions(-) diff --git a/ui/win32/file_dlg_win32.c b/ui/win32/file_dlg_win32.c index 37a979b0d0..97d029fe4e 100644 --- a/ui/win32/file_dlg_win32.c +++ b/ui/win32/file_dlg_win32.c @@ -71,7 +71,6 @@ static TCHAR *FILE_EXT_EXPORT[] = static UINT_PTR CALLBACK open_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param); static UINT_PTR CALLBACK save_as_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param); -static UINT_PTR CALLBACK save_as_statstree_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param); static UINT_PTR CALLBACK export_specified_packets_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param); static UINT_PTR CALLBACK merge_file_hook_proc(HWND mf_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param); static UINT_PTR CALLBACK export_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param); @@ -307,58 +306,6 @@ win32_save_as_file(HWND h_wnd, const wchar_t *title, capture_file *cf, GString * return gsfn_ok; } -gboolean win32_save_as_statstree(HWND h_wnd, GString *file_name, int *file_type) -{ - OPENFILENAME *ofn; - TCHAR file_name16[MAX_PATH] = _T(""); - int ofnsize = sizeof(OPENFILENAME); - BOOL gsfn_ok; - - if (!file_name || !file_type) - return FALSE; - - if (file_name->len > 0) { - StringCchCopy(file_name16, MAX_PATH, utf_8to16(file_name->str)); - } - - ofn = g_malloc0(sizeof(OPENFILENAME)); - - ofn->lStructSize = ofnsize; - ofn->hwndOwner = h_wnd; - ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE); - ofn->lpstrFilter = _T("Plain text file (.txt)\0*.txt\0Comma separated values (.csv)\0*.csv\0XML document (.xml)\0*.xml\0YAML document (.yaml)\0*.yaml\0"); - ofn->lpstrCustomFilter = NULL; - ofn->nMaxCustFilter = 0; - ofn->nFilterIndex = 1; /* the first entry is the best match; 1-origin indexing */ - ofn->lpstrFile = file_name16; - ofn->nMaxFile = MAX_PATH; - ofn->lpstrFileTitle = NULL; - ofn->nMaxFileTitle = 0; - ofn->lpstrInitialDir = utf_8to16(get_last_open_dir()); - ofn->lpstrTitle = _T("Wireshark: Save stats tree as ..."); - ofn->Flags = OFN_ENABLESIZING | OFN_ENABLETEMPLATE | OFN_EXPLORER | - OFN_NOCHANGEDIR | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | - OFN_PATHMUSTEXIST | OFN_ENABLEHOOK; - ofn->lpstrDefExt = NULL; - ofn->lpfnHook = save_as_statstree_hook_proc; - ofn->lpTemplateName = _T("WIRESHARK_SAVEASSTATSTREENAME_TEMPLATE"); - - HANDLE save_da_ctx = set_thread_per_monitor_v2_awareness(); - gsfn_ok = GetSaveFileName(ofn); - revert_thread_per_monitor_v2_awareness(save_da_ctx); - - if (gsfn_ok) { - g_string_printf(file_name, "%s", utf_16to8(file_name16)); - /* What file format was specified? */ - *file_type = ofn->nFilterIndex - 1; - } - - g_sf_hwnd = NULL; - g_free( (void *) ofn); - return gsfn_ok; -} - - gboolean win32_export_specified_packets_file(HWND h_wnd, const wchar_t *title, capture_file *cf, @@ -1299,26 +1246,6 @@ save_as_file_hook_proc(HWND sf_hwnd, UINT msg, WPARAM w_param _U_, LPARAM l_para return 0; } -static UINT_PTR CALLBACK -save_as_statstree_hook_proc(HWND sf_hwnd, UINT msg, WPARAM w_param _U_, LPARAM l_param _U_) { - - switch(msg) { - case WM_INITDIALOG: - g_sf_hwnd = sf_hwnd; - break; - - case WM_COMMAND: - break; - - case WM_NOTIFY: - break; - - default: - break; - } - return 0; -} - #define RANGE_TEXT_MAX 128 static UINT_PTR CALLBACK export_specified_packets_file_hook_proc(HWND sf_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) { diff --git a/ui/win32/file_dlg_win32.h b/ui/win32/file_dlg_win32.h index e454c5c019..86a518a859 100644 --- a/ui/win32/file_dlg_win32.h +++ b/ui/win32/file_dlg_win32.h @@ -104,17 +104,6 @@ gboolean win32_merge_file (HWND h_wnd, const wchar_t *title, GString *file_name, */ void win32_export_file (HWND h_wnd, const wchar_t *title, capture_file *cf, export_type_e export_type); -/** Open the "Save As" dialog box for stats_tree statistics window. - * - * @param h_wnd HWND of the parent window. - * @param file_name File name. May be empty. - * @param file_type stats_tree file type. - * - * @return FALSE if the dialog was cancelled - */ -gboolean win32_save_as_statstree(HWND h_wnd, GString *file_name, - int *file_type); - /* Open dialog defines */ /* #define EWFD_FILTER_BTN 1000 */ #define EWFD_FILTER_LBL 1000 -- cgit v1.2.3