[Subsurface-trac] [Subsurface] #66: links to license and documentation don't work
Dirk Hohndel
dirk at hohndel.org
Mon Feb 25 09:31:41 PST 2013
Lubomir and I have worked on getting the About dialog links to work
properly on Windows. But as I read through the code we have there now I
am seriously puzzled.
Can someone shed some light on this?
static void about_dialog(GtkWidget *w, gpointer data)
{
const char *logo_property = NULL;
GdkPixbuf *logo = NULL;
GtkWidget * dialog;
if (need_icon) {
logo_property = "logo";
logo = gdk_pixbuf_from_pixdata(&subsurface_icon_pixbuf, TRUE, NULL);
}
dialog = gtk_about_dialog_new();
#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION <= 24)
gtk_about_dialog_set_url_hook(about_dialog_link_cb, NULL, NULL); /* deprecated since GTK 2.24 */
#else
g_signal_connect(GTK_ABOUT_DIALOG(dialog), "activate-link", G_CALLBACK(about_dialog_link_cb), NULL);
#endif
gtk_show_about_dialog(NULL,
"title", _("About Subsurface"),
"program-name", "Subsurface",
"comments", _("Multi-platform divelog software in C"),
"website", "http://subsurface.hohndel.org",
"license", "GNU General Public License, version 2\nhttp://www.gnu.org/licenses/old-licenses/gpl-2.0.html",
"version", VERSION_STRING,
"copyright", _("Linus Torvalds, Dirk Hohndel, and others, 2011, 2012, 2013"),
/*++GETTEXT the term translator-credits is magic - list the names of the tranlators here */
"translator_credits", _("translator-credits"),
"logo-icon-name", "subsurface",
/* Must be last: */
logo_property, logo,
NULL);
}
So we unconditionally call gtk_about_dialog_new and then for later Gtk
version connect the signal "activate-link" to that dialog. For earlier
Gtk versions we do NOTHING with this variable (which is why gcc trows a
warning in that case).
And then we use the convenience function to show the about dialog - but
that doesn't reference the "dialog" variable.
Something is really odd here
/D
More information about the subsurface
mailing list