show 'unknown' in the protocol name for the unknown protocol

2002-04-02  jacob berkman  <jacob@ximian.com>

	* service-edit-dialog.c (fill_dialog): show 'unknown' in the
	protocol name for the unknown protocol
	(validate_data): actually run and destroy the error dialogs
This commit is contained in:
jacob berkman 2002-04-02 22:32:23 +00:00 committed by Jacob Berkman
parent 957714782b
commit 21be41f15f
2 changed files with 21 additions and 11 deletions

View file

@ -1,3 +1,9 @@
2002-04-02 jacob berkman <jacob@ximian.com>
* service-edit-dialog.c (fill_dialog): show 'unknown' in the
protocol name for the unknown protocol
(validate_data): actually run and destroy the error dialogs
2002-03-30 Jody Goldberg <jody@gnome.org>
* mime-edit-dialog.c (populate_component_list) : add some protection

View file

@ -321,7 +321,10 @@ fill_dialog (ServiceEditDialog *dialog)
gtk_entry_set_text (GTK_ENTRY (WID ("description_entry")), service_info_get_description (dialog->p->info));
if (dialog->p->info->protocol != NULL) {
#if 0
/* this causes the validate check later to fail */
if (strcmp (dialog->p->info->protocol, "unknown"))
#endif
gtk_entry_set_text (GTK_ENTRY (WID ("protocol_entry")), dialog->p->info->protocol);
gtk_widget_set_sensitive (WID ("protocol_entry"), FALSE);
@ -487,9 +490,8 @@ validate_data (ServiceEditDialog *dialog)
0, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
_("Please enter a protocol name."));
gtk_window_set_modal (GTK_WINDOW (err_dialog), TRUE);
gtk_dialog_run (GTK_DIALOG (err_dialog));
gtk_widget_destroy (err_dialog);
return FALSE;
} else {
for (tmp1 = tmp; *tmp1 != '\0' && isalnum (*tmp1); tmp1++);
@ -501,20 +503,22 @@ validate_data (ServiceEditDialog *dialog)
GTK_BUTTONS_OK,
_("Invalid protocol name. Please enter a protocol name without any spaces or punctuation."));
gtk_window_set_modal (GTK_WINDOW (err_dialog), TRUE);
gtk_dialog_run (GTK_DIALOG (err_dialog));
gtk_widget_destroy (err_dialog);
return FALSE;
}
if (dialog->p->is_add) {
dir = g_strconcat ("/desktop/gnome/url-handlers/", tmp, NULL);
if (get_service_info (tmp) || gconf_client_dir_exists (gconf_client_get_default (), dir, NULL)) {
gtk_message_dialog_new (GTK_WINDOW (dialog->p->dialog_win),
0, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
_("There is already a protocol by that name."));
gtk_window_set_modal (GTK_WINDOW (err_dialog), TRUE);
err_dialog =
gtk_message_dialog_new (GTK_WINDOW (dialog->p->dialog_win),
0, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
_("There is already a protocol by that name."));
gtk_dialog_run (GTK_DIALOG (err_dialog));
gtk_widget_destroy (err_dialog);
return FALSE;
}