aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/find_dlg.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-12-15 01:04:39 +0000
committerGerald Combs <gerald@wireshark.org>2012-12-15 01:04:39 +0000
commit5c2c5aed87a35800a8136b34e576aaf53ad25c1a (patch)
tree0aa9c2b38d1eb1ec46591c280f5addcf5c0c3760 /ui/gtk/find_dlg.c
parent92cfec56b8abd8cd04c0133763fea2ddbd9a197e (diff)
Rename the search type menu items to more accurately reflect what we're
actually doing and what users are likely to want to do. Rename the search enum values and functions to reflect what we're actually doing and add a comment explaining why making searches more correct might make searching worse. Add a search bar to the Qt main window, thus continuing the War On Gratuitous Dialogs. Clear out any previous temporary label stack items before adding a new one. svn path=/trunk/; revision=46541
Diffstat (limited to 'ui/gtk/find_dlg.c')
-rw-r--r--ui/gtk/find_dlg.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/ui/gtk/find_dlg.c b/ui/gtk/find_dlg.c
index e8085ed65c..b0c61a02dd 100644
--- a/ui/gtk/find_dlg.c
+++ b/ui/gtk/find_dlg.c
@@ -276,7 +276,7 @@ find_frame_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_widget_set_tooltip_text(case_cb, "Search by mixed upper/lower case?");
gtk_widget_show(case_cb);
- combo_lb = gtk_label_new("Character set:");
+ combo_lb = gtk_label_new("Character width:");
gtk_box_pack_start(GTK_BOX (string_opt_vb), combo_lb, TRUE, TRUE, 0);
gtk_misc_set_alignment(GTK_MISC(combo_lb), 0.0f, 0.5f);
gtk_widget_show(combo_lb);
@@ -287,9 +287,10 @@ find_frame_cb(GtkWidget *w _U_, gpointer d _U_)
combo_cb = gtk_combo_box_text_new();
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(combo_cb), "ASCII Unicode & Non-Unicode");
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(combo_cb), "ASCII Non-Unicode");
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(combo_cb), "ASCII Unicode");
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(combo_cb), "Narrow & wide");
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(combo_cb), "Narrow (UTF-8 / ASCII)");
+ /* UCS-2 might be more accurate but then we'd have to explain why we don't support UTF-16 */
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(combo_cb), "Wide (UTF-16)");
gtk_combo_box_set_active(GTK_COMBO_BOX(combo_cb),0);
gtk_box_pack_start(GTK_BOX (string_opt_vb), combo_cb, TRUE, TRUE, 0);
@@ -545,7 +546,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
GtkWidget *filter_te, *up_rb, *hex_rb, *string_rb, *combo_cb,
*case_cb, *packet_data_rb, *decode_data_rb, *summary_data_rb;
const gchar *filter_text;
- search_charset_t scs_type = SCS_ASCII_AND_UNICODE;
+ search_charset_t scs_type = SCS_NARROW_AND_WIDE;
guint8 *bytes = NULL;
size_t nbytes = 0;
char *string = NULL;
@@ -570,9 +571,9 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
/* Corresponds to the enum in file.c
* Character set for text search.
* typedef enum {
- * SCS_ASCII_AND_UNICODE,
- * SCS_ASCII,
- * SCS_UNICODE
+ * SCS_NARROW_AND_WIDE,
+ * SCS_NARROW,
+ * SCS_WIDE
* / * add EBCDIC when it's implemented * /
* } search_charset_t;
*/
@@ -610,12 +611,12 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
/*
* We are - get the character set type.
*/
- if (string_type == SCS_ASCII_AND_UNICODE)
- scs_type = SCS_ASCII_AND_UNICODE;
- else if (string_type == SCS_ASCII)
- scs_type = SCS_ASCII;
- else if (string_type == SCS_UNICODE)
- scs_type = SCS_UNICODE;
+ if (string_type == SCS_NARROW_AND_WIDE)
+ scs_type = SCS_NARROW_AND_WIDE;
+ else if (string_type == SCS_NARROW)
+ scs_type = SCS_NARROW;
+ else if (string_type == SCS_WIDE)
+ scs_type = SCS_WIDE;
else {
statusbar_push_temporary_msg("You didn't choose a valid character set.");
return;