Re: [Fwd: [evolution-patches] [resend] patches for #20672 (gtkhtml and mailer)]



On Mon, 2003-09-15 at 13:53, Radek Doul�wrote:
> On Fri, 2003-09-12 at 23:14, Larry Ewing wrote:
> > > > I'm not strongly opposed to this patch and rodo's approval is enough 
> > > > that I wouldn't mind it going in I would just like to avoid the 
> > > > autosaved references if possible.
> > > 
> > > Would you prefer a gtkhtml command to retrieve the undo step counter?
> > > Using that the composer could implement the autosave logic.
> > > 
> > 
> > That seems pretty reasonable.  Any thoughts Radek?
> 
> Yeah, it can be done this way as well. On the other hand we already have
> the same mechanism for saved/is-saved, so it makes sense implement
> autosaved/is-autosaved the same way.

I guess the difference is that saving is a much more common concept than
autosaving.

> If we do autosave counter outside, we should probably also remove
> saved/is-saved and use undo counter as well.

Care would have to be taken not to break backwards compatibility.

> I personally prefer to have save, autosave counters inside gtkhtml. They
> use gtkhtml's commands so it doesn't add any new complicated API. The
> reason I implemented saved/is-saved this way was that users of
> libgtkhtml may find the way how to handle saving easier. (we don't have
> much documentation :) Last time I was asked about saving (implementing
> dirty flag) by bighead on irc, so it may not be so clear though ;-)

Another possibility would be a generic way to set a marker in the undo
queue and check if it's still up to date. Might be a better abstraction
from the underlying implementation.

> I wouldn't mind either approach.

Let me know which one you guys are going to apply, and I'll whip it up.
:)


Meanwhile, could this patch be applied? It fixes a few cases where the
composer isn't marked as dirty when it should be.


-- 
Earthling Michel D�er   \  Debian (powerpc), XFree86 and DRI developer
Software libre enthusiast  \     http://svcs.affero.net/rm.php?r=daenzer
Index: composer/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.549
diff -p -u -r1.549 ChangeLog
--- composer/ChangeLog	7 Jul 2003 21:33:14 -0000	1.549
+++ composer/ChangeLog	16 Jul 2003 00:34:15 -0000
@@ -0,0 +0,8 @@
+2003-07-16  Michel D�er  <michel daenzer net>
+
+	* e-msg-composer-hdrs.c (from_changed): Also send HDRS_CHANGED
+	signal.
+
+	* e-msg-composer.c (menu_changed_charset_cb): Mark the composer
+	as changed.
+
Index: composer/e-msg-composer-hdrs.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-hdrs.c,v
retrieving revision 1.114
diff -p -u -r1.114 e-msg-composer-hdrs.c
--- composer/e-msg-composer-hdrs.c	17 Jun 2003 19:47:53 -0000	1.114
+++ composer/e-msg-composer-hdrs.c	15 Jul 2003 23:45:47 -0000
@@ -191,6 +191,7 @@ from_changed (GtkWidget *item, gpointer 
 	gtk_entry_set_text (GTK_ENTRY (hdrs->priv->reply_to.entry), reply_to ? reply_to : "");
 	
 	g_signal_emit (hdrs, signals [FROM_CHANGED], 0);
+	g_signal_emit (hdrs, signals [HDRS_CHANGED], 0);
 }
 
 static void
Index: composer/e-msg-composer.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
retrieving revision 1.399
diff -p -u -r1.399 e-msg-composer.c
--- composer/e-msg-composer.c	7 Jul 2003 21:33:14 -0000	1.399
+++ composer/e-msg-composer.c	15 Jul 2003 23:45:51 -0000
@@ -1915,14 +1930,19 @@ menu_changed_charset_cb (BonoboUICompone
 			 const char                  *state,
 			 gpointer                     user_data)
 {
+	EMsgComposer *composer = E_MSG_COMPOSER (user_data);
+
 	if (type != Bonobo_UIComponent_STATE_CHANGED)
 		return;
 	
 	if (atoi (state)) {
 		/* Charset menu names are "Charset-%s" where %s is the charset name */
-		g_free (E_MSG_COMPOSER (user_data)->charset);
-		E_MSG_COMPOSER (user_data)->charset = g_strdup (path + strlen ("Charset-"));
+		g_free (composer->charset);
+		composer->charset = g_strdup (path + strlen ("Charset-"));
 	}
+	
+	/* Mark the composer as changed so it prompts about unsaved changes on close */
+	e_msg_composer_set_changed (composer);
 }
 
 


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