forked from osmocom/wireshark
As per Michael Mann's email:
Yes, the following files can now be deleted: \wireshark\ui\gtk\prefs_nameres.c \wireshark\ui\gtk\prefs_nameres.h \wireshark\ui\gtk\prefs_print.c \wireshark\ui\gtk\prefs_print.h \wireshark\ui\gtk\prefs_protocols.c \wireshark\ui\gtk\prefs_protocols.h \wireshark\ui\gtk\prefs_taps.c \wireshark\ui\gtk\prefs_taps.h I thought removing them was part of the patch for bug 7402, but they still show up in the SVN (perhaps I didn't create the patch correctly). Make it so. svn path=/trunk/; revision=43591
This commit is contained in:
parent
dd105b80d8
commit
47dba62a84
8 changed files with 0 additions and 943 deletions
|
@ -1,307 +0,0 @@
|
|||
/* nameres_prefs.c
|
||||
* Dialog box for name resolution preferences
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <epan/addr_resolv.h>
|
||||
#include <epan/prefs.h>
|
||||
#include <epan/uat.h>
|
||||
#include <epan/oids.h>
|
||||
|
||||
#include "ui/gtk/prefs_nameres.h"
|
||||
#include "ui/gtk/gtkglobals.h"
|
||||
#include "ui/gtk/prefs_dlg.h"
|
||||
#include "ui/gtk/gui_utils.h"
|
||||
#include "ui/gtk/main.h"
|
||||
#include "ui/gtk/menus.h"
|
||||
|
||||
|
||||
#define M_RESOLVE_KEY "m_resolve"
|
||||
#define N_RESOLVE_KEY "n_resolve"
|
||||
#define T_RESOLVE_KEY "t_resolve"
|
||||
|
||||
#if defined(HAVE_C_ARES) || defined(HAVE_GNU_ADNS)
|
||||
# define C_RESOLVE_KEY "c_resolve"
|
||||
# define RESOLVE_CONCURRENCY_KEY "resolve_concurrency"
|
||||
#endif /* HAVE_C_ARES || HAVE_GNU_ADNS */
|
||||
|
||||
#define BASE_TABLE_ROWS 3
|
||||
|
||||
#if defined(HAVE_C_ARES) || defined(HAVE_GNU_ADNS)
|
||||
# define ASYNC_TABLE_ROWS 2
|
||||
#else
|
||||
# define ASYNC_TABLE_ROWS 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBSMI
|
||||
# define SUPPRESS_SMI_ERRORS_KEY "suppress_smi_errors"
|
||||
# define LOAD_SMI_MODULES_KEY "load_smi_modules"
|
||||
# define SMI_TABLE_ROWS 2
|
||||
#else
|
||||
# define SMI_TABLE_ROWS 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GEOIP
|
||||
# define GEOIP_TABLE_ROWS 1
|
||||
#else
|
||||
# define GEOIP_TABLE_ROWS 0
|
||||
#endif
|
||||
|
||||
#define RESOLV_TABLE_ROWS (\
|
||||
BASE_TABLE_ROWS + \
|
||||
ASYNC_TABLE_ROWS + \
|
||||
SMI_TABLE_ROWS + \
|
||||
GEOIP_TABLE_ROWS \
|
||||
)
|
||||
|
||||
GtkWidget*
|
||||
nameres_prefs_show(void)
|
||||
{
|
||||
guint table_row;
|
||||
GtkWidget *main_tb, *main_vb;
|
||||
GtkWidget *m_resolv_cb, *n_resolv_cb, *t_resolv_cb;
|
||||
#if defined(HAVE_C_ARES) || defined(HAVE_GNU_ADNS)
|
||||
GtkWidget *c_resolv_cb;
|
||||
GtkWidget *resolv_concurrency_te;
|
||||
char concur_str[10+1];
|
||||
#endif /* HAVE_C_ARES || HAVE_GNU_ADNS */
|
||||
#ifdef HAVE_LIBSMI
|
||||
GtkWidget *load_smi_modules_cb, *suppress_smi_errors_cb;
|
||||
uat_t *smi_paths_uat;
|
||||
uat_t *smi_modules_uat;
|
||||
#endif
|
||||
#ifdef HAVE_GEOIP
|
||||
uat_t *geoip_db_paths_uat;
|
||||
#endif
|
||||
/*
|
||||
* XXX - it would be nice if the current setting of the resolver
|
||||
* flags could be different from the preference flags, so that
|
||||
* the preference flags would represent what the user *typically*
|
||||
* wants, but they could override them for particular captures
|
||||
* without a subsequent editing of the preferences recording the
|
||||
* temporary settings as permanent preferences.
|
||||
*/
|
||||
prefs.name_resolve = gbl_resolv_flags;
|
||||
|
||||
/* Main vertical box */
|
||||
main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 7, FALSE);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
|
||||
|
||||
/* Main table */
|
||||
main_tb = gtk_table_new(RESOLV_TABLE_ROWS, 3, FALSE);
|
||||
gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
|
||||
gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
|
||||
gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
|
||||
gtk_widget_show(main_tb);
|
||||
|
||||
/* Resolve MAC addresses */
|
||||
table_row = 0;
|
||||
m_resolv_cb = create_preference_check_button(main_tb, table_row,
|
||||
"Enable MAC name resolution:", "e.g. Ethernet address to manufacturer name",
|
||||
prefs.name_resolve & RESOLV_MAC);
|
||||
g_object_set_data(G_OBJECT(main_vb), M_RESOLVE_KEY, m_resolv_cb);
|
||||
|
||||
/* Resolve network addresses */
|
||||
table_row++;
|
||||
n_resolv_cb = create_preference_check_button(main_tb, table_row,
|
||||
"Enable network name resolution:", "e.g. IP address to DNS name (hostname)",
|
||||
prefs.name_resolve & RESOLV_NETWORK);
|
||||
g_object_set_data(G_OBJECT(main_vb), N_RESOLVE_KEY, n_resolv_cb);
|
||||
|
||||
/* Resolve transport addresses */
|
||||
table_row++;
|
||||
t_resolv_cb = create_preference_check_button(main_tb, table_row,
|
||||
"Enable transport name resolution:", "e.g. TCP/UDP port to service name",
|
||||
prefs.name_resolve & RESOLV_TRANSPORT);
|
||||
g_object_set_data(G_OBJECT(main_vb), T_RESOLVE_KEY, t_resolv_cb);
|
||||
|
||||
#if defined(HAVE_C_ARES) || defined(HAVE_GNU_ADNS)
|
||||
/* Enable concurrent (asynchronous) DNS lookups */
|
||||
table_row++;
|
||||
c_resolv_cb = create_preference_check_button(main_tb, table_row,
|
||||
"Enable concurrent DNS name resolution:", "be sure to enable network name resolution",
|
||||
prefs.name_resolve & RESOLV_CONCURRENT);
|
||||
g_object_set_data(G_OBJECT(main_vb), C_RESOLVE_KEY, c_resolv_cb);
|
||||
|
||||
/* Max concurrent requests */
|
||||
table_row++;
|
||||
g_snprintf(concur_str, sizeof(concur_str), "%d", prefs.name_resolve_concurrency);
|
||||
resolv_concurrency_te = create_preference_entry(main_tb, table_row,
|
||||
"Maximum concurrent requests:", "maximum parallel running DNS requests", concur_str);
|
||||
g_object_set_data(G_OBJECT(main_vb), RESOLVE_CONCURRENCY_KEY, resolv_concurrency_te);
|
||||
|
||||
#else /* HAVE_C_ARES || HAVE_GNU_ADNS */
|
||||
table_row++;
|
||||
create_preference_static_text(main_tb, table_row,
|
||||
"Enable concurrent DNS name resolution: N/A",
|
||||
"Support for this feature was not compiled into this version of Wireshark");
|
||||
#endif /* HAVE_C_ARES || HAVE_GNU_ADNS */
|
||||
#ifdef HAVE_LIBSMI
|
||||
/* Enable OID resolution */
|
||||
table_row++;
|
||||
load_smi_modules_cb = create_preference_check_button(main_tb, table_row,
|
||||
"Enable OID resolution:", "You must restart Wireshark for this change to"
|
||||
" take effect. [If True the 'SMI paths' and 'SMI modules' preferences will be shown].",
|
||||
prefs.load_smi_modules);
|
||||
g_object_set_data(G_OBJECT(main_vb), LOAD_SMI_MODULES_KEY, load_smi_modules_cb);
|
||||
|
||||
/* Suppress smi errors */
|
||||
table_row++;
|
||||
suppress_smi_errors_cb = create_preference_check_button(main_tb, table_row,
|
||||
"Suppress SMI errors:", "Some errors can be ignored. If unsure, set to false.",
|
||||
prefs.suppress_smi_errors);
|
||||
g_object_set_data(G_OBJECT(main_vb), SUPPRESS_SMI_ERRORS_KEY, suppress_smi_errors_cb);
|
||||
|
||||
/* SMI paths UAT */
|
||||
smi_paths_uat = uat_get_table_by_name("SMI Paths");
|
||||
if (smi_paths_uat) {
|
||||
table_row++;
|
||||
create_preference_uat(main_tb, table_row,
|
||||
"SMI (MIB and PIB) paths",
|
||||
"Search paths for SMI (MIB and PIB) modules. You must\n"
|
||||
"restart Wireshark for these changes to take effect.",
|
||||
smi_paths_uat);
|
||||
}
|
||||
|
||||
/* SMI modules UAT */
|
||||
smi_modules_uat = uat_get_table_by_name("SMI Modules");
|
||||
if (smi_modules_uat) {
|
||||
table_row++;
|
||||
create_preference_uat(main_tb, table_row,
|
||||
"SMI (MIB and PIB) modules",
|
||||
"List of enabled SMI (MIB and PIB) modules. You must\n"
|
||||
"restart Wireshark for these changes to take effect.",
|
||||
smi_modules_uat);
|
||||
}
|
||||
#else /* HAVE_LIBSMI */
|
||||
table_row++;
|
||||
create_preference_static_text(main_tb, table_row,
|
||||
"SMI (MIB and PIB) modules and paths: N/A",
|
||||
"Support for this feature was not compiled into this version of Wireshark");
|
||||
table_row++;
|
||||
create_preference_static_text(main_tb, table_row,
|
||||
"Enable OID resolution: N/A",
|
||||
"Support for this feature was not compiled into this version of Wireshark");
|
||||
table_row++;
|
||||
create_preference_static_text(main_tb, table_row,
|
||||
"Suppress SMI errors: N/A",
|
||||
"Support for this feature was not compiled into this version of Wireshark");
|
||||
#endif /* HAVE_LIBSMI */
|
||||
|
||||
#ifdef HAVE_GEOIP
|
||||
/* GeoIP databases http://www.maxmind.com/app/api */
|
||||
geoip_db_paths_uat = uat_get_table_by_name("GeoIP Database Paths");
|
||||
|
||||
if (geoip_db_paths_uat) {
|
||||
table_row++;
|
||||
create_preference_uat(main_tb, table_row,
|
||||
"GeoIP database directories",
|
||||
"Search paths for GeoIP address mapping databases.\n"
|
||||
"Wireshark will look in each directory for files beginning\n"
|
||||
"with \"Geo\" and ending with \".dat\".\n"
|
||||
"You must restart Wireshark for these changes to take\n"
|
||||
"effect.",
|
||||
geoip_db_paths_uat);
|
||||
}
|
||||
#else /* HAVE_GEOIP */
|
||||
table_row++;
|
||||
create_preference_static_text(main_tb, table_row,
|
||||
"GeoIP database search paths: N/A",
|
||||
"Support for this feature was not compiled into this version of Wireshark");
|
||||
#endif /* HAVE_GEOIP */
|
||||
|
||||
/* Show 'em what we got */
|
||||
gtk_widget_show_all(main_vb);
|
||||
|
||||
return(main_vb);
|
||||
}
|
||||
|
||||
void
|
||||
nameres_prefs_fetch(GtkWidget *w)
|
||||
{
|
||||
GtkWidget *m_resolv_cb, *n_resolv_cb, *t_resolv_cb;
|
||||
#if defined(HAVE_C_ARES) || defined(HAVE_GNU_ADNS)
|
||||
GtkWidget *c_resolv_cb, *resolv_concurrency_te;
|
||||
#endif /* HAVE_C_ARES || HAVE_GNU_ADNS */
|
||||
#ifdef HAVE_LIBSMI
|
||||
GtkWidget *load_smi_modules_cb, *suppress_smi_errors_cb;
|
||||
gboolean load_smi_modules_orig;
|
||||
#endif
|
||||
|
||||
m_resolv_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), M_RESOLVE_KEY);
|
||||
n_resolv_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), N_RESOLVE_KEY);
|
||||
t_resolv_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), T_RESOLVE_KEY);
|
||||
#if defined(HAVE_C_ARES) || defined(HAVE_GNU_ADNS)
|
||||
c_resolv_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), C_RESOLVE_KEY);
|
||||
|
||||
resolv_concurrency_te = (GtkWidget *)g_object_get_data(G_OBJECT(w), RESOLVE_CONCURRENCY_KEY);
|
||||
#endif /* HAVE_C_ARES || HAVE_GNU_ADNS */
|
||||
|
||||
prefs.name_resolve = RESOLV_NONE;
|
||||
prefs.name_resolve |= (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (m_resolv_cb)) ? RESOLV_MAC : RESOLV_NONE);
|
||||
prefs.name_resolve |= (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (n_resolv_cb)) ? RESOLV_NETWORK : RESOLV_NONE);
|
||||
prefs.name_resolve |= (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (t_resolv_cb)) ? RESOLV_TRANSPORT : RESOLV_NONE);
|
||||
#if defined(HAVE_C_ARES) || defined(HAVE_GNU_ADNS)
|
||||
prefs.name_resolve |= (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (c_resolv_cb)) ? RESOLV_CONCURRENT : RESOLV_NONE);
|
||||
|
||||
prefs.name_resolve_concurrency = strtol (gtk_entry_get_text(
|
||||
GTK_ENTRY(resolv_concurrency_te)), NULL, 10);
|
||||
#endif /* HAVE_C_ARES || HAVE_GNU_ADNS */
|
||||
#ifdef HAVE_LIBSMI
|
||||
load_smi_modules_orig = prefs.load_smi_modules;
|
||||
load_smi_modules_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), LOAD_SMI_MODULES_KEY);
|
||||
prefs.load_smi_modules = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (load_smi_modules_cb));
|
||||
suppress_smi_errors_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), SUPPRESS_SMI_ERRORS_KEY);
|
||||
prefs.suppress_smi_errors = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (suppress_smi_errors_cb));
|
||||
|
||||
/* Perform actions needed when enabling/disabling OID resolution */
|
||||
if (load_smi_modules_orig && !prefs.load_smi_modules) {
|
||||
prefs.load_smi_modules = TRUE; /* hack to make oids_cleanup() actually do something */
|
||||
oids_cleanup();
|
||||
prefs.load_smi_modules = FALSE; /* end hack */
|
||||
} else if (!load_smi_modules_orig && prefs.load_smi_modules) {
|
||||
oids_init();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nameres_prefs_apply(GtkWidget *w _U_)
|
||||
{
|
||||
/*
|
||||
* XXX - force a regeneration of the protocol list if this has
|
||||
* changed?
|
||||
*/
|
||||
gbl_resolv_flags = prefs.name_resolve;
|
||||
menu_name_resolution_changed();
|
||||
}
|
||||
|
||||
void
|
||||
nameres_prefs_destroy(GtkWidget *w _U_)
|
||||
{
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/* nameres_prefs.h
|
||||
* Definitions for name resolution preferences window
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __NAMERES_PREFS_H__
|
||||
#define __NAMERES_PREFS_H__
|
||||
|
||||
/** @file
|
||||
* "Name resolution" preferences page.
|
||||
* @ingroup prefs_group
|
||||
*/
|
||||
|
||||
/** Build a Name resolution preferences page.
|
||||
*
|
||||
* @return the new preferences page
|
||||
*/
|
||||
GtkWidget *nameres_prefs_show(void);
|
||||
|
||||
/** Fetch preference values from page.
|
||||
*
|
||||
* @param widget widget from nameres_prefs_show()
|
||||
*/
|
||||
void nameres_prefs_fetch(GtkWidget *widget);
|
||||
|
||||
/** Apply preference values from page.
|
||||
*
|
||||
* @param widget widget from nameres_prefs_show()
|
||||
*/
|
||||
void nameres_prefs_apply(GtkWidget *widget);
|
||||
|
||||
/** Destroy preference values from page.
|
||||
*
|
||||
* @param widget widget from nameres_prefs_show()
|
||||
*/
|
||||
void nameres_prefs_destroy(GtkWidget *widget);
|
||||
|
||||
#endif
|
|
@ -1,182 +0,0 @@
|
|||
/* print_prefs.c
|
||||
* Dialog boxes for preferences for printing
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <epan/prefs.h>
|
||||
|
||||
#include "../print.h"
|
||||
#include "ui/util.h"
|
||||
|
||||
#include "ui/gtk/prefs_print.h"
|
||||
#include "ui/gtk/keys.h"
|
||||
#include "ui/gtk/prefs_dlg.h"
|
||||
#include "ui/gtk/gui_utils.h"
|
||||
#include "ui/gtk/file_dlg.h"
|
||||
#include "ui/gtk/stock_icons.h"
|
||||
#include "ui/gtk/gtkglobals.h"
|
||||
|
||||
|
||||
static void printer_browse_file_cb(GtkWidget *file_bt, GtkWidget *file_te);
|
||||
|
||||
#define E_PRINT_FORMAT_KEY "print_format"
|
||||
#define E_PRINT_DESTINATION_KEY "print_destination"
|
||||
|
||||
static const enum_val_t print_format_vals[] = {
|
||||
{ "text", "Plain Text", PR_FMT_TEXT },
|
||||
{ "postscript", "Postscript", PR_FMT_PS },
|
||||
{ NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
static const enum_val_t print_dest_vals[] = {
|
||||
#ifdef _WIN32
|
||||
/* "PR_DEST_CMD" means "to printer" on Windows */
|
||||
{ "command", "Printer", PR_DEST_CMD },
|
||||
#else
|
||||
{ "command", "Command", PR_DEST_CMD },
|
||||
#endif
|
||||
{ "file", "File", PR_DEST_FILE },
|
||||
{ NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
GtkWidget * printer_prefs_show(void)
|
||||
{
|
||||
GtkWidget *main_vb, *main_tb, *button;
|
||||
#ifndef _WIN32
|
||||
GtkWidget *cmd_te;
|
||||
#endif
|
||||
GtkWidget *file_lb_hb, *file_lb, *file_bt_hb, *file_bt, *file_te;
|
||||
|
||||
/* Enclosing containers for each row of widgets */
|
||||
main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 5, FALSE);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
|
||||
|
||||
main_tb = gtk_table_new(4, 2, FALSE);
|
||||
gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
|
||||
gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
|
||||
gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
|
||||
gtk_widget_show(main_tb);
|
||||
|
||||
/* Output format */
|
||||
button = create_preference_radio_buttons(main_tb, 0, "Format:",
|
||||
NULL, print_format_vals, prefs.pr_format);
|
||||
g_object_set_data(G_OBJECT(main_vb), E_PRINT_FORMAT_KEY, button);
|
||||
|
||||
/* Output destination */
|
||||
button = create_preference_radio_buttons(main_tb, 1, "Print to:",
|
||||
NULL, print_dest_vals, prefs.pr_dest);
|
||||
g_object_set_data(G_OBJECT(main_vb), E_PRINT_DESTINATION_KEY,
|
||||
button);
|
||||
|
||||
#ifndef _WIN32
|
||||
/* Command text entry */
|
||||
cmd_te = create_preference_entry(main_tb, 2, "Command:", NULL,
|
||||
prefs.pr_cmd);
|
||||
g_object_set_data(G_OBJECT(main_vb), PRINT_CMD_TE_KEY, cmd_te);
|
||||
#endif
|
||||
|
||||
|
||||
file_lb_hb = ws_gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0, FALSE);
|
||||
gtk_table_attach_defaults(GTK_TABLE(main_tb), file_lb_hb, 0, 1, 3, 4);
|
||||
gtk_widget_show(file_lb_hb);
|
||||
|
||||
file_lb = gtk_label_new("File:");
|
||||
gtk_box_pack_end(GTK_BOX(file_lb_hb), file_lb, FALSE, FALSE, 0);
|
||||
gtk_widget_show(file_lb);
|
||||
|
||||
/* File button and text entry */
|
||||
file_bt_hb = ws_gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0, FALSE);
|
||||
gtk_table_attach_defaults(GTK_TABLE(main_tb), file_bt_hb, 1, 2, 3, 4);
|
||||
gtk_widget_show(file_bt_hb);
|
||||
|
||||
file_bt = gtk_button_new_from_stock(WIRESHARK_STOCK_BROWSE);
|
||||
gtk_box_pack_end(GTK_BOX(file_bt_hb), file_bt, FALSE, FALSE, 0);
|
||||
gtk_widget_show(file_bt);
|
||||
|
||||
file_te = gtk_entry_new();
|
||||
g_object_set_data(G_OBJECT(main_vb), PRINT_FILE_TE_KEY, file_te);
|
||||
if (prefs.pr_file) gtk_entry_set_text(GTK_ENTRY(file_te), prefs.pr_file);
|
||||
gtk_box_pack_start(GTK_BOX(file_bt_hb), file_te, TRUE, TRUE, 0);
|
||||
gtk_widget_show(file_te);
|
||||
|
||||
g_signal_connect(file_bt, "clicked", G_CALLBACK(printer_browse_file_cb), file_te);
|
||||
|
||||
gtk_widget_show(main_vb);
|
||||
return(main_vb);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
printer_browse_file_cb(GtkWidget *file_bt, GtkWidget *file_te)
|
||||
{
|
||||
file_selection_browse(file_bt, file_te, "Wireshark: Print to a File",
|
||||
FILE_SELECTION_WRITE_BROWSE);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
printer_prefs_fetch(GtkWidget *w)
|
||||
{
|
||||
prefs.pr_format = fetch_preference_radio_buttons_val(
|
||||
g_object_get_data(G_OBJECT(w), E_PRINT_FORMAT_KEY), print_format_vals);
|
||||
|
||||
prefs.pr_dest = fetch_preference_radio_buttons_val(
|
||||
g_object_get_data(G_OBJECT(w), E_PRINT_DESTINATION_KEY), print_dest_vals);
|
||||
|
||||
#ifndef _WIN32
|
||||
g_free(prefs.pr_cmd);
|
||||
prefs.pr_cmd = g_strdup(gtk_entry_get_text(
|
||||
GTK_ENTRY(g_object_get_data(G_OBJECT(w), PRINT_CMD_TE_KEY))));
|
||||
#endif
|
||||
|
||||
g_free(prefs.pr_file);
|
||||
prefs.pr_file = g_strdup(gtk_entry_get_text(
|
||||
GTK_ENTRY(g_object_get_data(G_OBJECT(w), PRINT_FILE_TE_KEY))));
|
||||
}
|
||||
|
||||
void
|
||||
printer_prefs_apply(GtkWidget *w _U_)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
printer_prefs_destroy(GtkWidget *w)
|
||||
{
|
||||
GtkWidget *caller = gtk_widget_get_toplevel(w);
|
||||
GtkWidget *fs;
|
||||
|
||||
/* Is there a file selection dialog associated with this
|
||||
Preferences dialog? */
|
||||
fs = g_object_get_data(G_OBJECT(caller), E_FILE_SEL_DIALOG_PTR_KEY);
|
||||
|
||||
if (fs != NULL) {
|
||||
/* Yes. Destroy it. */
|
||||
window_destroy(fs);
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
/* print_prefs.h
|
||||
* Definitions for print preferences window
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __PRINT_PREFS_H__
|
||||
#define __PRINT_PREFS_H__
|
||||
|
||||
/** @file
|
||||
* "Print" preferences page.
|
||||
* @ingroup prefs_group
|
||||
*/
|
||||
|
||||
/** Build a Print preferences page.
|
||||
*
|
||||
* @return the new preferences page
|
||||
*/
|
||||
GtkWidget *printer_prefs_show(void);
|
||||
|
||||
/** Fetch preference values from page.
|
||||
*
|
||||
* @param widget widget from printer_prefs_show()
|
||||
*/
|
||||
void printer_prefs_fetch(GtkWidget *widget);
|
||||
|
||||
/** Apply preference values from page.
|
||||
*
|
||||
* @param widget widget from printer_prefs_show()
|
||||
*/
|
||||
void printer_prefs_apply(GtkWidget *widget);
|
||||
|
||||
/** Destroy preference values from page.
|
||||
*
|
||||
* @param widget widget from printer_prefs_show()
|
||||
*/
|
||||
void printer_prefs_destroy(GtkWidget *widget);
|
||||
|
||||
#endif
|
|
@ -1,89 +0,0 @@
|
|||
/* prefs_protocols.c
|
||||
* Dialog box for preferences common for all protocols
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <epan/prefs.h>
|
||||
|
||||
#include "ui/gtk/gui_utils.h"
|
||||
#include "ui/gtk/prefs_protocols.h"
|
||||
#include "ui/gtk/prefs_dlg.h"
|
||||
|
||||
#define PROTOCOLS_SHOW_HIDDEN_KEY "display_hidden_items"
|
||||
#define PROTOCOLS_TABLE_ROWS 1
|
||||
|
||||
GtkWidget*
|
||||
protocols_prefs_show(void)
|
||||
{
|
||||
GtkWidget *main_tb, *main_vb;
|
||||
GtkWidget *display_hidden_cb;
|
||||
int pos = 0;
|
||||
|
||||
/* Main vertical box */
|
||||
main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 7, FALSE);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
|
||||
|
||||
/* Main table */
|
||||
main_tb = gtk_table_new(PROTOCOLS_TABLE_ROWS, 1, FALSE);
|
||||
gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
|
||||
gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
|
||||
gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
|
||||
gtk_widget_show(main_tb);
|
||||
|
||||
/* Show hidden protocol items in packet list */
|
||||
display_hidden_cb = create_preference_check_button(main_tb, pos++,
|
||||
"Display hidden protocol items:",
|
||||
"Display all hidden protocol items in the packet list.",
|
||||
prefs.display_hidden_proto_items);
|
||||
g_object_set_data(G_OBJECT(main_vb), PROTOCOLS_SHOW_HIDDEN_KEY, display_hidden_cb);
|
||||
|
||||
/* Show 'em what we got */
|
||||
gtk_widget_show_all(main_vb);
|
||||
|
||||
return main_vb;
|
||||
}
|
||||
|
||||
void
|
||||
protocols_prefs_fetch(GtkWidget *w _U_)
|
||||
{
|
||||
GtkWidget *display_hidden_cb;
|
||||
|
||||
display_hidden_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), PROTOCOLS_SHOW_HIDDEN_KEY);
|
||||
prefs.display_hidden_proto_items = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (display_hidden_cb)) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
protocols_prefs_apply(GtkWidget *w _U_)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
protocols_prefs_destroy(GtkWidget *w _U_)
|
||||
{
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/* prefs_protocols.h
|
||||
* Definitions for preferences common for all protocols
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __PREFS_PROTOCOLS_H__
|
||||
#define __PREFS_PROTOCOLS_H__
|
||||
|
||||
/** @file
|
||||
* "Protocols" preferences page.
|
||||
* @ingroup prefs_group
|
||||
*/
|
||||
|
||||
/** Build a page for preferences common for all protocols
|
||||
*
|
||||
* @return the new preferences page
|
||||
*/
|
||||
GtkWidget *protocols_prefs_show(void);
|
||||
|
||||
/** Fetch preference values from page.
|
||||
*
|
||||
* @param widget widget from protocols_prefs_show()
|
||||
*/
|
||||
void protocols_prefs_fetch(GtkWidget *widget);
|
||||
|
||||
/** Apply preference values from page.
|
||||
*
|
||||
* @param widget widget from protocols_prefs_show()
|
||||
*/
|
||||
void protocols_prefs_apply(GtkWidget *widget);
|
||||
|
||||
/** Destroy preference values from page.
|
||||
*
|
||||
* @param widget widget from protocols_prefs_show()
|
||||
*/
|
||||
void protocols_prefs_destroy(GtkWidget *widget);
|
||||
|
||||
#endif
|
|
@ -1,136 +0,0 @@
|
|||
/* prefs_taps.c
|
||||
* Dialog box for tap/statistics preferences
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <epan/prefs.h>
|
||||
|
||||
#include "ui/gtk/gui_utils.h"
|
||||
#include "ui/gtk/prefs_taps.h"
|
||||
#include "ui/gtk/prefs_dlg.h"
|
||||
#include "ui/gtk/main.h"
|
||||
|
||||
#define TAP_UPDATE_INTERVAL_KEY "update_interval"
|
||||
|
||||
#define RTP_PLAYER_MAX_VISIBLE_KEY "rtp_player_max_visible"
|
||||
#define RTP_PLAYER_TABLE_ROWS 6
|
||||
|
||||
static char update_interval_str[128] = "";
|
||||
static char max_visible_str[128] = "";
|
||||
|
||||
|
||||
GtkWidget*
|
||||
stats_prefs_show(void)
|
||||
{
|
||||
GtkWidget *main_tb, *main_vb;
|
||||
GtkWidget *tap_update_interval_te;
|
||||
#ifdef HAVE_LIBPORTAUDIO
|
||||
GtkWidget *rtp_player_max_visible_te;
|
||||
#endif
|
||||
int pos = 0;
|
||||
|
||||
/* Main vertical box */
|
||||
main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 7, FALSE);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
|
||||
|
||||
/* Main table */
|
||||
main_tb = gtk_table_new(RTP_PLAYER_TABLE_ROWS, 2, FALSE);
|
||||
gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
|
||||
gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
|
||||
gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
|
||||
gtk_widget_show(main_tb);
|
||||
|
||||
/* Tap update gap in ms */
|
||||
tap_update_interval_te = create_preference_entry(main_tb, pos++,
|
||||
"Tap update interval in ms:",
|
||||
"Determines time between tap updates.", max_visible_str);
|
||||
g_snprintf(update_interval_str, sizeof(update_interval_str), "%d", prefs.tap_update_interval);
|
||||
gtk_entry_set_text(GTK_ENTRY(tap_update_interval_te), update_interval_str);
|
||||
gtk_widget_set_tooltip_text(tap_update_interval_te, "Gap in milliseconds between updates to taps is defined here");
|
||||
g_object_set_data(G_OBJECT(main_vb), TAP_UPDATE_INTERVAL_KEY, tap_update_interval_te);
|
||||
|
||||
#ifdef HAVE_LIBPORTAUDIO
|
||||
/* Max visible channels in RTP Player */
|
||||
rtp_player_max_visible_te = create_preference_entry(main_tb, pos++,
|
||||
"Max visible channels in RTP Player:",
|
||||
"Determines maximum height of RTP Player window.", max_visible_str);
|
||||
g_snprintf(max_visible_str, sizeof(max_visible_str), "%d", prefs.rtp_player_max_visible);
|
||||
gtk_entry_set_text(GTK_ENTRY(rtp_player_max_visible_te), max_visible_str);
|
||||
gtk_widget_set_tooltip_text(rtp_player_max_visible_te, "Maximum height of RTP Player window is defined here.");
|
||||
g_object_set_data(G_OBJECT(main_vb), RTP_PLAYER_MAX_VISIBLE_KEY, rtp_player_max_visible_te);
|
||||
#endif
|
||||
|
||||
/* Show 'em what we got */
|
||||
gtk_widget_show_all(main_vb);
|
||||
|
||||
return main_vb;
|
||||
}
|
||||
|
||||
void
|
||||
stats_prefs_fetch(GtkWidget *w _U_)
|
||||
{
|
||||
GtkWidget *tap_update_interval_te;
|
||||
#ifdef HAVE_LIBPORTAUDIO
|
||||
GtkWidget *rtp_player_max_visible_te;
|
||||
#endif
|
||||
|
||||
/* Tap update interval */
|
||||
tap_update_interval_te = (GtkWidget *)g_object_get_data(G_OBJECT(w), TAP_UPDATE_INTERVAL_KEY);
|
||||
prefs.tap_update_interval = strtol(gtk_entry_get_text(
|
||||
GTK_ENTRY(tap_update_interval_te)), NULL, 10);
|
||||
|
||||
/* Test for a sane tap update interval */
|
||||
if (prefs.tap_update_interval < 100 || prefs.tap_update_interval > 10000) {
|
||||
prefs.tap_update_interval = TAP_UPDATE_DEFAULT_INTERVAL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBPORTAUDIO
|
||||
/* Max RTP channels */
|
||||
rtp_player_max_visible_te = (GtkWidget *)g_object_get_data(G_OBJECT(w), RTP_PLAYER_MAX_VISIBLE_KEY);
|
||||
prefs.rtp_player_max_visible = strtol(gtk_entry_get_text(
|
||||
GTK_ENTRY(rtp_player_max_visible_te)), NULL, 10);
|
||||
|
||||
/* Test for a sane max channels entry */
|
||||
if (prefs.rtp_player_max_visible < 1 || prefs.rtp_player_max_visible > 10)
|
||||
prefs.rtp_player_max_visible = RTP_PLAYER_DEFAULT_VISIBLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
stats_prefs_apply(GtkWidget *w _U_)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
reset_tap_update_timer();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
stats_prefs_destroy(GtkWidget *w _U_)
|
||||
{
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/* prefs_taps.h
|
||||
* Definitions for Taps/Statistics preferences window
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __PREFS_STATS_H__
|
||||
#define __PREFS_STATS_H__
|
||||
|
||||
/** @file
|
||||
* "RTP player" preferences page.
|
||||
* @ingroup prefs_group
|
||||
*/
|
||||
|
||||
/** Build a RTP player preferences page.
|
||||
*
|
||||
* @return the new preferences page
|
||||
*/
|
||||
GtkWidget *stats_prefs_show(void);
|
||||
|
||||
/** Fetch preference values from page.
|
||||
*
|
||||
* @param widget widget from rtp_player_prefs_show()
|
||||
*/
|
||||
void stats_prefs_fetch(GtkWidget *widget);
|
||||
|
||||
/** Apply preference values from page.
|
||||
*
|
||||
* @param widget widget from rtp_player_prefs_show()
|
||||
*/
|
||||
void stats_prefs_apply(GtkWidget *widget);
|
||||
|
||||
/** Destroy preference values from page.
|
||||
*
|
||||
* @param widget widget from rtp_player_prefs_show()
|
||||
*/
|
||||
void stats_prefs_destroy(GtkWidget *widget);
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue