Pull up fix from the branch:

Make sure the OK button in the folder creation dialog is not sensitive
if no parent folder is selected.

Fix a Gtk-Warning that would happen if you selected "New" in the
folder selection dialog and then "Cancel" in the folder creation
dialog.

svn path=/trunk/; revision=9325
This commit is contained in:
Ettore Perazzoli
2001-04-15 14:51:19 +00:00
parent 655592d3a8
commit fbe64c2aee
3 changed files with 49 additions and 11 deletions

View File

@ -1,3 +1,21 @@
2001-04-15 Ettore Perazzoli <ettore@ximian.com>
* e-shell-folder-selection-dialog.c
(folder_creation_dialog_result_cb): Set the current folder only if
@result is `E_SHELL_FOLDER_CREATION_DIALOG_RESULT_SUCCESS'.
* e-shell-folder-creation-dialog.c (folder_name_entry_changed_cb):
Changed to get a pointer to the DialogData instead of just a
pointer to the dialog itself. Don't set the OK button sensitive
if there is no folder selected in the storage set view.
(setup_folder_name_entry): Don't connect
`folder_name_entry_changed_cb' anymore.
(e_shell_show_folder_creation_dialog): Connect here instead.
(storage_set_view_folder_selected_cb): New callback for the
"folder_selected" signal in the EStorageSetView. Make the OK
button sensitive if the entry is non-empty.
(e_shell_show_folder_creation_dialog): Connect it.
2001-04-14 Michael Meeks <michael@ximian.com>
* Makefile.am (dist-hook): remove built sources from dist.

View File

@ -207,16 +207,31 @@ static void
folder_name_entry_changed_cb (GtkEditable *editable,
void *data)
{
GnomeDialog *dialog;
GtkEntry *entry;
DialogData *dialog_data;
const char *parent_path;
entry = GTK_ENTRY (editable);
dialog = GNOME_DIALOG (data);
dialog_data = (DialogData *) data;
if (entry->text_length > 0)
gnome_dialog_set_sensitive (dialog, 0, TRUE);
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)
gnome_dialog_set_sensitive (GNOME_DIALOG (dialog_data->dialog), 0, TRUE);
else
gnome_dialog_set_sensitive (dialog, 0, FALSE);
gnome_dialog_set_sensitive (GNOME_DIALOG (dialog_data->dialog), 0, FALSE);
}
static void
storage_set_view_folder_selected_cb (EStorageSetView *storage_set_view,
const char *path,
void *data)
{
DialogData *dialog_data;
dialog_data = (DialogData *) data;
if (GTK_ENTRY (dialog_data->folder_name_entry)->text_length > 0)
gnome_dialog_set_sensitive (GNOME_DIALOG (dialog_data->dialog), 0, TRUE);
}
@ -263,9 +278,6 @@ setup_folder_name_entry (GtkWidget *dialog,
folder_name_entry = glade_xml_get_widget (gui, "folder_name_entry");
gnome_dialog_editable_enters (GNOME_DIALOG (dialog), GTK_EDITABLE (folder_name_entry));
gtk_signal_connect (GTK_OBJECT (folder_name_entry), "changed",
GTK_SIGNAL_FUNC (folder_name_entry_changed_cb), dialog);
}
static GtkWidget *
@ -419,6 +431,12 @@ e_shell_show_folder_creation_dialog (EShell *shell,
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
GTK_SIGNAL_FUNC (dialog_destroy_cb), dialog_data);
gtk_signal_connect (GTK_OBJECT (dialog_data->folder_name_entry), "changed",
GTK_SIGNAL_FUNC (folder_name_entry_changed_cb), dialog_data);
gtk_signal_connect (GTK_OBJECT (dialog_data->storage_set_view), "folder_selected",
storage_set_view_folder_selected_cb, dialog_data);
gtk_signal_connect_while_alive (GTK_OBJECT (shell), "destroy",
GTK_SIGNAL_FUNC (shell_destroy_cb), dialog_data,
GTK_OBJECT (dialog));

View File

@ -114,7 +114,9 @@ folder_creation_dialog_result_cb (EShell *shell,
dialog = E_SHELL_FOLDER_SELECTION_DIALOG (data);
priv = dialog->priv;
e_storage_set_view_set_current_folder (E_STORAGE_SET_VIEW (priv->storage_set_view), path);
if (result == E_SHELL_FOLDER_CREATION_DIALOG_RESULT_SUCCESS)
e_storage_set_view_set_current_folder (E_STORAGE_SET_VIEW (priv->storage_set_view),
path);
}