LTEXT "Read filter:", EWFD_FILTER_LBL, 67, 2, 49, 14
CONTROL "", EWFD_FILTER_EDIT, RICHEDIT_CLASS, ES_AUTOHSCROLL, 112, 0, 88, 12, WS_EX_CLIENTEDGE
+ COMBOBOX EWFD_FORMAT_TYPE, 67, 15, 135, 8, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CHECKBOX "MAC name resolution", EWFD_MAC_NR_CB, 67, 30, 100, 8, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "Transport name resolution", EWFD_TRANS_NR_CB, 67, 45, 100, 8, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "Network name resolution", EWFD_NET_NR_CB, 67, 60, 100, 8, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
*/
for (;;) {
#ifdef USE_WIN32_FILE_DIALOGS
- if (win32_open_file(GDK_WINDOW_HWND(gtk_widget_get_window(top_level)), file_name, display_filter)) {
+ if (win32_open_file(GDK_WINDOW_HWND(gtk_widget_get_window(top_level)), file_name, &type, display_filter)) {
#else /* USE_WIN32_FILE_DIALOGS */
if (gtk_open_file(top_level, file_name, &type, display_filter)) {
#endif /* USE_WIN32_FILE_DIALOGS */
}
int CaptureFileDialog::open(QString &file_name, unsigned int &type) {
- Q_UNUSED(type) // XXX Remove when type supporte is added to win32_open_file.
GString *fname = g_string_new(file_name.toUtf8().constData());
GString *dfilter = g_string_new(display_filter_.toUtf8().constData());
gboolean wof_status;
// XXX Add a widget->HWND routine to qt_ui_utils and use it instead.
- wof_status = win32_open_file((HWND)parentWidget()->effectiveWinId(), fname, dfilter);
+ wof_status = win32_open_file((HWND)parentWidget()->effectiveWinId(), fname, &type, dfilter);
file_name = fname->str;
- //type = format_type_.currentIndex();
display_filter_ = dfilter->str;
g_string_free(fname, TRUE);
*/
static HWND g_sf_hwnd = NULL;
static char *g_dfilter_str = NULL;
+static unsigned int g_format_type = WTAP_TYPE_AUTO;
static int
win32_get_ofnsize()
*/
gboolean
-win32_open_file (HWND h_wnd, GString *file_name, GString *display_filter) {
+win32_open_file (HWND h_wnd, GString *file_name, unsigned int *type, GString *display_filter) {
OPENFILENAME *ofn;
TCHAR file_name16[MAX_PATH] = _T("");
int ofnsize;
if (gofn_ok) {
g_string_printf(file_name, "%s", utf_16to8(file_name16));
g_string_printf(display_filter, "%s", g_dfilter_str ? g_dfilter_str : "");
+ *type = g_format_type;
}
g_free( (void *) ofn->lpstrFilter);
HWND cur_ctrl, parent;
OFNOTIFY *notify = (OFNOTIFY *) l_param;
TCHAR sel_name[MAX_PATH];
+ gint i;
switch(msg) {
case WM_INITDIALOG:
SetWindowText(cur_ctrl, utf_8to16(g_dfilter_str));
}
+ cur_ctrl = GetDlgItem(of_hwnd, EWFD_FORMAT_TYPE);
+ SendMessage(cur_ctrl, CB_ADDSTRING, 0, (WPARAM) _T("Automatic"));
+ for (i = 0; open_routines[i].name != NULL; i += 1) {
+ SendMessage(cur_ctrl, CB_ADDSTRING, 0, (WPARAM) utf_8to16(open_routines[i].name));
+ }
+ SendMessage(cur_ctrl, CB_SETCURSEL, 0, 0);
+
/* Fill in our resolution values */
cur_ctrl = GetDlgItem(of_hwnd, EWFD_MAC_NR_CB);
SendMessage(cur_ctrl, BM_SETCHECK, gbl_resolv_flags.mac_name, 0);
g_free(g_dfilter_str);
g_dfilter_str = filter_tb_get(cur_ctrl);
+ cur_ctrl = GetDlgItem(of_hwnd, EWFD_FORMAT_TYPE);
+ g_format_type = SendMessage(cur_ctrl, CB_GETCURSEL, 0, 0);
+
/* Fetch our resolution values */
cur_ctrl = GetDlgItem(of_hwnd, EWFD_MAC_NR_CB);
if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED)
*
* @param h_wnd HWND of the parent window.
* @param file_name File name
+ * @param type File type
* @param display_filter a display filter
*/
-gboolean win32_open_file (HWND h_wnd, GString *file_name, GString *display_filter);
+gboolean win32_open_file (HWND h_wnd, GString *file_name, unsigned int *type, GString *display_filter);
/** Verify that our proposed capture file format supports comments. If it can't
* ask the user what to do and return his or her response.
#define EWFD_PTX_FIRST_PKT 1014
#define EWFD_PTX_ELAPSED 1015
+#define EWFD_FORMAT_TYPE 1016
+
/* Save as and export dialog defines */
#define EWFD_GZIP_CB 1040