After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 109435 - move gnome_about to gtk
move gnome_about to gtk
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: future
Assigned To: gtk-bugs
gtk-bugs
Depends on: 110528
Blocks:
 
 
Reported: 2003-03-28 18:02 UTC by Paolo Borelli
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkaboutdialog.h (2.44 KB, text/plain)
2003-04-02 00:23 UTC, Matthias Clasen
  Details
gtkaboutdialog.c (23.88 KB, text/plain)
2003-04-02 00:24 UTC, Matthias Clasen
  Details
necessary glue and gtk-demo example (4.87 KB, patch)
2003-04-02 00:29 UTC, Matthias Clasen
none Details | Review
new gtkaboutdialog.h (2.56 KB, text/plain)
2003-04-08 23:36 UTC, Matthias Clasen
  Details
new gtkaboutdialog.c (24.90 KB, text/plain)
2003-04-08 23:37 UTC, Matthias Clasen
  Details
gtkaboutdialog.h (2.50 KB, text/plain)
2003-04-26 23:48 UTC, Matthias Clasen
  Details
gtkaboutdialog.c (29.16 KB, text/plain)
2003-04-26 23:49 UTC, Matthias Clasen
  Details
final (?) gtkaboutdialog.h (2.63 KB, text/plain)
2003-04-27 12:00 UTC, Matthias Clasen
  Details
final (?) gtkaboutdialog.c (28.88 KB, text/plain)
2003-04-27 12:01 UTC, Matthias Clasen
  Details
gtkaboutdialog.c (31.96 KB, text/plain)
2003-04-28 18:28 UTC, Matthias Clasen
  Details
minimal about dialog, using only defaults (10.49 KB, image/png)
2003-05-10 23:19 UTC, Matthias Clasen
  Details
full about dialog, specifying all optional parameters (54.67 KB, image/png)
2003-05-10 23:20 UTC, Matthias Clasen
  Details
new version (34.32 KB, text/plain)
2003-08-03 23:11 UTC, Matthias Clasen
  Details
new version of the header (5.32 KB, text/x-chdr)
2004-07-07 20:04 UTC, Matthias Clasen
  Details
new version of the source (50.15 KB, text/x-csrc)
2004-07-07 20:07 UTC, Matthias Clasen
  Details

Description Paolo Borelli 2003-03-28 18:02:46 UTC
Almost every app has an About dialog and AFAIK gnome_about doesn't use any
gnome specific feature... is there any chance to move this utility to gtk+
so that simple gtk apps can take advantage of it? Write the about dialog is
not an exciting programming task ;-) in fact if I take a look at the about
dialog of gtk apps I use here (e.g pan) they have an uglier about dialog
than gnome apps.

Btw, to have at least a GTK_STOCK_ABOUT icon would be useful too.
Comment 1 Havoc Pennington 2003-03-28 23:45:56 UTC
We do have to do this eventually to make it easy to write a complete 
app with only gtk. Should not be a lot of work.
Comment 2 Matthias Clasen 2003-04-02 00:23:36 UTC
Created attachment 15368 [details]
gtkaboutdialog.h
Comment 3 Matthias Clasen 2003-04-02 00:24:10 UTC
Created attachment 15369 [details]
gtkaboutdialog.c
Comment 4 Matthias Clasen 2003-04-02 00:27:15 UTC
Another libgnomeui widget coming home...
I decided to name it GtkAboutDialog to stay in sync with the other 
complex dialogs. Open questions:

* do we need setters and getters for all properties ?
* do we want a default image ? If so, which ? gtk-logo-rgb ?
Comment 5 Matthias Clasen 2003-04-02 00:29:39 UTC
Created attachment 15370 [details] [review]
necessary glue and gtk-demo example
Comment 6 Havoc Pennington 2003-04-02 03:05:45 UTC
It makes sense to me if the default image is taken from 
gtk_window_set_default_icon_list() perhaps, then perhaps 
fall back to no image at all (does the dialog look OK with no image?
surely we could make it look fine in that case).

Might also consider using g_get_application_name() instead of having to 
pass that in?
Comment 7 Havoc Pennington 2003-04-02 03:12:37 UTC
Would a "support URL or email" and "bug report URL or email" 
be a good idea? Not that the new() function needs more arguments. ;-)

I guess for GNOME we might want something like "Report bugs 
to your operating system vendor or to the kind volunteers
at http://bugzilla.gnome.org/" I dunno.

I don't think setters/getters are needed, the properties are good
enough IMHO.

I'm somewhat uncomfortable that the _new() function becomes broken if
we add/remove properties, but not sure there's a hugely better way.
everything I can think of has other problems.

Implementation looks pretty sane to me, I was afraid it'd be ancient
gnome-libs 1.0 cruft.
Comment 8 Matthias Clasen 2003-04-02 21:17:44 UTC
Falling back to g_get_application_name() and
gtk_window_get_default_icon_list () is a good idea. Do you think we
should drop the name argument from _new() completely or just fall back
if it is NULL ?

Adding bug reporting address / website would perhaps be nice, but the
immediate question is how to implement these as links without dragging
in too much gnome infrastructure.

