From 5d961e94b2009211f6e7069ee80c7bd448556446 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Sat, 8 Feb 2003 01:20:31 +0000 Subject: add an activate handler that returns a response OK if the OK response 2003-02-07 Larry Ewing * e-shell-folder-creation-dialog.c (folder_name_entry_activate_cb): add an activate handler that returns a response OK if the OK response would be active. svn path=/trunk/; revision=19852 --- shell/e-shell-folder-creation-dialog.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'shell/e-shell-folder-creation-dialog.c') diff --git a/shell/e-shell-folder-creation-dialog.c b/shell/e-shell-folder-creation-dialog.c index fc409e9194..617a6dd936 100644 --- a/shell/e-shell-folder-creation-dialog.c +++ b/shell/e-shell-folder-creation-dialog.c @@ -231,6 +231,22 @@ dialog_destroy_notify (void *data, dialog_data_destroy (dialog_data); } +static void +folder_name_entry_activate_cb (GtkEntry *entry, + void *data) +{ + DialogData *dialog_data; + const char *parent_path; + + dialog_data = (DialogData *) data; + + parent_path = e_storage_set_view_get_current_folder (E_STORAGE_SET_VIEW (dialog_data->storage_set_view)); + + if (parent_path != NULL + && GTK_ENTRY (dialog_data->folder_name_entry)->text_length > 0) + gtk_dialog_response (GTK_DIALOG (dialog_data->dialog), GTK_RESPONSE_OK); +} + static void folder_name_entry_changed_cb (GtkEditable *editable, void *data) @@ -541,6 +557,9 @@ e_shell_show_folder_creation_dialog (EShell *shell, g_signal_connect (dialog_data->folder_name_entry, "changed", G_CALLBACK (folder_name_entry_changed_cb), dialog_data); + g_signal_connect (dialog_data->folder_name_entry, "activate", + G_CALLBACK (folder_name_entry_activate_cb), dialog_data); + g_signal_connect (dialog_data->storage_set_view, "folder_selected", G_CALLBACK (storage_set_view_folder_selected_cb), dialog_data); -- cgit v1.2.3