[evolution] Bug 601219 - Transient dialogs in composer window blocks main window



commit f6ba97d9647a768ef225fdc095c16e8aa635f8f9
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Nov 9 12:31:31 2009 -0500

    Bug 601219 - Transient dialogs in composer window blocks main window

 calendar/gui/dialogs/comp-editor.c |   15 +++++++++++++++
 composer/e-composer-private.c      |   11 +++++++++++
 composer/e-composer-private.h      |    2 ++
 widgets/misc/e-attachment-store.c  |   17 +++++++++++++++++
 widgets/misc/e-attachment-store.h  |    9 +++++++++
 5 files changed, 54 insertions(+), 0 deletions(-)
---
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 7f96b4b..4d3c0af 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -81,6 +81,10 @@ struct _CompEditorPrivate {
 
 	gpointer shell;  /* weak pointer */
 
+	/* Each CompEditor window gets its own GtkWindowGroup, so it
+	 * doesn't block the main window or other CompEditor windows. */
+	GtkWindowGroup *window_group;
+
 	/* Client to use */
 	ECal *client;
 
@@ -1328,6 +1332,11 @@ comp_editor_dispose (GObject *object)
 		priv->shell = NULL;
 	}
 
+	if (priv->window_group != NULL) {
+		g_object_unref (priv->window_group);
+		priv->window_group = NULL;
+	}
+
 	if (priv->client) {
 		g_object_unref (priv->client);
 		priv->client = NULL;
@@ -1608,6 +1617,7 @@ comp_editor_init (CompEditor *editor)
 	GtkWidget *container;
 	GtkWidget *widget;
 	GtkWidget *scroll;
+	GtkWindow *window;
 	EShell *shell;
 	gint n_targets;
 	GError *error = NULL;
@@ -1620,6 +1630,11 @@ comp_editor_init (CompEditor *editor)
 
 	active_editors = g_list_prepend (active_editors, editor);
 
+	/* Each editor window gets its own window group. */
+	window = GTK_WINDOW (editor);
+	priv->window_group = gtk_window_group_new ();
+	gtk_window_group_add_window (priv->window_group, window);
+
 	priv->pages = NULL;
 	priv->changed = FALSE;
 	priv->needs_send = FALSE;
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index 0ec579f..1516b15 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -92,6 +92,7 @@ e_composer_private_init (EMsgComposer *composer)
 	GtkWidget *container;
 	GtkWidget *widget;
 	GtkWidget *send_widget;
+	GtkWindow *window;
 	const gchar *path;
 	gchar *filename;
 	gint ii;
@@ -109,6 +110,11 @@ e_composer_private_init (EMsgComposer *composer)
 
 	}
 
+	/* Each composer window gets its own window group. */
+	window = GTK_WINDOW (composer);
+	priv->window_group = gtk_window_group_new ();
+	gtk_window_group_add_window (priv->window_group, window);
+
 	priv->charset_actions = gtk_action_group_new ("charset");
 	priv->composer_actions = gtk_action_group_new ("composer");
 
@@ -308,6 +314,11 @@ e_composer_private_dispose (EMsgComposer *composer)
 		composer->priv->attachment_paned = NULL;
 	}
 
+	if (composer->priv->window_group != NULL) {
+		g_object_unref (composer->priv->window_group);
+		composer->priv->window_group = NULL;
+	}
+
 	if (composer->priv->charset_actions != NULL) {
 		g_object_unref (composer->priv->charset_actions);
 		composer->priv->charset_actions = NULL;
diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h
index 71ced95..df215d0 100644
--- a/composer/e-composer-private.h
+++ b/composer/e-composer-private.h
@@ -91,6 +91,8 @@ struct _EMsgComposerPrivate {
 	GtkWidget *header_table;
 	GtkWidget *attachment_paned;
 
+	GtkWindowGroup *window_group;
+
 	GtkActionGroup *charset_actions;
 	GtkActionGroup *composer_actions;
 
diff --git a/widgets/misc/e-attachment-store.c b/widgets/misc/e-attachment-store.c
index 4c87d65..b5f659c 100644
--- a/widgets/misc/e-attachment-store.c
+++ b/widgets/misc/e-attachment-store.c
@@ -649,6 +649,23 @@ e_attachment_store_run_save_dialog (EAttachmentStore *store,
 	return destination;
 }
 
+/***************** e_attachment_store_add_mime_parts_async() *****************/
+
+void
+e_attachment_store_add_mime_parts_async (EAttachmentStore *store,
+                                         GList *mime_parts,
+                                         GAsyncReadyCallback callback,
+                                         gpointer user_data)
+{
+}
+
+gboolean
+e_attachment_store_add_mime_parts_finish (EAttachmentStore *store,
+                                          GAsyncResult *result,
+                                          GError **error)
+{
+}
+
 /******************** e_attachment_store_get_uris_async() ********************/
 
 typedef struct _UriContext UriContext;
diff --git a/widgets/misc/e-attachment-store.h b/widgets/misc/e-attachment-store.h
index 1c3cb52..efe3e16 100644
--- a/widgets/misc/e-attachment-store.h
+++ b/widgets/misc/e-attachment-store.h
@@ -109,6 +109,15 @@ GFile *		e_attachment_store_run_save_dialog
 						 GtkWindow *parent);
 
 /* Asynchronous Operations */
+void		e_attachment_store_add_mime_parts_async
+						(EAttachmentStore *store,
+						 GList *mime_parts,
+						 GAsyncReadyCallback callback,
+						 gpointer user_data);
+gboolean	e_attachment_store_add_mime_parts_finish
+						(EAttachmentStore *store,
+						 GAsyncResult *result,
+						 GError **error);
 void		e_attachment_store_get_uris_async
 						(EAttachmentStore *store,
 						 GList *attachment_list,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]