aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-selection-button.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-02-10 13:27:00 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-02-10 13:27:00 +0800
commit82ad8000d65676dbde7b46f02d9b42237a8e0c6e (patch)
tree2dc4d9730ab40de91bf58c809f6d36e748db77cc /mail/em-folder-selection-button.c
parent0a50b0ab04ce94659ca09541a1d7f4fa5758c979 (diff)
downloadgsoc2013-evolution-82ad8000d65676dbde7b46f02d9b42237a8e0c6e.tar.gz
gsoc2013-evolution-82ad8000d65676dbde7b46f02d9b42237a8e0c6e.tar.zst
gsoc2013-evolution-82ad8000d65676dbde7b46f02d9b42237a8e0c6e.zip
** See bug #72266
2005-02-10 Not Zed <NotZed@Ximian.com> ** See bug #72266 * em-folder-selection-button.c (em_folder_selection_button_clicked): if the selector is already up, just raise it. (em_folder_selection_button_destroy): destroy the selector if it is still up. svn path=/trunk/; revision=28761
Diffstat (limited to 'mail/em-folder-selection-button.c')
-rw-r--r--mail/em-folder-selection-button.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/mail/em-folder-selection-button.c b/mail/em-folder-selection-button.c
index b727891781..337ec3555b 100644
--- a/mail/em-folder-selection-button.c
+++ b/mail/em-folder-selection-button.c
@@ -51,6 +51,8 @@ static GtkButtonClass *parent_class = NULL;
struct _EMFolderSelectionButtonPrivate {
GtkWidget *icon;
GtkWidget *label;
+
+ GtkWidget *selector;
char *uri; /* for single-select mode */
GList *uris; /* for multi-select mode */
@@ -167,6 +169,13 @@ em_folder_selection_button_init (EMFolderSelectionButton *emfsb)
static void
em_folder_selection_button_destroy (GtkObject *obj)
{
+ struct _EMFolderSelectionButtonPrivate *priv = ((EMFolderSelectionButton *) obj)->priv;
+
+ if (priv->selector) {
+ gtk_widget_destroy(priv->selector);
+ priv->selector = NULL;
+ }
+
GTK_OBJECT_CLASS (parent_class)->destroy (obj);
}
@@ -217,7 +226,12 @@ em_folder_selection_button_clicked (GtkButton *button)
if (GTK_BUTTON_CLASS (parent_class)->clicked != NULL)
(* GTK_BUTTON_CLASS (parent_class)->clicked) (button);
-
+
+ if (priv->selector) {
+ gtk_window_present((GtkWindow *)priv->selector);
+ return;
+ }
+
model = mail_component_peek_tree_model (mail_component_peek ());
emft = (EMFolderTree *) em_folder_tree_new_with_model (model);
em_folder_tree_set_multiselect (emft, priv->multiple_select);
@@ -228,6 +242,8 @@ em_folder_selection_button_clicked (GtkButton *button)
else
em_folder_selector_set_selected ((EMFolderSelector *) dialog, priv->uri);
g_signal_connect (dialog, "response", G_CALLBACK (emfsb_selector_response), button);
+ priv->selector = dialog;
+ g_signal_connect(dialog, "destroy", G_CALLBACK(gtk_widget_destroyed), &priv->selector);
gtk_widget_show (dialog);
}