aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/em-folder-selection-button.c18
2 files changed, 27 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b769cc9558..873ec617a9 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+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.
+
2005-02-09 Not Zed <NotZed@Ximian.com>
** See bug #71429
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);
}