[Evolution-hackers] gtk_message_dialog() alternatives

Not Zed notzed@ximian.com
Tue, 08 Mar 2005 10:26:24 +0800


--=-xseQOjAkyH6zE90HSCH8
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Mon, 2005-03-07 at 23:44 +0200, Jonathan Dieter wrote:

> Okay, I've put together a plugin that implements the functionality in my 
> original patch that incorporates the standards on variable naming, etc.  
> The one thing I'm not sure is what evolution-specific function to use 
> that calls gtk_message_dialog() (or something similar).  The closest 
> I've found is e_notice(), but that doesn't seem to let you use Yes/No 
> buttons.  When looking through code in other plugins (save-calendar for 
> instance), I note that they use gtk_message_dialog().  Any thoughts?

Yes, use e-error, as i suggested below.  Just grep the source for usage,
or look in misc/widgets/e-error.c and devel-docs/misc/errors.txt.  The
bit about using e-error-tool is a bit out of date, but the rest is
valid.

> While working on the plugin, I've modified configure.in to put my 
> plugin, default-mail-client-check, in the experimental plugin section 
> and autoreconf'd it to create the new configure script.  How should I 
> send the patch to the list?  The changes to both configure and 
> configure.in are quite extensive.

You should be working on a checkout from cvs.  Then you just use cvs
diff -up to generate the diff of the modified files, and it will only
diff the cvs files (configure is a generated file and not stored in
cvs).  I don't understand why your changes would need to be 'extensive',
it should only be a one line change in configure.in?


> Jonathan
> 
> Not Zed wrote:
> 
> >
> > Evolution patches list is probably as good a place as any.  Use 
> > evolution-hackers if you need to ask questions like this one.  You 
> > should subscribe to evolution-hackers at any rate.
> >
> > There is a shell event recently added "upgrade.done" which is called 
> > at startup after the configuration is setup to the current version.  
> > You can probably use that.
> >
> > The class is "org.gnome.evolution.shell.events:1.0"
> >
> > You might want to look at the other code, it uses a few things  - like 
> > e-error, which you should be using as well, for any messages - don't 
> > use gtk_message_dialog() directly.
> >
> >
> >
> > On Thu, 2005-03-03 at 08:23 +0200, Jonathan Dieter wrote:
> >
> >>Thanks for the quick response.  I've just gone through the published 
> >>eplugin API and I haven't seen any hooks for either evolution startup or 
> >>the mail component startup.  If you know what they are, or could at 
> >>least point me in the right direction to look for this information, I'd 
> >>sure appreciate it.  Also, would you want me to send the plugin to the 
> >>evolution-patches mailing-list or would it be better to send it elsewhere?
> >>
> >>Thanks,
> >>Jonathan Dieter
> >>jdieter99@gmx.net <mailto:jdieter99@gmx.net>
> >>
> >>Not Zed wrote:
> >>
> >>>
> >>>
> >>> Hmm, we actually had a patch all but complete for this last year, from 
> >>> Niklas Nylund <ninylund@abo.fi <mailto:ninylund@abo.fi> <mailto:ninylund@abo.fi <mailto:ninylund@abo.fi>>>, but then the 
> >>> thread seemed to peter out.
> >>>
> >>> I don't really know what we should do about this, since the other 
> >>> patch was so close.
> >>>
> >>> As for your patch - this functionality should now be done via the 
> >>> plugin interface.
> >>>
> >>> Also you're using java-style mixedCaps, we don't do that anywhere, we 
> >>> use lower-case names for everthing, usually with _ separating words 
> >>> (its easier for non-english speakers apparently).
> >>>
> >>> Michael
> >>>
> >>> On Thu, 2005-03-03 at 00:08 +0200, Jonathan Dieter wrote:
> >>>
> >>>>This patch will ask the user if they would like Evolution to be the 
> >>>>default mailer for GNOME the first time that Evolution is run.  If the 
> >>>>user says "yes", Evolution sets itself to be the default mailer.  If the 
> >>>>user says "no", Evolution won't change anything.  There is a check box 
> >>>>that asks whether the user wants to be asked this question every time 
> >>>>Evolution is started.  If the check box is not checked, Evolution will 
> >>>>never ask the question again.  If it is checked, Evolution will only ask 
> >>>>if there is either no mailer set up or if another mailer is set as the 
> >>>>default one.
> >>>>
> >>>>This is my first attempt at a patch, so any feedback would be 
> >>>>appreciated.  Thanks,
> >>>>
> >>>>Jonathan Dieter
> >>>>jdieter99 at gmx dot net
> >>>>    
> >>>>
> >>
> >>    
> >>
> _______________________________________________
> evolution-hackers maillist  -  evolution-hackers@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/evolution-hackers

