diff options
author | oabad <oabad@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-10-20 06:06:26 +0000 |
---|---|---|
committer | oabad <oabad@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-10-20 06:06:26 +0000 |
commit | cea9fdb79503a71bde3f02866387c0a162575d84 (patch) | |
tree | ef33aed4951e3f7d9ff6c97efb6d7b7512ca8d15 /gtk/gui_prefs.c | |
parent | 507c229ca24c071b5bf052fe712448bed83385c6 (diff) |
In fileopen_dir_changed_cb() :
- return FALSE immediately if the text entry is empty ;
- return FALSE at the end of the function so that the signal is sent to
the entry. It avoids a Gtk-ERROR (and an abort) :
file: gtkentry.c: line 4338 (blink_cb): assertion failed:
GTK_WIDGET_HAS_FOCUS(entry))
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8735 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/gui_prefs.c')
-rw-r--r-- | gtk/gui_prefs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk/gui_prefs.c b/gtk/gui_prefs.c index 8b151825ac..ed488815f7 100644 --- a/gtk/gui_prefs.c +++ b/gtk/gui_prefs.c @@ -1,7 +1,7 @@ /* gui_prefs.c * Dialog box for GUI preferences * - * $Id: gui_prefs.c,v 1.42 2003/10/16 21:19:12 guy Exp $ + * $Id: gui_prefs.c,v 1.43 2003/10/20 06:06:26 oabad Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -275,12 +275,14 @@ gui_prefs_show(void) gtk_table_attach_defaults( GTK_TABLE(main_tb), color_bt, 2, 3, 1, 2 ); /* Directory to default File Open dialog to */ - fileopen_dir_te = create_preference_entry(main_tb, 9, "Directory:", NULL, - prefs.gui_fileopen_dir); + fileopen_dir_te = create_preference_entry(main_tb, 9, "Directory:", + NULL, prefs.gui_fileopen_dir); OBJECT_SET_DATA(main_vb, GUI_FILEOPEN_DIR_KEY, fileopen_dir_te); - SIGNAL_CONNECT(fileopen_dir_te, "focus-out-event", fileopen_dir_changed_cb, main_vb); + SIGNAL_CONNECT(fileopen_dir_te, "focus-out-event", + fileopen_dir_changed_cb, main_vb); - /* Allow user to select where they want the File Open dialog to open to by default */ + /* Allow user to select where they want the File Open dialog to open to + * by default */ fileopen_rb = create_preference_radio_buttons(main_tb, 8, "File Open dialog behavior:", NULL, gui_fileopen_vals, prefs.gui_fileopen_style); SIGNAL_CONNECT(fileopen_rb, "clicked", fileopen_selected_cb, main_vb); @@ -658,10 +660,11 @@ fileopen_dir_changed_cb(GtkWidget *fileopen_entry _U_, GdkEvent *event _U_, gpoi fileopen_dir_te = (GtkWidget *)OBJECT_GET_DATA(parent_w, GUI_FILEOPEN_DIR_KEY); fileopen_dir_te_length = strlen(gtk_entry_get_text (GTK_ENTRY(fileopen_entry))); + if (fileopen_dir_te_length == 0) return FALSE; lastchar = gtk_editable_get_chars(GTK_EDITABLE(fileopen_entry), fileopen_dir_te_length-1, -1); if (strcmp(lastchar, G_DIR_SEPARATOR_S) != 0) gtk_entry_append_text(GTK_ENTRY(fileopen_entry), G_DIR_SEPARATOR_S); - return(TRUE); + return(FALSE); } static void |