diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 16 | ||||
-rw-r--r-- | shell/evolution-folder-selector-button.c | 29 | ||||
-rw-r--r-- | shell/evolution-folder-selector-button.h | 2 |
3 files changed, 45 insertions, 2 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 8682a3c374..ce8dd95929 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,19 @@ +2002-05-20 Chris Toshok <toshok@ximian.com> + + * evolution-folder-selector-button.c (clicked): set the parent + window insensitive before popping up the dialog and sensitive + after it's popped down, to give us semi-modal behavior. Also, + emit a "popped_up" signal when popping up the dialog, and emit + "canceled" when the return folder is NULL (when the user canceled + the dialog). + (class_init): fix typo (?) - parent type isn't + bonobo_object_get_type(), it's PARENT_TYPE. Also, initialize the + POPPED_UP and CANCELED signals. + + * evolution-folder-selector-button.h (struct + _EvolutionFolderSelectorButtonClass): add popped_up and canceled + signals. + 2002-05-20 Ettore Perazzoli <ettore@ximian.com> * e-shell-offline-sync.c (sync_folder): Skip the folder if it diff --git a/shell/evolution-folder-selector-button.c b/shell/evolution-folder-selector-button.c index 35ddf19c7a..56cc1ca13b 100644 --- a/shell/evolution-folder-selector-button.c +++ b/shell/evolution-folder-selector-button.c @@ -39,7 +39,9 @@ struct _EvolutionFolderSelectorButtonPrivate { }; enum { + POPPED_UP, SELECTED, + CANCELED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = { 0 }; @@ -131,17 +133,28 @@ clicked (GtkButton *button) gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_WINDOW); + gtk_widget_set_sensitive (GTK_WIDGET (parent_window), FALSE); + folder_selector_button = EVOLUTION_FOLDER_SELECTOR_BUTTON (button); priv = folder_selector_button->priv; + gtk_signal_emit (GTK_OBJECT (folder_selector_button), + signals[POPPED_UP]); + evolution_shell_client_user_select_folder (priv->shell_client, parent_window, priv->title, priv->uri ? priv->uri : "", (const char **)priv->possible_types, &return_folder); - if (!return_folder) + + gtk_widget_set_sensitive (GTK_WIDGET (parent_window), TRUE); + + if (!return_folder) { + gtk_signal_emit (GTK_OBJECT (folder_selector_button), + signals[CANCELED]); return; + } g_free (priv->uri); priv->uri = g_strdup (return_folder->evolutionUri); @@ -184,7 +197,7 @@ class_init (EvolutionFolderSelectorButtonClass *klass) GtkObjectClass *object_class; GtkButtonClass *button_class; - parent_class = gtk_type_class (bonobo_object_get_type ()); + parent_class = gtk_type_class (PARENT_TYPE); object_class = GTK_OBJECT_CLASS (klass); button_class = GTK_BUTTON_CLASS (klass); @@ -192,6 +205,12 @@ class_init (EvolutionFolderSelectorButtonClass *klass) button_class->clicked = clicked; object_class->destroy = destroy; + signals[POPPED_UP] = gtk_signal_new ("popped_up", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (EvolutionFolderSelectorButtonClass, popped_up), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); signals[SELECTED] = gtk_signal_new ("selected", GTK_RUN_FIRST, object_class->type, @@ -199,6 +218,12 @@ class_init (EvolutionFolderSelectorButtonClass *klass) gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + signals[CANCELED] = gtk_signal_new ("canceled", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (EvolutionFolderSelectorButtonClass, canceled), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); } diff --git a/shell/evolution-folder-selector-button.h b/shell/evolution-folder-selector-button.h index d2918bd143..5f5e1115d1 100644 --- a/shell/evolution-folder-selector-button.h +++ b/shell/evolution-folder-selector-button.h @@ -52,7 +52,9 @@ struct _EvolutionFolderSelectorButtonClass { GtkButtonClass parent_class; /* signals */ + void (*popped_up) (EvolutionFolderSelectorButton *button); void (*selected) (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folder *folder); + void (*canceled) (EvolutionFolderSelectorButton *button); }; |