X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/b3f11096f2dfb5c674eecbca51211c5703cbdae7..80471a6a905e00bf80ad04fa2061f88ea81f15cb:/src/dialog.c?ds=sidebyside diff --git a/src/dialog.c b/src/dialog.c index eb5d11e2..91f7e667 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -29,6 +29,7 @@ #include "degrees_converters.h" #include "authors.h" #include "googlesearch.h" +#include "util.h" #include @@ -572,32 +573,28 @@ gboolean a_dialog_time_threshold ( GtkWindow *parent, gchar *title_text, gchar * return FALSE; } +static void about_url_hook (GtkAboutDialog *about, + const gchar *link, + gpointer data) +{ + open_url (GTK_WINDOW(about), link); +} + +static void about_email_hook (GtkAboutDialog *about, + const gchar *email, + gpointer data) +{ + new_email (GTK_WINDOW(about), email); +} void a_dialog_about ( GtkWindow *parent ) { - int re; - char *msg = g_markup_printf_escaped ( - _(_("Viking %s\n\n" - "GPS Data and Topo Analyzer, Explorer, and Manager.\n\n" - "(C) 2003-2008, Evan Battaglia\n\n" - "Web site: %s")), - VIKING_VERSION, VIKING_URL); - GtkWidget *msgbox = gtk_message_dialog_new_with_markup ( parent, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_NONE, - msg); - - gtk_dialog_add_buttons (GTK_DIALOG(msgbox), _("Credits"), 1, _("License"), 2, _("Close"), 3, NULL, NULL); - - while ((re = gtk_dialog_run ( GTK_DIALOG(msgbox))) != 3) { - if (re==1) { - /* creds */ - a_dialog_info_msg(parent, AUTHORS); - } - if (re==2) { - a_dialog_info_msg(parent, _("\n\n" - "This program is free software; you can redistribute it and/or modify " + const gchar *program_name = PACKAGE_NAME; + const gchar *version = VIKING_VERSION; + const gchar *website = VIKING_URL; + const gchar *copyright = "2003-2008, Evan Battaglia"; + const gchar *comments = _("GPS Data and Topo Analyzer, Explorer, and Manager."); + const gchar *license = _("This program is free software; you can redistribute it and/or modify " "it under the terms of the GNU General Public License as published by " "the Free Software Foundation; either version 2 of the License, or " "(at your option) any later version." @@ -609,10 +606,22 @@ void a_dialog_about ( GtkWindow *parent ) "\n\n" "You should have received a copy of the GNU General Public License " "along with this program; if not, write to the Free Software " - "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA")); - } - } - gtk_widget_destroy ( msgbox ); + "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA"); + + gtk_about_dialog_set_url_hook (about_url_hook, NULL, NULL); + gtk_about_dialog_set_email_hook (about_email_hook, NULL, NULL); + gtk_show_about_dialog (parent, + /* TODO do not set program-name and correctly set info for g_get_application_name */ + "program-name", program_name, + "version", version, + "website", website, + "comments", comments, + "copyright", copyright, + "license", license, + "wrap-license", TRUE, + /* logo automatically retrieved via gtk_window_get_default_icon_list */ + "authors", AUTHORS, + NULL); } gboolean a_dialog_map_n_zoom(GtkWindow *parent, gchar *mapnames[], gint default_map, gchar *zoom_list[], gint default_zoom, gint *selected_map, gint *selected_zoom)