aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-folder-creation-dialog.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-04-15 22:51:19 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-04-15 22:51:19 +0800
commitfbe64c2aee924f646e01c096e40094585615c086 (patch)
tree32e1fbaaf8ca862417b8e95dd90fc28934e75b49 /shell/e-shell-folder-creation-dialog.c
parent655592d3a8ee26b96142ef09fdf0cd1a8eb776ed (diff)
downloadgsoc2013-evolution-fbe64c2aee924f646e01c096e40094585615c086.tar
gsoc2013-evolution-fbe64c2aee924f646e01c096e40094585615c086.tar.gz
gsoc2013-evolution-fbe64c2aee924f646e01c096e40094585615c086.tar.bz2
gsoc2013-evolution-fbe64c2aee924f646e01c096e40094585615c086.tar.lz
gsoc2013-evolution-fbe64c2aee924f646e01c096e40094585615c086.tar.xz
gsoc2013-evolution-fbe64c2aee924f646e01c096e40094585615c086.tar.zst
gsoc2013-evolution-fbe64c2aee924f646e01c096e40094585615c086.zip
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
Diffstat (limited to 'shell/e-shell-folder-creation-dialog.c')
-rw-r--r--shell/e-shell-folder-creation-dialog.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/shell/e-shell-folder-creation-dialog.c b/shell/e-shell-folder-creation-dialog.c
index 62e3b7a60f..8a50ebaab9 100644
--- a/shell/e-shell-folder-creation-dialog.c
+++ b/shell/e-shell-folder-creation-dialog.c
@@ -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));