I have looked at how gnumeric does it: they use 
gnome_href_new() for the link and simply add it to 
GTK_DIALOG (about)->vbox.

Another question that occurred to me: Are we comfortable with this
kind of one-shot, self-destructing dialog, or do we leave management
of the dialog lifecycle to the app ?
Comment 9 Matthias Clasen 2003-04-08 20:03:25 UTC
I have been looking around for complaints which people had about the
GnomeAbout in libgnomeui, and here is what I found:

bug 59632: website/email address for contributors and app
bug 73429: padding for the contributor lists
bug 80468: support custom credit tabs (e.g. "Artwork")
bug 84790: a bugfix for modal about dialogs
Comment 10 Havoc Pennington 2003-04-08 20:11:45 UTC
Owen suggests having the new() function take no arguments
and the resulting dialog doesn't destroy itself on response signal, 
but then have a convenience function:

 void gtk_about_show (GtkWindow *parent, ... all those args ...)

that would manage an about dialog associated with the given parent 
window (one about dialog per window, rather than a global dialog 
for the whole app).
Comment 11 Matthias Clasen 2003-04-08 23:35:48 UTC
Here is a new version with the gtk_about_dialog_new () /
gtk_about_dialog_show () split and the fix for bug 84790. I'm
currently contemplating about the other bugs listed above. 

Regarding the custom credit tabs, I think that the approach taken in
the patch attached to bug 80468 is overkill and it would be good
enough to add gchar *other_contributors_tab_title, gchar
**other_contributors
to the argument list of gtk_about_dialog_show(). That would allow to
add one custom tab with content similar to the other tabs.

Regarding email addresses of authors, I'm not sure if the introduction
of a boxed type

struct GtkAboutContributor 
{
  gchar *name;
  gchar *email;
  gchar *website;
  gchar *comment;
}

would be too heavy. With the current approach, we would have to do
something like
author = "Owen Taylor <otaylor@redhat.com>\n  wrote everything"
and rely on string parsing to recover the email address if we later
want to introduce mailto: links.
Comment 12 Matthias Clasen 2003-04-08 23:36:57 UTC
Created attachment 15582 [details]
new gtkaboutdialog.h
Comment 13 Matthias Clasen 2003-04-08 23:37:50 UTC
Created attachment 15583 [details]
new gtkaboutdialog.c
Comment 14 Matthias Clasen 2003-04-09 09:36:19 UTC
Forgot to mention: the latest version also has the fallbacks:


name --> g_get_application_name()


logo --> gtk_window_get_default_icon_list() --> no logo
Comment 15 Murray Cumming 2003-04-10 10:05:36 UTC
re. self-destructing dialogs - this is is very difficult for language 
bindings. Whenever GTK+ or libgnomeui dialogs self-destruct we have 
to do very difficult hacky stuff in gtkmm to prevent it. Please don't 
confuse window hiding with underlying destruction of the GTK+ 
instance.
Comment 16 Owen Taylor 2003-04-10 13:16:55 UTC
With the current plan, gtk_about_dialog_show() will be
a convenience function not usable from C++ anyways.
So, you'll have to make your own one-per-toplevel convenience
function, that can do whatever it wants for memory
management.

Plus, the planned gtk_about_dialog_show() doesn't return
a widget, so memory management from the language
binding point of view is irrelevant.

(The only self-destruction I can think of in GTK+ 
currently is the default handler for ::delete-event;
so this certainly isn't a general problem... (even
if as always, I think the gtkmm memory management
scheme is highly misguided.))
Comment 17 Matthias Clasen 2003-04-11 21:27:43 UTC
I have added a dependency on a gobject bug which adds a boxed type for
string arrays. With that, we can avoid the inconvenient GValueArray
for the string list properties and move to a more natural varargs
interface.
Comment 18 Paolo Borelli 2003-04-12 09:15:13 UTC
After having read the discussion about a too complicated API in
gtk-devel's archive, it seems to me that the things we want to pass to
the dialog can be divided in two: the things which we want to show in
the About itself (name, image, URL, etc) and the credits (authors,
translators, etc).
It has also been raised the point that commercial apps often don't
have credits so detailed.

What I was thinking is that maybe it makes sense to split the API in
the same way:

gtk_about_dialog_new()
gtk_about_dialog_show(name, image, etc) [without the credits button]
gtk_about_dialog_show_with_credits(name, image, etc and a credits
dialog widget)

where the credits dialog can be set up with another utility function as

gtk_about_dialog_credits_dialog_new(authors, translators, etc)

or, if the application writer prefer, can be a custom dialog.

I know I should probably shut up and let the experts work it out, but
since I filed the bug report I couldn't resist... hope it makes some
sense, after all it's saturday morning here ;)
Comment 19 Matthias Clasen 2003-04-12 21:36:46 UTC
I think the latest plan is to go with a varargs style interface:

gtk_about_dialog_show (GtkWidget *parent, 
                       const gchar *first_property_name,
                       ...)

We could then make the credits secondary dialog optional and simply
omit it if no credits are specified:

