[evolution-patches] mail, shell, e-error parent fix




ok here's a patch for this.

On Thu, 2004-07-22 at 10:12 +0800, Not Zed wrote:

ok thanks for following this up.  i think its just calling it in the wrong place/on the wrong widget.  its supposed to be doing it on each of the main toplevels that get created instead.  i'll have a look at it today.

On Tue, 2004-07-20 at 15:05 -0400, William Jon McCann wrote:
On Tue, 2004-07-20 at 12:05 +0800, Not Zed wrote:
> 
> ugh ok i misread it, sorry.
> 
> anyway its up to the callers to set the right toplevel widget.  this
> code shouldn't be looking for the toplevel itself.

Ok, I think I understand why this isn't working.  The
e_error_default_parent() is called in impl_createControls().  This gets
called in e-shell-window.c:init_view().  Obviously, this occurs *before*
the component is re-parented into the shell.

So, therefore, the component does not register a top-level widget with
e-error as the default parent.

Actually, I don't think you can ever rely on a component knowing what
the toplevel component will be before you need to use it.

I think you can move the e_error_default_parent() call into e-shell-
window.c or just have e-error look for the toplevel when needed.

Jon

_______________________________________________
evolution-patches mailing list
evolution-patches lists ximian com
http://lists.ximian.com/mailman/listinfo/evolution-patches
--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer
--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3417
diff -u -3 -r1.3417 ChangeLog
--- mail/ChangeLog	21 Jul 2004 15:54:00 -0000	1.3417
+++ mail/ChangeLog	22 Jul 2004 04:31:50 -0000
@@ -1,3 +1,9 @@
+2004-07-22  Not Zed  <NotZed Ximian com>
+
+	* mail-component.c (impl_createControls): dont call
+	e_error_default parent here, we dont have access to the toplevel
+	yet.
+
 2004-07-19  Jeffrey Stedfast  <fejj novell com>
 
 	* em-migrate.c (em_migrate_folder): Free uri and name
Index: mail/mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.94
diff -u -3 -r1.94 mail-component.c
--- mail/mail-component.c	17 Jun 2004 07:34:49 -0000	1.94
+++ mail/mail-component.c	22 Jul 2004 04:31:51 -0000
@@ -530,8 +530,6 @@
 	mc_startup(mail_component);
 
 	view_widget = em_folder_browser_new ();
-	/* so error boxes have a parent if none supplied */
-	e_error_default_parent((GtkWindow *)view_widget);
 	
 	tree_widget = (GtkWidget *) em_folder_tree_new_with_model (priv->model);
 	em_folder_tree_set_excluded ((EMFolderTree *) tree_widget, 0);
Index: shell/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1461
diff -u -3 -r1.1461 ChangeLog
--- shell/ChangeLog	9 Jul 2004 11:18:16 -0000	1.1461
+++ shell/ChangeLog	22 Jul 2004 04:31:52 -0000
@@ -1,3 +1,9 @@
+2004-07-22  Not Zed  <NotZed Ximian com>
+
+	* e-shell.c (create_window): merged this into
+	e_shell_create_window, all it was doing was adding a stack frame.
+	(e_shell_create_window): setup the e error default window.
+
 2004-07-08  Frederic Crozat  <fcrozat mandrakesoft com>
 
 	* Makefile.am:
Index: shell/e-shell.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell.c,v
retrieving revision 1.250
diff -u -3 -r1.250 e-shell.c
--- shell/e-shell.c	24 Jun 2004 08:14:51 -0000	1.250
+++ shell/e-shell.c	22 Jul 2004 04:31:53 -0000
@@ -347,29 +347,6 @@
 	}
 }
 
-static EShellWindow *
-create_window (EShell *shell,
-	       const char *component_id,
-	       EShellWindow *template_window)
-{
-	EShellPrivate *priv;
-	EShellWindow *window;
-
-	priv = shell->priv;
-
-	window = E_SHELL_WINDOW (e_shell_window_new (shell, component_id));
-
-	g_signal_connect (window, "delete_event", G_CALLBACK (window_delete_event_cb), shell);
-	g_object_weak_ref (G_OBJECT (window), window_weak_notify, shell);
-
-	shell->priv->windows = g_list_prepend (shell->priv->windows, window);
-
-	g_signal_emit (shell, signals[NEW_WINDOW_CREATED], 0, window);
-
-	return window;
-}
-
-
 /* GObject methods.  */
 
 static void
@@ -809,9 +786,17 @@
 
 	priv = shell->priv;
 
-	window = create_window (shell, component_id, template_window);
+	window = E_SHELL_WINDOW (e_shell_window_new (shell, component_id));
+
+	g_signal_connect (window, "delete_event", G_CALLBACK (window_delete_event_cb), shell);
+	g_object_weak_ref (G_OBJECT (window), window_weak_notify, shell);
+	shell->priv->windows = g_list_prepend (shell->priv->windows, window);
+
+	g_signal_emit (shell, signals[NEW_WINDOW_CREATED], 0, window);
 
 	gtk_widget_show (GTK_WIDGET (window));
+
+	e_error_default_parent((GtkWindow *)window);
 
 	set_interactive (shell, TRUE);
 


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