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