gtk_about_dialog_show (myapp, 
                       "name", "MyApp", 
                       "logo", my_logo, 
                       NULL);

vs.

gtk_about_dialog_show (myapp, 
                       "name", "MyApp", 
                       "logo", my_logo, 
                       "authors", authors,
                       NULL);
Comment 20 Matthias Clasen 2003-04-26 23:48:41 UTC
Created attachment 16032 [details]
gtkaboutdialog.h
Comment 21 Matthias Clasen 2003-04-26 23:49:29 UTC
Created attachment 16033 [details]
gtkaboutdialog.c
Comment 22 Matthias Clasen 2003-04-26 23:53:50 UTC
The latest version implements the varargs api. It also adds an
optional credits page for artists, autolinkification for email
addresses and urls , signals "send_email" and "show_url" which are
emitted when the links are activated, and additional "website" and
"website_label" properties, which can be used to put a link on the
about dialog itself. "website_label" defaults to "website". email
addresses and urls are shown as plain text when the corresponding
signals have no handlers connected to them.
Comment 23 Havoc Pennington 2003-04-27 02:07:13 UTC
Should we use the approach as with 
 gtk_color_selection_set_change_palette_hook() 
rather than signals on the dialog for show_url? don't you 
want the same handler for all dialogs?

Wow, I just saw 
"GtkColorSelectionChangePaletteWithScreenFunc" - that wins some kind 
of length award ;-)
Comment 24 Matthias Clasen 2003-04-27 11:58:42 UTC
Yes, that is much better. I also renamed the _show() function to
gtk_show_about_dialog(), since it doesn't take an about dialog as
first parameter, as the old name suggested.
Comment 25 Matthias Clasen 2003-04-27 12:00:41 UTC
Created attachment 16051 [details]
final (?) gtkaboutdialog.h
Comment 26 Matthias Clasen 2003-04-27 12:01:25 UTC
Created attachment 16052 [details]
final (?) gtkaboutdialog.c
Comment 27 Matthias Clasen 2003-04-28 18:28:14 UTC
The next version adds a "license" property which is displayed in
another dialog, opened from a "License" button next to the "Credits"
button.
I also enabled Pango markup in the comments property, since it may be
useful to add something in "small print", e.g. a serial number.
Comment 28 Matthias Clasen 2003-04-28 18:28:53 UTC
Created attachment 16084 [details]
gtkaboutdialog.c
Comment 29 Matthias Clasen 2003-05-10 23:19:32 UTC
Created attachment 16416 [details]
minimal about dialog, using only defaults
Comment 30 Matthias Clasen 2003-05-10 23:20:10 UTC
Created attachment 16417 [details]
full about dialog, specifying all optional parameters
Comment 31 Murray Cumming 2003-07-15 07:08:58 UTC
Will this land in GTK+ 2.4 soon, in time for the GTK+ feature freeze?
Comment 32 Matthias Clasen 2003-07-15 08:09:15 UTC
I have not tried to push it. In fact, I've already moved it to the


nascent 2.6 feature set. But feel free to try and get it in 2.4.
Comment 33 Paolo Borelli 2003-07-15 18:56:38 UTC
I don't want to whine :) but is there a strong reason to delay until 2.6?
Code has been here for a while and the api has been dicussed on
gtk-devel and it looked like everyone agreed that it was ok, beside
it's an utility widget, so it does not look like a big source of bugs
and instabilties...

Don't get me wrong, I respect your decisions whichever they are, it's
only that since the code is ready and nobody seemed to have concerns I
would like to start using it as soon as possible. 
Comment 34 Matthias Clasen 2003-08-03 23:11:30 UTC
Created attachment 18883 [details]
new version
Comment 35 Matthias Clasen 2003-08-03 23:12:41 UTC
The latest version implements the links in the credits pages more
properly using tags (code inspired by similar code in gucharmap).
Comment 36 Matthias Clasen 2003-11-13 10:19:31 UTC
Won't go into 2.4
Comment 37 Paolo Borelli 2004-04-15 16:01:32 UTC
I've been following the discussion about the proposed schedule for gtk+2.6 which
seems to suggest that it will be used for gnome 2.10: I was wondering if it
would make sense to move this about dialog implementation in libegg and
encourage it's use for gnome 2.8 in order to have wider testing/feedback...
Comment 38 Fernando Herrera 2004-06-10 05:42:37 UTC
Great work! please take a look at #135684 about if G{gnome,tk}AboutDialog should
set the window icon. 
Comment 39 Matthias Clasen 2004-07-07 20:04:48 UTC
Created attachment 29327 [details]
new version of the header

A new version of the patch, this time including setters and getters.
Comment 40 Matthias Clasen 2004-07-07 20:07:07 UTC
Created attachment 29328 [details]
new version of the source

Here is the implementation again, now including docs. I have updated it to the
2.4 api (using G_DEFINE_TYPE, private struct support, g_markup_printf_escape,
etc),
fixed a couple of bugs and added a style property for the link color.
Comment 41 Matthias Clasen 2004-07-12 17:03:40 UTC
Committed this now.