--=-xseQOjAkyH6zE90HSCH8
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.5.7">
</HEAD>
<BODY>
On Mon, 2005-03-07 at 23:44 +0200, Jonathan Dieter wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Okay, I've put together a plugin that implements the functionality in my </FONT>
<FONT COLOR="#000000">original patch that incorporates the standards on variable naming, etc.  </FONT>
<FONT COLOR="#000000">The one thing I'm not sure is what evolution-specific function to use </FONT>
<FONT COLOR="#000000">that calls gtk_message_dialog() (or something similar).  The closest </FONT>
<FONT COLOR="#000000">I've found is e_notice(), but that doesn't seem to let you use Yes/No </FONT>
<FONT COLOR="#000000">buttons.  When looking through code in other plugins (save-calendar for </FONT>
<FONT COLOR="#000000">instance), I note that they use gtk_message_dialog().  Any thoughts?</FONT>
</PRE>
</BLOCKQUOTE>
Yes, use e-error, as i suggested below.&nbsp; Just grep the source for usage, or look in misc/widgets/e-error.c and devel-docs/misc/errors.txt.&nbsp; The bit about using e-error-tool is a bit out of date, but the rest is valid.
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">While working on the plugin, I've modified configure.in to put my </FONT>
<FONT COLOR="#000000">plugin, default-mail-client-check, in the experimental plugin section </FONT>
<FONT COLOR="#000000">and autoreconf'd it to create the new configure script.  How should I </FONT>
<FONT COLOR="#000000">send the patch to the list?  The changes to both configure and </FONT>
<FONT COLOR="#000000">configure.in are quite extensive.</FONT>
</PRE>
</BLOCKQUOTE>
You should be working on a checkout from cvs.&nbsp; Then you just use cvs diff -up to generate the diff of the modified files, and it will only diff the cvs files (configure is a generated file and not stored in cvs).&nbsp; I don't understand why your changes would need to be 'extensive', it should only be a one line change in configure.in?<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Jonathan</FONT>

<FONT COLOR="#000000">Not Zed wrote:</FONT>

<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; Evolution patches list is probably as good a place as any.  Use </FONT>
<FONT COLOR="#000000">&gt; evolution-hackers if you need to ask questions like this one.  You </FONT>
<FONT COLOR="#000000">&gt; should subscribe to evolution-hackers at any rate.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; There is a shell event recently added &quot;upgrade.done&quot; which is called </FONT>
<FONT COLOR="#000000">&gt; at startup after the configuration is setup to the current version.  </FONT>
<FONT COLOR="#000000">&gt; You can probably use that.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; The class is &quot;org.gnome.evolution.shell.events:1.0&quot;</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; You might want to look at the other code, it uses a few things  - like </FONT>
<FONT COLOR="#000000">&gt; e-error, which you should be using as well, for any messages - don't </FONT>
<FONT COLOR="#000000">&gt; use gtk_message_dialog() directly.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; On Thu, 2005-03-03 at 08:23 +0200, Jonathan Dieter wrote:</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;Thanks for the quick response.  I've just gone through the published </FONT>
<FONT COLOR="#000000">&gt;&gt;eplugin API and I haven't seen any hooks for either evolution startup or </FONT>
<FONT COLOR="#000000">&gt;&gt;the mail component startup.  If you know what they are, or could at </FONT>
<FONT COLOR="#000000">&gt;&gt;least point me in the right direction to look for this information, I'd </FONT>
<FONT COLOR="#000000">&gt;&gt;sure appreciate it.  Also, would you want me to send the plugin to the </FONT>
<FONT COLOR="#000000">&gt;&gt;evolution-patches mailing-list or would it be better to send it elsewhere?</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;Thanks,</FONT>
<FONT COLOR="#000000">&gt;&gt;Jonathan Dieter</FONT>
<FONT COLOR="#000000">&gt;&gt;<A HREF="mailto:jdieter99@gmx.net">jdieter99@gmx.net</A> &lt;mailto:<A HREF="mailto:jdieter99@gmx.net">jdieter99@gmx.net</A>&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;Not Zed wrote:</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; Hmm, we actually had a patch all but complete for this last year, from </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; Niklas Nylund &lt;<A HREF="mailto:ninylund@abo.fi">ninylund@abo.fi</A> &lt;mailto:<A HREF="mailto:ninylund@abo.fi">ninylund@abo.fi</A>&gt; &lt;mailto:<A HREF="mailto:ninylund@abo.fi">ninylund@abo.fi</A> &lt;mailto:<A HREF="mailto:ninylund@abo.fi">ninylund@abo.fi</A>&gt;&gt;&gt;, but then the </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; thread seemed to peter out.</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; I don't really know what we should do about this, since the other </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; patch was so close.</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; As for your patch - this functionality should now be done via the </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; plugin interface.</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; Also you're using java-style mixedCaps, we don't do that anywhere, we </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; use lower-case names for everthing, usually with _ separating words </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; (its easier for non-english speakers apparently).</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; Michael</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; On Thu, 2005-03-03 at 00:08 +0200, Jonathan Dieter wrote:</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;This patch will ask the user if they would like Evolution to be the </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;default mailer for GNOME the first time that Evolution is run.  If the </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;user says &quot;yes&quot;, Evolution sets itself to be the default mailer.  If the </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;user says &quot;no&quot;, Evolution won't change anything.  There is a check box </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;that asks whether the user wants to be asked this question every time </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;Evolution is started.  If the check box is not checked, Evolution will </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;never ask the question again.  If it is checked, Evolution will only ask </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;if there is either no mailer set up or if another mailer is set as the </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;default one.</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;This is my first attempt at a patch, so any feedback would be </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;appreciated.  Thanks,</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;Jonathan Dieter</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;jdieter99 at gmx dot net</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;    </FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;    </FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">evolution-hackers maillist  -  <A HREF="mailto:evolution-hackers@lists.ximian.com">evolution-hackers@lists.ximian.com</A></FONT>
<FONT COLOR="#000000"><A HREF="http://lists.ximian.com/mailman/listinfo/evolution-hackers">http://lists.ximian.com/mailman/listinfo/evolution-hackers</A></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-xseQOjAkyH6zE90HSCH8--