diff options
author | Chris Toshok <toshok@ximian.com> | 2002-05-21 05:59:27 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-05-21 05:59:27 +0800 |
commit | 09061834119ed7118b3ddb345c9257285376e02f (patch) | |
tree | 6ccf969e56a708e067e616aadd3fe99d11ef0964 /shell/evolution-folder-selector-button.c | |
parent | 9b2e9f2b20d848c3bb884f3d7203d1eef72ca8c9 (diff) | |
download | gsoc2013-evolution-09061834119ed7118b3ddb345c9257285376e02f.tar.gz gsoc2013-evolution-09061834119ed7118b3ddb345c9257285376e02f.tar.zst gsoc2013-evolution-09061834119ed7118b3ddb345c9257285376e02f.zip |
set the parent window insensitive before popping up the dialog and
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.
svn path=/trunk/; revision=16959
Diffstat (limited to 'shell/evolution-folder-selector-button.c')
-rw-r--r-- | shell/evolution-folder-selector-button.c | 29 |
1 files changed, 27 insertions, 2 deletions
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); } |